Skip to content

Commit

Permalink
v1.9.43: fixed reading newick trees with quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
annazhukova committed Feb 26, 2024
1 parent e57266c commit 0c8a338
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pastml/acr.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from pastml.visualisation.itol_manager import generate_itol_annotations
from pastml.visualisation.tree_compressor import REASONABLE_NUMBER_OF_TIPS, VERTICAL, HORIZONTAL, TRIM

PASTML_VERSION = '1.9.42'
PASTML_VERSION = '1.9.43'

model2class = {F81: F81Model, JC: JCModel, CUSTOM_RATES: CustomRatesModel, HKY: HKYModel, JTT: JTTModel, EFT: EFTModel}

Expand Down
9 changes: 7 additions & 2 deletions pastml/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from Bio import Phylo
from ete3 import Tree, TreeNode
from ete3.parser.newick import NewickError

POSTORDER = 'postorder'

Expand Down Expand Up @@ -176,8 +177,12 @@ def read_tree(tree_path, columns=None):
try:
tree = Tree(tree_path, format=f)
break
except:
continue
except NewickError:
try:
tree = Tree(tree_path, format=f, quoted_node_names=True)
break
except NewickError:
continue
if not tree:
raise ValueError('Could not read the tree {}. Is it a valid newick?'.format(tree_path))
if columns:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3 :: Only',
],
version='1.9.42',
version='1.9.43',
description='Ancestral character reconstruction and visualisation for rooted phylogenetic trees.',
author='Anna Zhukova',
author_email='anna.zhukova@pasteur.fr',
Expand Down

0 comments on commit 0c8a338

Please sign in to comment.