# Convert a dataframe to GRanges object
data(sites)
alldata.rd <- makeGRanges(sites,soloStart=TRUE)
data(genes)
genes.rd <- makeGRanges(genes)
nearestGenes <- get2NearestFeature(alldata.rd,genes.rd,"NearestGene")
nearestGenes
nearestGenes <- get2NearestFeature(alldata.rd,genes.rd,"NearestGene",
side="5p")
nearestGenes
nearestGenes <- get2NearestFeature(alldata.rd,genes.rd,"NearestGene",
side="3p")
nearestGenes
Run the code above in your browser using DataLab