Question: Bedtools Intersect -v returns same file, with only one line removed
0
gravatar for sfox02
2.5 years ago by
sfox020
sfox020 wrote:

I have two bed files, a file with peaks, and a file I created to be +/- 1kb of the TSS in mm9.

When I try to use bedtools intersect -v to find all of the peaks that are not overlapping with the 1kb region around a TSS, it returns the same peak file, but with one line different:

$ bedtools intersect -v -a ProE_replicatePeaks.bed -b 1kbTSS.bed > ATAC_Not_Pr.bed

$ wc -l ProE_replicatePeaks.bed

17440 ProE_replicatePeaks.bed

$ wc -l ATAC_Not_Pr.bed

17439 ATAC_Not_Pr.bed

I thought maybe I needed to sort the file containing the region around the TSS, but the same problem occurred.

Any input is appreciated! Thanks.

chip-seq software error • 871 views
ADD COMMENTlink modified 2.5 years ago by Alex Reynolds28k • written 2.5 years ago by sfox020
  1. What version of bedtools?
  2. Can you post a few relevant lines of each file?
ADD REPLYlink written 2.5 years ago by Devon Ryan91k
1
gravatar for Alex Reynolds
2.5 years ago by
Alex Reynolds28k
Seattle, WA USA
Alex Reynolds28k wrote:

Are you expecting no overlaps? Perhaps try BEDOPS, in order to see what answer you get with an alternative toolkit.

First, sort the inputs:

$ sort-bed ProE_replicatePeaks.unknownSortOrder.bed > ProE_replicatePeaks.bed 
$ sort-bed 1kbTSS.unknownSortOrder.bed > 1kbTSS.bed

Then do the exclusion operation:

$ bedops --not-element-of 1 ProE_replicatePeaks.bed 1kbTSS.bed > ATAC_Not_Pr.bed

You could also do the opposite operation:

$ bedops --element-of 1 ProE_replicatePeaks.bed 1kbTSS.bed > ATAC_Pr.bed

In theory, if the first operation worked in the same way, you would get one BED element from the second operation, with which you can do a sanity check by comparing 1kbTSS.bed with ATAC_Pr.bed:

$ bedmap --echo --echo-map 1kbTSS.bed ATAC_Pr.bed > sanityCheck.bed
ADD COMMENTlink written 2.5 years ago by Alex Reynolds28k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 557 users visited in the last hour