Repository navigation
Conversation
Bumps [sh](https://github.com/amoffat/sh) from 1.14.3 to 2.2.4. - [Release notes](https://github.com/amoffat/sh/releases) - [Changelog](https://github.com/amoffat/sh/blob/develop/CHANGELOG.md) - [Commits](amoffat/sh@1.14.3...2.2.4) --- updated-dependencies: - dependency-name: sh dependency-version: 2.2.4 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [urllib3](https://github.com/urllib3/urllib3) from 2.7.0 to 2.8.0. - [Release notes](https://github.com/urllib3/urllib3/releases) - [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst) - [Commits](urllib3/urllib3@2.7.0...2.8.0) --- updated-dependencies: - dependency-name: urllib3 dependency-version: 2.8.0 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [werkzeug](https://github.com/pallets/werkzeug) from 3.1.6 to 3.1.9. - [Release notes](https://github.com/pallets/werkzeug/releases) - [Changelog](https://github.com/pallets/werkzeug/blob/main/CHANGES.rst) - [Commits](pallets/werkzeug@3.1.6...3.1.9) --- updated-dependencies: - dependency-name: werkzeug dependency-version: 3.1.9 dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [certifi](https://github.com/certifi/python-certifi) from 2026.1.4 to 2026.10.19. - [Commits](certifi/python-certifi@2026.01.04...2026.10.19) --- updated-dependencies: - dependency-name: certifi dependency-version: 2026.10.19 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [black](https://github.com/psf/black) from 26.3.1 to 26.10.1. - [Release notes](https://github.com/psf/black/releases) - [Changelog](https://github.com/psf/black/blob/main/CHANGES.md) - [Commits](psf/black@26.3.1...26.10.1) --- updated-dependencies: - dependency-name: black dependency-version: 26.10.1 dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [mako](https://github.com/sqlalchemy/mako) from 1.3.12 to 1.4.2. - [Release notes](https://github.com/sqlalchemy/mako/releases) - [Changelog](https://github.com/sqlalchemy/mako/blob/main/CHANGES) - [Commits](https://github.com/sqlalchemy/mako/commits) --- updated-dependencies: - dependency-name: mako dependency-version: 1.4.2 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [pylint](https://github.com/pylint-dev/pylint) from 4.0.5 to 4.0.9. - [Release notes](https://github.com/pylint-dev/pylint/releases) - [Commits](pylint-dev/pylint@v4.0.5...v4.0.9) --- updated-dependencies: - dependency-name: pylint dependency-version: 4.0.9 dependency-type: direct:development ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [oauthlib](https://github.com/oauthlib/oauthlib) from 3.3.1 to 4.0.1. - [Release notes](https://github.com/oauthlib/oauthlib/releases) - [Changelog](https://github.com/oauthlib/oauthlib/blob/v4.0.1/CHANGELOG.rst) - [Commits](oauthlib/oauthlib@v3.3.1...v4.0.1) --- updated-dependencies: - dependency-name: oauthlib dependency-version: 4.0.1 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
Bumps [soupsieve](https://github.com/facelessuser/soupsieve) from 2.8.4 to 4.0. - [Release notes](https://github.com/facelessuser/soupsieve/releases) - [Commits](facelessuser/soupsieve@2.8.4...4.0) --- updated-dependencies: - dependency-name: soupsieve dependency-version: '4.0' dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com>
Add qc_only flag that skips the typing when using the finish command
Pass the QC-only setting through analysis jobs and select the QC track when finishing, avoiding typing scraping for QC-only runs. Refs #271
Enable QC-only runs from the analyse command
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
…-validation Validate analysis setup before submission and support assembly references
Implement QC-only report generation and filtering in reporter
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
MLST setup can submit typing jobs against empty profile tables, while QC-only runs can retain stale metadata and full-report versioning can miss changes to included samples.
3 open issues
What changed in this PR
This PR adds QC-only workflows to microSALT and strengthens validation before SLURM submission, with supporting changes to reference preparation, reporting and error handling.
Changes:
- Add QC-only analysis and finalization, excluding typing and assembly outputs from reports and deliverables.
- Validate sample metadata, FASTQ paths and reference resources, collecting setup errors before job submission.
- Update report fingerprints and sample filtering, with expanded regression coverage.
| File | Description |
|---|---|
| tests/utils/test_validation.py | Tests metadata, identifiers, FASTQ pairing and file access. |
| tests/utils/test_scraper.py | Tests QC-only scraping and preservation of typing results. |
| tests/utils/test_reporter.py | Tests QC-only output filtering and report versioning calls. |
| tests/utils/test_referencer.py | Tests genome downloads, indexing and MLST availability handling. |
| tests/utils/test_reference_preparation.py | Tests resource preparation and collected failures. |
| tests/utils/test_jobcreator.py | Tests preparation-before-submission and QC-only job behavior. |
| tests/utils/conftest.py | Adds an isolated reference-management fixture. |
| tests/test_cli.py | Tests QC flags, validation errors and job integration. |
| tests/store/test_database.py | Tests roster and metadata changes in report fingerprints. |
| tests/server/test_jinja2_rendering.py | Tests sample filtering in QC HTML. |
| README.md | Documents QC-only workflows, validation and failure behavior. |
| microSALT/utils/validation.py | Adds reusable input and metadata validation. |
| microSALT/utils/scraper.py | Adds QC-only scraping and missing-MLST handling. |
| microSALT/utils/reporter.py | Filters QC-only outputs and passes report roster metadata. |
| microSALT/utils/referencer.py | Adds resource validation and safer genome download preparation. |
| microSALT/utils/job_creator.py | Prepares jobs before submission and propagates submission failures. |
| microSALT/store/db_manipulator.py | Uses structured JSON fingerprints for report versions. |
| microSALT/server/views.py | Supports sample-ID filtering for report data and QC pages. |
| microSALT/exc/exceptions.py | Defines setup-failure and unavailable-MLST exceptions. |
| microSALT/cli.py | Exposes QC-only flags and coordinates pre-submission validation. |
Review effort: Balanced
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Critical defects can block valid submissions, overwrite concurrent report outputs, and let validation pass despite missing samples or mandatory checks.
6 open issues
Derive the project from the validated project ID · New Retain the allocated report version throughout rendering · New Flag samples missing from the post-run snapshot · New Require all mandatory checks before reporting PASS · New Use a fresh transaction snapshot for each observation · New Initialize the shared database before constructing fixtures · New
3 resolved since last review
Review effort: Balanced
| "trimmed": not untrimmed, | ||
| "pool": pool, | ||
| "qc_only": qc_only, | ||
| "pool": [sample["CG_ID_sample"] for sample in sampleinfo] if len(sampleinfo) > 1 else [], |
Comment on lines
+524
to
+525
| self.session.add(self.add_report(CG_ID_project=name, date=datetime.now(), version=version)) | ||
| self.commit_session() |
Comment on lines
+147
to
+148
| if new is None: | ||
| continue |
Comment on lines
+153
to
+155
| checks = list(self.state.checks(f"{self.name}/").values()) | ||
| if not checks: | ||
| return "-" |
|
|
||
| def snapshot_project(self, project: str) -> dict: | ||
| """Per-sample typing, metadata and QC values plus typing row counts.""" | ||
| self.session.expire_all() |
| state: State | ||
| runner: MicrosaltRunner | ||
| fixtures: FixtureHelper | ||
| _db: Database | None = field(default=None, repr=False) |
rannick
reviewed
Dec 3, 2026
rannick
reviewed
Dec 3, 2026
| raise | ||
| except Exception as e: | ||
| self.logger.error(f"Unable to create job for sample {self.name}\nSource: {e!s}") | ||
| shutil.rmtree(self.finishdir, ignore_errors=True) |
There was a problem hiding this comment.
Won't removing that make the output directory too bulky?
rannick
reviewed
Dec 3, 2026
| the release includes one), `-d` reinstall all dependencies. | ||
| 1. Deploy master to production: | ||
| 1. Log in to appropriate server `ssh <server.scilifelab.se>` | ||
| 1. `sudo -iu hiseq.clinical`, then `up` |
rannick
reviewed
Dec 3, 2026
| "references": "/tmp/MLST/references/ST_loci", | ||
| "_comment": "Resistances. Commonly from resFinder", | ||
| "resistances": "/tmp/MLST/references/resistances", | ||
| "_comment": "ExPEC virulence genes (.fsa files) for Escherichia coli. Not bundled; must be provided", |
karlnyr
commented
Dec 4, 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.


Description
Closes #272
Closes #273
This pull request introduces significant improvements to the microSALT pipeline, focusing on robust validation and support for QC-only (quality control only) workflows. The changes enhance the CLI experience, enforce strict input and reference validation before job submission, and add new error handling mechanisms. Additionally, the reporting and job creation logic have been updated to support these new features.
Key changes include:
QC-only Workflow Support
--qc-only/--qc_onlyflags to theanalyseandutils finishCLI commands, enabling users to perform read/alignment QC without assembly, typing, or resistance analysis. The documentation inREADME.mdhas been updated with detailed instructions and explanations of the QC-only workflow. [1] [2] [3] [4]utils finish --qc-onlygenerates only QC-related reports and deliverables, omitting assembly, QUAST, and typing outputs. [1] [2]ExPEC virulence references
folders.expecconfiguration key to the directory containing the.fsafiles, rather than to an individual file. This follows the same directory layout asfolders.resistances.Input and Reference Validation
Error Handling and Exceptions
AnalysisSetupError,ReferenceSetupError,MLSTUnavailableError) to clearly distinguish setup failures and allow for more informative error messages. These are now used throughout the CLI and job creation logic. [1] [2]click.ClickExceptionwith detailed error information if setup or job creation fails, ensuring users are immediately informed of all issues. [1] [2]Reporting and Job Creation
DB_Manipulator.set_reportto use a structured JSON fingerprint based on sample metadata, improving report versioning and reproducibility.Web Interface and Report Data
gen_reportdataand related web view functions to allow filtering by sample IDs, supporting more flexible report generation and visualization. [1] [2] [3]These changes collectively make the pipeline more robust, user-friendly, and maintainable, particularly for large-scale or QC-focused sequencing projects.
Primary function of PR
Testing
bash /home/proj/production/servers/resources/hasta.scilifelab.se/install-microsalt-stage.sh BRANCHNAMEusconda activate S_microSALTmicroSALT analyse --input /path/to/fastq/ SAMPLEINFO_FILETest results
These are the results of the tests, and necessary conclusions, that prove the stability of the PR.
Sign-offs