from cogent3 import make_aligned_seqs
aln = make_aligned_seqs({"s1": "ACGA-GACG", "s2": "GATGATGYT"}, moltype="dna")
aln| 0 | |
| s1 | ACGA-GACG |
| s2 | GATGATGYT |
2 x 9 dna alignment
Degenerate IUPAC base symbols represent a site position that can have multiple possible characters. For a DNA example, “Y” represents pyrimidines where the site can be either “C” or “T”.
In many molecular evolutionary and phylogenetic analyses, the gap character “-” is treated “N”, meaning any base.
Let’s create sample data with degenerate characters
| 0 | |
| s1 | ACGA-GACG |
| s2 | GATGATGYT |
2 x 9 dna alignment
If we create the app with the argument gap_is_degen=False, we can omit degenerate characters but retain gaps.
If we create omit_degenerates with the argument motif_length, it will split sequences into non-overlapping tuples of the specified length and exclude any tuple that contains a degenerate character.