% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
\name{get_nearest_annotation}
\alias{get_nearest_annotation}
\title{Compute the nearest annotation to the annoated genes in brainflowprobes}
\usage{
get_nearest_annotation(gr, CODING_ONLY = FALSE)
}
\arguments{
\item{gr}{A \link[GenomicRanges:GRanges-class]{GenomicRanges::GRanges()} object.}

\item{CODING_ONLY}{A logical vector of length 1 specifying whether to
subset the Annotated Genes to only the coding genes. That is, whether to
subset the genes by whether they have a non-NA \code{CSS} value. The Annotated
Genes are downloaded with \code{\link[GenomicState:GenomicStateHub]{GenomicState::GenomicStateHub()}}.}
}
\value{
The \code{\link[bumphunter:matchGenes]{bumphunter::matchGenes()}} output for the annotation information
using the Annotated Genes for Gencode version 31 on hg19 coordinates (subset
to only the coding elements if \code{CODING_ONLY} was set to \code{TRUE}).
}
\description{
For a given set of genomic regions, this function computes the nearest
annotation information using the Annotated Genes required by this package.
The Annotated Genes are actually provided by
\code{\link[GenomicState:GenomicStateHub]{GenomicState::GenomicStateHub()}}.
}
\details{
This is an utility function used by \link{region_info}, \link{four_panels}
and \link{plot_coverage}.
}
\examples{

gr <- GenomicRanges::GRanges("chr10:135379301-135379311:+")

get_nearest_annotation(gr)
get_nearest_annotation(gr, CODING_ONLY = TRUE)
}
\author{
Leonardo Collado-Torres
}
