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