How to visualize mixed sequence alignment via PhyloTree

10 views
Skip to first unread message

Michael Gruenstaeudl

unread,
Nov 27, 2023, 7:00:11 PM11/27/23
to The ETE toolkit
I am looking for a way to visualize a mixed sequence alignment - comprising of DNA nucleotides as well as binary characters - as a PhyloTree object. While a sequence alignment comprising only DNA nucleotides can be visualized easily (see example 1 below), one that comprises both DNA nucleotides and binary characters cannot (see example 2 below).

```
# Example 1
from ete3 import PhyloTree
tre = "(A:3,(B:1,C:6));"
aln = """
>A
ATGC
>B
GCAT
>C
AGCT
"""
t = PhyloTree(tre, alignment=aln, alg_format="fasta")
t.show()
```

```
# Example 2 - Results in Error
from ete3 import PhyloTree
tre = "(A:3,(B:1,C:6));"
aln = """
>A
ATGC01
>B
GCAT00
>C
AGCT11
"""
t = PhyloTree(tre, alignment=aln, alg_format="fasta")
t.show()
# KeyError: '0'
```
Reply all
Reply to author
Forward
0 new messages