Learn R Programming

MEAL (version 1.2.3)

DARegionAnalysis: Analyse methylation or expression in a specific range

Description

Methylation analysis in a genomic range, taking into account snps.

Usage

DARegionAnalysis(set, range, omicset = "methylation", variable_names, variable_types = rep(NA, length(variable_names)), covariable_names = NULL, covariable_types = rep(NA, length(covariable_names)), equation = NULL, num_var = NULL, labels = NULL, sva = FALSE, use_snps = TRUE, snps_cutoff = 0.01, region_methods = c("blockFinder", "bumphunter", "DMRcate"), shrinkVar = FALSE, probe_method = "robust", max_iterations = 100, num_cores = 1, verbose = FALSE, nperm = 1000, ...)

Arguments

set
MethylationSet, ExpressionSet or MultiDataSet.
range
GenomicRanges with the desired range.
omicset
In a MultiDataSet allows to choose between methylation and expression (valid values are: "methylation" or "expression").
variable_names
Character vector with the names of the variables that will be returned as result.
variable_types
Character vector with the types of the variables. By default, variables type won't be changed.
covariable_names
Character vector with the names of the variables that will be used to adjust the model.
covariable_types
Character vector with the types of the covariables. By default, variables type won't be changed.
equation
String containing the formula to be used to create the model.
num_var
Numeric with the number of variables in the matrix for which the analysis will be performed. Compulsory if equation is not null.
labels
Character vector with the labels of the variables.
sva
Logical indicating if Surrogate Variable Analysis should be applied.
use_snps
Logical indicating if SNPs should be used in the analysis.
snps_cutoff
Numerical with the threshold to consider a SNP-cpg correlation p-value significant.
region_methods
Character vector with the methods used in DARegion. If "none", region analysis is not performed.
shrinkVar
Logical indicating if shrinkage of variance should be applied in probe analysis.
probe_method
Character with the type of linear regression applied in probe analysis ("ls" or "robust")
max_iterations
Numeric with the maximum of iterations in the robust regression.
num_cores
Numeric with the number of cores to be used.
verbose
Logical value. If TRUE, it writes out some messages indicating progress. If FALSE nothing should be printed.
nperm
Numeric with the number of permutations used to compute RDA p-values.
...
Further arguments passsed to DAPipeline function.

Value

AnalysisRegionResult object

Details

Set is filtered to the range specified. If SNPs are present in the set, those are also filtered and then, correlation between SNPs and cpgs is tested. SNPs that are correlated to at least one cpg are added to covariables. After that, DAPipeline is run. RDA test of the region is performed, returning the R2 between the variables and the beta matrix and a p-value of this R2.

See Also

preparePhenotype, DAPipeline

Examples

Run this code
if (require(minfiData)){
 set <- prepareMethylationSet(getBeta(MsetEx)[1:1000, ], pheno = pData(MsetEx))
 range <- GenomicRanges::GRanges(seqnames=Rle("chrX"), 
 ranges = IRanges(30000, end = 123000000))
 res <- DARegionAnalysis(set, range = range, variable_names = "Sample_Group",
 probe_method = "ls") 
 res
}

Run the code above in your browser using DataLab