Skip to content

Add abundance metrics#1025

Merged
d4straub merged 13 commits into
nf-core:devfrom
d4straub:add-abundance-metrics
Jul 3, 2026
Merged

Add abundance metrics#1025
d4straub merged 13 commits into
nf-core:devfrom
d4straub:add-abundance-metrics

Conversation

@d4straub

@d4straub d4straub commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

This is a follow-up PR to #1023.

With this PR the comparison of observed to expected sequences is finished for now, I think. The results are not (yet) integrated to the pipeline summary report though.
A comparison of observed to expected taxa would be also great in future. Changing the test datasets to mock data could make the comparison also in tests meaningful.

This PR adds metrics based on abundances:

  • pearson_cor: Pearson's Correlation (cor)
  • spearman_rho: Spearman's Rank Correlation (rho)
  • deviation: Median Percent Abundance Deviation
  • mae: Mean Absolute Error (MAE)
  • rmse: Root Mean Square Error (RMSE)
  • ps: Proportional Similarity (PS)
  • bray-curtis: Bray-Curtis Dissimilarity
  • hellinger: Hellinger Distance
  • jensen-shannon: Jensen-Shannon Divergence

and figures thereof, e.g.
image

and fixes a shortcoming in the previous PR that limited the blast result filtering.

Additionally, --expected_sequences_mismatches was added. It allows to increase the threshold for mismatches/gaps to call a TP. For example, --expected_sequences_mismatches 1 also allows observed sequences with 1 mismatch to an expected sequence to be accepted as TP (by default only exact matches, i.e. --expected_sequences_mismatches 0).

Previously, the comparison results were published in a folder that included the params md5sum in its path. While this was great for repeatedly resuming the pipeline with various parameters and accumulating all results in a single outdir directory, it proofed difficult: the CI tests seemed to not like missing files (md5sum changed when param was added) and md5sums were different between local & CI nf-test run due to differing parameter string. Therefore, the comparison results are now not published under a md5sum, but overwritten each time. The md5sum_version.txt still has all that info though.

PR checklist

  • This comment contains a description of changes (with reason).
  • If you've fixed a bug or added code that should be tested, add tests!
  • If you've added a new tool - have you followed the pipeline conventions in the contribution docs
  • If necessary, also make a PR on the nf-core/ampliseq branch on the nf-core/test-datasets repository.
  • Make sure your code lints (nf-core pipelines lint).
  • Ensure the test suite passes (nextflow run . -profile test,docker --outdir <OUTDIR>).
  • Check for unexpected warnings in debug mode (nextflow run . -profile debug,test,docker --outdir <OUTDIR>).
  • Usage Documentation in docs/usage.md is updated.
  • Output Documentation in docs/output.md is updated.
  • CHANGELOG.md is updated.
  • README.md is updated (including new tool citations and authors/contributors).

@d4straub
d4straub marked this pull request as ready for review July 3, 2026 08:49

@erikrikarddaniel erikrikarddaniel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few spelling mistakes.

Comment thread docs/output.md Outdated
Comment thread docs/output.md Outdated
Comment thread docs/usage.md Outdated
Co-authored-by: Daniel Lundin <erik.rikard.daniel@gmail.com>
@d4straub

d4straub commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks!

@d4straub
d4straub merged commit 53d81c5 into nf-core:dev Jul 3, 2026
70 of 72 checks passed
@d4straub
d4straub deleted the add-abundance-metrics branch July 3, 2026 10:55
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.

2 participants