Skip to content

Grade adapter, overrepresented, N content and duplication as FastQC - #146

Open
MaximilianStammnitz wants to merge 1 commit into
smithlabcode:mainfrom
MaximilianStammnitz:fix-grading-units
Open

MaximilianStammnitz wants to merge 1 commit into
smithlabcode:mainfrom
MaximilianStammnitz:fix-grading-units

Conversation

@MaximilianStammnitz

@MaximilianStammnitz MaximilianStammnitz commented Nov 2, 2026 •

Copy link
Copy Markdown

Fixes #145.

  • Overrepresented sequences: graded in percent, on the top sequence of the reported list (zero if the list is empty), as FastQC does. Before, a fraction was compared with percent cutoffs.
  • Adapter content: graded on the cumulative percentage the report shows, rather than the largest count of adapter starts at a single position.
  • Units: N content and duplication are also graded in percent, with their default cutoffs given in percent, so every module uses the same units as Configuration/limits.txt. With the default cutoffs their grades do not change.
  • Cutoffs: for modules where higher is worse, a value equal to a cutoff no longer reaches it (FastQC tests value > cutoff); e.g. a sequence at exactly 0.1 % passes.
  • data/test_data/md5sum.txt: bam_mult_out/bam_2 now warns for overrepresented sequences (top sequence 0.12 % of reads), as FastQC 0.13.0 does. No other test output changes.

Tested: all 17 tests pass (Linux, GCC 14, main @ 99197e7). On the file from #145 and on bam_2.bam the four grades this PR touches now match FastQC 0.13.0 (on the #145 file every module does), and all other sections of fastqc_data.txt are unchanged.

Four modules were graded against cutoffs in different units from the
values compared with them, or on a different quantity from the one the
report shows:

- overrepresented: the value was a fraction of reads, the default cutoffs
  (0.1, 1) are percent, so the effective cutoffs were 10% and 100%. The
  grade is now the percentage of the top sequence in the reported list
  (zero if the list is empty), as in FastQC, so a sequence below the
  list's own cutoffs can no longer raise it.
- adapter: the value was the largest per-position count of an adapter
  start, while the report (and FastQC) shows the cumulative percentage of
  reads with the adapter at or before each position. The grade is now
  the maximum of that cumulative percentage.
- n_content, duplication: fractions compared with fractional default
  cutoffs, which worked, but a config file in the FastQC limits.txt
  format (percent: n_content 5/20, duplication 70/50) made N content
  unable to warn and duplication always fail. Both are now graded in
  percent and the defaults are given in percent, like every other
  module and like Configuration/limits.txt.

Also, for modules where higher is worse, a value equal to a cutoff no
longer reaches it (FastQC tests value > cutoff), e.g. a sequence at
exactly 0.1% passes.

data/test_data/md5sum.txt: bam_2 now warns for overrepresented sequences
(top sequence 0.12% of reads), as FastQC 0.13.0 does.
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.

v2.0.3: Overrepresented sequences and Adapter Content are graded PASS when FastQC's cutoffs give FAIL

1 participant