Dfference between intersectBed and multiIntersectBed
When I compare the two bed files using intersectBed and multiIntersectBEd, I see different results like:
multiIntersectBed -i R1_merge.bg R2_merge.bg | grep "gi|589289284|ref|NW_006711693.1|"
gi|589289284|ref|NW_006711693.1| 43585 43665 1 1 1 0
gi|589289284|ref|NW_006711693.1| 43585 43665 1 2 0 1
intersectBed -a R1_merge.bg -b R2_merge.bg | grep "gi|589289284|ref|NW_006711693.1|"
gi|589289284|ref|NW_006711693.1| 43585 43665
From multiIntersectBed, I am expecting something like:
gi|589289284|ref|NW_006711693.1| 43585 43665 2 1,2 1 1
Though the coordinates are the same, I do not understand why multiIntersectBed showing them in two separate lines ? I could not figure out the problem here.
• 3,676 views
•
link
1 answer
Not to leave it as an open question, I'm answering it.
Intersectbed can also work without sorting the bed file. But multiintersectBed requires sorted bed file.
• 0 views
•
link
Log in to answer this question.
It works after sorting both the files again. But I do not understand how the intersectBed is working without sorting.
The
intersecttool has alternate, tree-based method for finding intersections without sorting. It is slower and requires more memory, however.That's interesting. Thanks.