Skip to content

Commit

Permalink
fix for synonymous+inframe variant change type
Browse files Browse the repository at this point in the history
  • Loading branch information
Jody Phelan committed Sep 7, 2019
1 parent 07d5ff2 commit 6586bb1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pathogenprofiler/vcf.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,17 @@ def load_csq(self,ann_file=None):
variants[sample].append({"sample":sample,"gene_id":ann_gene,"chr":chrom,"genome_pos":pos,"type":"non_coding","change":cng,"freq":adr[call2], "nucleotide_change":cng})
elif "missense" in info[0] or "start_lost" in info[0] or "stop_gained" in info[0]:
variants[sample].append({"sample":sample,"gene_id":gene_id,"gene_name":gene_name,"chr":chrom,"genome_pos":pos,"type":info[0],"change":info[5],"freq":adr[call2], "nucleotide_change":info[6]})
elif "synonymous" in info[0] or info[0]=="stop_retained":
change_num,ref_nuc,alt_nuc = parse_mutation(info[6])
change = "%s%s>%s" % (ann_pos,ref_nuc,alt_nuc) if ann_pos else "%s%s>%s" % (pos,ref_nuc,alt_nuc)
variants[sample].append({"sample":sample,"gene_id":gene_id,"gene_name":gene_name,"chr":chrom,"genome_pos":pos,"type":info[0],"change":change,"freq":adr[call2],"nucleotide_change":info[6]})
elif "frame" in info[0] or "stop_lost" in info[0]:
if len(info)<6:
if chrom in ann and pos in ann[chrom]:
change = "%s%s>%s" % (pos,ref,call2)
variants[sample].append({"sample":sample,"gene_id":gene_id,"gene_name":gene_name,"chr":chrom,"genome_pos":pos,"type":info[0],"change":change,"freq":adr[call2],"nucleotide_change":change})
else:
variants[sample].append({"sample":sample,"gene_id":gene_id,"gene_name":gene_name,"chr":chrom,"genome_pos":pos,"type":info[0],"change":info[6],"freq":adr[call2],"nucleotide_change":info[6]})
elif "synonymous" in info[0] or info[0]=="stop_retained":
change_num,ref_nuc,alt_nuc = parse_mutation(info[6])
change = "%s%s>%s" % (ann_pos,ref_nuc,alt_nuc) if ann_pos else "%s%s>%s" % (pos,ref_nuc,alt_nuc)
variants[sample].append({"sample":sample,"gene_id":gene_id,"gene_name":gene_name,"chr":chrom,"genome_pos":pos,"type":info[0],"change":change,"freq":adr[call2],"nucleotide_change":info[6]})
elif info[0]=="non_coding":
if chrom in ann and pos in ann[chrom]:
gene = ann[chrom][pos][0]
Expand Down

0 comments on commit 6586bb1

Please sign in to comment.