Bedtools - can I operate two operations same time, and on the same database?
1
0
Entering edit mode
3.6 years ago
Waly • 0

Hi everyone,

I'm using the bedtools to find the closest hits between 2 databases and merge them to one file, but I wonder if I can have a command that operates for example; closest + intersect on the same database and same time; is this possible? can anyboday help me with the right commands?

thanks!

bedtools • 619 views
ADD COMMENT
1
Entering edit mode
3.6 years ago

If you can use BEDOPS tools, you can use pipes and process substitutions pretty easily.

For instance:

$ bedops --intersect <(closest-features --closest A.bed query.bed) B.bed > answer.bed

Or:

$ closest-features --closest <(bedops --intersect A.bed B.bed) query.bed > answer.bed

Or:

$ closest-features --closest A.bed query.bed | bedops --intersect - B.bed > answer.bed

Or:

$ bedops --intersect A.bed B.bed | closest-features --closest - query.bed > answer.bed

Etc.

It just depends on what you're trying to do. Your question might be a little unclear, in that an intersection operation on two sets A and B will calculate elements which are always zero units away from B. Feel free to clarify what you're trying to do, if that's not the case.

ADD COMMENT

Login before adding your answer.

Traffic: 1457 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6