26 lines
745 B
Python
26 lines
745 B
Python
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()
|