This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Tool: mosdepth: fast BAM/CRAM depth calculation for WGS, exome, or targeted sequencing

mosdepth is a command-line tool for fast depth calculation. Because of the underlying algorithm it is possible to build a lot of features around the calculation. For example, once depth is calculated for every base in a chromosome, mosdepth can calculate the mean coverage in each of 100K intervals in about 1 additional second total. There are a number of additional features such that, for the most part, users can get all depth information out of a BAM/CRAM in a single pass.

You can read about it here in the bioinformatics app note.

and get the code and binary on github here

The github page describes the options and usage in more detail.

depth-of-coverage exome wgs

First link is not working right (fast.bam).

fixed. thanks.

1 answer

The speed is really impressive. Do you plan to add features that allow normalization and direct output in bigwig format? Both can of course be done manually but especially for larger files, an in-built option would raise the impact of mosdepth notably, beyond its improved speed.

I see the utility of this, but I don't have any plans to do it. It would require wrapping Devon's libBigWig and then adding an additional option to output that instead of BED. I don't think this would make it too much faster--maybe a few percent if the user chose to output per-base depth.

Ok I see. As an alternative, an option to send the bedgraph to STDOUT might be beneficial, so custom modifications with awk on $4 can be performed on the fly. Is that possible based on the current design?

that was the original design, but now it outputs to a file. that file is bgzipped and indexed on-the-fly so it gives similar utility to bigwig.

Log in to answer this question.