Is there a way to get the list of valid values for table argument of the translate()
method programatically?
Or, if I want to try all, do I need to provide the list of the valid tables manually?
Is there a way to get the list of valid values for table argument of the translate()
method programatically?
Or, if I want to try all, do I need to provide the list of the valid tables manually?
Take a look at the end of this file, where the codon tables are defined.
EDIT
Looks like you just need to do:
>>> from Bio.Data.CodonTable import generic_by_name
>>> generic_by_name.keys()
dict_keys(['Hexamita Nuclear', 'SGC4', 'Alternative Yeast Nuclear', 'SGC1', 'SGC8', 'Standard', 'SGC9', 'Yeast Mitochondrial', 'Scenedesmus obliquus Mitochondrial', 'Plant Plastid', 'Alternative Flatworm Mitochondrial', 'Ascidian Mitochondrial', 'Vertebrate Mitochondrial', 'SGC0', 'Dasycladacean Nuclear', 'Coelenterate Mitochondrial', 'Invertebrate Mitochondrial', 'Trematode Mitochondrial', 'Bacterial', 'Flatworm Mitochondrial', 'Echinoderm Mitochondrial', 'Mycoplasma', 'Blepharisma Macronuclear', 'SGC2', 'Ciliate Nuclear', 'Thraustochytrium Mitochondrial', 'Mold Mitochondrial', 'Euplotid Nuclear', 'Chlorophycean Mitochondrial', 'Spiroplasma', 'SGC5', 'SGC3', 'Protozoan Mitochondrial'])
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Are you referring to BioPython Seq.translate() or Python string.translate()?
Seq.translate()