Building alignments#

Using a cogent3 progressive aligner for nucleotides#

We load a canned nucleotide substitution model and the progressive aligner tree_align function.

We first align without providing a guide tree. The tree_align algorithm builds pairwise alignments and estimates the substitution model parameters and pairwise distances. The distances are used to build a neighbour joining tree and the median value of substitution model parameters are provided to the substitution model for the progressive alignment step.

We then align using a guide tree (pre-estimated) and specifying the ratio of transitions to transversions (kappa).

Using a cogent3 progressive aligner for codons#

We load a canned codon substitution model and use a pre-defined tree and parameter estimates.

Converting gaps from aa-seq alignment to nuc seq alignment#

We load some unaligned DNA sequences and show their translation.

We load an alignment of these protein sequences.

We then obtain an alignment of the DNA sequences by aligning their translations.