get_matrix: Extract assays from an 'scMethrix' object

Description Usage Arguments Details Value Examples

View source: R/scmethrix_operations.R

Description

Extract assays from an scMethrix object

Usage

1
2
3
4
5
6
7
8
9
get_matrix(
  scm = NULL,
  assay = "score",
  add_loci = FALSE,
  in_granges = FALSE,
  order_by_sd = FALSE,
  n_chunks = 1,
  by = c("row", "column")
)

Arguments

scm

scMethrix; the single cell methylation experiment

assay

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

add_loci

Default FALSE. If TRUE adds CpG position info to the matrix and returns as a data.table

in_granges

Do you want the outcome in GRanges?

order_by_sd

Order output matrix by standard deviation

n_chunks

integer; Number of chunks to split the scMethrix object in case it is very large. Default = 1

by

string; split the matrix by "row" or "col" if n_chunks != 1

Details

Takes scMethrix object and returns the methylation matrix. This will return in the format used by the object (matrix or HDF5matrix).

Value

HDF5Matrix or matrix

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
data('scMethrix_data')

# Get methylation data
get_matrix(scMethrix_data)

# Get methylation data with loci
get_matrix(scMethrix_data, add_loci=TRUE)

# Get methylation data with loci inside a Granges object 
get_matrix(scMethrix_data, add_loci=TRUE, in_granges=TRUE)

# Get methylation data sorted by SD
get_matrix(scMethrix_data, order_by_sd = TRUE)

# Split the matrix into parts
get_matrix(scMethrix_data, n_chunks = 4, by="row")

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