Translate DNA sequences to amino acid sequences.
Example
Section titled “Example”import pysegul
def translate_sequences(): translate = pysegul.SequenceTranslation( input_fmt='nexus', datatype='dna', output_path='tests/output', output_format='fasta', table='1', reading_frame=1, ) translate.from_dir('tests/align-data')To use a list of files, call from_files instead of from_dir:
translate.from_files(['tests/align-data/alignment1.nex', 'tests/align-data/alignment2.nex'])Options
Section titled “Options”| Option | Default | Description |
|---|---|---|
input_fmt | Required | 'auto', 'fasta', 'nexus', 'phylip' |
datatype | Required | 'dna', 'aa', 'ignore' |
output_path | Required | Output directory |
output_format | Required | 'fasta', 'nexus', 'phylip', or interleaved 'fasta-int', 'nexus-int', 'phylip-int' |
table | '1' | NCBI genetic code number as a string. See supported translation tables |
reading_frame | None | 1, 2, or 3. Detected for each file when not set |
Methods
Section titled “Methods”| Method | Description |
|---|---|
from_dir(input_dir) | Translate the sequence files in a directory |
from_files(input_files) | Translate a list of sequence files |