Repository navigation
Run the pipeline for real in CI, on a cohort whose truth is known - #14
Merged
Merged
Conversation
The tests stopped short of the science: -stub-run replaces every process's script block and the unit tests run bin/ one script at a time, so no script block had any coverage. A new CI job runs BAMpiro in its pinned images on a cohort tests/e2e/cohort.py simulates at test time from one seed: a 24 kb genome with five genes and three samples at 100x, one of them single-end over two runs. Every deliverable is held against what was planted: the SNP matrix with each fraction and protein change; the codon-level table, with two codon changes carried whole, one whose first base alone says a stop, and two SNPs of one codon on different molecules that must stay two changes; the indel matrix with each call's filter; the consensus over a repeat and over a stretch one sample lost; the SNP distances; the deletions table; and the report's own copy of the matrices. The expectations were checked against the tools before the first run: bwa and FreeBayes with the pipeline's settings make exactly the 25 planted SNP calls and 4 indel calls and no other, get_MNV reads the three codon changes and gives the fourth no read, and SnpEff writes the 15 protein changes the cohort computes. The job runs on every pull request and keeps the run as an artifact when it fails; locally it is tests/run_tests.sh e2e, with Docker. The CI comments no longer call the repository private.
software_versions.txt took the first line each tool prints, and bwa-mem2 opens with the SIMD build it launches, so `Looking to launch executable ...` stood where its version should be. Under the docker profile, where the container runs as the invoking user with HOME=/, genmap could not create its config directory and the error took its place. The first real run of the pipeline in CI showed both. The version is now the first line that carries a version number, and the step gets a home it can write to when it has none.
The first CI run failed at GET_MNV, and the message kept the last lines of Nextflow's output, which cut off the process and its cause: it now starts at Nextflow's own ERROR block. Its partial results asked for two corrections. The ends of the stretch S3 lost are only as sharp as the junction allows (3 bases at one end and 1 at the other repeat across it and align on either side), so the consensus is held to '-' over the interior. And a line in software_versions.txt now has to carry a version number, genmap's included, since a banner or an error also passed for one.
The version pattern had '\.' in it, and a Groovy ''' block reads a backslash as the start of an escape: \. is none, so modules/qc.nf no longer compiled and every run, stub runs included, stopped before starting. It now matches the dot as [.]. The e2e run reported that failure only as "Failed to invoke workflow.onComplete", because its message started at Nextflow's first "ERROR ~" and a script that does not compile is reported before that, as "Error <file>:<line>". It now starts at whichever comes first.
The first complete run passed 13 of 16 checks, and the three it failed were the test's own expectations: - The SNP matrix and the report read FreeBayes' raw VCF, where two changes of one codon on the same reads are one MNP record annotated as the codon they make (CAC>GAG, p.His145Glu). Each base keeps that change there, so the cohort's truth now says so (matrix_aa); the main VCF, split into bases first, keeps each base's own change. - The same raw VCF keeps every site FreeBayes weighed, genotyped reference or not and masked or not, so the matrix also lists 13149: two error reads (5%) at the edge of the masked repeat in S2, which no sample calls. That is pinned as what the code does today; the outputs page says a row is a called site. The strict check moves to the deliverable of calls: each sample's main VCF holds exactly the SNPs planted in it, each annotated base by base. Against the run's artifact all 17 checks pass.
The strict check is on each sample's main VCF, the deliverable of its calls; the SNP matrix is held to the planted SNPs and their values. The run takes about two and a half minutes on a GitHub runner.
4 of 6 tasks
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.
What changed and why
Every test so far stopped short of the science.
-stub-runreplaces each process's script block, and the unit tests runbin/one script at a time, so no script block had any coverage. A new CI job, End-to-end run (Docker), runs BAMpiro for real, in its pinned images, on a cohort thattests/e2e/cohort.pysimulates at test time, and holds every deliverable against what was planted.The cohort. One seed, about a second to write, 2 MB, not committed: a 24 kb genome with five genes and three samples read at 100x.
p.Arg135del; the frameshift kept asLowSupportPASS; the repeat SNP never calledMNV-masked; the unphased pair not mergedWhat the run is held to (17 checks).
What it found on its first runs.
tabix, so the.tbithe process declared never appeared. This was fixed in Deliver indels, and read two SNPs of one codon as one change #13 before it merged (d9a667c).software_versions.txtrecorded a message as two tools' versions. For bwa-mem2 it kept the SIMD banner the tool prints first, and under thedockerprofile it kept genmap's error about an unwritable home. Fixed here: the version is the first line that carries a version number, and the step gets a writable home when it has none.outputs.mdsays a row is a called site and changing it deserves its own change.Outputs and defaults
pipeline_info/software_versions.txt, which now records real versions for bwa-mem2 and, underdocker, genmap.test_e2e(conf/test_e2e.config): production thresholds, resources capped to a GitHub runner, used as-profile docker,test_e2e.e2e-runartifact.tests/run_tests.sh e2e, orBAMPIRO_E2E=1 python -m pytest tests/e2e. It needs Docker and is not part of the defaulttests/run_tests.sh.How it was verified
LowSupportturnedPASS, a SNP nobody carries..tbibug.modules/qc.nf.latest-stable.Checklist
tests/run_tests.shpasses: every leg in CI; locally lint, the default stub run and the parameter tests (no Docker daemon here, so the e2e leg ran in CI)ruff check .is clean, and I did not restyle code the change does not touchmodules/has astub:block, and-profile test_fullreaches it (not applicable: no new process)tests/data/was not edited by hand (the e2e cohort is written at test time and not committed)CHANGELOG.mdentry and, where relevant, a docs update