mosdepth icon indicating copy to clipboard operation
mosdepth copied to clipboard

mosDepth vs plotCoverage

Open lmanchon opened this issue 2 years ago • 4 comments

--Hi,

I encounter differences between the plotCoverage tool and mosdepth (see attachment) and i don't know why. I use the following commands:

plotCoverage --bamfiles SRR6823381.bam --BED Exome-Agilent.bed -p max -o coverage_plotCoverage.png mosdepth --by Exome-Agilent.bed SRR098401_mosdepth -x -t 24 SRR6823381.bam python scripts/plot-dist.py *.mosdepth.global.dist.txt

coverage_plotCoverage dist.zip

thanks

lmanchon avatar Jul 20 '21 11:07 lmanchon

Mosdepth gives you the CDF (cumulative). It loosk like the other tools is giving you the PDF (point).

So the mosdepth plot tells you that about 50% of the genome is covered to at least 250X (go over to 250 and up to ~0.5)

The other plot is showing that that ~0.27% of the bases are covered at exactly 250X (over to 250, up to ~0.0027)

brentp avatar Jul 20 '21 11:07 brentp

-- I think i used the wrong file, i should have taken the 'mosdepth.region.dist.txt' file: python scripts/plot-dist.py -o dist_region.html *.mosdepth.region.dist.txt now the result is closer to plotCoverage output (see attachment).

For computing WES coverage do you think i need to use the -n parameter or not ? last question: is it possible to modify the text of the legend on the graphs ?

thank you.

dist_region.zip

lmanchon avatar Jul 20 '21 11:07 lmanchon

the -n option only determines if the per-base bed.gz output is written. it does not affect the other files.

you can modify the legend by editing the plot-dist.py script.

brentp avatar Jul 20 '21 11:07 brentp

-- it seems to be in line 71 ($showlegend) but i don't know how to change this variable.

lmanchon avatar Jul 20 '21 12:07 lmanchon