fix: four bugs in integrate and exon_fasta_to_twobit modules#33
Merged
ReverendCasy merged 1 commit intoMay 13, 2026
Merged
Conversation
exon_fasta_to_twobit.py:
- Use self.fa2twobit instead of hardcoded "faToTwoBit" so that
--fatotwobit_binary is actually respected at the SLEASY step
integrate.py (prepare_sequence_files / _read_fasta):
- Open gzipped input FASTAs in text mode ("rt") not binary ("rb");
_read_fasta uses str.startswith which fails on bytes
- Check f"{ref}.{proj}" against self.final_projections instead of bare
proj; final_projections stores names with the species prefix, so the
bare lookup never matched and protein/nucleotide outputs were always empty
- Write integrated FASTAs with gzip.open instead of open so the .fa.gz
output files are valid gzip archives
constants.py (Nextflow template):
- Move joblist guard and Channel.fromPath call inside the workflow {}
block, required for Nextflow DSL2 compatibility
Collaborator
|
Thank you very much for your contribution. Sequence extraction for the “integrate” mode has been mostly tested with the BigBed input, so reading from FA did not get enough attention so far. |
ReverendCasy
added a commit
that referenced
this pull request
May 13, 2026
ReverendCasy
added a commit
that referenced
this pull request
May 13, 2026
ReverendCasy
added a commit
that referenced
this pull request
May 13, 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.
Found and fixed four bugs while running TOGA2 on RHEL8 (glibc 2.28)
with three references against a query genome.
exon_fasta_to_twobit.py--fatotwobit_binarysilently ignored: Line 166 hardcodesf"faToTwoBit {tmp_path} {output}"instead of usingself.fa2twobit,so the
--fatotwobit_binaryCLI flag has no effect at the SLEASY step.Fixed to
f"{self.fa2twobit} {tmp_path} {output}".integrate.py(prepare_sequence_files/_read_fasta)gzip.openwas called with"rb"(bytes), but_read_fastausesstr.startswith, causingTypeError: startswith first arg must be bytes or a tuple of bytes, not str.Fixed to
"rt".self.final_projectionsstores names as
"{species}.{projection}"(e.g.hg38.XM_011510358.3#NBAS#328),but
_read_fastalooked up the bare projection name without the prefix —so nothing ever matched and
protein.fa.gz/nucleotide.fa.gzwerealways empty. Fixed to check
f"{ref}.{proj}".open()instead ofgzip.open(),producing plain-text files with a
.fa.gzextension (invalid gzip).Fixed to
gzip.open(..., "wt"/"at").constants.py(Nextflow template)Channel.fromPathcallwere at the top level, which is not valid in Nextflow DSL2. Moved both
inside the
workflow {}block.