Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Differences between bedtools overlap / findOverlaps and findOverlapsOfPeaks #18

Open
csijcs opened this issue Apr 5, 2022 · 10 comments

Comments

@csijcs
Copy link

csijcs commented Apr 5, 2022

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?

@jianhong
Copy link
Owner

jianhong commented Apr 5, 2022

@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

@csijcs
Copy link
Author

csijcs commented Apr 6, 2022

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

@jianhong
Copy link
Owner

jianhong commented Apr 6, 2022

Could you share the image by following codes:

ol <- findOverlapsOfPeaks(file1,file2, connectedPeaks='keepAll')
makeVennDiagram(ol)

@csijcs
Copy link
Author

csijcs commented Apr 6, 2022

test.pdf

@jianhong
Copy link
Owner

jianhong commented Apr 6, 2022

sorry,
I forget the parameters for venndiagram
makeVennDiagram(ol, connectedPeaks='keepAll')

@csijcs
Copy link
Author

csijcs commented Apr 6, 2022

test.pdf

@jianhong
Copy link
Owner

jianhong commented Apr 6, 2022

now try to run

ol <- findOverlaps(file1,file2)
length(unique(queryHits(ol)))
length(unique(subjectHits(ol)))

and share me the number

@csijcs
Copy link
Author

csijcs commented Apr 6, 2022

> length(unique(queryHits(ol)))
[1] 1961
> length(unique(subjectHits(ol)))
[1] 1957

@jianhong
Copy link
Owner

jianhong commented Apr 6, 2022

I think you figure it out the difference. Let me know if you still have any questions.

@csijcs
Copy link
Author

csijcs commented Apr 6, 2022

Got it, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants