Generates a random subset of CpG sites

generate_random_subset(scm = NULL, n_cpgs = 10000, seed = "123")

Arguments

scm

scMethrix; the single cell methylation experiment

n_cpgs

numeric; The number of CpGs to include

seed

string; value to use for sampling

Value

scMethrix; an experiment with n_cpgs

Details

From an scMethrix object, this will randomly select n_cpgs and create a new object containing only those CpGs. This is typically used for approximation or visualization. The seed can be specified for consistency.

Examples

data('scMethrix_data') generate_random_subset(scMethrix_data,n_cpgs = round(nrow(scMethrix_data)/2))
#> An object of class scMethrix #> n_CpGs: 143 #> n_samples: 4 #> assays: score, counts #> reduced dims: #> is_h5: FALSE #> Reference: hg19 #> Physical size: 38.6 Kb