Find the closest feature to a given set of genomic regions
ClosestFeature(regions, annotation, ...)
regions | A set of genomic regions to query |
---|---|
annotation | A GRanges object containing annotation information. |
... | Additional arguments passed to |
Returns a dataframe with the name of each region, the closest feature in the annotation, and the distance to the feature.
# \donttest{ ClosestFeature( regions = head(rownames(atac_small)), annotation = StringToGRanges( head(rownames(atac_small)), sep = c(':', '-')), sep = c(":", "-") )#> closest_region query_region distance #> 1 chr1:565107-565550 chr1:565107-565550 0 #> 2 chr1:569174-569639 chr1:569174-569639 0 #> 3 chr1:713460-714823 chr1:713460-714823 0 #> 4 chr1:752422-753038 chr1:752422-753038 0 #> 5 chr1:762106-763359 chr1:762106-763359 0 #> 6 chr1:779589-780271 chr1:779589-780271 0# }