Last active
August 29, 2015 14:10
-
-
Save zero323/a380c7347c10414e8b52 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(GenomicRanges) | |
gr1 <- GRanges( | |
"chr1", strand="+", | |
IRanges(start = c(100, 200), end =c(200, 300)) | |
) | |
gr2 <- GRanges( | |
"chr1", strand="+", | |
IRanges(start = 0, end = 250) | |
) | |
# Use 'within' as a type parameter | |
hits <- findOverlaps(gr1, gr2, type = 'within') | |
gr1[queryHits(hits)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment