Loop bedtools command over multiple files
1
0
Entering edit mode
6.9 years ago

I need to loop through bedtools over multiple files. There are 40 files that i should perform bedtools intersect with another file on shell. This is what i gave:

for i in temp*
do
bedtools intersect -a A.bed -b $i -v
done

However, this did not work. Is there anyother way that this can be done?

software error • 2.1k views
ADD COMMENT
0
Entering edit mode

Try putting the -v before the -a.

ADD REPLY
4
Entering edit mode
6.9 years ago

Without using a loop:

$ bedops --not-element-of 1 A.bed temp*.bed > answer.bed
ADD COMMENT

Login before adding your answer.

Traffic: 3070 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