diff snpEff_cds_report.py @ 7:fbb6510186df default tip

when codon has ambiguous nucleotide translate to X
author Jim Johnson <jj@umn.edu>
date Mon, 15 Sep 2014 06:13:47 -0500
parents a64ef0611117
children
line wrap: on
line diff
--- a/snpEff_cds_report.py	Thu Jun 13 11:37:34 2013 -0500
+++ b/snpEff_cds_report.py	Mon Sep 15 06:13:47 2014 -0500
@@ -37,7 +37,8 @@
   rna = seq.upper().replace('T','U')
   aa = []
   for i in range(0,len(rna) - 2, 3):
-    aa.append(codon_map[rna[i:i+3]])
+    codon = rna[i:i+3]
+    aa.append(codon_map[codon] if codon in codon_map else 'X')
   return ''.join(aa)
 
 """