I am using Biopython Phylo and RDkit Cluster to obtain a UPGMA tree from a distance matrix of 5k x 5k entries. How can I extract clustered entry names given a number of clusters?

For example, Bio.Phylo can return plain-text representation of a tree, so I think I can parse it by the number of tabs:

             Clade(branch_length=0.102, name='A')
             Clade(branch_length=0.23, name='B')
         Clade(branch_length=0.4, name='C') 

or, ASCII format:

          _____________ A
_|       |_______________________________ B
 |_______________________________________________________ C

Which, I think is more difficult to parse but possible. Either way, those are not established methods for this kind of task, so I would use a hint.

  • $\begingroup$ Use R (ape etc..) or ETE3 (python), thats the hint $\endgroup$
    – M__
    Dec 15 '20 at 14:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.