Thank you! It worked perfectly.
I have Nanopore long read data from several patients. I would like to calculate coverage of the long read data but I couldn't find any tool that does this. I did some calculations myself (SUM (samtools depth)/total bases) but I'm not sure if this is accurate. Any suggestion of tools or approaches to calculate the coverage for long read data would be appreciated.
1 answer
See samtools coverage http://www.htslib.org/doc/samtools-coverage.html can output the per-chromosome coverage
There is also mosdepth which is similar but also outputs the genome-wide coverage instead of just the per-chromosome coverage in a file named <prefix>.mosdepth.summary.txt
example contents of the <prefix>.mosdepth.summary.txt file:
```
How do you calculate the total (genome-wide) average coverage from "samtools coverage" output which is per chromosome?
you can try mosdepth. It outputs a file called <prefix>.mosdepth.summary.txt and the last line in it includes the genome wide mean/min/max coverages https://github.com/brentp/mosdepth (there are also various solutions in this thread Tools To Calculate Average Coverage For A Bam File? but i think a well tested tool for something like this is much preferred to the ad hoc scripts!)
Thank you! I eventually used the information generated by three tools (samtools coverage+ mosdepth + NanoPlot).
Log in to answer this question.