Analysis of coverage from BAM files to BED tracks [provides: "covtobed" and "coverage"]
1.1K
Reads one (or more) alignment files (sorted BAM) and prints a BED with the coverage. It will join consecutive bases with the same coverage, and can be used to only print a BED file with the regions having a specific coverage range.
:book: Read more in the wiki - this is the main documentation source
Features:
bwa mem .. | samtools view -b | samtools sort - | covtobed):book: The complete documentation is available in the GitHub wiki.
Synopsis:
Usage: covtobed [options] [BAM]...
Computes coverage from alignments
Options:
-h, --help show this help message and exit
--version show program's version number and exit
--physical-coverage compute physical coverage (needs paired alignments in input)
-q MINQ, --min-mapq=MINQ
skip alignments whose mapping quality is less than MINQ
(default: 0)
-m MINCOV, --min-cov=MINCOV
print BED feature only if the coverage is bigger than
(or equal to) MINCOV (default: 0)
-x MAXCOV, --max-cov=MAXCOV
print BED feature only if the coverage is lower than
MAXCOV (default: 100000)
-l MINLEN, --min-len=MINLEN
print BED feature only if its length is bigger (or equal
to) than MINLELN (default: 1)
-z MINCTG, --min-ctg-len=MINCTG
skip reference sequences having size less or equal to MINCTG
-d, --discard-invalid-alignments
skip duplicates, failed QC, and non primary alignment,
minq>0 (or user-defined if higher) (default: 0)
--output-strands output coverage and stats separately for each strand
--format=CHOICE output format
Command:
covtobed -m 0 -x 5 test/demo.bam
Output:
[...]
NC_001416.1 0 2 0
NC_001416.1 2 6 1
NC_001416.1 6 7 2
NC_001416.1 7 12 3
NC_001416.1 12 18 4
NC_001416.1 169 170 4
NC_001416.1 201 206 4
[...]
See the full example output from different tools :open_file_folder: here
conda install -c bioconda covtobed
sudo docker pull andreatelatin/covtobed
sudo docker run --rm -ti andreatelatin/covtobed coverage -h
singularity pull docker://andreatelatin/covtobed, then:singularity exec covtobed.simg coverage -h
covtobed is generally faster than bedtools. More details are in the benchmark page.
This tool requires libbamtools and zlib.
To manually compile:
c++ -std=c++11 *.cpp -I/path/to/bamtools/ -L${HOME}/path/to/lib/ -lbamtools -o covtobed
This tools uses libbamtools by Derek Barnett, Erik Garrison, Gabor Marth and Michael Stromberg, and cpp-optparse by Johannes Weißl. Both tools and this program are released with MIT license.
Giovanni Birolo (@gbirolo), University of Turin, and Andrea Telatin (@telatin), Quadram Institute Bioscience.
This program was finalized with a Flexible Talent Mobility Award funded by BBSRC through the Quadram Institute.
If you use this tool, we would really appreciate if you will cite its paper:
Birolo et al., (2020). covtobed: a simple and fast tool to extract coverage tracks from BAM files. Journal of Open Source Software, 5(47), 2119, https://doi.org/10.21105/joss.02119
BibTeX citation:
@article{Birolo2020,
doi = {10.21105/joss.02119},
url = {https://doi.org/10.21105/joss.02119},
year = {2020},
publisher = {The Open Journal},
volume = {5},
number = {47},
pages = {2119},
author = {Giovanni Birolo and Andrea Telatin},
title = {covtobed: a simple and fast tool to extract coverage tracks from BAM files},
journal = {Journal of Open Source Software}
}
Content type
Image
Digest
Size
148.4 MB
Last updated
almost 6 years ago
docker pull andreatelatin/covtobed