Mercurial > repos > jjohnson > ensembl_variant_report
diff ensembl_variant_report.py @ 8:fd612f8119a2 draft
planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/ensembl_variant_report commit f003aece24587f68b883449f278f1e601110e2ec-dirty
author | jjohnson |
---|---|
date | Tue, 17 Jul 2018 12:21:36 -0400 |
parents | d5cb252c68da |
children | 0ef485da6ba6 |
line wrap: on
line diff
--- a/ensembl_variant_report.py Thu Jun 14 18:07:10 2018 -0400 +++ b/ensembl_variant_report.py Tue Jul 17 12:21:36 2018 -0400 @@ -96,7 +96,8 @@ dp = int(fields[di]) dpr = [int(x) for x in fields[fi].split(',')] for i,alt in enumerate(alts.split(',')): - freq = float(dpr[i+1])/float(sum(dpr)) if dpr else None + freq = float(dpr[i+1])/float(dp) if dp and dpr else \ + float(dpr[i+1])/float(sum(dpr)) if dpr else None yield (transcript,pos,ref,alt,dp,freq) def parse_snpeff_vcf(): @@ -131,7 +132,8 @@ (eff, effs) = effect.rstrip(')').split('(') (impact, functional_class, codon_change, aa_change, aa_len, gene_name, biotype, coding, transcript, exon, alt) = effs.split('|')[0:11] i = alt_list.index(alt) if alt in alt_list else 0 - freq = float(dpr[i+1])/float(sum(dpr)) if dpr else None + freq = float(dpr[i+1])/float(dp) if dp and dpr else \ + float(dpr[i+1])/float(sum(dpr)) if dpr else None yield (transcript,pos,ref,alt,dp,freq)