# HG changeset patch # User jjohnson # Date 1553110022 14400 # Node ID 652d35c42bcad99501a6189755c8314e1444cfc5 # Parent f87fe6bc48f498fe5f856aa7fdc89679bfc4d44a planemo upload for repository https://github.com/jj-umn/galaxytools/tree/master/ensembl_variant_report commit d3b7ff1c2f0a1eed7a65af7208e987a35627402c-dirty diff -r f87fe6bc48f4 -r 652d35c42bca ensembl_variant_report.py --- a/ensembl_variant_report.py Mon Mar 18 21:43:34 2019 -0400 +++ b/ensembl_variant_report.py Wed Mar 20 15:27:02 2019 -0400 @@ -116,6 +116,7 @@ qual = float(qual) dp = None dpr = None + ao = None af = None for info_item in info.split(';'): if info_item.find('=') < 0: continue @@ -124,6 +125,8 @@ dp = int(val) if key == 'DPR' or key == 'AD': dpr = [int(x) for x in val.split(',')] + if key == 'AO': + ao = [int(x) for x in val.split(',')] if key == 'AF': af = [float(x) for x in val.split(',')] if key in ['EFF','ANN']: @@ -135,11 +138,14 @@ (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 - if af: - freq = af[i] + if ao: + freq = float(ao[i])/float(dp) if dp else \ + float(dpr[i])/float(sum(ao)) elif dpr: freq = float(dpr[i+1])/float(dp) if dp else \ float(dpr[i+1])/float(sum(dpr)) + elif af: + freq = af[i] else: freq = None if freq: diff -r f87fe6bc48f4 -r 652d35c42bca ensembl_variant_report.xml --- a/ensembl_variant_report.xml Mon Mar 18 21:43:34 2019 -0400 +++ b/ensembl_variant_report.xml Wed Mar 20 15:27:02 2019 -0400 @@ -1,4 +1,4 @@ - + gtf_to_genes twobitreader @@ -97,7 +97,7 @@ + default="Gene,Ref_location,Ref_seq,Var_seq,Frequency,DP,Ensemble_Gene_transcript,AA_pos,AA_var,Protein_len,Stop_Codon,Variant_Peptide,Transcript_type"/> @@ -179,18 +179,43 @@ 10.1093/bioinformatics/btt385 diff -r f87fe6bc48f4 -r 652d35c42bca ensemblref.pyc Binary file ensemblref.pyc has changed