pg-main from prod server added
This commit is contained in:
25
pgx-main/combine_outside_calls.py
Normal file
25
pgx-main/combine_outside_calls.py
Normal file
@@ -0,0 +1,25 @@
|
||||
from argparse import ArgumentParser
|
||||
import pandas as pd
|
||||
import os
|
||||
|
||||
|
||||
def combine(sample):
|
||||
files = os.listdir("data/")
|
||||
dfs = []
|
||||
for f in files:
|
||||
f = "data/" + f
|
||||
if f.startswith(sample + "_cyp") and f.endswith(".tsv"):
|
||||
dfs.append(pd.read_csv(f, sep="\t", header=None))
|
||||
os.unlink(f)
|
||||
df = pd.concat(dfs, ignore_index=True).dropna()
|
||||
df.to_csv(f"{sample}_outside_call.tsv", sep="\t", index=False, header=False)
|
||||
|
||||
|
||||
def main():
|
||||
parser = ArgumentParser(description="Combine StellarPGx Output")
|
||||
parser.add_argument('sample', type=str, help="StellarPGx allele file prefix")
|
||||
args = parser.parse_args()
|
||||
combine(args.sample.replace("_calls", ""))
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Reference in New Issue
Block a user