Description Usage Arguments Value Details References See Also Examples
The function calculates differential methylation statistics between two groups of samples. The function uses either logistic regression test or Fisher's Exact test to calculate differential methylation. See the rest of the help page and references for detailed explanation on statistics.
1 2 3 4 5 6 7 8 9 10 11 12 13 14  calculateDiffMeth(.Object, covariates = NULL, overdispersion = c("none",
"MN", "shrinkMN"), adjust = c("SLIM", "holm", "hochberg", "hommel",
"bonferroni", "BH", "BY", "fdr", "none", "qvalue"), effect = c("wmean",
"mean", "predicted"), parShrinkMN = list(), test = c("F", "Chisq"),
mc.cores = 1, slim = TRUE, weighted.mean = TRUE, chunk.size = 1e+06,
save.db = FALSE, ...)
## S4 method for signature 'methylBaseDB'
calculateDiffMeth(.Object, covariates = NULL,
overdispersion = c("none", "MN", "shrinkMN"), adjust = c("SLIM", "holm",
"hochberg", "hommel", "bonferroni", "BH", "BY", "fdr", "none", "qvalue"),
effect = c("wmean", "mean", "predicted"), parShrinkMN = list(),
test = c("F", "Chisq"), mc.cores = 1, slim = TRUE,
weighted.mean = TRUE, chunk.size = 1e+06, save.db = TRUE, ...)

.Object 
a 
covariates 
a 
overdispersion 
If set to "none"(default), no overdispersion correction will be attempted. If set to "MN", basic overdispersion correction, proposed by McCullagh and Nelder (1989) will be applied.This correction applies a scaling parameter to variance estimated by the model. EXPERIMENTAL: If set to "shrinkMN", scaling parameter will be shrunk towards a common value (not thoroughly tested as of yet). 
adjust 
different methods to correct the pvalues for multiple testing.
Default is "SLIM" from methylKit. For "qvalue" please see

effect 
method to calculate the mean methylation different between groups using read coverage as weights (default). When set to "mean", the generic mean is applied and when set to "predicted", predicted means from the logistic regression model is used for calculating the effect. 
parShrinkMN 
a list for squeezeVar(). (NOT IMPLEMENTED) 
test 
the statistical test used to determine the methylation differences. The Chisqtest is used by default, while the Ftest can be chosen if overdispersion control ist applied. 
mc.cores 
integer denoting how many cores should be used for parallel differential methylation calculations (can only be used in machines with multiple cores). 
slim 
If set to FALSE, 
weighted.mean 
If set to FALSE, 
chunk.size 
Number of rows to be taken as a chunk for processing the

save.db 
A Logical to decide whether the resulting object should be saved as flat file database or not, default: explained in Details section. 
... 
optional Arguments used when save.db is TRUE

a methylDiff
object containing the differential methylation
statistics and locations for regions or bases
Covariates can be included in the analysis. The function will then try to
separate the
influence of the covariates from the treatment effect via a linear model.
The Chisqtest is used per default only when no overdispersion correction is
applied.
If overdispersion correction is applied, the function automatically switches
to the
Ftest. The Chisqtest can be manually chosen in this case as well, but the
Ftest only
works with overdispersion correction switched on.
The parameter chunk.size
is only used when working with
methylBaseDB
objects, as they are read in chunk by chunk to enable
processing largesized objects which are stored as flat file database.
Per default the chunk.size is set to 1M rows, which should work for most systems.
If you encounter memory problems or
have a high amount of memory available feel free to adjust the chunk.size
.
The parameter save.db
is per default TRUE for
methylDB objects as methylBaseDB
,
while being per default FALSE for methylBase
.
If you wish to save the result of an
inmemorycalculation as flat file database or if the size of the database
allows the calculation inmemory,
then you might want to change the value of this parameter.
Altuna Akalin, Matthias Kormaksson, Sheng Li, Francine E. GarrettBakelman, Maria E. Figueroa, Ari Melnick, Christopher E. Mason. (2012). "methylKit: A comprehensive R package for the analysis of genomewide DNA methylation profiles." Genome Biology.
McCullagh and Nelder. (1989). Generalized Linear Models. Chapman and Hall. London New York.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29  data(methylKit)
# The Chisqtest will be applied when no overdispersion control is chosen.
my.diffMeth=calculateDiffMeth(methylBase.obj,covariates=NULL,
overdispersion=c("none"),
adjust=c("SLIM"))
# pool samples in each group
pooled.methylBase=pool(methylBase.obj,sample.ids=c("test","control"))
# After applying the pool() function, there is one sample in each group.
# The Fisher's exact test will be applied for differential methylation.
my.diffMeth2=calculateDiffMeth(pooled.methylBase,covariates=NULL,
overdispersion=c("none"),
adjust=c("SLIM"))
# Covariates and overdispersion control:
# generate a methylBase object with age as a covariate
covariates=data.frame(age=c(30,80,30,80))
sim.methylBase<dataSim(replicates=4,sites=1000,treatment=c(1,1,0,0),
covariates=covariates,
sample.ids=c("test1","test2","ctrl1","ctrl2"))
# Apply overdispersion correction and include covariates
# in differential methylation calculations.
my.diffMeth3<calculateDiffMeth(sim.methylBase,
covariates=covariates,
overdispersion="MN",test="Chisq",mc.cores=1)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.