Debian Codegraph @

docs/content/tools/multicov.rst

raw
1 .. _multicov:
2
3 ###############
4 *multicov*
5 ###############
6 ``bedtools multicov``, reports the count of alignments from multiple
7 position-sorted and indexed BAM files that overlap intervals in a BED file.
8 Specifically, for each BED interval provided, it reports a separate count of
9 overlapping alignments from each BAM file.
10
11 .. note::
12
13 ``bedtools multicov`` depends upon index BAM files in order to count the
14 number of overlaps in each BAM file. As such, each BAM file should be
15 position sorted (``samtool sort aln.bam aln.sort``) and
16 indexed (``samtools index aln.sort.bam``) with either samtools or bamtools.
17
18
19 ==========================================================================
20 Usage and option summary
21 ==========================================================================
22 **Usage**:
23 ::
24
25 bedtools multicov [OPTIONS] -bams BAM1 BAM2 BAM3 ... BAMn -bed <BED/GFF/VCF>
26
27 **(or)**:
28 ::
29
30 multiBamCov [OPTIONS] -bams BAM1 BAM2 BAM3 ... BAMn -bed <BED/GFF/VCF>
31
32
33 ============ ================================================================
34 Option Description
35 ============ ================================================================
36 **-split** Treat "split" BAM or BED12 entries as distinct BED intervals.
37 **-s** Require same strandedness. That is, only report hits in B
38 that overlap A on the _same_ strand. By default, overlaps are
39 reported without respect to strand.
40 **-S** Require different strandedness. That is, only report hits in B
41 that overlap A on the _opposite_ strand. By default, overlaps
42 are reported without respect to strand.
43 **-f** Minimum overlap required as a fraction of each -bed record. Default is
44 1E-9 (i.e., 1bp).
45 **-r** Require that the fraction overlap is reciprocal for -bed and B. In
46 other words, if -f is 0.90 and -r is used, this requires that
47 B overlap 90% of the -bed record and the -bed record _also_ overlaps 90% of B.
48 **-q** Minimum mapping quality (MAPQ) allowed. Default is 0.
49 **-D** Include duplicate reads. Default counts non-duplicates only
50 **-F** Include failed-QC reads. Default counts pass-QC reads only
51 **-p** Only count proper pairs. Default counts all alignments with
52 ``MAPQ > -q`` argument, regardless of the BAM FLAG field.
53 ============ ================================================================
54
55
56 ==========================================================================
57 Default behavior.
58 ==========================================================================
59 By default, ``multicov`` will report the count of alignments in each input
60 BAM file that overlap.
61
62 .. code-block:: bash
63
64 $ cat ivls-of-interest.bed
65 chr1 0 10000 ivl1
66 chr1 10000 20000 ivl2
67 chr1 20000 30000 ivl3
68 chr1 30000 40000 ivl4
69
70 $ bedtools multicov -bams aln1.bam aln2.bam aln3.bam -bed ivls-of-interest.bed
71 chr1 0 10000 ivl1 100 2234 0
72 chr1 10000 20000 ivl2 123 3245 1000
73 chr1 20000 30000 ivl3 213 2332 2034
74 chr1 30000 40000 ivl4 335 7654 0
75
76
77 The output of ``multicov`` reflects a distinct report of the overlapping
78 alignments for each record in the ``-bed`` file. In the example above, each
79 line of the output reflects **a)** the original line from the ``-bed`` file
80 followed by **b)** the count of alignments that overlap the ``-bed`` interval
81 from each input ``-bam`` file. In the example above, the output consists of
82 7 columns: the first four of which are the columns from the ``-bed`` file and
83 the last 3 are the count of overlapping alignments from the 3 input ``-bam``
84 files. The order of the counts reflects the order of the files given on the
85 command line.
86
87 .. note::
88
89 ``bedtools multicov`` will work with a single BAM as well.
90
91 .. code-block:: bash
92
93 $ bedtools multicov -bams aln1.bam -bed ivls-of-interest.bed
94 chr1 0 10000 ivl1 100
95 chr1 10000 20000 ivl2 123
96 chr1 20000 30000 ivl3 213
97 chr1 30000 40000 ivl4 335
98