Skip to content

Commit

Permalink
Fix creation of sample PhyloTree used in tests/test_treeview
Browse files Browse the repository at this point in the history
Creating a PhyloTree without passing a naming function now does not
use name[:3] as it used in the past, and this example relied on it.
  • Loading branch information
jordibc committed Mar 7, 2024
1 parent 735db7a commit fe221d1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/test_treeview/phylotree_visualization.py
Expand Up @@ -31,8 +31,9 @@ def get_example_tree():
# Performs a tree reconciliation analysis
gene_tree_nw = '((Dme_001,Dme_002),(((Cfa_001,Mms_001),((Hsa_001,Ptr_001),Mmu_001)),(Ptr_002,(Hsa_002,Mmu_002))));'
species_tree_nw = "((((Hsa, Ptr), Mmu), (Mms, Cfa)), Dme);"
genetree = PhyloTree(gene_tree_nw)
sptree = PhyloTree(species_tree_nw)
naming_fn = lambda name: name[:3]
genetree = PhyloTree(gene_tree_nw, sp_naming_function=naming_fn)
sptree = PhyloTree(species_tree_nw, sp_naming_function=naming_fn)
recon_tree, events = genetree.reconcile(sptree)
recon_tree.link_to_alignment(alg)
return recon_tree, TreeStyle()
Expand Down

0 comments on commit fe221d1

Please sign in to comment.