Package Bio :: Package Data :: Module CodonTable
[hide private]
[frames] | no frames]

Source Code for Module Bio.Data.CodonTable

  1  # This code is part of the Biopython distribution and governed by its 
  2  # license.  Please see the LICENSE file that should have been included 
  3  # as part of this package. 
  4  """Codon tables based on those from the NCBI. 
  5   
  6  These tables are based on parsing the NCBI file: 
  7  ftp://ftp.ncbi.nih.gov/entrez/misc/data/gc.prt 
  8   
  9  Last updated for Version 3.9 
 10  """ 
 11   
 12  from Bio import Alphabet 
 13  from Bio.Alphabet import IUPAC 
 14  from Bio.Data import IUPACData 
 15   
 16  unambiguous_dna_by_name = {} 
 17  unambiguous_dna_by_id = {} 
 18  unambiguous_rna_by_name = {} 
 19  unambiguous_rna_by_id = {} 
 20  generic_by_name = {} # unambiguous DNA or RNA 
 21  generic_by_id = {} # unambiguous DNA or RNA 
 22   
 23  ambiguous_dna_by_name = {} 
 24  ambiguous_dna_by_id = {} 
 25  ambiguous_rna_by_name = {} 
 26  ambiguous_rna_by_id = {} 
 27  ambiguous_generic_by_name = {} # ambiguous DNA or RNA 
 28  ambiguous_generic_by_id = {} # ambiguous DNA or RNA  
 29   
 30  # standard IUPAC unambiguous codons 
 31  standard_dna_table = None 
 32  standard_rna_table = None 
 33   
 34  # In the future, the back_table could return a statistically 
 35  # appropriate distribution of codons, so do not cache the results of 
 36  # back_table lookups! 
 37   
