clean_beta {MEAT} | R Documentation

## Clean beta-matrix.

### Description

`clean_beta` reduces the beta-matrix stored in the input SummarizedExperiment object `SE` to the right CpGs, imputes missing values if any, and replaces 0 and 1 with min and max values.

### Usage

    clean_beta(SE = NULL, version = "MEAT2.0")

### Arguments

`SE` | A `SummarizedExperiment-class` object. The "assays" component of `SE` should contain a beta-matrix of DNA methylation beta-values called "beta", with samples in columns and CpGs in rows. `SE` may optionally contain annotation information on the CpGs stored in "rowData" and sample phenotypes stored in "colData".
`version` | A character specifying which version of the epigenetic clock you would like to use. Dy default, `version` is set to "MEAT2.0" for the second version of the epigenetic clock. If you would like to use the original version, set `version` to "MEAT".

### Details

`clean_beta` will transform the the beta-matrix stored in `SE` by:

1. reducing it to the CpGs used to calibrate DNA methylation profiles to the gold standard. By default, `clean_beta` will reduce your beta-matrix to the 18,666 CpGs used in the updated version of MEAT (MEAT 2.0). If you would like to use the original version of MEAT, `clean_beta` will reduce your data to the 19,401 CpGs that are in common between the 12 datasets from the original publication.

2. checking whether it contains missing values, and impute them with `impute.knn`,

3. check whether it contains 0 and 1 values, and if any, change them to the minimum non-0 and maximum non-1 values in the beta-matrix.

### Value

A clean version of the input `SE` reduced to the right CpGs, with missing values imputed, and without 0 or 1 values.

### See Also

`impute.knn` for imputation of missing values, and `SummarizedExperiment-class` for more details on how to create and manipulate SummarizedExperiment objects.

### Examples

    # Load matrix of beta-values of two individuals from dataset GSE121961
    data("GSE121961", envir = environment())
    # Load phenotypes of the two individuals from dataset GSE121961
    data("GSE121961_pheno", envir = environment())

    # Create a SummarizedExperiment object to coordinate phenotypes and
    # methylation into one object.
    library(SummarizedExperiment)
    GSE121961_SE <- SummarizedExperiment(assays=list(beta=GSE121961),
    colData=GSE121961_pheno)

    # Run clean_beta() to clean the beta-matrix
    GSE121961_SE_clean <- clean_beta(SE = GSE121961_SE, version = "MEAT2.0")

[Package MEAT version 1.0.4 Index]