Repository navigation
Validate analysis setup before submission and support assembly references - #276
Merged
Merged
Conversation
karlnyr
added a commit
that referenced
this pull request
Nov 12, 2026
Treat absent MLST schemes and version dates separately from resource failures. Skip unavailable MLST, retain other analyses, and clear stale sequence types. Keep genuine setup failures fatal. Rename preflight to validation and split its checks into focused, independently tested helpers. Refs #276
karlnyr
added a commit
that referenced
this pull request
Nov 12, 2026
Keep setup checks limited to filenames, mate pairs and file access. Leave FASTQ record and gzip integrity checks to compute-node analysis tools instead of decompressing inputs during validation. Refs #276
karlnyr
added a commit
that referenced
this pull request
Nov 12, 2026
Reduce preparation complexity while preserving collected errors, optional MLST handling and independent ExPEC checks. Add direct tests for each helper and the top-level orchestration. Refs #276
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Preflight accepts an incomplete MLST cache, allowing jobs to run with missing required loci and produce incomplete typing results instead of blocking submission.
1 open issue
What changed in this PR
This PR addresses #272 by validating analysis setup before SLURM submission and adding NCBI Assembly reference support, while preserving QC-only behavior.
Changes:
- Validate metadata, paired FASTQ paths, reference FASTA files and indexes; collect setup failures across samples.
- Resolve matching RefSeq/GenBank assemblies and stage genome downloads and indexing before publication.
- Prepare sample and reporting scripts before submission, preserve existing results on preparation failure, and report accepted job IDs after submission failures.
| File | Description |
|---|---|
| tests/utils/test_validation.py | Tests metadata, reference normalization and paired-input checks. |
| tests/utils/test_scraper.py | Tests continued analysis without an MLST scheme. |
| tests/utils/test_referencer.py | Tests assembly downloads, reference validation and indexing failures. |
| tests/utils/test_reference_preparation.py | Tests resource preparation and error collection. |
| tests/utils/test_jobcreator.py | Tests preparation ordering, submission failures and result preservation. |
| tests/utils/conftest.py | Adds an isolated reference-manager fixture. |
| tests/test_cli.py | Tests preflight failures, normalized metadata and QC submission. |
| README.md | Documents validation, assembly references and failure behavior. |
| microSALT/utils/validation.py | Adds shared metadata and FASTQ-path validation. |
| microSALT/utils/scraper.py | Skips unavailable MLST scraping while retaining other analyses. |
| microSALT/utils/referencer.py | Adds resource preflight and staged assembly downloads. |
| microSALT/utils/job_creator.py | Separates job preparation from submission and reports failures. |
| microSALT/exc/exceptions.py | Defines reference and analysis setup exceptions. |
| microSALT/cli.py | Runs preflight validation before creating analysis jobs. |
Review effort: Balanced
karlnyr
commented
Nov 16, 2026
karlnyr
added a commit
that referenced
this pull request
Nov 16, 2026
Treat absent MLST schemes and version dates separately from resource failures. Skip unavailable MLST, retain other analyses, and clear stale sequence types. Keep genuine setup failures fatal. Rename preflight to validation and split its checks into focused, independently tested helpers. Refs #276
karlnyr
force-pushed
the
fix/analysis-preflight-validation
branch
from
November 16, 2026 11:07
8caabb0 to
4dc8828
Compare
karlnyr
added a commit
that referenced
this pull request
Nov 16, 2026
Keep setup checks limited to filenames, mate pairs and file access. Leave FASTQ record and gzip integrity checks to compute-node analysis tools instead of decompressing inputs during validation. Refs #276
karlnyr
added a commit
that referenced
this pull request
Nov 16, 2026
Reduce preparation complexity while preserving collected errors, optional MLST handling and independent ExPEC checks. Add direct tests for each helper and the top-level orchestration. Refs #276
Treat absent MLST schemes and version dates separately from resource failures. Skip unavailable MLST, retain other analyses, and clear stale sequence types. Keep genuine setup failures fatal. Rename preflight to validation and split its checks into focused, independently tested helpers. Refs #276
Keep setup checks limited to filenames, mate pairs and file access. Leave FASTQ record and gzip integrity checks to compute-node analysis tools instead of decompressing inputs during validation. Refs #276
Reduce preparation complexity while preserving collected errors, optional MLST handling and independent ExPEC checks. Add direct tests for each helper and the top-level orchestration. Refs #276
karlnyr
force-pushed
the
fix/analysis-preflight-validation
branch
from
November 16, 2026 11:07
4dc8828 to
177627d
Compare
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.

Description
Closes #272.
Validate analysis inputs and references before submitting any SLURM jobs, collect setup errors across samples, and support NCBI Assembly accessions as reference genomes.
Stack
Depends on #274, which depends on #271. This PR targets
fix/analyse-qc-onlyto keep its diff focused; retarget tomasteronce the preceding PRs merge.Changes
finish.GCF_...andGCA_...accessions through NCBI Assembly and download the complete genomic FASTA from the matching RefSeq/GenBank directory over HTTPS. Do not silently substitute another assembly version or the paired assembly.--skip_updatedisables downloading/indexing but still validates required cached resources.Primary function of PR
Testing
.venv/bin/python -m pytest: 180 passed.git diff --check: passed.GCF_000262545.1: gzip decoded successfully, containing three FASTA records.GCA_000262545.1: matching GenBank download URL confirmed.