Skip to content

Commit

Permalink
small fixes to quant suggested in issue #75
Browse files Browse the repository at this point in the history
  • Loading branch information
tpereachamblee committed Feb 22, 2022
1 parent d31fe72 commit 4828a47
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/quant.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4828a47

Please sign in to comment.