I have four BED files with data from different conditions (let's say A B C and D). I want to make a file (using bedtools subtract) that have those regions specific to A. Since bedtools subtract works pairwise, I should do (manual example):
bedtools subtract -a A.bed –b B.bed > temp1.bed bedtools subtract -a temp1.bed –b C.bed > temp2.bed bedtools subtract -a temp2.bed –b D.bed > only_A.bed
By any chance bedtools has a way of doing it for multiple files? such as
bedtools subtract -a A.bed –b B.bed C.bed D.bed > only_A.bed
On its manual entry is not very clear, but they have done it for other tools such as intersect. Thank you !