Thank you, I tried using bedtools, but it turns out lots of item are lost. In the case above, it only shows chr3 181879555 181879573
• 1 views
•
link
Hi, I have two bed files, say file A and file B.
File A:
File B:
How can I subtract the common items in A and B from A, and get bed file C as follow
Thanks a lot for your help.
use the following command to remove intersected `regions' of A and B from A:
bedtools subtract -a A.bed -b B.bed > C.bed
or if you just want to remove the shared `lines' from A:
awk -F'\t' 'BEGIN{OFS="\t"}NR==FNR{a[$0];next}{if(!($0 in a)){print}}' B.bed A.bed > C.bed
Try bedtools intersect -v -a A.bed -b B.bed: http://bedtools.readthedocs.io/en/latest/content/tools/intersect.html
Thank you, I tried using bedtools, but it turns out lots of item are lost. In the case above, it only shows chr3 181879555 181879573
Log in to answer this question.