Skip to content

Add raw read counts to alignment QC report - #260

Open
karlnyr wants to merge 5 commits into
rc5.0.3from
feat/trimmomatic-report-and-parsing
Open

Add raw read counts to alignment QC report#260
karlnyr wants to merge 5 commits into
rc5.0.3from
feat/trimmomatic-report-and-parsing

Conversation

@karlnyr

@karlnyr karlnyr commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

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:

  • Trimmomatic is now invoked with -summary <trimdir>/{sample}_trim_summary.txt per sample.
  • A new Scraper.scrape_trimmomatic() parses Input Read Pairs from that summary and stores raw_reads (pairs * 2) on the sample.
  • raw_reads is a new samples column, added via a new (idempotent) Alembic migration so it applies cleanly to both fresh and existing databases.
  • The alignment report JSON and the alignment QC page now include both values: a new "Totalt antal läsningar (***)" column for raw reads, and "Antal Reads" is renamed to "Läsningar efter filtrering (**)" for clarity.

Primary function of PR

  • Hot-fix
  • Patch
  • Minor functionality improvement
  • New type of analysis
  • Backward-breaking functionality improvement
  • This change requires internal documents to be updated
  • This change requires another repository to be updated

Testing

  • bash /home/proj/production/servers/resources/hasta.scilifelab.se/install-microsalt-stage.sh BRANCHNAME
  • us
  • conda activate S_microSALT
  • microSALT analyse --input /path/to/fastq/ SAMPLEINFO_FILE

Test 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

  • Approved to run at Clinical-Genomics by @karlnyr or @Clinical-Genomics/micro

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>
@karlnyr
karlnyr requested a review from a team as a code owner September 3, 2026 15:03
karlnyr and others added 4 commits September 3, 2026 17:06
(**) 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant