BamToCov

CovToBam logo

BamToCov is a suite of tools for coverage analysis written in Nim and built upon the memory efficient algorithm of covtobed.

The program uses htslib to parse BAM/CRAM files, and specifically the Nim-wrapper hts-nim.

We designed BamToCov to fill some gaps in coverage analysis:

  1. Accepting input streams (i.e. not requiring the BAM index, at the expense of speed)
  2. Enabling per strand coverage analysis
  3. Enabling the physical coverage analysis
  4. Using a minimum amount of memory (minimum memory usage)

This makes BamToCov a useful companion especially when testing pipelines on small datasets.

For coverage analysis of large datasets it can be useful to consider Mosdepth, that uses indexed BAM/CRAM files as input. Another interesting alternative is Megadepth, a fast and memory efficient tool.