add-variants: fix .tbi/.csi crashing the enricher (v2.8.2) + MGBOA license - #43
Merged
Merged
Conversation
…; MGBOA license
FIX (add-variants): the VCF-directory listing filtered .tbi with
for file in listChrs:
if file.endswith('.tbi'): listChrs.remove(file)
which mutates the list while iterating over it and therefore SKIPS elements, so
some .tbi index files survived and were passed to the enricher. The enricher
gzip.open()s + readline()s each input, so decompressing a binary .tbi as text
raised 'UnicodeDecodeError: utf-8 codec cant decode byte 0x9d'. Replace with a
single comprehension that excludes both .tbi and .csi index sidecars, so only
real VCFs reach the enricher. Verified: the other listChrs (genome dir, indexGenome)
uses continue not remove, so it has no twin bug; nothing downstream needs the
index entries; the enricher requires gzip input so dropping index sidecars is
both necessary and non-regressing.
VERSION: 2.8.1 -> 2.8.2 (crispritz.py + conda/meta.yaml) + CHANGELOG entry.
LICENSE: AGPL-3.0 (dual) -> MGB Open Access License 1.0 (MGBOA 1.0), matching
CRISPRme+ and CRISPRme (non-commercial academic use; commercial use requires a
commercial license).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
Two things, bundled because the version bump is shared:
1. Bug fix —
add-variantscrashes on tabix/bcftools index sidecarsThe VCF-directory listing filtered
.tbiwith a mutate-while-iterating loop:Removing from a list during iteration skips elements, so some
.tbifiles survive and are passed to the enricher, whichgzip.open()s +readline()s each input → decompressing a binary.tbias text raisesUnicodeDecodeError: 'utf-8' codec can't decode byte 0x9d. Replaced with a single comprehension excluding.tbiand.csi:Surfaced building a genotyped 1000G index whose VCF folder was tabix-indexed. The stray index workers were harmless (they died before writing) but produced confusing tracebacks and were a latent collision risk.
Verified (independent review):
listChrs(genome dir,indexGenome) usescontinue, notremove— no twin bug.len(listChrs)worker count + thefor elem in listChrsenrichment loop want real VCFs only)..csi/.tbireaching it would crash the same way).2. Version + license
VERSION2.8.1 → 2.8.2 (crispritz.py+conda/meta.yaml) + CHANGELOG entry.LICENSE: AGPL-3.0 (dual) → MGB Open Access License 1.0 (MGBOA 1.0), matching CRISPRme+ and CRISPRme (non-commercial academic use; commercial use requires a commercial license).Note: the stale
conda/crispritz.pyanddocker_image/crispritz.pycopies (not installed byconda/build.shor the rootDockerfile, which both use rootcrispritz.py) are left untouched.🤖 Generated with Claude Code