intersectBed
not used if the file A type is BAM
5% by default

What it does

This tool use the "intersectBed" function of Bedtools to report overlaps between two feature files.

Note: When intersecting SNPs, make sure the coordinate conform to the UCSC format. That is, the start position for each SNP should be SNP position - 1 and the end position should be SNP position. E.g. chr7 10000001 10000002 rs123464

  • Report the base-pair overlap between sequence alignments and genes. $ intersectBed -a reads.bed -b genes.bed
  • Report whether each alignment overlaps one or more genes. If not, the alignment is not reported. $ intersectBed -a reads.bed -b genes.bed -u
  • Report those alignments that overlap NO genes. Like "grep -v" $ intersectBed -a reads.bed -b genes.bed -v
  • Report the number of genes that each alignment overlaps. $ intersectBed -a reads.bed -b genes.bed -c
  • Report the entire, original alignment entry for each overlap with a gene. $ intersectBed -a reads.bed -b genes.bed -wa
  • Report the entire, original alignment and genes entries for each overlap plus the number of base pairs. Only reads features with overlap are reported. $ intersectBed -a reads.bed -b genes.bed -wo
  • Report the entire, original alignment and genes entries for each overlap plus the number of base pairs. However, alignment features w/o overlap are also reported with a NULL gene feature and overlap = 0. $ intersectBed -a reads.bed -b genes.bed -wao
  • Only report an overlap with a repeat if it spans at least 50% of the exon. $ intersectBed -a exons.bed -b repeatMasker.bed –f 0.50
  • Only report an overlap if comprises 50% of the structural variant and 50% of the segmental duplication. Thus, it is reciprocally at least a 50% overlap. $ intersectBed -a SV.bed -b segmentalDups.bed –f 0.50 -r
  • Read BED A from stdin. For example, find genes that overlap LINEs but not SINEs. $ intersectBed -a genes.bed -b LINES.bed | intersectBed -a stdin -b SINEs.bed -v
  • Retain only single-end BAM alignments that overlap exons. $ intersectBed -abam reads.bam -b exons.bed > reads.touchingExons.bam
  • Retain only single-end BAM alignments that do not overlap simple sequence repeats. $ intersectBed -abam reads.bam -b SSRs.bed -v > reads.noSSRs.bam

Contact Bruno Zeitouni (bruno.zeitouni@curie.fr) for any questions or concerns about the Galaxy implementation of IntersectBed.