Repository navigation
Move the regression and large-index tests into the pytest suite - #541
Merged
Merged
Conversation
scripts/test/test_regressions.py ports the tests from regressions.py, which had not run in CI and failed at startup whenever the checkout path contained "bowtie2" more than once. Issues 288 (--un with --no-unal), 279 (--un-conc and --al-conc with --no-unal) and 313 (dots in output directory names) keep their original checks and now also compare output files byte for byte, so a change in which reads are written is caught, not only a change in how many. The check that a positional index without -x is rejected is kept. The --version check is dropped because test_output.py::test_version already covers it. regressions.py and dataface.py, which only regressions.py used, are removed. large_idx.py still uses bt2face.py and btdata.py, so those stay. The README now describes the pytest suite and where regression tests go.
scripts/test/test_large_genome.py checks alignment against a prebuilt .bt2l index whose joined reference exceeds 2^32 bases, which the small --large-index tests elsewhere in the suite cannot reach. It is skipped unless BOWTIE2_LARGE_INDEX names such an index. Reads and 300 bp pairs are cut from the index's own reference by streaming bowtie2-inspect one sequence at a time: 150 at evenly spaced offsets beyond 2^32 in the joined reference (which leaves out runs of N), one straddling that offset, and a few control reads from the first sequence. Even spacing keeps most reads in long sequences rather than in short, repetitive unplaced contigs. Every unpaired read must align perfectly and every pair concordantly. Uniquely aligned reads and pairs must land where they were cut, pairs with the expected TLEN, and at least a quarter must be unique. Pairs in repeats are not required to score perfectly, because bowtie2 can report a concordant placement there that is not the best one. BOWTIE2_LARGE_INDEX_OFFSET lowers the target offset so the test logic can be checked against a small .bt2l index. Run against a GRCh38 plus CAST/EiJ T2T mouse index (6.05 Gbp), both tests pass in about four minutes with 16 threads and an 8.3 GB peak resident set. large_idx.py, btdata.py, bt2face.py and big_data/ are removed. large_idx.py downloaded hg19 and rn4 over UCSC FTP, built the index itself, checked only exit codes, and failed at startup when the checkout path contained "bowtie2" more than once. Unpaired and paired reads are aligned in separate runs, because mixing them in one run at -p > 1 loses the pairs or hangs on master.
This was referenced Oct 24, 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.
Follow-up to #535 and #540: retires the old Python
unittestscripts inscripts/testin favour of the pytest suite. Two commits:1. Move the issue regression tests into the pytest suite.
test_regressions.pyports the tests fromregressions.py, which had not run in CI and failed at startup whenever the checkout path contained "bowtie2" more than once.--unwith--no-unal), 279 (--un-conc/--al-concwith--no-unal) and 313 (dots in output directory names) keep their original checks and now also compare output files byte for byte, so a change in which reads are written is caught, not only how many.-xis rejected is kept. The--versioncheck is dropped becausetest_output.py::test_versioncovers it.regressions.pyanddataface.py(used only by it) are removed.2. Replace the large-index script with an opt-in pytest module.
test_large_genome.pychecks alignment against a prebuilt.bt2lindex whose joined reference exceeds 2^32 bases, which the small--large-indextests cannot reach. It is skipped unlessBOWTIE2_LARGE_INDEXnames such an index, so CI is unaffected.bowtie2-inspectone sequence at a time: about 150 at evenly spaced joined offsets beyond 2^32, one straddling that offset, and a few controls from the first sequence.BOWTIE2_LARGE_INDEX_OFFSETlowers the target offset so the test logic can be exercised on a small.bt2lindex.large_idx.py,btdata.py,bt2face.pyandbig_data/are removed. The old script downloaded hg19 and rn4 over UCSC FTP, built the index itself, checked only exit codes, and had the same startup path bug.Testing
BOWTIE2_LARGE_INDEX).test_large_genome.pyagainst a small.bt2lE. coli index split into three sequences with N runs placed around the target offset, at several values ofBOWTIE2_LARGE_INDEX_OFFSET; offsets checked by hand.test_large_genome.pyon the JHU Rockfish cluster against a GRCh38 + CAST/EiJ T2T mouse.bt2lindex (6.05 Gbp): 2 passed in about 4 minutes with 16 threads, 8.3 GB peak RSS.Found along the way (not changed here)
Aligning unpaired reads (
-U) and pairs (-1/-2) in a single run at-p > 1either drops the pairs from the output or hangs on master. The large-genome test aligns them in separate runs to avoid it.Created by Ben with help from Claude Opus 5.5