% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/utils.R
\name{optimizeReads}
\alias{optimizeReads}
\title{Find optimized subset of valid reads}
\usage{
optimizeReads(grl, reads)
}
\arguments{
\item{grl}{a \code{\link{GRangesList}} or GRanges object}

\item{reads}{a GRanges, GAlignment or GAlignmentPairs object}
}
\value{
the reads as GRanges,  GAlignment or GAlignmentPairs
}
\description{
Keep only the ones that overlap within the grl ranges.
Also sort them in the end
}
\seealso{
Other utils: 
\code{\link{bedToGR}()},
\code{\link{convertToOneBasedRanges}()},
\code{\link{export.bed12}()},
\code{\link{export.bigWig}()},
\code{\link{export.fstwig}()},
\code{\link{export.wiggle}()},
\code{\link{fimport}()},
\code{\link{findFa}()},
\code{\link{fread.bed}()},
\code{\link{readBam}()},
\code{\link{readBigWig}()},
\code{\link{readWig}()}
}
\concept{utils}
\keyword{internal}
