DMRScan_package: DMRScan: An R-package for identification of Differentially...

Description Arguments Value Author(s) References Examples

Description

DMRScan: An R-package for identification of Differentially Metylated Regions

Arguments

observations

An object of type GRangesList from makeCpGregions

windowSize

A sequence of windowSizes for the slidingWindow, must be an integer

windowThreshold

Optional argument with corresponding cut-off for each window. Will be estimated if not supplied.

...

Optional arguments to be pased to estimateThreshold, if no grid is specified.

Value

An object of type GRanges with signficantly differentially

Author(s)

Christian Page, page.ntnu@gmail.com

References

Not Published yet (Under revision)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
                                                             
## nProbeoad methylation data from chromosome 22                             
data(DMRScan.methylationData)                                                
## nProbeoad phenotype (end-point for methylation data)                      
data(DMRScan.phenotypes)                                                     
                                                                             
## Test for an association between phenotype and Methylation                 
test.statistics <- apply(DMRScan.methylationData,1,function(x,y)             
  summary(glm(y ~ x, family = binomial(link = "logit")))$coefficients[2,3],  
                                                   y = DMRScan.phenotypes)   
## Set chromosomal position to each test-statistic                           
positions <- data.frame(matrix(as.integer(unlist(strsplit(names(test.statistics), split="chr|[.]"))), ncol = 3, byrow = TRUE))[,-1]
## Set clustering features                                                   
min.cpg <- 4  ## Minimum number of CpGs in a tested cluster                  
## Maxium distance (in base-pairs) within a cluster                          
## before it is broken up into two seperate cluster                          
max.gap <- 750                                                               
                                                                             
## Identify all clusters, and generate a list for each cluster               
regions <- makeCpGregions(observations = test.statistics,                    
                          chr = positions[,1], pos = positions[,2],          
                          maxGap = max.gap, minCpG = min.cpg)                
## Number of CpGs in the slidingWindows, can be either a single number       
## or a sequence of windowSizes                                              
windowSizes <- 3:7                                                           
nCpG        <- sum(sapply(regions, length)) ## Number of CpGs to be tested                  
                                                                             
# Estimate the windowThreshold, based on the number of CpGs and windowSizes  
windowThresholds <- estimateWindowThreshold(nProbe = nCpG,                   
               windowSize = windowSizes, method = "sampling", mcmc = 10000)  
## Run the slidingWindow                                                     
DMRScanResults   <- dmrscan(observations = regions,                          
                            windowSize = windowSizes,                        
                            windowThreshold = windowThresholds)              
## Print the result                                                          
print(DMRScanResults)                                                        

DMRScan documentation built on Nov. 8, 2020, 8:10 p.m.