get_region_summary: Extracts and summarizes methylation or coverage info by...

Description Usage Arguments Details Value Examples

Description

Extracts and summarizes methylation or coverage info by regions of interest

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
get_region_summary(
  scm = NULL,
  assay = "score",
  regions = NULL,
  group = NULL,
  n_chunks = 1,
  n_threads = 1,
  by = c("mean", "median", "maximum", "minimum", "sum", "sd"),
  overlap_type = c("within", "start", "end", "any", "equal"),
  verbose = TRUE
)

Arguments

scm

scMethrix; the single cell methylation experiment

assay

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

regions

GRanges; genomic regions to be summarized. Could be a data.table with 3 columns (chr, start, end) or a GenomicRanges object

group

a column name from sample annotation that defines groups. In this case, the number of min_samples will be tested group-wise.

n_chunks

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

n_threads

integer; Maximum number of parallel instances. Default = 1

by

closure; mathematical function by which regions should be summarized. Can be one of the following: mean, sum, max, min. Default 'mean'

overlap_type

defines the type of the overlap of the CpG sites with the target region. Default value is within. For detailed description, see the findOverlaps function of the IRanges package.

verbose

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

Details

Takes scMethrix object and summarizes regions

Value

table of summary statistic for the given region

Examples

1
2
3
4
data('scMethrix_data')
get_region_summary(scMethrix_data,
   regions = GenomicRanges::GRanges(seqnames = c("chr1","chr2"), ranges = IRanges(1,100000000)),
   assay = 'score', by = 'mean')

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