Skip to content

Commit b416148

Browse files
committed
add suport for GRangesList
1 parent 9f866a1 commit b416148

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

R/nearest-genes.R

+5
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
#' queryAnnotated = calcNearestGenes(query, TSS_hg19)
1717
calcNearestGenes = function(query, annotations, gene_name_key="gene_id", gene_type_key="gene_biotype") {
1818
.validateInputs(list(query=c("GRanges","GRangesList")))
19+
if (is(query, "GRangesList")) {
20+
# Recurse over each GRanges object
21+
x = lapply(query, calcFeatureDist, features)
22+
return(x)
23+
}
1924

2025
# calculate the nearest annotations to given query
2126
nearestIds = nearest(query, annotations)

0 commit comments

Comments
 (0)