Entering edit mode
4.3 years ago
brown.annaleigh
▴
10
I would like to extract only regions which exactly match another bed
So I have a regions of interest bed which defines regions, I want to extract only exact matches to these regions
cat regions_of_interest.bed
chr8 79611214 79636802 annotated 0 -
chr8 79611214 79616823 abnormal 0 -
Trying with bedops extracts the regions which also have overlap with these regions
bedops -e 1 target.sorted.bed regions_of_interest.bed
Returns
chr8 79611214 79613670 target.sorted.bed 3 +
chr8 79611214 79613823 target.sorted.bed 178 +
chr8 79611214 79615702 target.sorted.bed 3 +
chr8 79611214 79616054 target.sorted.bed 6 +
Bedtools intersect also returns any overlap
bedtools intersect -a target.sorted.bed -b regions_of_interest.bed
chr8 79611214 79613670 target.sorted.bed 3 +
chr8 79611214 79613670 target.sorted.bed 3 +
chr8 79611214 79613823 target.sorted.bed 178 +
chr8 79611214 79613823 target.sorted.bed 178 +
chr8 79611214 79615702 target.sorted.bed 3 +
chr8 79611214 79615702 target.sorted.bed 3 +
chr8 79611214 79616054 target.sorted.bed 6 +
chr8 79611214 79616054 target.sorted.bed 6 +
Ideally the function would work like this
differenttool intersect -a target.sorted.bed -b regions_of_interest.bed
chr8 79611214 79613823 target.sorted.bed 178 +
chr8 79611214 79636802 target.sorted.bed 2996 +