% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
\name{convertToOneBasedRanges}
\alias{convertToOneBasedRanges}
\title{Convert a GRanges Object to 1 width reads}
\usage{
convertToOneBasedRanges(gr, method = "5prime", addScoreColumn = FALSE,
  addSizeColumn = FALSE, after.softclips = TRUE)
}
\arguments{
\item{gr}{GRanges, GAlignment Object to reduce}

\item{method}{the method to reduce, see info. (5prime defualt)}

\item{addScoreColumn}{logical (FALSE), if TRUE, add a score column that
sums up the hits per unique range This will make each read unique, so
that each read is 1 time, and score column gives the number of hits.
A useful compression.}

\item{addSizeColumn}{logical (FALSE), if TRUE, add a size column that
for each read, that gives original width of read. Useful if you need
original read lengths. This takes care of soft clips etc.}

\item{after.softclips}{logical (TRUE), TRUE: include softclips in size}
}
\value{
Converted GRanges object
}
\description{
There are 4 ways of doing this
1. Take 5' ends, reduce away rest (5prime)
2. Take 3' ends, reduce away rest (3prime)
3. Tile to 1-mers and include all (tileAll)
4. Take middle point per GRanges (middle)
}
\details{
Many other ways to do this have their own functions, like startSites and
stopSites etc.
To retain information on original width, set addSizeColumn to TRUE.
To compress data, 1 GRanges object per unique read, set addScoreColumn to
TRUE. This will give you a score column with how many duplicated reads there
were in the specified region.

NOTE: Does not support paired end reads for the moment!
}
\seealso{
Other utils: \code{\link{bedToGR}}, \code{\link{findFa}},
  \code{\link{fread.bed}}, \code{\link{optimizeReads}},
  \code{\link{readBam}}, \code{\link{readWig}}
}
\concept{utils}
