well ,It seems not works well ,maybe I'm not good at bedtools software, I want to output the A file all information and B file not overlaps A file information .At last obtain a C file
Hello,
At present I have two files and want to remove some overlaps.
A file
chr1 transcript 156510 159981
chr1 transcript 156510 162275
chr1 transcript 156510 162275
chr4 transcript 979875 997688
chr5 transcript 983222 984521
B file
chr1 transcript 156670 159700
chr1 transcript 156410 162000
chr1 transcript 156510 16390
chr6 transcript 4744609 4745158
I want to obatin C file like this :
chr1 transcript 156670 159700
chr1 transcript 156410 162000
chr1 transcript 156510 16390
chr4 transcript 979875 997688
chr5 transcript 983222 984521
chr6 transcript 4744609 4745158
I am a new programmer and really need this result.
Thanks
Alex
2 answers
bedtools intersect : http://bedtools.readthedocs.io/en/latest/content/tools/intersect.html
Read documentation
As Pierre suggest, you can use bedtools intersect -v "that only report those entries in A that have no overlap in B". Is that what you want? or also you can use the option -wao that "write the original A and B entries plus the number of base pairs of overlap between the two features"
it's may can't obtain the ideal result,I want to obtain C file like this
A file
chr1 transcript 156510 159981
chr1 transcript 156510 162275
chr1 transcript 156510 162275
chr4 transcript 979875 997688
chr5 transcript 983222 984521
B file
chr1 transcript 156670 159700
chr1 transcript 156410 162000
chr1 transcript 156510 16390
chr6 transcript 4744609 4745158
**I want to obatin C file like this :
chr1 transcript 156670 159700
chr1 transcript 156410 162000
chr1 transcript 156510 16390
chr4 transcript 979875 997688
chr5 transcript 983222 984521
chr6 transcript 4744609 4745158
Well, in that case you can get the out file for bedtool and then you will merge with your original sample, remove the unique results and you will get it. You have to play with your files a bit to obtain the ideal result ;)
Log in to answer this question.