Learn R Programming

DMRcate (version 1.8.6)

cpg.annotate: Annotate CpGs with their chromosome position and test statistic

Description

Either: - Annotate a matrix of M-values (logit transform of beta) representing 450K or EPIC data with probe weights (depending on analysis.type) and chromosomal position, or - Standardise this information from DSS:::DMLtest() to the same data format.

Usage

cpg.annotate(datatype = c("array", "sequencing"), object, annotation=c(array = "IlluminaHumanMethylation450k", annotation = "ilmn12.hg19"), analysis.type = c("differential", "variability"), design, contrasts = FALSE, cont.matrix = NULL, fdr = 0.05, coef, ...)

Arguments

datatype
Character string representing the type of data being analysed.
object
Either: - A matrix of M-values, with unique Illumina probe IDs as rownames and unique sample IDs as column names or, - Output from DSS:::DMLtest().
annotation
A vector describing the type of annotation to affix to object. Identical context to minfi, i.e. annotation <- annotation(minfiobject) where minfiobject is a [Genomic](Methyl|Ratio)Set). Argument for 450K arrays: c(array = "IlluminaHumanMethylation450k", annotation = "ilmn12.hg19"). Argument for EPIC arrays: c(array = "IlluminaHumanMethylationEPIC", annotation = "ilm10b2.hg19"). An error will be thrown if you attempt one on an object with rownames on the other, due to non-overlapping probes on both platforms. Only applicable when datatype="array".
analysis.type
"differential" for dmrcate() to return DMRs and "variability" to return VMRs. Only applicable when datatype="array".
design
Study design matrix. Identical context to differential analysis pipeline in limma. Must have an intercept if contrasts=FALSE. Applies only when analysis.type="differential". Only applicable when datatype="array".
contrasts
Logical denoting whether a limma-style contrast matrix is specified. Only applicable when datatype="array".
cont.matrix
Limma-style contrast matrix for explicit contrasting. For each call to cpg.annotate, only one contrast will be fit. Only applicable when datatype="array".
fdr
FDR cutoff (Benjamini-Hochberg) for which CpG sites are individually called as significant. Used only to determine effect size, and not for downstream thresholding.
coef
The column index in design corresponding to the phenotype comparison. Corresponds to the comparison of interest in design when contrasts=FALSE, otherwise must be a column name in cont.matrix. Applies only when analysis.type="differential" and when datatype="array".
...
Extra arguments passed to the limma function lmFit(). Applies only when analysis.type="differential" and when datatype="array".

Value

An object of class "annot", for passing to dmrcate, containing the vectors:
  • ID: Illumina probe ID or row number
  • stat: t-statistic or Wald statistics between phenotypes for each CpG
  • CHR: Chromosome which the CpG maps to
  • pos: Genomic coordinate (on CHR) that the CpG maps to
  • betafc: The beta fold change according to the given design
  • indfdr: Individually-derived FDRs for each CpG
  • is.sig: Logical denoting either significance from fdr (analysis.type="differential") or top ventile of variable probes (analysis.type="variability")

References

Smyth, G. K. (2005). Limma: linear models for microarray data. In: Bioinformatics and Computational Biology Solutions using R and Bioconductor, R. Gentleman, V. Carey, S. Dudoit, R. Irizarry, W. Huber (eds.), Springer, New York, pages 397-420.

Feng, H., Conneely, K. N., & Wu, H. (2014). A Bayesian hierarchical model to detect differentially methylated loci from single nucleotide resolution sequencing data. Nucleic Acids Research, 42(8), e69.

Peters T.J., Buckley M.J., Statham, A., Pidsley R., Samaras K., Lord R.V., Clark S.J. and Molloy P.L. De novo identification of differentially methylated regions in the human genome. Epigenetics & Chromatin 2015, 8:6, doi:10.1186/1756-8935-8-6.

Examples

Run this code
## Not run: 
# data(dmrcatedata)
# myMs <- logit2(myBetas)
# myMs.noSNPs <- rmSNPandCH(myMs, dist=2, mafcut=0.05)
# patient <- factor(sub("-.*", "", colnames(myMs)))
# type <- factor(sub(".*-", "", colnames(myMs)))
# design <- model.matrix(~patient + type) 
# myannotation <- cpg.annotate("array", myMs.noSNPs, analysis.type="differential",
#     design=design, coef=39)
# ## End(Not run)

Run the code above in your browser using DataLab