Masks non-variable CpGs

mask_by_variance(
  scm = NULL,
  assay = "score",
  low_threshold = 0.05,
  n_threads = 1,
  verbose = TRUE
)

Arguments

scm

scMethrix; the single cell methylation experiment

assay

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

low_threshold

numeric; The variability threshold. Masking is done for all CpGs less than or equal to this value. A CpG that is methylated or unmethylated in all samples will have a variability of 0, whereas a completely variable CpG will have a value of 1. Default = 0.05.

n_threads

integer; Number of parallel instances. Can only be used if scMethrix is in HDF5 format. Default = 1.

verbose

boolean; Flag for outputting function status messages. Default = TRUE

Value

An object of class scMethrix

Details

Takes scMethrix object and masks CpGs with low variability by putting NA for assay values. The sites will remain in the object and all assays will be affected.

Examples

data('scMethrix_data') mask_by_variance(scMethrix_data,low_threshold=0.05)
#> Masking non-variable CpG sites...
#> Masked 225 [78.67%] CpG sites in 0.14s
#> An object of class scMethrix #> n_CpGs: 286 #> n_samples: 4 #> assays: score, counts #> reduced dims: #> is_h5: FALSE #> Reference: hg19 #> Physical size: 47 Kb