get_region_summary: Extract and summarize methylation or coverage info by regions...

Description Usage Arguments Details Value Examples

View source: R/methrix_operations.R

Description

Extract and summarize methylation or coverage info by regions of interest

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
get_region_summary(
  m,
  regions = NULL,
  type = "M",
  how = "mean",
  overlap_type = "within",
  na_rm = TRUE,
  elementMetadata.col = NULL,
  verbose = TRUE,
  n_chunks = 1,
  n_cores = 1
)

Arguments

m

methrix object

regions

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

type

matrix which needs to be summarized. Coule be ‘M', 'C'. Default ’M'

how

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.

na_rm

Remove NA's? Default TRUE

elementMetadata.col

columns in methrix@elementMetadata which needs to be summarised. Default = NULL.

verbose

Default TRUE

n_chunks

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

n_cores

Number of parallel instances. n_cores should be less than or equal to n_chunks. If n_chunks is not specified, then n_chunks is initialized to be equal to n_cores. Default = 1.

Details

Takes methrix object and summarizes regions

Value

a coverage or methylation matrix

Examples

1
2
3
4
data('methrix_data')
get_region_summary(m = methrix_data,
regions = data.table(chr = 'chr21', start = 27867971, end =  27868103),
type = 'M', how = 'mean')

methrix documentation built on Feb. 13, 2021, 2 a.m.