rescale_minus1To1: Recode matrix

View source: R/EMmultigene.R

rescale_minus1To1R Documentation

Recode matrix

Description

Recode values in methylation matrix from a scale of 0 (no meth) to 1 (meth) to a scale of -1 (no meth) to 1 (meth). NaN are set to 0 and NAs can be either 0 or randomly assigned to -0.5 or 0.5

Usage

rescale_minus1To1(dataMatrix, randomiseNAs = F)

Arguments

dataMatrix

A matrix containing methylation values for a region of the genome using coordinates relative to an anchor point. dataMatrix[i,j] is the methylation value of sample i at position j. 0=not methylated, 1=methylated, NA=no methylation information at this position, NaN=non-methylatable positon.

randomiseNAs

if TRUE NAs randomly receive values between -0.5 and 0.5. If FALSE, NAs are encoded as 0

Value

Matrix with methylation values coded on a -1 to 1 scale


jsemple19/EMclassifieR documentation built on Aug. 12, 2022, 2:57 p.m.