38 -class TranslationError(Exception):
39 pass
40
41 -class CodonTable(object):
42 nucleotide_alphabet = Alphabet.generic_nucleotide 43 protein_alphabet = Alphabet.generic_protein 44 45 forward_table = {} # only includes codons which actually code 46 back_table = {} # for back translations 47 start_codons = [] 48 stop_codons = [] 49 # Not always called from derived classes!
50 - def __init__(self, nucleotide_alphabet = nucleotide_alphabet, 51 protein_alphabet = protein_alphabet, 52 forward_table = forward_table, back_table = back_table, 53 start_codons = start_codons, stop_codons = stop_codons):
60
61 - def __str__(self):
62 """Returns a simple text representation of the codon table 63 64 e.g. 65 >>> import Bio.Data.CodonTable 66 >>> print Bio.Data.CodonTable.standard_dna_table 67 >>> print Bio.Data.CodonTable.generic_by_id[1] 68 """ 69 70 if self.id: 71 answer = "Table %i" % self.id 72 else: 73 answer = "Table ID unknown" 74 if self.names: 75 answer += " " + ", ".join(filter(None, self.names)) 76 77 #Use the main four letters (and the conventional ordering) 78 #even for ambiguous tables 79 letters = self.nucleotide_alphabet.letters 80 if isinstance(self.nucleotide_alphabet, Alphabet.DNAAlphabet) \ 81 or (letters is not None and "T" in letters): 82 letters = "TCAG" 83 else: 84 #Should be either RNA or generic nucleotides, 85 #e.g. Bio.Data.CodonTable.generic_by_id[1] 86 letters = "UCAG" 87 88 #Build the table... 89 answer=answer + "\n\n |" + "|".join( \ 90 [" %s " % c2 for c2 in letters] \ 91 ) + "|" 92 answer=answer + "\n--+" \ 93 + "+".join(["---------" for c2 in letters]) + "+--" 94 for c1 in letters: 95 for c3 in letters: 96 line = c1 + " |" 97 for c2 in letters: 98 codon = c1+c2+c3 99 line = line + " %s" % codon 100 if codon in self.stop_codons: 101 line = line + " Stop|" 102 else: 103 try: 104 amino = self.forward_table[codon] 105 except KeyError: 106 amino = "?" 107 except TranslationError: 108 amino = "?" 109 if codon in self.start_codons: 110 line = line + " %s(s)|" % amino 111 else: 112 line = line + " %s |" % amino 113 line = line + " " + c3 114 answer = answer + "\n"+ line 115 answer=answer + "\n--+" \ 116 + "+".join(["---------" for c2 in letters]) + "+--" 117 return answer
118
119 -def make_back_table(table, default_stop_codon):
120 # ONLY RETURNS A SINGLE CODON 121 # Do the sort so changes in the hash implementation won't affect 122 # the result when one amino acid is coded by more than one codon. 123 back_table = {} 124 for key in sorted(table): 125 back_table[table[key]] = key 126 back_table[None] = default_stop_codon 127 return back_table
128 129
130 -class NCBICodonTable(CodonTable):
131 nucleotide_alphabet = Alphabet.generic_nucleotide 132 protein_alphabet = IUPAC.protein 133
134 - def __init__(self, id, names, table, start_codons, stop_codons):
135 self.id = id 136 self.names = names 137 self.forward_table = table 138 self.back_table = make_back_table(table, stop_codons[0]) 139 self.start_codons = start_codons 140 self.stop_codons = stop_codons
141 142
143 -class NCBICodonTableDNA(NCBICodonTable):
144 nucleotide_alphabet = IUPAC.unambiguous_dna
145
146 -class NCBICodonTableRNA(NCBICodonTable):
147 nucleotide_alphabet = IUPAC.unambiguous_rna
148 149 150 ######### Deal with ambiguous forward translations 151
152 -class AmbiguousCodonTable(CodonTable):
153 - def __init__(self, codon_table, 154 ambiguous_nucleotide_alphabet, 155 ambiguous_nucleotide_values, 156 ambiguous_protein_alphabet, 157 ambiguous_protein_values):
158 CodonTable.__init__(self, 159 ambiguous_nucleotide_alphabet, 160 ambiguous_protein_alphabet, 161 AmbiguousForwardTable(codon_table.forward_table, 162 ambiguous_nucleotide_values, 163 ambiguous_protein_values), 164 codon_table.back_table, 165 166 # These two are WRONG! I need to get the 167 # list of ambiguous codons which code for 168 # the stop codons XXX 169 list_ambiguous_codons(codon_table.start_codons, ambiguous_nucleotide_values), 170 list_ambiguous_codons(codon_table.stop_codons, ambiguous_nucleotide_values) 171 ) 172 self._codon_table = codon_table
173 174 # Be sneaky and forward attribute lookups to the original table. 175 # This lets us get the names, if the original table is an NCBI 176 # table.
177 - def __getattr__(self, name):
178 return getattr(self._codon_table, name)
179
180 -def list_possible_proteins(codon, forward_table, ambiguous_nucleotide_values):
181 c1, c2, c3 = codon 182 x1 = ambiguous_nucleotide_values[c1] 183 x2 = ambiguous_nucleotide_values[c2] 184 x3 = ambiguous_nucleotide_values[c3] 185 possible = {} 186 stops = [] 187 for y1 in x1: 188 for y2 in x2: 189 for y3 in x3: 190 try: 191 possible[forward_table[y1+y2+y3]] = 1 192 except KeyError: 193 # If tripping over a stop codon 194 stops.append(y1+y2+y3) 195 if stops: 196 if possible: 197 raise TranslationError("ambiguous codon '%s' codes " % codon \ 198 + "for both proteins and stop codons") 199 # This is a true stop codon - tell the caller about it 200 raise KeyError(codon) 201 return possible.keys()
202
203 -def list_ambiguous_codons(codons, ambiguous_nucleotide_values):
204 """Extends a codon list to include all possible ambigous codons. 205 206 e.g. ['TAG', 'TAA'] -> ['TAG', 'TAA', 'TAR'] 207 ['UAG', 'UGA'] -> ['UAG', 'UGA', 'URA'] 208 209 Note that ['TAG', 'TGA'] -> ['TAG', 'TGA'], this does not add 'TRR'. 210 Thus only two more codons are added in the following: 211 212 e.g. ['TGA', 'TAA', 'TAG'] -> ['TGA', 'TAA', 'TAG', 'TRA', 'TAR'] 213 214 Returns a new (longer) list of codon strings. 215 """ 216 217 #Note ambiguous_nucleotide_values['R'] = 'AG' (etc) 218 #This will generate things like 'TRR' from ['TAG', 'TGA'], which 219 #we don't want to include: 220 c1_list = sorted(letter for (letter, meanings) \ 221 in ambiguous_nucleotide_values.iteritems() \ 222 if set([codon[0] for codon in codons]).issuperset(set(meanings))) 223 c2_list = sorted(letter for (letter, meanings) \ 224 in ambiguous_nucleotide_values.iteritems() \ 225 if set([codon[1] for codon in codons]).issuperset(set(meanings))) 226 c3_list = sorted(letter for (letter, meanings) \ 227 in ambiguous_nucleotide_values.iteritems() \ 228 if set([codon[2] for codon in codons]).issuperset(set(meanings))) 229 #candidates is a list (not a set) to preserve the iteration order 230 candidates = [] 231 for c1 in c1_list: 232 for c2 in c2_list: 233 for c3 in c3_list: 234 codon = c1+c2+c3 235 if codon not in candidates and codon not in codons: 236 candidates.append(codon) 237 answer = codons[:] #copy 238 #print "Have %i new candidates" % len(candidates) 239 for ambig_codon in candidates: 240 wanted = True 241 #e.g. 'TRR' -> 'TAA', 'TAG', 'TGA', 'TGG' 242 for codon in [c1+c2+c3 \ 243 for c1 in ambiguous_nucleotide_values[ambig_codon[0]] \ 244 for c2 in ambiguous_nucleotide_values[ambig_codon[1]] \ 245 for c3 in ambiguous_nucleotide_values[ambig_codon[2]]]: 246 if codon not in codons: 247 #This ambiguous codon can code for a non-stop, exclude it! 248 wanted=False 249 #print "Rejecting %s" % ambig_codon 250 continue 251 if wanted: 252 answer.append(ambig_codon) 253 return answer
254 255 assert list_ambiguous_codons(['TGA', 'TAA'],IUPACData.ambiguous_dna_values) == ['TGA', 'TAA', 'TRA'] 256 assert list_ambiguous_codons(['TAG', 'TGA'],IUPACData.ambiguous_dna_values) == ['TAG', 'TGA'] 257 assert list_ambiguous_codons(['TAG', 'TAA'],IUPACData.ambiguous_dna_values) == ['TAG', 'TAA', 'TAR'] 258 assert list_ambiguous_codons(['UAG', 'UAA'],IUPACData.ambiguous_rna_values) == ['UAG', 'UAA', 'UAR'] 259 assert list_ambiguous_codons(['TGA', 'TAA', 'TAG'],IUPACData.ambiguous_dna_values) == ['TGA', 'TAA', 'TAG', 'TAR', 'TRA'] 260 261 # Forward translation is "onto", that is, any given codon always maps 262 # to the same protein, or it doesn't map at all. Thus, I can build 263 # off of an existing table to produce the ambiguous mappings. 264 # 265 # This handles the general case. Perhaps it's overkill? 266 # >>> t = CodonTable.ambiguous_dna_by_id[1] 267 # >>> t.forward_table["AAT"] 268 # 'N' 269 # >>> t.forward_table["GAT"] 270 # 'D' 271 # >>> t.forward_table["RAT"] 272 # 'B' 273 # >>> t.forward_table["YTA"] 274 # 'L' 275
276 -class AmbiguousForwardTable(object):
277 - def __init__(self, forward_table, ambiguous_nucleotide, ambiguous_protein):
278 self.forward_table = forward_table 279 280 self.ambiguous_nucleotide = ambiguous_nucleotide 281 self.ambiguous_protein = ambiguous_protein 282 283 inverted = {} 284 for name, val in ambiguous_protein.iteritems(): 285 for c in val: 286 x = inverted.get(c, {}) 287 x[name] = 1 288 inverted[c] = x 289 for name, val in inverted.iteritems(): 290 inverted[name] = val.keys() 291 self._inverted = inverted 292 293 self._cache = {}
294
295 - def get(self, codon, failobj = None):
296 try: 297 return self.__getitem__(codon) 298 except KeyError: 299 return failobj
300
301 - def __getitem__(self, codon):
302 try: 303 x = self._cache[codon] 304 except KeyError: 305 pass 306 else: 307 if x is TranslationError: 308 raise TranslationError(codon) # no unique translation 309 if x is KeyError: 310 raise KeyError(codon) # it's a stop codon 311 return x 312 try: 313 x = self.forward_table[codon] 314 self._cache[codon] = x 315 return x 316 except KeyError: 317 pass 318 319 # XXX Need to make part of this into a method which returns 320 # a list of all possible encodings for a codon! 321 try: 322 possible = list_possible_proteins(codon, 323 self.forward_table, 324 self.ambiguous_nucleotide) 325 except KeyError: 326 self._cache[codon] = KeyError 327 raise KeyError(codon) # stop codon 328 except TranslationError: 329 self._cache[codon] = TranslationError 330 raise TranslationError(codon) # does not code 331 assert len(possible) > 0, "unambiguous codons must code" 332 333 # Hah! Only one possible protein, so use it 334 if len(possible) == 1: 335 self._cache[codon] = possible[0] 336 return possible[0] 337 338 # See if there's an ambiguous protein encoding for the multiples. 339 # Find residues which exist in every coding set. 340 ambiguous_possible = {} 341 for amino in possible: 342 for term in self._inverted[amino]: 343 ambiguous_possible[term] = ambiguous_possible.get(term, 0) + 1 344 345 n = len(possible) 346 possible = [] 347 for amino, val in ambiguous_possible.iteritems(): 348 if val == n: 349 possible.append(amino) 350 351 # No amino acid encoding for the results 352 if len(possible) == 0: 353 self._cache[codon] = TranslationError 354 raise TranslationError(codon) # no valid translation 355 356 # All of these are valid, so choose one 357 # To be unique, sort by smallet ambiguity then alphabetically 358 # Can get this if "X" encodes for everything. 359 #def _sort(x, y, table = self.ambiguous_protein): 360 # a = cmp(len(table[x]), len(table[y])) 361 # if a == 0: 362 # return cmp(x, y) 363 # return a 364 365 #Sort by key is 2.x and 3.x compatible 366 possible.sort(key=lambda x:(len(self.ambiguous_protein[x]), x)) 367 368 x = possible[0] 369 self._cache[codon] = x 370 return x
371 372
373 -def register_ncbi_table(name, alt_name, id, 374 table, start_codons, stop_codons):
375 """Turns codon table data into objects, and stores them in the dictionaries (PRIVATE).""" 376 #In most cases names are divided by "; ", however there is also 377 #'Bacterial and Plant Plastid' (which used to be just 'Bacterial') 378 names = [x.strip() for x in name.replace(" and ","; ").split("; ")] 379 380 dna = NCBICodonTableDNA(id, names + [alt_name], table, start_codons, 381 stop_codons) 382 383 ambig_dna = AmbiguousCodonTable(dna, 384 IUPAC.ambiguous_dna, 385 IUPACData.ambiguous_dna_values, 386 IUPAC.extended_protein, 387 IUPACData.extended_protein_values) 388 389 # replace all T's with U's for the RNA tables 390 rna_table = {} 391 generic_table = {} 392 for codon, val in table.iteritems(): 393 generic_table[codon] = val 394 codon = codon.replace("T", "U") 395 generic_table[codon] = val 396 rna_table[codon] = val 397 rna_start_codons = [] 398 generic_start_codons = [] 399 for codon in start_codons: 400 generic_start_codons.append(codon) 401 codon = codon.replace("T", "U") 402 generic_start_codons.append(codon) 403 rna_start_codons.append(codon) 404 rna_stop_codons = [] 405 generic_stop_codons = [] 406 for codon in stop_codons: 407 generic_stop_codons.append(codon) 408 codon = codon.replace("T", "U") 409 generic_stop_codons.append(codon) 410 rna_stop_codons.append(codon) 411 412 generic = NCBICodonTable(id, names + [alt_name], generic_table, 413 generic_start_codons, generic_stop_codons) 414 415 #The following isn't very elegant, but seems to work nicely. 416 _merged_values = dict(IUPACData.ambiguous_rna_values.iteritems()) 417 _merged_values["T"] = "U" 418 ambig_generic = AmbiguousCodonTable(generic, 419 Alphabet.NucleotideAlphabet(), 420 _merged_values, 421 IUPAC.extended_protein, 422 IUPACData.extended_protein_values) 423 424 rna = NCBICodonTableRNA(id, names + [alt_name], rna_table, 425 rna_start_codons, rna_stop_codons) 426 427 ambig_rna = AmbiguousCodonTable(rna, 428 IUPAC.ambiguous_rna, 429 IUPACData.ambiguous_rna_values, 430 IUPAC.extended_protein, 431 IUPACData.extended_protein_values) 432 433 if id == 1: 434 global standard_dna_table, standard_rna_table 435 standard_dna_table = dna 436 standard_rna_table = rna 437 438 unambiguous_dna_by_id[id] = dna 439 unambiguous_rna_by_id[id] = rna 440 generic_by_id[id] = generic 441 ambiguous_dna_by_id[id] = ambig_dna 442 ambiguous_rna_by_id[id] = ambig_rna 443 ambiguous_generic_by_id[id] = ambig_generic 444 445 if alt_name is not None: 446 names.append(alt_name) 447 448 for name in names: 449 unambiguous_dna_by_name[name] = dna 450 unambiguous_rna_by_name[name] = rna 451 generic_by_name[name] = generic 452 ambiguous_dna_by_name[name] = ambig_dna 453 ambiguous_rna_by_name[name] = ambig_rna 454 ambiguous_generic_by_name[name] = ambig_generic
455 456 457 ### These tables created from the data file 458 ### ftp://ftp.ncbi.nih.gov/entrez/misc/data/gc.prt 459 ### using the following: 460 ##import re 461 ##for line in open("gc.prt").readlines(): 462 ## if line[:2] == " {": 463 ## names = [] 464 ## id = None 465 ## aa = None 466 ## start = None 467 ## bases = [] 468 ## elif line[:6] == " name": 469 ## names.append(re.search('"([^"]*)"', line).group(1)) 470 ## elif line[:8] == " name": 471 ## names.append(re.search('"(.*)$', line).group(1)) 472 ## elif line == ' Mitochondrial; Mycoplasma; Spiroplasma" ,\n': 473 ## names[-1] = names[-1] + " Mitochondrial; Mycoplasma; Spiroplasma" 474 ## elif line[:4] == " id": 475 ## id = int(re.search('(\d+)', line).group(1)) 476 ## elif line[:10] == " ncbieaa ": 477 ## aa = line[12:12+64] 478 ## elif line[:10] == " sncbieaa": 479 ## start = line[12:12+64] 480 ## elif line[:9] == " -- Base": 481 ## bases.append(line[12:12+64]) 482 ## elif line[:2] == " }": 483 ## assert names != [] and id is not None and aa is not None 484 ## assert start is not None and bases != [] 485 ## if len(names) == 1: 486 ## names.append(None) 487 ## print "register_ncbi_table(name = %s," % repr(names[0]) 488 ## print " alt_name = %s, id = %d," % \ 489 ## (repr(names[1]), id) 490 ## print " table = {" 491 ## s = " " 492 ## for i in range(64): 493 ## if aa[i] != "*": 494 ## t = " '%s%s%s': '%s'," % (bases[0][i], bases[1][i], 495 ## bases[2][i], aa[i]) 496 ## if len(s) + len(t) > 75: 497 ## print s 498 ## s = " " + t 499 ## else: 500 ## s = s + t 501 ## print s, "}," 502 503 ## s = " stop_codons = [" 504 ## for i in range(64): 505 ## if aa[i] == "*": 506 ## t = " '%s%s%s'," % (bases[0][i], bases[1][i], bases[2][i]) 507 ## if len(s) + len(t) > 75: 508 ## print s 509 ## s = " " + t 510 ## else: 511 ## s = s + t 512 ## print s, "]," 513 514 ## s = " start_codons = [" 515 ## for i in range(64): 516 ## if start[i] == "M": 517 ## t = " '%s%s%s'," % (bases[0][i], bases[1][i], bases[2][i]) 518 ## if len(s) + len(t) > 75: 519 ## print s 520 ## s = " " + t 521 ## else: 522 ## s = s + t 523 ## print s, "]" 524 ## print " )" 525 ## elif line[:2] == "--" or line == "\n" or line == "}\n" or \ 526 ## line == 'Genetic-code-table ::= {\n': 527 ## pass 528 ## else: 529 ## raise Exception("Unparsed: " + repr(line)) 530 531 register_ncbi_table(name = 'Standard', 532 alt_name = 'SGC0', id = 1, 533 table = { 534 'TTT': 'F', 'TTC': 'F', 'TTA': 'L', 'TTG': 'L', 'TCT': 'S', 535 'TCC': 'S', 'TCA': 'S', 'TCG': 'S', 'TAT': 'Y', 'TAC': 'Y', 536 'TGT': 'C', 'TGC': 'C', 'TGG': 'W', 'CTT': 'L', 'CTC': 'L', 537 'CTA': 'L', 'CTG': 'L', 'CCT': 'P', 'CCC': 'P', 'CCA': 'P', 538 'CCG': 'P', 'CAT': 'H', 'CAC': 'H', 'CAA': 'Q', 'CAG': 'Q', 539 'CGT': 'R', 'CGC': 'R', 'CGA': 'R', 'CGG': 'R', 'ATT': 'I', 540 'ATC': 'I', 'ATA': 'I', 'ATG': 'M', 'ACT': 'T', 'ACC': 'T', 541 'ACA': 'T', 'ACG': 'T', 'AAT': 'N', 'AAC': 'N', 'AAA': 'K', 542 'AAG': 'K', 'AGT': 'S', 'AGC': 'S', 'AGA': 'R', 'AGG': 'R', 543 'GTT': 'V', 'GTC': 'V', 'GTA': 'V', 'GTG': 'V', 'GCT': 'A', 544 'GCC': 'A', 'GCA': 'A', 'GCG': 'A', 'GAT': 'D', 'GAC': 'D', 545 'GAA': 'E', 'GAG': 'E', 'GGT': 'G', 'GGC': 'G', 'GGA': 'G', 546 'GGG': 'G', }, 547 stop_codons = [ 'TAA', 'TAG', 'TGA', ], 548 start_codons = [ 'TTG', 'CTG', 'ATG', ] 549 ) 550 register_ncbi_table(name = 'Vertebrate Mitochondrial', 551 alt_name = 'SGC1', id = 2, 552 table = { 553 'TTT': 'F', 'TTC': 'F', 'TTA': 'L', 'TTG': 'L', 'TCT': 'S', 554 'TCC': 'S', 'TCA': 'S', 'TCG': 'S', 'TAT': 'Y', 'TAC': 'Y', 555 'TGT': 'C', 'TGC': 'C', 'TGA': 'W', 'TGG': 'W', 'CTT': 'L', 556 'CTC': 'L', 'CTA': 'L', 'CTG': 'L', 'CCT': 'P', 'CCC': 'P', 557 'CCA': 'P', 'CCG': 'P', 'CAT': 'H', 'CAC': 'H', 'CAA': 'Q', 558 'CAG': 'Q', 'CGT': 'R', 'CGC': 'R', 'CGA': 'R', 'CGG': 'R', 559 'ATT': 'I', 'ATC': 'I', 'ATA': 'M', 'ATG': 'M', 'ACT': 'T', 560 'ACC': 'T', 'ACA': 'T', 'ACG': 'T', 'AAT': 'N', 'AAC': 'N', 561 'AAA': 'K', 'AAG': 'K', 'AGT': 'S', 'AGC': 'S', 'GTT': 'V', 562 'GTC': 'V', 'GTA': 'V', 'GTG': 'V', 'GCT': 'A', 'GCC': 'A', 563 'GCA': 'A', 'GCG': 'A', 'GAT': 'D', 'GAC': 'D', 'GAA': 'E', 564 'GAG': 'E', 'GGT': 'G', 'GGC': 'G', 'GGA': 'G', 'GGG': 'G', }, 565 stop_codons = [ 'TAA', 'TAG', 'AGA', 'AGG', ], 566 start_codons = [ 'ATT', 'ATC', 'ATA', 'ATG', 'GTG', ] 567 ) 568 register_ncbi_table(name = 'Yeast Mitochondrial', 569 alt_name = 'SGC2', id = 3, 570 table = { 571 'TTT': 'F', 'TTC': 'F', 'TTA': 'L', 'TTG': 'L', 'TCT': 'S', 572 'TCC': 'S', 'TCA': 'S', 'TCG': 'S', 'TAT': 'Y', 'TAC': 'Y', 573 'TGT': 'C', 'TGC': 'C', 'TGA': 'W', 'TGG': 'W', 'CTT': 'T', 574 'CTC': 'T', 'CTA': 'T', 'CTG': 'T', 'CCT': 'P', 'CCC': 'P', 575 'CCA': 'P', 'CCG': 'P', 'CAT': 'H', 'CAC': 'H', 'CAA': 'Q', 576 'CAG': 'Q', 'CGT': 'R', 'CGC': 'R', 'CGA': 'R', 'CGG': 'R', 577 'ATT': 'I', 'ATC': 'I', 'ATA': 'M', 'ATG': 'M', 'ACT': 'T', 578 'ACC': 'T', 'ACA': 'T', 'ACG': 'T', 'AAT': 'N', 'AAC': 'N', 579 'AAA': 'K', 'AAG': 'K', 'AGT': 'S', 'AGC': 'S', 'AGA': 'R', 580 'AGG': 'R', 'GTT': 'V', 'GTC': 'V', 'GTA': 'V', 'GTG': 'V', 581 'GCT': 'A', 'GCC': 'A', 'GCA': 'A', 'GCG': 'A', 'GAT': 'D', 582 'GAC': 'D', 'GAA': 'E', 'GAG': 'E', 'GGT': 'G', 'GGC': 'G', 583 'GGA': 'G', 'GGG': 'G', }, 584 stop_codons = [ 'TAA', 'TAG', ], 585 start_codons = [ 'ATA', 'ATG', ] 586 ) 587 register_ncbi_table(name = 'Mold Mitochondrial; Protozoan Mitochondrial; Coelenterate Mitochondrial; Mycoplasma; Spiroplasma', 588 alt_name = 'SGC3', id = 4, 589 table = { 590 'TTT': 'F', 'TTC': 'F', 'TTA': 'L', 'TTG': 'L', 'TCT': 'S', 591 'TCC': 'S', 'TCA': 'S', 'TCG': 'S', 'TAT': 'Y', 'TAC': 'Y', 592 'TGT': 'C', 'TGC': 'C', 'TGA': 'W', 'TGG': 'W', 'CTT': 'L', 593 'CTC': 'L', 'CTA': 'L', 'CTG': 'L', 'CCT': 'P', 'CCC': 'P', 594 'CCA': 'P', 'CCG': 'P', 'CAT': 'H', 'CAC': 'H', 'CAA': 'Q', 595 'CAG': 'Q', 'CGT': 'R', 'CGC': 'R', 'CGA': 'R', 'CGG': 'R', 596 'ATT': 'I', 'ATC': 'I', 'ATA': 'I', 'ATG': 'M', 'ACT': 'T', 597 'ACC': 'T', 'ACA': 'T', 'ACG': 'T', 'AAT': 'N', 'AAC': 'N', 598 'AAA': 'K', 'AAG': 'K', 'AGT': 'S', 'AGC': 'S', 'AGA': 'R', 599 'AGG': 'R', 'GTT': 'V', 'GTC': 'V', 'GTA': 'V', 'GTG': 'V', 600 'GCT': 'A', 'GCC': 'A', 'GCA': 'A', 'GCG': 'A', 'GAT': 'D', 601 'GAC': 'D', 'GAA': 'E', 'GAG': 'E', 'GGT': 'G', 'GGC': 'G', 602 'GGA': 'G', 'GGG': 'G', }, 603 stop_codons = [ 'TAA', 'TAG', ], 604 start_codons = [ 'TTA', 'TTG', 'CTG', 'ATT', 'ATC', 605 'ATA', 'ATG', 'GTG', ] 606 ) 607 register_ncbi_table(name = 'Invertebrate Mitochondrial', 608 alt_name = 'SGC4', id = 5, 609 table = { 610 'TTT': 'F', 'TTC': 'F', 'TTA': 'L', 'TTG': 'L', 'TCT': 'S', 611 'TCC': 'S', 'TCA': 'S', 'TCG': 'S', 'TAT': 'Y', 'TAC': 'Y', 612 'TGT': 'C', 'TGC': 'C', 'TGA': 'W', 'TGG': 'W', 'CTT': 'L', 613 'CTC': 'L', 'CTA': 'L', 'CTG': 'L', 'CCT': 'P', 'CCC': 'P', 614 'CCA': 'P', 'CCG': 'P', 'CAT': 'H', 'CAC': 'H', 'CAA': 'Q', 615 'CAG': 'Q', 'CGT': 'R', 'CGC': 'R', 'CGA': 'R', 'CGG': 'R', 616 'ATT': 'I', 'ATC': 'I', 'ATA': 'M', 'ATG': 'M', 'ACT': 'T', 617 'ACC': 'T', 'ACA': 'T', 'ACG': 'T', 'AAT': 'N', 'AAC': 'N', 618 'AAA': 'K', 'AAG': 'K', 'AGT': 'S', 'AGC': 'S', 'AGA': 'S', 619 'AGG': 'S', 'GTT': 'V', 'GTC': 'V', 'GTA': 'V', 'GTG': 'V', 620 'GCT': 'A', 'GCC': 'A', 'GCA': 'A', 'GCG': 'A', 'GAT': 'D', 621 'GAC': 'D', 'GAA': 'E', 'GAG': 'E', 'GGT': 'G', 'GGC': 'G', 622 'GGA': 'G', 'GGG': 'G', }, 623 stop_codons = [ 'TAA', 'TAG', ], 624 start_codons = [ 'TTG', 'ATT', 'ATC', 'ATA', 'ATG', 625 'GTG', ] 626 ) 627 register_ncbi_table(name = 'Ciliate Nuclear; Dasycladacean Nuclear; Hexamita Nuclear', 628 alt_name = 'SGC5', id = 6, 629 table = { 630 'TTT': 'F', 'TTC': 'F', 'TTA': 'L', 'TTG': 'L', 'TCT': 'S', 631 'TCC': 'S', 'TCA': 'S', 'TCG': 'S', 'TAT': 'Y', 'TAC': 'Y', 632 'TAA': 'Q', 'TAG': 'Q', 'TGT': 'C', 'TGC': 'C', 'TGG': 'W', 633 'CTT': 'L', 'CTC': 'L', 'CTA': 'L', 'CTG': 'L', 'CCT': 'P', 634 'CCC': 'P', 'CCA': 'P', 'CCG': 'P', 'CAT': 'H', 'CAC': 'H', 635 'CAA': 'Q', 'CAG': 'Q', 'CGT': 'R', 'CGC': 'R', 'CGA': 'R', 636 'CGG': 'R', 'ATT': 'I', 'ATC': 'I', 'ATA': 'I', 'ATG': 'M', 637 'ACT': 'T', 'ACC': 'T', 'ACA': 'T', 'ACG': 'T', 'AAT': 'N', 638 'AAC': 'N', 'AAA': 'K', 'AAG': 'K', 'AGT': 'S', 'AGC': 'S', 639 'AGA': 'R', 'AGG': 'R', 'GTT': 'V', 'GTC': 'V', 'GTA': 'V', 640 'GTG': 'V', 'GCT': 'A', 'GCC': 'A', 'GCA': 'A', 'GCG': 'A', 641 'GAT': 'D', 'GAC': 'D', 'GAA': 'E', 'GAG': 'E', 'GGT': 'G', 642 'GGC': 'G', 'GGA': 'G', 'GGG': 'G', }, 643 stop_codons = [ 'TGA', ], 644 start_codons = [ 'ATG', ] 645 ) 646 register_ncbi_table(name = 'Echinoderm Mitochondrial; Flatworm Mitochondrial', 647 alt_name = 'SGC8', id = 9, 648 table = { 649 'TTT': 'F', 'TTC': 'F', 'TTA': 'L', 'TTG': 'L', 'TCT': 'S', 650 'TCC': 'S', 'TCA': 'S', 'TCG': 'S', 'TAT': 'Y', 'TAC': 'Y', 651 'TGT': 'C', 'TGC': 'C', 'TGA': 'W', 'TGG': 'W', 'CTT': 'L', 652 'CTC': 'L', 'CTA': 'L', 'CTG': 'L', 'CCT': 'P', 'CCC': 'P', 653 'CCA': 'P', 'CCG': 'P', 'CAT': 'H', 'CAC': 'H', 'CAA': 'Q', 654 'CAG': 'Q', 'CGT': 'R', 'CGC': 'R', 'CGA': 'R', 'CGG': 'R', 655 'ATT': 'I', 'ATC': 'I', 'ATA': 'I', 'ATG': 'M', 'ACT': 'T', 656 'ACC': 'T', 'ACA': 'T', 'ACG': 'T', 'AAT': 'N', 'AAC': 'N', 657 'AAA': 'N', 'AAG': 'K', 'AGT': 'S', 'AGC': 'S', 'AGA': 'S', 658 'AGG': 'S', 'GTT': 'V', 'GTC': 'V', 'GTA': 'V', 'GTG': 'V', 659 'GCT': 'A', 'GCC': 'A', 'GCA': 'A', 'GCG': 'A', 'GAT': 'D', 660 'GAC': 'D', 'GAA': 'E', 'GAG': 'E', 'GGT': 'G', 'GGC': 'G', 661 'GGA': 'G', 'GGG': 'G', }, 662 stop_codons = [ 'TAA', 'TAG', ], 663 start_codons = [ 'ATG', 'GTG', ] 664 ) 665 register_ncbi_table(name = 'Euplotid Nuclear', 666 alt_name = 'SGC9', id = 10, 667 table = { 668 'TTT': 'F', 'TTC': 'F', 'TTA': 'L', 'TTG': 'L', 'TCT': 'S', 669 'TCC': 'S', 'TCA': 'S', 'TCG': 'S', 'TAT': 'Y', 'TAC': 'Y', 670 'TGT': 'C', 'TGC': 'C', 'TGA': 'C', 'TGG': 'W', 'CTT': 'L', 671 'CTC': 'L', 'CTA': 'L', 'CTG': 'L', 'CCT': 'P', 'CCC': 'P', 672 'CCA': 'P', 'CCG': 'P', 'CAT': 'H', 'CAC': 'H', 'CAA': 'Q', 673 'CAG': 'Q', 'CGT': 'R', 'CGC': 'R', 'CGA': 'R', 'CGG': 'R', 674 'ATT': 'I', 'ATC': 'I', 'ATA': 'I', 'ATG': 'M', 'ACT': 'T', 675 'ACC': 'T', 'ACA': 'T', 'ACG': 'T', 'AAT': 'N', 'AAC': 'N', 676 'AAA': 'K', 'AAG': 'K', 'AGT': 'S', 'AGC': 'S', 'AGA': 'R', 677 'AGG': 'R', 'GTT': 'V', 'GTC': 'V', 'GTA': 'V', 'GTG': 'V', 678 'GCT': 'A', 'GCC': 'A', 'GCA': 'A', 'GCG': 'A', 'GAT': 'D', 679 'GAC': 'D', 'GAA': 'E', 'GAG': 'E', 'GGT': 'G', 'GGC': 'G', 680 'GGA': 'G', 'GGG': 'G', }, 681 stop_codons = [ 'TAA', 'TAG', ], 682 start_codons = [ 'ATG', ] 683 ) 684 register_ncbi_table(name = 'Bacterial and Plant Plastid', 685 alt_name = None, id = 11, 686 table = { 687 'TTT': 'F', 'TTC': 'F', 'TTA': 'L', 'TTG': 'L', 'TCT': 'S', 688 'TCC': 'S', 'TCA': 'S', 'TCG': 'S', 'TAT': 'Y', 'TAC': 'Y', 689 'TGT': 'C', 'TGC': 'C', 'TGG': 'W', 'CTT': 'L', 'CTC': 'L', 690 'CTA': 'L', 'CTG': 'L', 'CCT': 'P', 'CCC': 'P', 'CCA': 'P', 691 'CCG': 'P', 'CAT': 'H', 'CAC': 'H', 'CAA': 'Q', 'CAG': 'Q', 692 'CGT': 'R', 'CGC': 'R', 'CGA': 'R', 'CGG': 'R', 'ATT': 'I', 693 'ATC': 'I', 'ATA': 'I', 'ATG': 'M', 'ACT': 'T', 'ACC': 'T', 694 'ACA': 'T', 'ACG': 'T', 'AAT': 'N', 'AAC': 'N', 'AAA': 'K', 695 'AAG': 'K', 'AGT': 'S', 'AGC': 'S', 'AGA': 'R', 'AGG': 'R', 696 'GTT': 'V', 'GTC': 'V', 'GTA': 'V', 'GTG': 'V', 'GCT': 'A', 697 'GCC': 'A', 'GCA': 'A', 'GCG': 'A', 'GAT': 'D', 'GAC': 'D', 698 'GAA': 'E', 'GAG': 'E', 'GGT': 'G', 'GGC': 'G', 'GGA': 'G', 699 'GGG': 'G', }, 700 stop_codons = [ 'TAA', 'TAG', 'TGA', ], 701 start_codons = [ 'TTG', 'CTG', 'ATT', 'ATC', 'ATA', 702 'ATG', 'GTG', ] 703 ) 704 register_ncbi_table(name = 'Alternative Yeast Nuclear', 705 alt_name = None, id = 12, 706 table = { 707 'TTT': 'F', 'TTC': 'F', 'TTA': 'L', 'TTG': 'L', 'TCT': 'S', 708 'TCC': 'S', 'TCA': 'S', 'TCG': 'S', 'TAT': 'Y', 'TAC': 'Y', 709 'TGT': 'C', 'TGC': 'C', 'TGG': 'W', 'CTT': 'L', 'CTC': 'L', 710 'CTA': 'L', 'CTG': 'S', 'CCT': 'P', 'CCC': 'P', 'CCA': 'P', 711 'CCG': 'P', 'CAT': 'H', 'CAC': 'H', 'CAA': 'Q', 'CAG': 'Q', 712 'CGT': 'R', 'CGC': 'R', 'CGA': 'R', 'CGG': 'R', 'ATT': 'I', 713 'ATC': 'I', 'ATA': 'I', 'ATG': 'M', 'ACT': 'T', 'ACC': 'T', 714 'ACA': 'T', 'ACG': 'T', 'AAT': 'N', 'AAC': 'N', 'AAA': 'K', 715 'AAG': 'K', 'AGT': 'S', 'AGC': 'S', 'AGA': 'R', 'AGG': 'R', 716 'GTT': 'V', 'GTC': 'V', 'GTA': 'V', 'GTG': 'V', 'GCT': 'A', 717 'GCC': 'A', 'GCA': 'A', 'GCG': 'A', 'GAT': 'D', 'GAC': 'D', 718 'GAA': 'E', 'GAG': 'E', 'GGT': 'G', 'GGC': 'G', 'GGA': 'G', 719 'GGG': 'G', }, 720 stop_codons = [ 'TAA', 'TAG', 'TGA', ], 721 start_codons = [ 'CTG', 'ATG', ] 722 ) 723 register_ncbi_table(name = 'Ascidian Mitochondrial', 724 alt_name = None, id = 13, 725 table = { 726 'TTT': 'F', 'TTC': 'F', 'TTA': 'L', 'TTG': 'L', 'TCT': 'S', 727 'TCC': 'S', 'TCA': 'S', 'TCG': 'S', 'TAT': 'Y', 'TAC': 'Y', 728 'TGT': 'C', 'TGC': 'C', 'TGA': 'W', 'TGG': 'W', 'CTT': 'L', 729 'CTC': 'L', 'CTA': 'L', 'CTG': 'L', 'CCT': 'P', 'CCC': 'P', 730 'CCA': 'P', 'CCG': 'P', 'CAT': 'H', 'CAC': 'H', 'CAA': 'Q', 731 'CAG': 'Q', 'CGT': 'R', 'CGC': 'R', 'CGA': 'R', 'CGG': 'R', 732 'ATT': 'I', 'ATC': 'I', 'ATA': 'M', 'ATG': 'M', 'ACT': 'T', 733 'ACC': 'T', 'ACA': 'T', 'ACG': 'T', 'AAT': 'N', 'AAC': 'N', 734 'AAA': 'K', 'AAG': 'K', 'AGT': 'S', 'AGC': 'S', 'AGA': 'G', 735 'AGG': 'G', 'GTT': 'V', 'GTC': 'V', 'GTA': 'V', 'GTG': 'V', 736 'GCT': 'A', 'GCC': 'A', 'GCA': 'A', 'GCG': 'A', 'GAT': 'D', 737 'GAC': 'D', 'GAA': 'E', 'GAG': 'E', 'GGT': 'G', 'GGC': 'G', 738 'GGA': 'G', 'GGG': 'G', }, 739 stop_codons = [ 'TAA', 'TAG', ], 740 start_codons = [ 'TTG', 'ATA', 'ATG', 'GTG', ] 741 ) 742 register_ncbi_table(name = 'Alternative Flatworm Mitochondrial', 743 alt_name = None, id = 14, 744 table = { 745 'TTT': 'F', 'TTC': 'F', 'TTA': 'L', 'TTG': 'L', 'TCT': 'S', 746 'TCC': 'S', 'TCA': 'S', 'TCG': 'S', 'TAT': 'Y', 'TAC': 'Y', 747 'TAA': 'Y', 'TGT': 'C', 'TGC': 'C', 'TGA': 'W', 'TGG': 'W', 748 'CTT': 'L', 'CTC': 'L', 'CTA': 'L', 'CTG': 'L', 'CCT': 'P', 749 'CCC': 'P', 'CCA': 'P', 'CCG': 'P', 'CAT': 'H', 'CAC': 'H', 750 'CAA': 'Q', 'CAG': 'Q', 'CGT': 'R', 'CGC': 'R', 'CGA': 'R', 751 'CGG': 'R', 'ATT': 'I', 'ATC': 'I', 'ATA': 'I', 'ATG': 'M', 752 'ACT': 'T', 'ACC': 'T', 'ACA': 'T', 'ACG': 'T', 'AAT': 'N', 753 'AAC': 'N', 'AAA': 'N', 'AAG': 'K', 'AGT': 'S', 'AGC': 'S', 754 'AGA': 'S', 'AGG': 'S', 'GTT': 'V', 'GTC': 'V', 'GTA': 'V', 755 'GTG': 'V', 'GCT': 'A', 'GCC': 'A', 'GCA': 'A', 'GCG': 'A', 756 'GAT': 'D', 'GAC': 'D', 'GAA': 'E', 'GAG': 'E', 'GGT': 'G', 757 'GGC': 'G', 'GGA': 'G', 'GGG': 'G', }, 758 stop_codons = [ 'TAG', ], 759 start_codons = [ 'ATG', ] 760 ) 761 register_ncbi_table(name = 'Blepharisma Macronuclear', 762 alt_name = None, id = 15, 763 table = { 764 'TTT': 'F', 'TTC': 'F', 'TTA': 'L', 'TTG': 'L', 'TCT': 'S', 765 'TCC': 'S', 'TCA': 'S', 'TCG': 'S', 'TAT': 'Y', 'TAC': 'Y', 766 'TAG': 'Q', 'TGT': 'C', 'TGC': 'C', 'TGG': 'W', 'CTT': 'L', 767 'CTC': 'L', 'CTA': 'L', 'CTG': 'L', 'CCT': 'P', 'CCC': 'P', 768 'CCA': 'P', 'CCG': 'P', 'CAT': 'H', 'CAC': 'H', 'CAA': 'Q', 769 'CAG': 'Q', 'CGT': 'R', 'CGC': 'R', 'CGA': 'R', 'CGG': 'R', 770 'ATT': 'I', 'ATC': 'I', 'ATA': 'I', 'ATG': 'M', 'ACT': 'T', 771 'ACC': 'T', 'ACA': 'T', 'ACG': 'T', 'AAT': 'N', 'AAC': 'N', 772 'AAA': 'K', 'AAG': 'K', 'AGT': 'S', 'AGC': 'S', 'AGA': 'R', 773 'AGG': 'R', 'GTT': 'V', 'GTC': 'V', 'GTA': 'V', 'GTG': 'V', 774 'GCT': 'A', 'GCC': 'A', 'GCA': 'A', 'GCG': 'A', 'GAT': 'D', 775 'GAC': 'D', 'GAA': 'E', 'GAG': 'E', 'GGT': 'G', 'GGC': 'G', 776 'GGA': 'G', 'GGG': 'G', }, 777 stop_codons = [ 'TAA', 'TGA', ], 778 start_codons = [ 'ATG', ] 779 ) 780 register_ncbi_table(name = 'Chlorophycean Mitochondrial', 781 alt_name = None, id = 16, 782 table = { 783 'TTT': 'F', 'TTC': 'F', 'TTA': 'L', 'TTG': 'L', 'TCT': 'S', 784 'TCC': 'S', 'TCA': 'S', 'TCG': 'S', 'TAT': 'Y', 'TAC': 'Y', 785 'TAG': 'L', 'TGT': 'C', 'TGC': 'C', 'TGG': 'W', 'CTT': 'L', 786 'CTC': 'L', 'CTA': 'L', 'CTG': 'L', 'CCT': 'P', 'CCC': 'P', 787 'CCA': 'P', 'CCG': 'P', 'CAT': 'H', 'CAC': 'H', 'CAA': 'Q', 788 'CAG': 'Q', 'CGT': 'R', 'CGC': 'R', 'CGA': 'R', 'CGG': 'R', 789 'ATT': 'I', 'ATC': 'I', 'ATA': 'I', 'ATG': 'M', 'ACT': 'T', 790 'ACC': 'T', 'ACA': 'T', 'ACG': 'T', 'AAT': 'N', 'AAC': 'N', 791 'AAA': 'K', 'AAG': 'K', 'AGT': 'S', 'AGC': 'S', 'AGA': 'R', 792 'AGG': 'R', 'GTT': 'V', 'GTC': 'V', 'GTA': 'V', 'GTG': 'V', 793 'GCT': 'A', 'GCC': 'A', 'GCA': 'A', 'GCG': 'A', 'GAT': 'D', 794 'GAC': 'D', 'GAA': 'E', 'GAG': 'E', 'GGT': 'G', 'GGC': 'G', 795 'GGA': 'G', 'GGG': 'G', }, 796 stop_codons = [ 'TAA', 'TGA', ], 797 start_codons = [ 'ATG', ] 798 ) 799 register_ncbi_table(name = 'Trematode Mitochondrial', 800 alt_name = None, id = 21, 801 table = { 802 'TTT': 'F', 'TTC': 'F', 'TTA': 'L', 'TTG': 'L', 'TCT': 'S', 803 'TCC': 'S', 'TCA': 'S', 'TCG': 'S', 'TAT': 'Y', 'TAC': 'Y', 804 'TGT': 'C', 'TGC': 'C', 'TGA': 'W', 'TGG': 'W', 'CTT': 'L', 805 'CTC': 'L', 'CTA': 'L', 'CTG': 'L', 'CCT': 'P', 'CCC': 'P', 806 'CCA': 'P', 'CCG': 'P', 'CAT': 'H', 'CAC': 'H', 'CAA': 'Q', 807 'CAG': 'Q', 'CGT': 'R', 'CGC': 'R', 'CGA': 'R', 'CGG': 'R', 808 'ATT': 'I', 'ATC': 'I', 'ATA': 'M', 'ATG': 'M', 'ACT': 'T', 809 'ACC': 'T', 'ACA': 'T', 'ACG': 'T', 'AAT': 'N', 'AAC': 'N', 810 'AAA': 'N', 'AAG': 'K', 'AGT': 'S', 'AGC': 'S', 'AGA': 'S', 811 'AGG': 'S', 'GTT': 'V', 'GTC': 'V', 'GTA': 'V', 'GTG': 'V', 812 'GCT': 'A', 'GCC': 'A', 'GCA': 'A', 'GCG': 'A', 'GAT': 'D', 813 'GAC': 'D', 'GAA': 'E', 'GAG': 'E', 'GGT': 'G', 'GGC': 'G', 814 'GGA': 'G', 'GGG': 'G', }, 815 stop_codons = [ 'TAA', 'TAG', ], 816 start_codons = [ 'ATG', 'GTG', ] 817 ) 818 register_ncbi_table(name = 'Scenedesmus obliquus Mitochondrial', 819 alt_name = None, id = 22, 820 table = { 821 'TTT': 'F', 'TTC': 'F', 'TTA': 'L', 'TTG': 'L', 'TCT': 'S', 822 'TCC': 'S', 'TCG': 'S', 'TAT': 'Y', 'TAC': 'Y', 'TAG': 'L', 823 'TGT': 'C', 'TGC': 'C', 'TGG': 'W', 'CTT': 'L', 'CTC': 'L', 824 'CTA': 'L', 'CTG': 'L', 'CCT': 'P', 'CCC': 'P', 'CCA': 'P', 825 'CCG': 'P', 'CAT': 'H', 'CAC': 'H', 'CAA': 'Q', 'CAG': 'Q', 826 'CGT': 'R', 'CGC': 'R', 'CGA': 'R', 'CGG': 'R', 'ATT': 'I', 827 'ATC': 'I', 'ATA': 'I', 'ATG': 'M', 'ACT': 'T', 'ACC': 'T', 828 'ACA': 'T', 'ACG': 'T', 'AAT': 'N', 'AAC': 'N', 'AAA': 'K', 829 'AAG': 'K', 'AGT': 'S', 'AGC': 'S', 'AGA': 'R', 'AGG': 'R', 830 'GTT': 'V', 'GTC': 'V', 'GTA': 'V', 'GTG': 'V', 'GCT': 'A', 831 'GCC': 'A', 'GCA': 'A', 'GCG': 'A', 'GAT': 'D', 'GAC': 'D', 832 'GAA': 'E', 'GAG': 'E', 'GGT': 'G', 'GGC': 'G', 'GGA': 'G', 833 'GGG': 'G', }, 834 stop_codons = [ 'TCA', 'TAA', 'TGA', ], 835 start_codons = [ 'ATG', ] 836 ) 837 register_ncbi_table(name = 'Thraustochytrium Mitochondrial', 838 alt_name = None, id = 23, 839 table = { 840 'TTT': 'F', 'TTC': 'F', 'TTG': 'L', 'TCT': 'S', 'TCC': 'S', 841 'TCA': 'S', 'TCG': 'S', 'TAT': 'Y', 'TAC': 'Y', 'TGT': 'C', 842 'TGC': 'C', 'TGG': 'W', 'CTT': 'L', 'CTC': 'L', 'CTA': 'L', 843 'CTG': 'L', 'CCT': 'P', 'CCC': 'P', 'CCA': 'P', 'CCG': 'P', 844 'CAT': 'H', 'CAC': 'H', 'CAA': 'Q', 'CAG': 'Q', 'CGT': 'R', 845 'CGC': 'R', 'CGA': 'R', 'CGG': 'R', 'ATT': 'I', 'ATC': 'I', 846 'ATA': 'I', 'ATG': 'M', 'ACT': 'T', 'ACC': 'T', 'ACA': 'T', 847 'ACG': 'T', 'AAT': 'N', 'AAC': 'N', 'AAA': 'K', 'AAG': 'K', 848 'AGT': 'S', 'AGC': 'S', 'AGA': 'R', 'AGG': 'R', 'GTT': 'V', 849 'GTC': 'V', 'GTA': 'V', 'GTG': 'V', 'GCT': 'A', 'GCC': 'A', 850 'GCA': 'A', 'GCG': 'A', 'GAT': 'D', 'GAC': 'D', 'GAA': 'E', 851 'GAG': 'E', 'GGT': 'G', 'GGC': 'G', 'GGA': 'G', 'GGG': 'G', }, 852 stop_codons = [ 'TTA', 'TAA', 'TAG', 'TGA', ], 853 start_codons = [ 'ATT', 'ATG', 'GTG', ] 854 ) 855 856 857 858 #Basic sanity test, 859 for key, val in generic_by_name.iteritems(): 860 assert key in ambiguous_generic_by_name[key].names 861 for key, val in generic_by_id.iteritems(): 862 assert ambiguous_generic_by_id[key].id == key 863 del key, val 864 865 for n in ambiguous_generic_by_id: 866 assert ambiguous_rna_by_id[n].forward_table["GUU"] == "V" 867 assert ambiguous_rna_by_id[n].forward_table["GUN"] == "V" 868 if n != 23 : 869 #For table 23, UUN = F, L or stop. 870 assert ambiguous_rna_by_id[n].forward_table["UUN"] == "X" #F or L 871 #R = A or G, so URR = UAA or UGA / TRA = TAA or TGA = stop codons 872 if "UAA" in unambiguous_rna_by_id[n].stop_codons \ 873 and "UGA" in unambiguous_rna_by_id[n].stop_codons: 874 try: 875 print ambiguous_dna_by_id[n].forward_table["TRA"] 876 assert False, "Should be a stop only" 877 except KeyError: 878 pass 879 assert "URA" in ambiguous_generic_by_id[n].stop_codons 880 assert "URA" in ambiguous_rna_by_id[n].stop_codons 881 assert "TRA" in ambiguous_generic_by_id[n].stop_codons 882 assert "TRA" in ambiguous_dna_by_id[n].stop_codons 883 del n 884 assert ambiguous_generic_by_id[1] == ambiguous_generic_by_name["Standard"] 885 assert ambiguous_generic_by_id[4] == ambiguous_generic_by_name["SGC3"] 886 assert ambiguous_generic_by_id[11] == ambiguous_generic_by_name["Bacterial"] 887 assert ambiguous_generic_by_id[11] == ambiguous_generic_by_name["Plant Plastid"] 888 assert ambiguous_generic_by_id[15] == ambiguous_generic_by_name['Blepharisma Macronuclear'] 889 assert generic_by_id[1] == generic_by_name["Standard"] 890 assert generic_by_id[4] == generic_by_name["SGC3"] 891 assert generic_by_id[11] == generic_by_name["Bacterial"] 892 assert generic_by_id[11] == generic_by_name["Plant Plastid"] 893 assert generic_by_id[15] == generic_by_name['Blepharisma Macronuclear'] 894