Repository navigation
Conversation
pyham 2 uses ete4 instead of ete3. ete4 stores data as props of the
tree nodes and does not allow attribute access or setting arbitrary
attributes, so all synteny graphs and tree statistics are now stored
with add_prop and read from props; the genome of a tree node is
read with props.get('genome'). In ete4, missing branch lengths are
None instead of 1.0; characterize_tree counts them as 1.0, so the RED
scores do not change.
With pyham 2, the species tree can be read from the <taxonomy> section
of the orthoXML. --species_tree is therefore optional; if both are
given, the species tree is used.
On test_data and the OMA HDF5 test dataset, all synteny edges and
their attributes are unchanged compared to pyham 1. pyham 1 created a
few spurious ancestral genes for families with duplications (e.g. a
Hominidae HOG extended up to Simiiformes); pyham 2 does not, so these
singleton ancestral genes are gone. Labels of HOGs that pyham 2
synthesizes for paralogous branches now use their own ids (e.g.
HOG:0001787.1b instead of HOG:0001787_11).
Also:
- port utils/extract_age_timetree.py to ete4
- install gcc in the Docker builder stage, as ete4 is only
distributed as source
- require pyham>=2.0.0rc1,<3 and ete4>=4.3,<5 instead of ete3
- bump the version to 0.2.0
Allow Python up to 3.14 and add 3.13 and 3.14 to the CI matrix. pyoma requires numpy<2, which has no wheels for Python 3.13+, so the oma extra is limited to Python <3.13 and numpy>=2 is required on 3.13+. Python 3.15 runs as a non-blocking experimental CI job: it widens requires-python in its checkout to the matrix version plus one minor and resolves the dependencies without uv.lock. Also add CLAUDE.md with notes for working on the repository.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #43: the pyham upgrade that should land before the algorithm fixes (#36, #37, #38).
Dependencies
pyham>=2.0.0rc1,<3(to be raised to>=2.0.0once pyham 2.0.0 is released) andete4>=4.3,<5instead ofete3gcc. Theomaextra still pullsete3via pyoma; both packages can be installed side by side.ete4 props
ete4 stores data as props of the tree nodes and does not support attribute access (
node.genome) or setting arbitrary attributes (node.n_internal_nodes = ...). Consistently throughout edgehog:tree_node.add_prop(name, value)(wasadd_feature)tree_node.props[name]tree_node.props.get('genome')(Nonereplaces the formerAttributeError)is_leafis a propertyNonein ete4 (1.0 in ete3);characterize_species_tree.branch_lengthcounts them as 1.0, so the RED scores do not changeutils/extract_age_timetree.pyis ported to ete4 as well.Optional
--species_treepyham 2 can read the species tree from a
<taxonomy>section of the orthoXML (e.g. orthoXML exported from the OMA browser).--species_treeis therefore optional; if both are given, the species tree is used (pyham's behavior). Without either, edgehog exits with pyham's error message.HOG ids
No change needed in edgehog. HOG ids are only used for output labels (duplicates are already made unique with
_c<n>) and by the HDF5 writer, which strips the_<taxid>part to look up the OMA rows. pyham 2 gives HOGs that it synthesizes for paralogous branches their own LOFT ids, which makes the labels of in-paralogs distinguishable and the taxid lookup inget_taxid_from_hog_namesmore reliable.Comparison with pyham 1
I ran
test_data(GFF input, with--date_edges --orient_edges --phylostratify) and the OMA HDF5 test dataset (--hdf5, TSV and HDF5 output) with pyham 1.2.0 (currentmain) and with this branch, and compared all synteny graphs at every level. Each graph node was identified by its set of descendant extant proteins, so the comparison does not depend on HOG ids or node order.Synteny.h5identical.HOG:0001787_11, which the orthoXML roots at Hominidae, up to Simiiformes, and put an extra HOG at Cercopithecinae above the Simiiformes root ofHOG:0001733_1. pyham 2 follows the orthoXML, so these singletons are no longer in the output.weightis written as4instead of4.0when a graph has no singletons.With the
<taxonomy>of the OMA orthoXML instead ofsimplified_speciestree.nwk, all graphs are identical, except that one level is namedSaccharomycetalesinstead ofSaccharomycotina.Tests
test_synthetic_pipeline.pynow also runs with the species tree as<taxonomy>in the orthoXML and no tree file, with the same expected ancestral orderstest_species_tree.py: RED scores and levels, missing branch lengths counting as 1.0, the optional--species_tree, the error without any taxonomy, and the newick taking precedence over the<taxonomy>xfailtests still fail for the same reasonsdocker buildand a run oftest_datain the image work