Description Usage Arguments Details Value Examples
View source: R/scMethrix_transforms.R
Collapses multiple samples into a single sample by group
1 2 3 4 5 6 7 8 9 10 |
scm |
|
colname |
string; The colname from |
trans |
named vector of closures; The transforms for each assay in a named vector. Default NULL, meaning that operations for "counts" assay is sum(x, na.rm=TRUE), and for all other assays is mean(x, na.rm=TRUE) |
h5_dir |
string; The directory to use. Will be created if it does not exist. Default = NULL |
batch_size |
The number of CpGs to calculate at once.
|
n_threads |
integer; Maximum number of parallel instances. Default = 1 |
replace |
boolean; flag for whether to delete the contents of h5_dir before saving |
verbose |
boolean; Flag for outputting function status messages. Default = TRUE |
Multiple samples can be collapsed into a single meta-sample. Grouping for samples can be defined via colData. The collapse function can accept an arbitrary function for each assay on how to handle the collapsing (typically mean
for scores, and sum
for counts).
In the output object, colData()
will contain a comma-delimited list of samples (Samples
) that each group contains as well as the total number of CpGs in the group (n_Samples
).
Reduced dimensionality data will be discarded.
An scMethrix
object
1 2 3 | data('scMethrix_data')
colData(scMethrix_data)["Cluster"] = c("X","X","Y","Y")
collapse_samples(scMethrix_data, colname = "Cluster")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.