Skip to content

Sequence Translation

To translate DNA alignment to amino acid:

Terminal window
segul sequence translate -d [path-to-alignment-files] -f [sequence-format-keyword]

The app will default to the standard code table (NCBI Table 1). Use the --table option to set the translation table. For example, to translate DNA sequences using NCBI Table 2 (vertebrate MtDNA):

Terminal window
segul sequence translate -d loci/ -f fasta --table 2

You can also set the reading frame using the --reading-frame option:

Terminal window
segul sequence translate -d loci/ -f fasta --table 2 --reading-frame 2

To let SEGUL detect the reading frame of each alignment, use the --auto-read flag instead:

Terminal window
segul sequence translate -d loci/ -f fasta --table 2 --auto-read

To show all the table options, use the --show-tables flag:

Terminal window
segul sequence translate --show-tables
Table No Genetic Code
1 The Standard Code
2 The Vertebrate Mitochondrial Code
3 The Yeast Mitochondrial Code
4 The Mold, Protozoan, and Coelenterate Mitochondrial Code and the Mycoplasma/Spiroplasma Code
5 The Invertebrate Mitochondrial Code
6 The Ciliate, Dasycladacean and Hexamita Nuclear Code
9 The Echinoderm and Flatworm Mitochondrial Code
10 The Euplotid Nuclear Code
11 The Bacterial, Archaeal and Plant Plastid Code
12 The Alternative Yeast Nuclear Code
13 The Ascidian Mitochondrial Code
14 The Alternative Flatworm Mitochondrial Code
16 Chlorophycean Mitochondrial Code
21 Trematode Mitochondrial Code
22 Scenedesmus obliquus Mitochondrial Code
23 Thraustochytrium Mitochondrial Code
24 Rhabdopleuridae Mitochondrial Code
25 Candidate Division SR1 and Gracilibacteria Code
26 Pachysolen tannophilus Nuclear Code
29 Mesodinium Nuclear Code
30 Peritrich Nuclear Code
33 Cephalodiscidae Mitochondrial UAA-Tyr Code

Sources: NCBI Genetic Code Tables

Option Description
-d, --dir Directory with alignments
-i, --input Alignment files. Allows wildcards
-f, --input-format Input format: auto (default), fasta, nexus, or phylip
--datatype Data type: dna (default), aa, or ignore
--table NCBI translation table. Default: 1
--reading-frame Reading frame: 1 (default), 2, or 3
--auto-read Detect the reading frame of each alignment
--show-tables Print the supported translation tables
-F, --output-format Output format: nexus (default), phylip, fasta, nexus-int, phylip-int, or fasta-int
-o, --output Output directory. Default: Sequence-Translate
--force Overwrite an existing output directory
--log Log file path. Default: segul.log