transform_assay: Transforms an assay in an 'scMethrix' object.

Description Usage Arguments Details Value Examples

View source: R/scMethrix_transforms.R

Description

Transforms an assay in an scMethrix object.

Usage

1
2
3
4
5
6
7
transform_assay(
  scm,
  assay = "score",
  new_assay = "new_assay",
  trans = NULL,
  h5_temp = NULL
)

Arguments

scm

scMethrix; the single cell methylation experiment

assay

string; name of an existing assay. Default = "score"

new_assay

string; name for transformed assay. Default = "new_assay"

trans

closure; The transformation function. Default = mean

h5_temp

string; temporary directory to store the temporary HDF5 files

Details

Uses the inputted function to transform an assay in the scMethrix object. The function is applied column-wise as to optimize how HDF5 files access sample data.

If HDF5 objects are used, transform functions need to accept 'DelayedMatrix' (e.g., from DelayedMatrixStats). Otherwise,

Value

An scMethrix object

Examples

1
2
data('scMethrix_data')
transform_assay(scMethrix_data,assay="score",new_assay="plus1",trans=function(x){x+1})

CompEpigen/scMethrix documentation built on Nov. 6, 2021, 3:09 p.m.