Add raw read counts to alignment QC report - #260
Open
karlnyr wants to merge 5 commits into
Open
Conversation
Trimmomatic now writes a per-sample -summary file. A new scraper function parses 'Input Read Pairs' from it and stores raw_reads (pairs * 2) on the sample, migrated in via a new alembic revision. The alignment report now shows both the raw read count and the post-filtering read count, clarifying the pass/fail discrepancy between raw sequencing depth and filtered QC metrics. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
(**) and (***) rendered with a distorted, italic-looking middle character in the browser due to consecutive asterisk glyphs. Use the standard *, dagger, double-dagger footnote sequence instead. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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
Currently the alignment summary page only shows the read count after Trimmomatic filtering ("Antal Reads"). This creates a discrepancy: a sample is deemed passable if the raw reads fed into the workflow are sufficient and no other QC metric is red, but the report never surfaces that raw read count, so the reasoning behind a pass/fail isn't visible to reviewers.
This PR adds the raw (pre-filtering) read count alongside the existing filtered count:
-summary <trimdir>/{sample}_trim_summary.txtper sample.Scraper.scrape_trimmomatic()parsesInput Read Pairsfrom that summary and storesraw_reads(pairs * 2) on the sample.raw_readsis a newsamplescolumn, added via a new (idempotent) Alembic migration so it applies cleanly to both fresh and existing databases.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
Full local test suite passes (90/90), including new unit tests for the Trimmomatic summary parsing and a manual verification of the Alembic migration against both a fresh SQLite database and one pre-seeded at the prior revision (idempotent, no duplicate-column errors).
Sign-offs