Skip to content

fix: infer-subhogs no longer drops proteins (#113) - #130

Merged
alpae merged 7 commits into
devfrom
fix/subhog-dropouts
Nov 17, 2026
Merged

alpae merged 7 commits into
devfrom
fix/subhog-dropouts

Conversation

@alpae

@alpae alpae commented Nov 12, 2026

Copy link
Copy Markdown
Member

Fixes #113.

fastoma-infer-subhogs lost proteins in four places. Each commit fixes one of them:

  1. MSA filter. Rows that the column filter drops (left with fewer than 2 columns) were not reported as removed, so their HOGs were never frozen.
  2. Column filter of a merged HOG (HOG.__init__). It could drop all representative rows, and the HOG was then lost at the next level. If the filter would drop rows, the unfiltered rows are kept.
  3. split_hog. It kept only the subHOGs that a partition's representatives lead to. It now also returns the others unchanged, and merge_subhogs freezes them, because they have no representative in the gene tree.
  4. Empty filtered MSA. process() returned without the frozen HOGs. The subHOGs also stay active now, so the level is just skipped.

Safety net. At the end of every level, process() checks that the output HOGs hold all input proteins. Any missing protein is kept as a frozen singleton, with a warning and a lost_at_level trace event. On the 10 fungi-30 rootHOGs that dropped proteins, the safety net never triggers: the four fixes account for all of them.

Tests

  • The strict xfails listed in infer-subhogs silently drops proteins (3% of all proteins on fungi-30) #113 now pass, and the strict xfail markers are removed.
  • New tests cover the frozen subHOGs of a split and the safety net. Both fail on dev.
  • The 10 drops rootHOGs of the fungi-30 fixture are now golden snapshots, generated in dessimozlab/fastoma:dev. The 13 existing snapshots are unchanged, so rootHOGs that didn't drop proteins give the same output.
  • Full suite: 397 passed, 23 skipped, 15 xfailed.

Note for review. The recovered proteins are not merged back into their families. Frozen subHOGs are passed up without being merged again, so they end up as separate top-level HOGs, or as unwritten singletons. They are no longer lost, but their orthology to the rest of the family is not recovered. For example, F0412257 now has 456 of 496 proteins in groups, where it previously lost 367 proteins.

🤖 Generated with Claude Code

alpae and others added 6 commits November 12, 2026 16:31
Their HOGs were never frozen and their proteins got lost (#113).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A HOG whose representative rows were all filtered out was lost at the next level (#113).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
They are frozen at the current level instead of being lost (#113).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The subHOGs stay active, so they can still be merged at the next level (#113).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Proteins missing from the output HOGs are kept as frozen singletons, with a warning (#113). Adds a test for the frozen subHOGs of a split.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@alpae
alpae requested a balanced review from Copilot November 12, 2026 15:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

…ter fix

- tests set FASTOMA_STRICT_INVARIANTS: process() raises instead of repairing
  a lost protein, so the safety net can no longer hide a regression
- process() also reports proteins that end up in several HOGs
- HOG.__init__ keeps unfiltered rows only if the filter would drop all of them
- get_subhog_path no longer loops forever on an inconsistent HOG
- trace: recovered proteins get kept_as_singleton_at_level, not a loss fate

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@alpae
alpae merged commit a67bfa2 into dev Nov 17, 2026
26 checks passed
@alpae
alpae deleted the fix/subhog-dropouts branch November 17, 2026 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants