Repository navigation
fix: top-level paralogGroups get the TaxRange directly above the duplication - #129
Merged
Merged
Conversation
ete3's get_common_ancestor with a single node returns the root of the tree. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…es' LCA A top-level HOG that starts with a duplication is put into an orthologGroup whose TaxRange (and scores) is the direct parent, in the full species tree, of the common ancestor of all species in the paralogGroup. Before, the level of the HOG was used, which is usually the top of the whole rootHOG because HOGs that nothing joins are still wrapped at every level above (#128). The wrapping no longer depends on the orthoxml_v03 flag, which is removed. ImpliedLosses looks through the wrapper HOGs above the scored level. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
If the paralogs' LCA is the root, there is no parent level for the wrapper: each copy becomes its own top-level group (same rules, recursively), and single-gene copies are not written. Stale MRCA xfails now expect the parent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Added 2d5664c: when the LCA of a top-level paralogGroup's species is the root of the species tree, there is no parent level for the wrapper. The copies are then written as separate top-level groups. The same rules apply to each copy, so a copy that starts with its own duplication is wrapped at the parent of its LCA, or split again. They keep their subHOG ids, so they still share the Also replaced the two stale xfails that expected TaxRange = MRCA for the wrapper ( |
This was referenced Nov 12, 2026
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.
Fixes #128.
What changes
A top-level HOG that starts with a duplication (all its copies come from one clade) is written as a
paralogGroupinside an extraorthologGroup. That wrapper usedhog.taxnameas its TaxRange and scoring level. Usually this is the top of the whole rootHOG, because HOGs that nothing joins are still wrapped at every level above.The wrapper now sits at the direct parent, in the full species tree, of the common ancestor of all species in the paralogGroup. CompletenessScore, ImpliedLosses and TCSScore are computed at that level too.
root_orthoxml()(new,_hog_class.py): builds the top-level element of a HOG. It replaces the inline code inread_infer_xml_rhog. The wrapping no longer depends on theorthoxml_v03flag, which is removed._species_mrcareturned the root of the tree for a single species (ete3'sget_common_ancestorwith one node). It now returns the species' leaf. Before this, in-paralogs of one species would have been wrapped at the root. This is a separate commit.Effect on output
In the fungi-30 run (FastOMA 0.5.1, 2026-11-02), 509 of 25,734 top-level groups are such wrappers. 246 of them had a TaxRange 1–6 levels too old (details in #128). For those groups, these change:
collect_subhogsbuilds the top-level id as<family>_<taxid of TaxRange>, e.g.HOG:0000127_1→HOG:0000127_<Basidiomycota taxid>.All TaxRange values are still nodes of the full species tree, so
collect_subhogs'sname2taxidlookup works unchanged.utils/orthoxml2rootHOGidLevel.pynow reports the corrected level for these rootHOGs.Testing
tests/test_hog_class.py:_species_mrcaof a single species.dessimozlab/fastoma:dev: no change. Their only wrapper (F0413304, two paralogs in the Fungiincertaesedis polytomy) already sat at the correct level, Fungi.🤖 Generated with Claude Code