Repository navigation
fix: skip bcftools merge for single PCGR VCF chunk (#26) - #36
Merged
Merged
Conversation
3 tasks done
run_somatic_chunk -> merging_pcgr_files unconditionally called util.merge_vcf_files, which shells out to `bcftools merge`. That command requires 2+ inputs, so a sample whose variants fit in a single chunk (no splitting needed) produced a bcftools merge Usage error instead of a valid annotated VCF. Guard on len(pcgr_vcf_files) == 1: copy the single chunk's VCF directly to the expected merged-output path and tabix-index it, matching the indexed .vcf.gz contract that merge_vcf_files normally produces. Two or more chunks still go through the existing bcftools merge -> sort -> index path unchanged.
qclayssen
force-pushed
the
bolt-26-single-chunk-merge-guard
branch
from
July 16, 2026 00:49
a26d2ff to
faebfd8
Compare
This was referenced Jul 17, 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.
Summary
merging_pcgr_files()(bolt/common/pcgr.py) calledbcftools mergeunconditionally on the chunked PCGR VCF outputs.bcftools mergerequires 2+ input files — when a sample's variants fit in a single PCGR chunk (no splitting needed), this produced abcftools mergeusage error instead of a valid annotated VCF..vcf.gzcontractmerge_vcf_filesnormally produces. 2+ chunks are unaffected.Closes #26.
Test plan
test_single_chunk_skips_bcftools_merge,test_multiple_chunks_still_merge(tests/test_pcgr_hypermutated.py)python -m pytest tests/test_pcgr_hypermutated.py -v— 35 passedpython -m unittest discover tests/ --buffer— 49 tests, OK