Entering edit mode
6.3 years ago
elisheva
▴
120
Hi everyone! I have 2 bed files:
A.bed
chr1 1090377 1090381 1 1 +
chr1 1090377 1090381 1 1 +
chr1 1090415 1090419 1 1 +
chr1 1090425 1090429 1 1 +
chr1 1090442 1090446 1 1 -
chr1 1090575 1090579 1 1 -
chr1 1090661 1090665 1 1 +
chr1 1090744 1090748 1 1 +
chr1 1090747 1090751 1 1 -
chr1 1090815 1090819 1 1 +
B.bed
chr1 1090351 1096351 1093351 1 +
chr1 1437425 1443425 1440425 1 +
chr1 1837483 1843483 1840483 1 +
chr1 6792385 6798385 6795385 1 +
chr1 6800919 6806919 6803919 1 +
chr1 8011248 8017248 8014248 1 +
chr1 8061773 8067773 8064773 1 +
chr1 8097782 8103782 8100782 1 +
chr1 8103290 8109290 8106290 1 +
chr1 8104835 8110835 8107835 1 +
and I want to find all intervals that are both in A and B. I used bedtools version v2.26.0 intersect for it:
bedtools intersect -wa -a A.bed -b B.bed
and got:
chr1 1090377 1090381 1 1 +
chr1 1090377 1090381 1 1 +
chr1 1090415 1090419 1 1 +
chr1 1090425 1090429 1 1 +
chr1 1090442 1090446 1 1 -
chr1 1090575 1090579 1 1 -
chr1 1090661 1090665 1 1 +
chr1 1090744 1090748 1 1 +
chr1 1090747 1090751 1 1 -
chr1 1090815 1090819 1 1 +
However, when I tried to force strandedness by adding -s
to the command:
bedtools intersect -wa -a A.bed -b B.bed -s
I got no result.
What could be the reason for it?
Are you sure that you show us the correct content of
A.bed
? The coordinates are much smaller than those byB.bed
.fin swimmer
Yes, I know, but that what I want to get eventually.
??
The both files you show have no overlap. Even without having a look on the strands.
The output of
$ bedtools intersect -wa -a A.bed -b B.bed
is also empty.I edited the post, but those are only the first 10 lines, actually, they have overlap, as you can see in the first result.
Ok, but please show us lines that should overlap. Without it is impossible to test.
BTW: Standard question: What version of bedtools are you using?
I am using version: v2.26.0
Current version is v2.27.1. But I've tested your updated example data in both version and it works for me
and
Do you get an output with the subset example you've posted? If so than your original bed file is corrupted somehow.
That's really weird, and yes, for the example I posted I get an output as I posted either.
can confirm finswimmer ' s observation with OP data:
Even with bedtools version v2.25.0: