% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/addAnnotationToTSR.R
\docType{methods}
\name{addAnnotationToTSR}
\alias{addAnnotationToTSR}
\alias{addAnnotationToTSR,tssObject,character,numeric,numeric,numeric,character,character,logical-method}
\title{\strong{addAnnotationToTSR}}
\usage{
addAnnotationToTSR(experimentName, tsrSetType, tsrSet = 1, upstreamDist,
  downstreamDist, feature, featureColumnID, writeTable = TRUE)


  \S4method{addAnnotationToTSR}{tssObject,character,numeric,numeric,numeric,character,character,logical}(experimentName,
  tsrSetType, tsrSet = 1, upstreamDist = 1000, downstreamDist = 200,
  feature = "gene", featureColumnID = "ID", writeTable = TRUE)
}
\arguments{
\item{experimentName}{an object of class \emph{tssObject} with occupied
data slots \emph{@tsrData} (and/or \emph{@tsrDataMerged}).
The \emph{tssObject} must alrady have an annotation attached to the slot
\emph{@annotation}, which is provided by either
\code{\link{importAnnotationExternal}} or
\code{\link{importAnnotationHub}}.}

\item{tsrSetType}{Specifies the type of TSR set to be processed.
Options are "replicates" or "merged".}

\item{tsrSet}{Number of the data set (of type \emph{tsrSetType}) to be
processed. (numeric)}

\item{upstreamDist}{the maximum distance (in bp) upstream of the selected
interval necessary to associate a TSR with a given annotation. (numeric)}

\item{downstreamDist}{the maximum distance (in bp) downstream of the start
of the selected interval to associate a TSR with a given annotation.
(numeric)}

\item{feature}{Specifies the feature to be used for annotation
(typically "gene" [default] or "mRNA" for GFF3 input); set to "all" if all
annotations from the input are to be used. (character)}

\item{featureColumnID}{Name of the column identifier in the
\linkS4class{GRanges} annotation object. This should be "ID" (default) for
GFF3 input or "name" for bed input. (character)}

\item{writeTable}{logical, specifying whether the output should be written
to a tab-delimited file. Defaults to TRUE.}
}
\value{
addAnnotationToTSR adds feature annotation to the (merged)
\emph{@tsrData} data frame and returns the updated \emph{tssObject}.
}
\description{
\code{addAnnotationToTSR} associates an identified promoter
with a given gene, if found upstream and on the same strand within
a specified range.
}
\note{
An example similar to the this one can be found
in the vignette (/inst/doc/TSRchitect.Rmd)
}
\examples{
load(system.file("extdata", "tssObjectExample.RData",
package="TSRchitect"))
tssObjectExample <- addAnnotationToTSR(experimentName=tssObjectExample,
tsrSetType="merged", tsrSet=1, upstreamDist=1000, downstreamDist=200,
feature="transcript", featureColumnID="ID", writeTable=FALSE)
#if the object attached to @annotation is a gff/gff3 file

}
