Hi all,
I am currently analyzing chip-seq data for two TFs. I want to find out overlapping as well as unique peaks between these two TFs. Im using the package ChIPpeakAnno. The thing is I have this code in R that finds the overlapping peaks but I can't seem to get the unique ones out of it:
overlap=function(x,y){
peaks1=RangedData(IRanges(start=x$V2,end=x$V3),space=as.character(x$V1))
peaks2=RangedData(IRanges(start=y$V2,end=y$V3),space=as.character(y$V1))
t1 = findOverlappingPeaks(peaks1, peaks2, maxgap=2000,NameOfPeaks1="TF1", NameOfPeaks2="TF2", select="all", annotate=1, multiple=TRUE)
return(t1)
}
overlapping_peaks=overlap(TF1, TF2)
TF1-TF2= TF1[ !(overlapping_peaks),]
I can't seem to make this ! work. I want to exclude all the peaks which overlap and get all the ones unique in TF1.
Any suggestions on how to make it work. Should I use match somehow?
The files look like this:
TF1 and TF2 look like this:
chr start end
1 chr1 85571823 85575093
2 chr1 78834350 78837116
3 chr1 2872978 2875530
4 chr1 50641235 50643585
5 chr1 37698343 37699420
6 chr1 37698343 37699420
overlapping_peaks file:
chr start end
1 chr1 79092406 79094792
2 chr1 198383685 198385392
3 chr1 200988993 200993982
4 chr1 63836348 63842294
Thanks a lot!!!
I digged bedpost little bit. Its a great program in terms of finding overlaps of my chip seq peaks. However, I couldnt find how to implement peak density values to the bedops. Those values are also as important as the locations of the peaks. Could you help me about that ?