% Generated by roxygen2 (4.1.0): do not edit by hand
% Please edit documentation in R/computeDMRs.R
\name{analyseReadsInsideRegionsForCondition}
\alias{analyseReadsInsideRegionsForCondition}
\title{Analyse reads inside regions for condition}
\usage{
analyseReadsInsideRegionsForCondition(regions, methylationData, context,
  label = "", cores = 1)
}
\arguments{
\item{regions}{a \code{\link{GRanges}} object with a list of regions on the
genome; e.g. could be a list of DMRs}

\item{methylationData}{the methylation data in one condition
(see \code{\link{methylationDataList}}).}

\item{context}{the context in which to extract the reads (\code{"CG"},
\code{"CHG"} or \code{"CHH"}).}

\item{label}{a string to be added to the columns to identify the condition}

\item{cores}{the number of cores used to compute the DMRs.}
}
\value{
a \code{\link{GRanges}} object with additional four metadata columns
\describe{
 \item{sumReadsM}{the number of methylated reads}
 \item{sumReadsN}{the total number of reads}
 \item{proportion}{the proportion methylated reads}
 \item{cytosinesCount}{the number of cytosines in the regions}
}
}
\description{
This function extracts from the methylation data the total number of reads,
the number of methylated reads and the number of cytosines in the specific
context from a region (e.g. DMRs)
}
\examples{
# load the methylation data
data(methylationDataList)

#load the DMRs in CG context. These DMRs were computed with minGap = 200.
data(DMRsNoiseFilterCG)

#retrive the number of reads in CHH context in WT
DMRsNoiseFilterCGreadsCHH <- analyseReadsInsideRegionsForCondition(
                             DMRsNoiseFilterCG[1:10],
                             methylationDataList[["WT"]], context = "CHH",
                             label = "WT")
}
\author{
Nicolae Radu Zabet
}
\seealso{
\code{\link{filterDMRs}}, \code{\link{computeDMRs}},
\code{\link{DMRsNoiseFilterCG}}, and \code{\link{mergeDMRsIteratively}}
}

