Category

Genomic Interval Manipulation


Usage

bedtools multiinter [OPTIONS] -i FILE1 FILE2 .. FILEn


Manual

This tool is part of the bedtools suite ans it's also known as multiIntersectBed.

Required arguments

  • -i FILE1 FILE2 .. FILEn: Requires that each interval file is sorted by chrom/start.

Options

  • -cluster: Invoke Ryan Layers's clustering algorithm.
  • -header: Print a header line (chrom/start/end + names of each file).
  • -names STRING: A list of names (one/file) to describe each file in -i. These names will be printed in the header line.
  • -g STRING: Use genome file to calculate empty regions.
  • -empty: Report empty regions (i.e., start/end intervals w/o values in all files). Requires the -g parameter.
  • -filler TEXT: Use TEXT when representing intervals having no value. Default is '0', but you can use 'N/A' or any text.
  • -examples: Show detailed usage examples.

Examples

Input files

$ cat a.bed
chr1  6   12
chr1  10  20
chr1  22  27
chr1  24  30

$ cat b.bed
chr1  12  32
chr1  14  30

$ cat c.bed
chr1  8   15
chr1  10  14
chr1  32  34

$ cat sizes.txt
chr1  5000
Multi-intersect the files
$ multiIntersectBed -i a.bed b.bed c.bed
chr1    6    8    1    1    1    0    0
chr1    8    12    2    1,3    1    0    1
chr1    12    15    3    1,2,3    1    1    1
chr1    15    20    2    1,2    1    1    0
chr1    20    22    1    2    0    1    0
chr1    22    30    2    1,2    1    1    0
chr1    30    32    1    2    0    1    0
chr1    32    34    1    3    0    0    1
Multi-intersect the files, with a header line

In this case, titles are the file names

$ multiIntersectBed -header -i a.bed b.bed c.bed
chrom    start    end    num    list    a.bed    b.bed    c.bed
chr1    6    8    1    1    1    0    0
chr1    8    12    2    1,3    1    0    1
chr1    12    15    3    1,2,3    1    1    1
chr1    15    20    2    1,2    1    1    0
chr1    20    22    1    2    0    1    0
chr1    22    30    2    1,2    1    1    0
chr1    30    32    1    2    0    1    0
chr1    32    34    1    3    0    0    1
Multi-intersect the files, with a header line and custom names
$ multiIntersectBed -header -i a.bed b.bed c.bed -names A B C
chrom    start    end    num    list    A    B    C
chr1    6    8    1    A    1    0    0
chr1    8    12    2    A,C    1    0    1
chr1    12    15    3    A,B,C    1    1    1
chr1    15    20    2    A,B    1    1    0
chr1    20    22    1    B    0    1    0
chr1    22    30    2    A,B    1    1    0
chr1    30    32    1    B    0    1    0
chr1    32    34    1    C    0    0    1
Multi-intersect the files, showing empty regions
$ multiIntersectBed -header -i a.bed b.bed c.bed -names A B C -empty -g sizes.txt
chrom    start    end    num    list    A    B    C
chr1    0    6    0    none    0    0    0
chr1    6    8    1    A    1    0    0
chr1    8    12    2    A,C    1    0    1
chr1    12    15    3    A,B,C    1    1    1
chr1    15    20    2    A,B    1    1    0
chr1    20    22    1    B    0    1    0
chr1    22    30    2    A,B    1    1    0
chr1    30    32    1    B    0    1    0
chr1    32    34    1    C    0    0    1
chr1    34    5000    0    none    0    0    0

 

File formats this tool works with
BEDGFFGTF

Share your experience or ask a question