GR_to_UM: Green/Red to Unmethylated/Methylated

View source: R/GR_to_UM.R

GR_to_UMR Documentation

Green/Red to Unmethylated/Methylated

Description

Transforms Green/Red fluorescence signals into Unmethylated/Methylated channels

Usage

GR_to_UM(Red = NULL, Grn = NULL, rgSet, what = NULL, nBeads = NULL)

Arguments

Red

Mean or SD Red fluorescence intensity matrix (probes as rows, samples as columns)

Grn

Mean or SD Green fluorescence intensity matrix (probes as rows, samples as columns)

rgSet

An rgSet object imported by minfi (see minfi::read.metharray.exp for details)

what

Either 'Mean', 'SD' or 'NBeads'

nBeads

A matrix containing the number of beads (probes as rows, samples as columns)

Details

Illumina DNA methylation microarrays detection rely on three types of probes:

  • type-I Red: 2 probes/addresses per CpG, informative on the Red channel exclusively.

  • type-I Green: 2 probes/addresses per CpG, informative on the Green channel exclusively.

  • type-II: 1 probe/address per CpG, informative in both Green and Red channels.

When what is equal to "SD" or "Mean", Methylated and unmethylated intensities are computed as followed:

Methylated Unmethylated
Type-II Green (addressA) Red (addressA)
Type-I Red Red (addressB) Red (addressA)
Type-I Green Green (addressB) Green (addressA)

Also, due to the beadchip technology, each probe has been assigned to a random number of beads. If what == "NBeads", it converts the number of beads per probe and per sample to the number of beads per CpG and per sample. This requires a criteria for type-I probes for which 2 probes target the same CpG. In this case,the minimum number between the two probes targetting a type-I probe is chosen.

Value

A list including matrices M and U (CpGs as rows, samples as columns) when what is "Mean" or "SD" and or a matrix nBeads, containing number of beads (CpGs as rows, samples as columns) when what is equal to "NBeads".

Examples

# Read IDAT files. Without the extended option, SD cannot be acquired
rgSet <- read.metharray.exp(getwd(), extended = TRUE)

# Green/Red mean to Unmethylated/Methylated mean intensities
Grn <- assay(rgSet, "Green")
Red <- assay(rgSet, "Red")
UM <- GR_to_UM(Red = Red, Grn = Grn, rgSet = rgSet, what = "Mean")

# Green/Red SD to Unmethylated/Methylated intensity SDs
GrnSD <- assay(rgSet, "GreenSD")
RedSD <-assay(rgSet, "RedSD")
UM_SD <- GR_to_UM(Red = RedSD, Grn = GrnSD, rgSet = rgSet, what = "SD")

# nBeads in probes to nBeads per CpG
nBeads <- assay(rgSet, "NBeads")
nBeads <- GR_to_UM(nBeads = nBeads, rgSet = rgSet, what = "NBeads")

BenjaminPlanterose/UMtools documentation built on Aug. 19, 2024, 4:54 a.m.