augur translate

Command-line arguments

Translate gene regions from nucleotides to amino acids.

Translates nucleotide sequences of nodes in a tree to amino acids for gene regions of the annotated features of the provided reference sequence. Each node then gets assigned a list of amino acid mutations for any position that has a mismatch between its own amino acid sequence and its parent’s sequence. The reference amino acid sequences, genome annotations, and node amino acid mutations are output to a node-data JSON file.

Note

The mutation positions in the node-data JSON are one-based.

usage: augur translate [-h] [--config CONFIG] --tree TREE
                       --ancestral-sequences ANCESTRAL_SEQUENCES
                       --reference-sequence REFERENCE_SEQUENCE
                       [--genes GENES [GENES ...]]
                       [--output-node-data OUTPUT_NODE_DATA]
                       [--alignment-output ALIGNMENT_OUTPUT]
                       [--validation-mode {error,warn,skip}]
                       [--skip-validation] [--vcf-reference VCF_REFERENCE]
                       [--vcf-reference-output VCF_REFERENCE_OUTPUT]

Named Arguments

--config

config file path

--tree

prebuilt Newick -- no tree will be built if provided

--ancestral-sequences

JSON (fasta input) or VCF (VCF input) containing ancestral and tip sequences

--reference-sequence

GenBank or GFF file containing the annotation

--genes

genes to translate (list or file containing list)

--output-node-data

name of JSON file to save aa-mutations to

--alignment-output

write out translated gene alignments. If a VCF-input, a .vcf or .vcf.gz will be output here (depending on file ending). If fasta-input, specify the file name like so: ā€˜my_alignment_%GENE.fasta’, where ā€˜%GENE’ will be replaced by the name of the gene

--validation-mode

Possible choices: error, warn, skip

Control if optional validation checks are performed and what happens if they fail.

ā€˜error’ and ā€˜warn’ modes perform validation and emit messages about failed validation checks. ā€˜error’ mode causes a non-zero exit status if any validation checks failed, while ā€˜warn’ does not.

ā€˜skip’ mode performs no validation.

Note that some validation checks are non-optional and as such are not affected by this setting.

Default: error

--skip-validation

Skip validation of input/output files, equivalent to a ā€˜--validation-mode’/’validation_mode’ value of ā€˜skip’. Use at your own risk!

VCF specific

These arguments are only applicable if the input (ā€˜--ancestral-sequences’/’ancestral_sequences’) is in VCF format.

--vcf-reference

fasta file of the sequence the VCF was mapped to

--vcf-reference-output

fasta file where reference sequence translations for VCF input will be written

Configuration

Options can also be specified in a YAML configuration file supplied to --config with the following top-level keys:

Option

Type

Description

tree

file

prebuilt Newick -- no tree will be built if provided

ancestral_sequences

file

JSON (fasta input) or VCF (VCF input) containing ancestral and tip sequences

reference_sequence

file

GenBank or GFF file containing the annotation

genes

string(s)

genes to translate (list or file containing list)

output_node_data

string

name of JSON file to save aa-mutations to

alignment_output

string

write out translated gene alignments. If a VCF-input, a .vcf or .vcf.gz will be output here (depending on file ending). If fasta-input, specify the file name like so: ā€˜my_alignment_%%GENE.fasta’, where ā€˜%%GENE’ will be replaced by the name of the gene

validation_mode

one of:

  • error
  • warn
  • skip

Control if optional validation checks are performed and what happens if they fail.

ā€˜error’ and ā€˜warn’ modes perform validation and emit messages about failed validation checks. ā€˜error’ mode causes a non-zero exit status if any validation checks failed, while ā€˜warn’ does not.

ā€˜skip’ mode performs no validation.

Note that some validation checks are non-optional and as such are not affected by this setting.

skip_validation

string

Skip validation of input/output files, equivalent to a ā€˜--validation-mode’/’validation_mode’ value of ā€˜skip’. Use at your own risk!

vcf_reference

file

fasta file of the sequence the VCF was mapped to

vcf_reference_output

string

fasta file where reference sequence translations for VCF input will be written

Example Node Data JSON

Here’s an example of the output node-data JSON where NODE_1 has no mutations compared to it’s parent and NODE_2 has multiple mutations in multiple genes.

{
    "annotations": {
        "GENE_1": {
            "end": 1685,
            "seqid": "reference.gb",
            "start": 108,
            "strand": "+",
            "type": "CDS"
        },
        "GENE_2": {
            "end": 2705,
            "seqid": "reference.gb",
            "start": 1807,
            "strand": "+",
            "type": "CDS"
        },
    },
    "nodes": {
        "NODE_1": {
            "aa_muts": []
        },
        "NODE_2": {
            "aa_muts": [
                "GENE_1": [
                    "S139N",
                    "R213K",
                    "R439G",
                    "V440A",
                    "D474N",
                    "S479W",
                    "S481T",
                    "P485L",
                    "R521K"
                ],
                "GENE_2": [
                    "P43S",
                    "D46N",
                    "C64R",
                    "R98K",
                    "D136G",
                    "M175V"
                ]
            ]
        }
    },
    "reference": {
        "GENE_1": "MATLLRSLAL...",
        "GENE_2": "MAEEQARHVK..."
    }
}