Let's say I have three files A.bed, B.bed and C.bed which are having coordinates of peaks. Using bed-tools intersect I got common peaks or I guess those are common.
My question is: Is there any other way using bed-tools by which I can find the exact common peaks from all the three files ?
Can you please define better the "exact common peaks"?
If you mean to have 100% overlap, you can do this by using the parameters -f 1 to match 100% the file1 or -F 1 to match 100% the file2. If you want to set different % of overlap just try to adjust the values between 0-1 (e.g 0.2 is 20%)
However, I have to tell you that I don t agree with this strategy, since it is practically impossible to get sooooo precise coordinates during peak calling amongst different samples
The thing is i have different replicates of same experiment and to get significant peaks i'm using this approach as if same peak is coming in all the three files it has more chances to be called as significant peak.
In that way i have to find same peaks through out three files and manually it is not doable. so which way should i go to filter out common peaks in three files
I tried doing A.bed vs B.bed and the result of A and B, with C.bed this is giving me some replicates in the end result file
But I still believe that it is impossible to get the exact start and end position in you replicates. Maybe you should try to decrease the level of strictness (50% overlap or less).
I don t know why you get those duplicates. This depends on the output file parameters you set, like -wa -wb etc.
Can you post some example?
The thing is i have different replicates of same experiment and to get significant peaks i'm using this approach as if same peak is coming in all the three files it has more chances to be called as significant peak.
In that way i have to find same peaks through out three files and manually it is not doable. so which way should i go to filter out common peaks in three files
I tried doing A.bed vs B.bed and the result of A and B, with C.bed this is giving me some replicates in the end result file
But I still believe that it is impossible to get the exact start and end position in you replicates. Maybe you should try to decrease the level of strictness (50% overlap or less).
I don t know why you get those duplicates. This depends on the output file parameters you set, like -wa -wb etc. Can you post some example?
I havn't used any strictness and this is the command i used
bedtools intersect -a A.bed -b B.bed > Inter.bed bedtools intersect -a Inter.bed -b C.bed > Final.bed
Using this my logic is the common peaks from A and B i can get common peak from C
Yes that s true. In that case you report the common peaks as the fraction of overlap:
By default, if an overlap is found, bedtools intersect reports the shared interval between the two overlapping features
You can also use the multiple file function