Add cached cd hit est reference collapse step to pathoscope#188
Open
ReeceHoffmann wants to merge 6 commits into
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
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.
Comment on lines
+441
to
+445
| return { | ||
| "isolate_count_before": before_count, | ||
| "isolate_count_after": after_count, | ||
| "isolate_count_removed": before_count - after_count, | ||
| } |
Comment on lines
+7
to
+40
| def get_reference_index_path(work_path: Path) -> Path: | ||
| return work_path / "reference_index" / "reference" | ||
|
|
||
|
|
||
| def get_collapsed_reference_path(work_path: Path) -> Path: | ||
| return work_path / "collapsed_reference" / "reference.json" | ||
|
|
||
|
|
||
| def get_subtraction_indexes_path(work_path: Path) -> Path: | ||
| return work_path / "subtraction_indexes" | ||
|
|
||
|
|
||
| def get_isolate_path(work_path: Path) -> Path: | ||
| return work_path / "isolates" | ||
|
|
||
|
|
||
| def get_isolate_fasta_path(isolate_path: Path) -> Path: | ||
| return isolate_path / "isolate_index.fa" | ||
|
|
||
|
|
||
| def get_isolate_fastq_path(isolate_path: Path) -> Path: | ||
| return isolate_path / "isolate_mapped.fq" | ||
|
|
||
|
|
||
| def get_isolate_index_path(isolate_path: Path) -> Path: | ||
| return isolate_path / "isolates" | ||
|
|
||
|
|
||
| def get_isolate_bam_path(isolate_path: Path) -> Path: | ||
| return isolate_path / "to_isolates.bam" | ||
|
|
||
|
|
||
| def get_subtracted_bam_path(work_path: Path) -> Path: | ||
| return work_path / "subtracted.bam" |
Member
There was a problem hiding this comment.
Should be inlined if only used once. No need for separate function declaration.
Comment on lines
+96
to
+97
| with open(collapsed_reference_dir / "collapse-manifest.json", "w") as handle: | ||
| json.dump(stats, handle) |
Member
There was a problem hiding this comment.
to_thread.
Not to sure what the point of stats and this file is. Seems like debugging that should be a test?
|
|
||
| log.info("collapsing reference", outcome="miss", source=str(index.json_path)) | ||
|
|
||
| stats = await collapse_reference_json( |
Member
There was a problem hiding this comment.
Why is this called stats? Is it not a "collapse-manifest"?
|
|
||
| log.info("reference collapse complete", **stats) | ||
|
|
||
| created = await cache.put(key, collapsed_reference_dir, params=params) |
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.
Add reference collapsing step to pathoscope