From 4828a47d71388f9bcd8264dfabda376d0751dbe1 Mon Sep 17 00:00:00 2001 From: tpereachamblee Date: Tue, 22 Feb 2022 18:51:39 +0000 Subject: [PATCH] small fixes to quant suggested in issue #75 --- scripts/quant.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/quant.py b/scripts/quant.py index e419be1..7574345 100644 --- a/scripts/quant.py +++ b/scripts/quant.py @@ -178,7 +178,7 @@ def arg_check_files(parser, arg): for idx, gene in allele_idx.items(): idx_allele[gene].add(idx) - if args.file[0].endswith('.fq.gz'): + if args.file[0].endswith('.fq.gz') or args.file[0].endswith('.fastq.gz'): command = ['kallisto quant', '-i', indv_idx, '-o', temp, '-t', args.threads] @@ -255,7 +255,10 @@ def arg_check_files(parser, arg): df = pd.DataFrame(allele_results).T df.index.names = ['gene'] - df = df[['allele1','allele2', 'allele1_count', 'allele2_count', 'allele2_tpm','allele1_tpm', 'baf']] + try: + df = df[['allele1','allele2', 'allele1_count', 'allele2_count', 'allele1_tpm', 'allele2_tpm', 'baf']] + except: + df = df[['allele1', 'allele1_count', 'allele1_tpm']] df.to_csv(allele_results_tsv,sep='\t') df = pd.DataFrame(gene_results).T