Open csijcs opened 2 years ago
@csijcs Thank you for trying ChIPpeakAnno to annotate your data. I have trouble in understanding your question. Could you please show me the sample to explain your question? Here may be something you want read: https://bioconductor.org/packages/release/bioc/vignettes/ChIPpeakAnno/inst/doc/FAQs.html#Find_Overlaps_of_Peaks
Intersecting with bedtools:
$ bedtools intersect -a file1.bed -b file2.bed | wc -l
1962
Using findOverlaps:
> findOverlaps(file1,file2)
Hits object with 1962 hits and 0 metadata columns:
Using findOverlapsOfPeaks:
> findOverlapsOfPeaks(file1,file2)$venn_cnt[4,3]
Counts
1956
Could you share the image by following codes:
ol <- findOverlapsOfPeaks(file1,file2, connectedPeaks='keepAll')
makeVennDiagram(ol)
sorry, I forget the parameters for venndiagram makeVennDiagram(ol, connectedPeaks='keepAll')
now try to run
ol <- findOverlaps(file1,file2)
length(unique(queryHits(ol)))
length(unique(subjectHits(ol)))
and share me the number
> length(unique(queryHits(ol)))
[1] 1961
> length(unique(subjectHits(ol)))
[1] 1957
I think you figure it out the difference. Let me know if you still have any questions.
Got it, thanks!
Thanks for the great tool!
I'm a bit unclear why there is a difference between the number of overlapping peaks found by bedtools overlap and findOverlaps (which find the exact same number of overlapping peaks), and that of findOverlapsOfPeaks, which seems to with miss a few of the peaks or filter them out. I am just running the functions with default parameters. I have tried altering the connectedPeaks parameter, but still get the same number of overlapping peaks. Can you tell me why there are missing peaks and how I can recover them?