Add abundance metrics#1025
Merged
Merged
Conversation
d4straub
marked this pull request as ready for review
July 3, 2026 08:49
erikrikarddaniel
approved these changes
Jul 3, 2026
erikrikarddaniel
left a comment
Member
There was a problem hiding this comment.
A few spelling mistakes.
Co-authored-by: Daniel Lundin <erik.rikard.daniel@gmail.com>
Collaborator
Author
|
Thanks! |
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.
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 Deviationmae: Mean Absolute Error (MAE)rmse: Root Mean Square Error (RMSE)ps: Proportional Similarity (PS)bray-curtis: Bray-Curtis Dissimilarityhellinger: Hellinger Distancejensen-shannon: Jensen-Shannon Divergenceand figures thereof, e.g.

and fixes a shortcoming in the previous PR that limited the blast result filtering.
Additionally,
--expected_sequences_mismatcheswas added. It allows to increase the threshold for mismatches/gaps to call a TP. For example,--expected_sequences_mismatches 1also 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
nf-core pipelines lint).nextflow run . -profile test,docker --outdir <OUTDIR>).nextflow run . -profile debug,test,docker --outdir <OUTDIR>).docs/usage.mdis updated.docs/output.mdis updated.CHANGELOG.mdis updated.README.mdis updated (including new tool citations and authors/contributors).