correlated_regions: Correlation between methylation and expression

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Correlation between methylation and expression

Usage

1
2
3
4
correlated_regions(sample_id, expr, txdb, chr, extend = 50000,
    cov_filter = function(x) sum(x > 0, na.rm = TRUE) > length(x)/2,
    cor_method = "spearman", factor = NULL, window_size = 5, max_width = 10000,
    raw_meth = FALSE, cov_cutoff = 3, min_dp = 4, col = NULL)

Arguments

sample_id

a vector of sample id

expr

expression matrix in which columns correspond to sample ids

txdb

a GenomicFeatures::GRanges object. Gene names should be same type as row names in expr

chr

a single chromosome

extend

extension of gene model, both upstream and downstream

cov_filter

if coverage hook is set in methylation_hooks, this option can be set to filter out CpG sites with low coverage across samples. the value for this option is a function for which the argument is a vector of coverage values for current CpG in all samples.

cor_method

method to calculate correlation

factor

classes of samples

window_size

number of CpGs in a window

max_width

maximum width of a window

raw_meth

whether use raw methylation value (values from raw hook set in methylation_hooks)

cov_cutoff

cutoff for coverage

min_dp

minimal non-NA values for calculating correlations

col

color for classes

Details

The detection for correlated regions is gene-centric. For every gene, the process are as follows:

Following meth columns are attached to the GRanges objects:

n

number of CpG sites

mean_meth_*

mean methylation in each window in every sample.

corr

correlation

corr_p

p-value for the correlation test

meth_IQR

IQR of mean methylation if factor is not set

meth_anova

p-value from oneway ANOVA test if factor is set

meth_diameter

range between maximum mean and minimal mean in all subgroups if factor is set

gene_id

gene id

gene_tss_dist

distance to tss of genes

tx_tss_dist

if genes have multiple transcripts, this is the distance to the nearest transcript

nearest_txx_tss

transcript id of the nearest transcript

This function keeps all the information for all CpG windows. Users can get filter_correlated_regions to get correlated regions with significant correlations and use reduce_cr to merge neighbouring windows.

Since information for all CpG windows are kept, the size of the object is always very huge, thus, it is reasonable to analyze each chromosome separately and save each object as a single file. Some downstream functions expect a formatted path of the cr file.

Value

A GRanges object which contains associated statistics for every CpG windows.

Author(s)

Zuguang Gu <z.gu@dkfz.de>

See Also

filter_correlated_regions, reduce_cr

Examples

1
2
# There is no example
NULL

eilslabs/epic documentation built on May 16, 2019, 1:24 a.m.