data(H3K27Ac, package = "MAnorm2")
attr(H3K27Ac, "metaInfo")
## Fit and plot a mean-variance curve for GM12891 and GM12892 cell lines.
# \donttest{
# Perform the MA normalization and construct bioConds to represent
# individuals.
norm <- normalize(H3K27Ac, 5:6, 10:11)
norm <- normalize(norm, 7:8, 12:13)
conds <- list(GM12891 = bioCond(norm[5:6], norm[10:11], name = "GM12891"),
GM12892 = bioCond(norm[7:8], norm[12:13], name = "GM12892"))
autosome <- !(H3K27Ac$chrom %in% c("chrX", "chrY"))
conds <- normBioCond(conds, common.peak.regions = autosome)
# Fit mean-variance trend based on the presumed parametric form.
conds <- fitMeanVarCurve(conds, method = "parametric", occupy.only = TRUE)
summary(conds[[1]])
# Plot the fitted mean-variance curve.
plotMeanVarCurve(conds, subset = "occupied")
# Use different colors for the two bioConds, to see if the mean-variance
# points from the two cell lines mix uniformly with each other.
plotMeanVarCurve(conds, subset = "occupied",
col = scales::alpha(c("blue", "green3"), 0.02))
# }
Run the code above in your browser using DataLab