Skip to content

mosdepth fixes for issues #1566, #1568, and a bug on calculating per-contig avg coverage - #1570

Merged
ewels merged 14 commits into
MultiQC:masterfrom
fgvieira:mosdepth
Jan 25, 2022
Merged

ewels merged 14 commits into
MultiQC:masterfrom
fgvieira:mosdepth

Conversation

@fgvieira

@fgvieira fgvieira commented Nov 1, 2021 •

Copy link
Copy Markdown
Contributor
  • This comment contains a description of changes (with reason)
  • CHANGELOG.md has been updated

Changes:

  • Added mean coverage (#1566)
  • Fixed issue #1568
  • Fixed a bug when reporting per contig coverage
  • General code tweaks (e.g. unification of gen stats table, text clarifications)

@brentp this module calculates per-contig average coverage by summing over the cumulative distribution of .mosdepth.region.dist.txt (or global). However, this value does not always match the one in .mosdepth.summary.txt. Is this expected?

@brentp

brentp commented Nov 1, 2021

Copy link
Copy Markdown

how large are the differences? Was a region file given to --by argument?

@fgvieira

fgvieira commented Nov 1, 2021

Copy link
Copy Markdown
Contributor Author

mosdepth.summary.txt:

[...]
chr20   64444167        145213184       2.25332 0       3738
chr20_region    34869   70659078        2026.41538      0       3738
[...]

MultiQC reports 1915.3x

yes, a bed file was given to --by.

@brentp

brentp commented Nov 1, 2021

Copy link
Copy Markdown

I'd guess it's a difference between median and mean or something like that. Or the loss of precision from adding the .dist files.

@fgvieira

fgvieira commented Nov 1, 2021 •

Copy link
Copy Markdown
Contributor Author

They should both be the mean, multiQC report (the per-contig average by summing all over bins of the cumulative coverage distribution) and the .mosdepth.summary.txt. Then I guess it has to be about precision differences.

@VladSaveliev any reason why the per-contig coverage is calculated from the cumulative distribution and not read directly from .mosdepth.summary.txt?

And should we keep it as is? Or should we use the values from .mosdepth.summary.txt instead?

@ewels ewels 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.

Reading over the code looks good, I'll just test locally and push the minor name cleaning suggestion..

Comment thread multiqc/modules/mosdepth/mosdepth.py Resolved
Comment thread multiqc/modules/mosdepth/mosdepth.py Resolved
@ewels

ewels commented Jan 25, 2022

Copy link
Copy Markdown
Member

Everything looks good here, thank you for working on this @fgvieira! Apologies that it's taken me so long to review.

I'll merge now, but if you could sanity check my change / comment in #1570 (review) that would be great.

Thanks!

@ewels
ewels enabled auto-merge January 25, 2022 10:53
@ewels ewels linked an issue Jan 25, 2022 that may be closed by this pull request
@ewels
ewels merged commit 7d0e584 into MultiQC:master Jan 25, 2022
ewels added a commit that referenced this pull request Jan 25, 2022
@pontushojer pontushojer mentioned this pull request May 29, 2023
2 tasks done
@fgvieira
fgvieira deleted the mosdepth branch December 12, 2023 10:26
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.

Mean Depth From mosdepth.

3 participants