DMRMark-package: DMR Detection by Non-Homogeneous Hidden Markov Model from...

Description Author(s) Examples

Description

Perform differential analysis for methylation array data. DMRMark detects differentially methylated regions (DMRs) from array M-values. The core of DSS is a Non-homogeneous Hidden Markov Model for estimating spatial correlation and a novel Constrained Gaussian Mixture Model for modeling the M-value pairs of each individual locus.

DMRMark only works for two-group comparisons currently. We have the plan to extend the transition and response model that make then suitable for complex experimental designs in the future.

Author(s)

Linghao SHEN <sl013@ie.cuhk.edu.hk>

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
	# DMR detection performed on chr18 of a small BLCA dataset from TCGA
	data(BLCA)
	
	# Use a small subset
	nprobe <- 500 
	# M-values
	mv <- BLCA$mv[1:nprobe,]
	
	# Distance between probes, L<0 indicates acorssing chromosomes 
	L = BLCA$distance[1:nprobe]
	
	# Initialize new chain when probe distance too long 
	# or across different chromosomes
	newChains <- which((L > 100000) | L < 0)
	# The starting positions of new chains
	starting <- c(1, newChains[-length(newChains)]+1)
	
	# Run DMRMark with default options
	set.seed(0)
	par <- DMRMark(mv, L, starting)
	
	# Get the posterior of being certain states
	# Return the result of DMC for plotting by setting 'region=FALSE'
	results <- DMRViterbi(mv, par, L, starting, region=FALSE)
	
	# The MAP states being 3 or 4 indicate DMCs
	isDMC <- (results$states > 2) + 0
	mvScatter(mv, isDMC, nPlot=10000)

Example output

Loading required package: MCMCpack
Loading required package: coda
Loading required package: MASS
##
## Markov Chain Monte Carlo Package (MCMCpack)
## Copyright (C) 2003-2018 Andrew D. Martin, Kevin M. Quinn, and Jong Hee Park
##
## Support provided by the U.S. National Science Foundation
## (Grants SES-0350646 and SES-0350613)
##
Loading required package: mvtnorm
Loading required package: ellipse
[1] "Start..."
[1] "Parameter Estimation finished."

DMRMark documentation built on May 2, 2019, 1:53 p.m.