Question: Bedtools - can I operate two operations same time, and on the same database?
gravatar for Waly
12 weeks ago by
Waly0 wrote:

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?


bedtools • 202 views
ADD COMMENTlink modified 12 weeks ago by Alex Reynolds31k • written 12 weeks ago by Waly0
gravatar for Alex Reynolds
12 weeks ago by
Alex Reynolds31k
Seattle, WA USA
Alex Reynolds31k wrote:

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


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


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


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


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 COMMENTlink written 12 weeks ago by Alex Reynolds31k
Please log in to add an answer.


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