TransitionMatrixGeneration: "TransitionMatrixGeneration"

Description Usage Arguments Details Value References Examples

View source: R/TransitionMatrixGeneration.R

Description

Generate the transition matrix from the original DNA methylation level to the terminal DNA methylation level which is suitable for TMParameterEstimation().

Usage

1
TransitionMatrixGeneration(original_methyl, terminal_methyl)

Arguments

original_methyl

The original methylation level of each CpG/gene/region.

terminal_methyl

The paired terminal methylation level of each CpG/gene/region.

Details

.

Value

observation_matrix The transition ratio matrix(5 \times 5) from the original state to the terminal state. DNA methylation level was classed to five classes (class1:0;class1:1/4;class1:1/2;class1:3/4;class5:1). The ratio of each class change to others are described as blows:

original_class1 original_class2 original_class3 original_class4 original_class5
terminal_class1 a1 b1 c1 d1 e1
terminal_class2 a2 b2 c2 d2 e2
terminal_class3 a3 b3 c3 d3 e3
terminal_class4 a4 b4 c4 d4 e4
terminal_class5 a5 b5 c5 d5 e5

# observation_matrix[1,1](a1) is the ratio of original_class1 to terminal_class1,observation_matrix[1,2](b1) is the ratio of original_class2 to terminal_class1 and so on # observation_matrix[2,1](a2) is the ratio of original_class1 to terminal_class2,observation_matrix[2,2](b2) is the ratio of original_class2 to terminal_class2 and so on # The sum of the ratio that original_class1 change to 5 classes should be 1. That is a1+a2+a3+a4+a5=1.

References

Zhao, C. et.al.(2019). A DNA methylation state transition model reveals the programmed epigenetic heterogeneity in pre-implantation embryos. Under revision.

Examples

1
2
3
4
5
6
# Let's simulate the original DNA methylation level vector and the terminal one.
set.seed(0)
original_methyl <- runif(10000, min = 0, max = 1)
set.seed(1)
terminal_methyl <- runif(10000, min = 0, max = 1)
TransitionMatrixGeneration(original_methyl,terminal_methyl)

ChengchenZhao/MethylTransition documentation built on Nov. 30, 2020, 11:09 a.m.