This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Using pairwise alignment scores to draw phylogenetic tree?

I prefer to use my global pairwise alignment scores to draw a phylogenetic tree. I can make a matrix of these scores using this sample code:

from Bio.Phylo.TreeConstruction import _Matrix
names = ['Alpha', 'Beta', 'Gamma', 'Delta']
scores = [[0], [1310, 0], [1332, 1353, 0], [1321, 1342, 1330, 0]]
m = _Matrix(names, scores)

But I have a few problems:

1- These are alignment scores and I have to convert them to distances. Is it rational at all? and how can I do this?

2- Lets suppose I passed the first problem and have pairwise distances, when I try the following code to draw a UPGMA tree I get an error:

from Bio.Phylo.TreeConstruction import DistanceTreeConstructor
constructor = DistanceTreeConstructor()
upgmatree = constructor.upgma(m)
Phylo.draw(upgmatree)

this is the error:

Must provide a DistanceMatrix object.

How can I over come these problems?

phylo biopython pairwise2

0 answers

No answers yet.

Log in to answer this question.