Merges two scMethrix objects by row or col

merge_scMethrix(
  scm1 = NULL,
  scm2 = NULL,
  by = c("row", "column"),
  verbose = TRUE
)

Arguments

scm1

scMethrix; A single cell methylation experiment

scm2

scMethrix; A single cell methylation experiment

by

string; Merge by 'columns' or 'rows'

verbose

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

Value

A merged scMethrix object

Details

Merges the assay data from two scMethrix objects. Assays not shared between assays will be dropped, as well as all reduced dimensionality data.

Requirements for merging

  • If merging by rows, all CpG sites must be unique and samples must be identical

  • If merging by columns, all samples must be unique and CpG sites must be identical

Metadata will be retained in certain situations: For row merges: - Ranges metadata (mcols()) will be merged, with missing columns in either assay filled with NAs - Sample metadata (colData()) will attempt to be merged. Overlapping, non-identical columns will be appended with .1 and .2.

For row merges: - Ranges metadata (mcols()) will attempt to be merged. Overlapping, non-identical columns will be appended with .1 and .2. - Sample metadata (colData()) will be merged, with missing columns in either assay filled with NAs

For both merges: - Experiment metadata (metadata()) will attempt to be merged. Overlapping, non-identical elements will be appended with .1 and .2.

Custom experiment metadata can manually be added via metadata() <-, or to rowRanges via mcols() <-.

Examples

data('scMethrix_data') merge_scMethrix(scMethrix_data[1:5],scMethrix_data[6:10],by="row")
#> Merging experiment metadata
#> Merging assays...
#> An object of class scMethrix #> n_CpGs: 10 #> n_samples: 4 #> assays: score, counts #> reduced dims: #> is_h5: FALSE #> Reference: hg19 #> Physical size: 30.9 Kb
merge_scMethrix(scMethrix_data[,1:2],scMethrix_data[,3:4],by="col")
#> Merging experiment metadata
#> Merging assays...
#> 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