Add cached cd hit est reference collapse step to pathoscope#188
Merged
Conversation
- run cd-hit-est per segment with bounded concurrency - keep each cd-hit-est process single-threaded so proc controls segment-level parallelism
- allow isolates to omit schema segments during reference collapse - permit empty segment sentinels for unsegmented OTUs
ReeceHoffmann
marked this pull request as ready for review
June 12, 2026 21:32
igboyes
requested changes
Jun 29, 2026
igboyes
left a comment
Member
There was a problem hiding this comment.
utils.py is turning into a pig and should be modularized.
…into reecehoffmann/vir-2534-add-cached-cd-hit-est-reference-collapse-step-to-pathoscope # Conflicts: # tests/test_workflow.py
- move reference collapse helpers out of general workflow utilities - stop persisting collapse stats as a cache manifest
- preserve OTUs that cannot be safely collapsed and report per-outcome counts - build explicit OTU fixtures for validation and mixed-result coverage
igboyes
approved these changes
Jul 15, 2026
|
🎉 This PR is included in version 5.17.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
Summary
Adds a cached preprocessing step that collapses redundant reference isolates with
cd-hit-estbefore Pathoscope builds its mapping indexes.cd-hit-estat 99% identity for each OTU segment, with concurrency limited by the workflow processor count.cd-hit-estversion, and collapse identity.cd-hit-est4.8.1 to the workflow image.reference.pymodule.Collapse behavior
For eligible OTUs, sequences are clustered independently by segment. The collapsed reference:
OTUs with a single isolate are left unchanged. OTUs whose structure cannot be collapsed safely—such as invalid segment names, duplicate segments, or ambiguous unsegmented isolates are unchanged