bedtools multicov 可以用来对sorted and indexed bam文件依据已有的bed files进行reads计数
bedtools multicov depends upon index BAM files in order to count the number of overlaps in each BAM file. As such, each BAM file should be with either samtools or bamtools.
Usage and option summary
image.pngBy default, multicov will report the count of alignments in each input BAM file that overlap.
$ cat ivls-of-interest.bed
chr1 0 10000 ivl1
chr1 10000 20000 ivl2
chr1 20000 30000 ivl3
chr1 30000 40000 ivl4
$ bedtools multicov -bams aln1.bam aln2.bam aln3.bam -bed ivls-of-interest.bed
chr1 0 10000 ivl1 100 2234 0
chr1 10000 20000 ivl2 123 3245 1000
chr1 20000 30000 ivl3 213 2332 2034
chr1 30000 40000 ivl4 335 7654 0
image.png
bedtools multicov will work with a single BAM as well.(单个bam files也是可以的)
$ bedtools multicov -bams aln1.bam -bed ivls_of_interest.bed
chr1 0 10000 ivl1 100
chr1 10000 20000 ivl2 123
chr1 20000 30000 ivl3 213
chr1 30000 40000 ivl4 335
来源:[https://bedtools.readthedocs.io/en/latest/content/tools/groupby.html]
参考:http://www.bio-info-trainee.com/745.html
网友评论