View source: R/GRanges-utils.R
intOverWidth | R Documentation |
Compute the fraction of a query genomic interval that overlaps with another set of genomic intervals. We divide the total width of the intersection with the width of the query.
intOverWidth(query, subject)
query |
a |
subject |
a |
A numeric vector of the same length as the query
GRanges
library(GenomicRanges)
autosomes <- function() paste0("chr", 1:22)
del <- GRanges(c("chr1", "chr2"), IRanges(c(1, 1), c(10, 10)))
filters <- GRanges(c("chr1", "chr2"), IRanges(c(5, 8), c(20, 10000)))
test <- intOverWidth(del, filters)
identical(test, c(0.6, 0.3))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.