This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How To Get All Entries Of B With Bedtools

Hi All,

Is there any way to get all the original B entry(even the ones for which there is no overlap with A as well) in intersectBed utility? I am trying to overlap two bed files. I need all the entry of file B which I put in -b options. I can not switch the file as the size of file A i.e in -a option is very very big.

Thanks

intersect bedtools

2 answers

Sort your A and B files first then use the -sorted flag. This will use far less memory, and should allow you to flip the A and B files as you suggest.

Just off the top of my head - you could add one long interval to you file A that covers the entirety of B. Later you can use the name of this artificial interval to distinguish between real and artificial overlaps.

Log in to answer this question.