Skip to contents

Because gene body mCH proportions are negatively correlated with gene expression level in neurons, we need to reverse the direction of the methylation data. We do this by simply subtracting all values from the maximum methylation value. The resulting values are positively correlated with gene expression. This will only be applied to variable genes detected in prior.

Usage

reverseMethData(object, useDatasets, verbose = getOption("ligerVerbose", TRUE))

Arguments

object

A liger object, with variable genes identified.

useDatasets

Required. A character vector of the names, a numeric or logical vector of the index of the datasets that should be identified as methylation data where the reversed data will be created.

verbose

Logical. Whether to show information of the progress. Default getOption("ligerVerbose") or TRUE if users have not set.

Value

The input liger object, where the scaleData slot of the specified datasets will be updated with value as described in Description.

Examples

# Assuming the second dataset in example data "pbmc" is methylation data
pbmc <- normalize(pbmc, useDatasets = 1)
#>  Normalizing datasets "ctrl"
#>  Normalizing datasets "ctrl" ... done
#> 
pbmc <- selectGenes(pbmc, datasets.use = 1)
#>  Selecting variable features for dataset "ctrl"
#>  ... 168 features selected out of 249 shared features.
#>  Finally 168 shared variable features are selected.
pbmc <- scaleNotCenter(pbmc, useDatasets = 1)
#>  Scaling dataset "ctrl"
#>  Scaling dataset "ctrl" ... done
#> 
pbmc <- reverseMethData(pbmc, useDatasets = 2)
#>  Substracting methylation data: "stim"