Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/correlated_regions.R
Correlation between methylation and expression
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", subgroup = NULL, window_size = 5, window_step = window_size,
max_width = 10000, raw_meth = FALSE, cov_cutoff = 3, min_dp = 4, col = NULL, genome = "hg19")
|
sample_id |
a vector of sample IDs |
expr |
expression matrix |
txdb |
a |
chr |
a single chromosome name |
extend |
extension of gene model, both upstream and downstream |
cov_filter |
if |
cor_method |
method for calcualting correlations, pass to |
subgroup |
subgroup information. If provided, ANOVA test and group mean are applied on each correlated region. |
window_size |
how many CpG sites in a window |
window_step |
step of the sliding window, measured in number of CpG sites |
max_width |
maximum width of a window |
raw_meth |
whether use raw methylation value (values from |
cov_cutoff |
cutoff for CpG coverage when using raw methylation rate, used for raw methylation. Note when the CpG coverage is too low, the raw methylation rate is not reliable. Raw methylation rate for those CpGs with coverage less this this cutoff is set to |
min_dp |
minimal number of non-NA values for calculating correlations. When |
col |
color for subgroups. This setting will be saved in the returned object and will be used in downstream analysis. If not set, random colors are assigned. |
genome |
genome This setting will be saved and used in downstream analysis |
A correlated region is defined as a region where methylation is correlated with the expression of associated gene. The detection for correlated regions is gene-centric. For every gene, the processes are as follows:
extend to both upstream and downstream by extend
;
filter CpG sites by CpG coverage (by cov_filter
);
from the most upstream, use a sliding window which contains windows_size
CpG sites, moving step of window_step
CpG sites;
calculate correlation between methylation and gene expression for this window;
calculate other statistics.
Following meta columns are attached to the GRanges
objects:
number of CpG sites
mean methylation in each window in every sample.
correlation between methylation and expression
p-value for the correlation test
IQR of mean methylation if subgroup
is not set
p-value from oneway ANOVA test if subgroup
is set
range between maximum mean and minimal mean in all subgroups if subgroup
is set
when there are two subgroups, the mean methylation in subgroup 1 substracting mean methylation in subgroup 2.
gene id
distance to tss of genes
if genes have multiple transcripts, this is the distance to the nearest transcript
transcript id of the nearest transcript
This function keeps all the information for all CpG windows. Uses can use cr_add_fdr_column
to add fdr columns to the object,
filter significant correlated regions by p-value, fdr and meth_diff columns, or use cr_reduce
to reduce the significant regions.
A GRanges
object which contains correlations and associated statistics for every CpG windows.
The settings for finding correlated regions are stored as the meta data of the GRanges
object.
Zuguang Gu <z.gu@dkfz.de>
Internally, the calculation is done by correlated_regions_by_window
.
1 2 | # There is no example
NULL
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.