MethylCalculation: "MethylCalculation"

Description Usage Arguments Details Value References Examples

View source: R/MethylCalculation.R


Calculate the ratio of each methylation class after n cell cycle(s).


MethylCalculation(original_classes, u, d, p, cell_cycle = 1)



The original methylation classes


The paramater that describing the methylation probablity on CpG site


The paramater that describing the de-methylation probablity on 5mCpG site


The paramater that describing the methylation probablity on semi-CpG site


The cell cycle times


The transition matrix of this model describes the changes of DNA methylation during one cell cycle in three steps: passive demethylation by DNA replication, active DNA methylation changes affected by DNA methylation-modifying enzymes and DNA methylation combinations during homologous recombination. For each CpG site in a chromsome, the methylation states are one of these four types: 0-0, 0-1, 1-0, 1-1. The transition matrix after DNA replication would be :

original(0-0) original(0-1) original(1-0) original(1-1)
after_replication(0-0) 1 a 1-a 0
after_replication(0-1) 0 1-a 0 1-a
after_replication(1-0) 0 0 0 a
after_replication(1-1) 0 0 0 0

among this matrix ,a is the methylation change probability with DNA replication and equal to 0.5. Then the transition matrix after active DNA methylation changes would be:

after_replication(0-0) after_replication(0-1) after_replication(1-0) after_replication(1-1)
after_enzymemodifying(0-0) (1-u )\times (1-u) (1-u-p+u \times p )\times d d \times (1-u-p+u \times p) 0
after_enzymemodifying(0-1) u \times (1-u) (1-u-p+u \times p )\times (1-d) d \times (u+p-u \times p) 0
after_enzymemodifying(1-0) u \times (1-u) (u+p-u \times p )\times d (1-d )\times (1-u-p+u \times p) 0
after_enzymemodifying(1-1) u \times u (u+p-u \times p )\times (1-d) (1-d )\times (u+p-u \times p) 1

The paramater u described the methylation probablity on CpG site. The paramater d described the de-methylation probablity on 5mCpG site. The paramater p described the methylation probablity on semi-CpG site. Thus the mathlation state change is P = Penzymemodifying \cdot Preplication \cdot original_classes We using t_{i,j} represent the i and j vector of the matrix Penzymemodifying \cdot Preplication Then two chromsomes are combined during homologous recombination. The observed DNA methylation of each CpG site is the combination of the methylation types in both chromsomes. The observed transition matrix would be :

original_class1(0) original_class2(1/4) original_class3(1/2) original_class4(3/4) original_class5(1)
terminal_class1(0) x_{1,1} x_{1,2} x_{1,3} x_{1,4} x_{1,5}
terminal_class2(1/4) x_{2,1} x_{2,2} x_{2,3} x_{2,4} x_{2,5}
terminal_class3(1/2) x_{3,1} x_{3,2} x_{3,3} x_{3,4} x_{3,5}
terminal_class4(3/4) x_{4,1} x_{4,2} x_{4,3} x_{4,4} x_{4,5}
terminal_class5(1) x_{5,1} x_{5,2} x_{5,3} x_{5,4} x_{5,5}


x_{1,1}=t_{1,1 }\times t_{1,1}

x_{1,1}=t_{{,1},1 }\times t_{{,1},1}

x_{1,2}=1/4 \times (t_{1,1 }\times t_{1,2}+t_{1,1 }\times t_{1,3}+t_{1,2 }\times t_{1,1}+t_{1,3 }\times t_{1,1})

x_{1,3}=1/6 \times (t_{1,1 }\times t_{1,4}+t_{1,2 }\times t_{1,2}+t_{1,2 }\times t_{1,3}+t_{1,3 }\times t_{1,2}+t_{1,3 }\times t_{1,3}+t_{1,4 }\times t_{1,1})

x_{1,4}=1/4 \times (t_{1,2 }\times t_{1,4}+t_{1,3 }\times t_{1,4}+t_{1,4 }\times t_{1,2}+t_{1,4 }\times t_{1,3})

x_{1,5}=t_{1,4 }\times t_{1,4}

x_{2,1}=t_{1,1 }\times t_{2,1}+t_{1,1 }\times t_{3,1}+t_{2,1 }\times t_{1,1}+t_{3,1 }\times t_{1,1}

x_{2,2}=1/4 \times (t_{1,1 }\times t_{2,2}+t_{1,1 }\times t_{2,3}+t_{1,2 }\times t_{2,1}+t_{1,3 }\times t_{2,1}+t_{1,1 }\times t_{3,2}+t_{1,1 }\times t_{3,3}+t_{1,2 }\times t_{3,1}+t_{1,3 }\times t_{3,1}+t_{2,1 }\times t_{1,2}+t_{2,1 }\times t_{1,3}+t_{2,2 }\times t_{1,1}+t_{2,3 }\times t_{1,1}+t_{3,1 }\times t_{1,2}+t_{3,1 }\times t_{1,3}+t_{3,2 }\times t_{1,1}+t_{3,3 }\times t_{1,1})

x_{2,3}=1/6 \times (t_{1,1 }\times t_{2,4}+t_{1,2 }\times t_{2,2}+t_{1,2 }\times t_{2,3}+t_{1,3 }\times t_{2,2}+t_{1,3 }\times t_{2,3}+t_{1,4 }\times t_{2,1}+t_{1,1 }\times t_{3,4}+t_{1,2 }\times t_{3,2}+t_{1,2 }\times t_{3,3}+t_{1,3 }\times t_{3,2}+t_{1,3 }\times t_{3,3}+t_{1,4 }\times t_{3,1}+t_{2,1 }\times t_{1,4}+t_{2,2 }\times t_{1,2}+t_{2,2 }\times t_{1,3}+t_{2,3 }\times t_{1,2}+t_{2,3 }\times t_{1,3}+t_{2,4 }\times t_{1,1}+t_{3,1 }\times t_{1,4}+t_{3,2 }\times t_{1,2}+t_{3,2 }\times t_{1,3}+t_{3,3 }\times t_{1,2}+t_{3,3 }\times t_{1,3}+t_{3,4 }\times t_{1,1})

x_{2,4}=1/4 \times (t_{1,2 }\times t_{2,4}+t_{1,3 }\times t_{2,4}+t_{1,4 }\times t_{2,2}+t_{1,4 }\times t_{2,3}+t_{1,2 }\times t_{3,4}+t_{1,3 }\times t_{3,4}+t_{1,4 }\times t_{3,2}+t_{1,4 }\times t_{3,3}+t_{2,2 }\times t_{1,4}+t_{2,3 }\times t_{1,4}+t_{2,4 }\times t_{1,2}+t_{2,4 }\times t_{1,3}+t_{3,2 }\times t_{1,4}+t_{3,3 }\times t_{1,4}+t_{3,4 }\times t_{1,2}+t_{3,4 }\times t_{1,3})

x_{2,5}=t_{1,4 }\times t_{2,4}+t_{1,4 }\times t_{3,4}+t_{2,4 }\times t_{1,4}+t_{3,4 }\times t_{1,4}

x_{3,1}=t_{1,1 }\times t_{4,1}+t_{2,1 }\times t_{2,1}+t_{2,1 }\times t_{3,1}+t_{3,1 }\times t_{2,1}+t_{3,1 }\times t_{3,1}+t_{4,1 }\times t_{1,1}

x_{3,2}=1/4 \times (t_{1,1 }\times t_{4,2}+t_{1,1 }\times t_{4,3}+t_{1,2 }\times t_{4,1}+t_{1,3 }\times t_{4,1}+t_{2,1 }\times t_{2,2}+t_{2,1 }\times t_{2,3}+t_{2,2 }\times t_{2,1}+t_{2,3 }\times t_{2,1}+t_{2,1 }\times t_{3,2}+t_{2,1 }\times t_{3,3}+t_{2,2 }\times t_{3,1}+t_{2,3 }\times t_{3,1}+t_{3,1 }\times t_{2,2}+t_{3,1 }\times t_{2,3}+t_{3,2 }\times t_{2,1}+t_{3,3 }\times t_{2,1}+t_{3,1 }\times t_{3,2}+t_{3,1 }\times t_{3,3}+t_{3,2 }\times t_{3,1}+t_{3,3 }\times t_{3,1}+t_{4,1 }\times t_{1,2}+t_{4,1 }\times t_{1,3}+t_{4,2 }\times t_{1,1}+t_{4,3 }\times t_{1,1})

x_{3,3}=1/6 \times (t_{1,1 }\times t_{4,4}+t_{1,2 }\times t_{4,2}+t_{1,2 }\times t_{4,3}+t_{1,3 }\times t_{4,2}+t_{1,3 }\times t_{4,3}+t_{1,4 }\times t_{4,1}+t_{2,1 }\times t_{2,4}+t_{2,2 }\times t_{2,2}+t_{2,2 }\times t_{2,3}+t_{2,3 }\times t_{2,2}+t_{2,3 }\times t_{2,3}+t_{2,4 }\times t_{2,1}+t_{2,1 }\times t_{3,4}+t_{2,2 }\times t_{3,2}+t_{2,2 }\times t_{3,3}+t_{2,3 }\times t_{3,2}+t_{2,3 }\times t_{3,3}+t_{2,4 }\times t_{3,1}+t_{3,1 }\times t_{2,4}+t_{3,2 }\times t_{2,2}+t_{3,2 }\times t_{2,3}+t_{3,3 }\times t_{2,2}+t_{3,3 }\times t_{2,3}+t_{3,4 }\times t_{2,1}+t_{3,1 }\times t_{3,4}+t_{3,2 }\times t_{3,2}+t_{3,2 }\times t_{3,3}+t_{3,3 }\times t_{3,2}+t_{3,3 }\times t_{3,3}+t_{3,4 }\times t_{3,1}+t_{4,1 }\times t_{1,4}+t_{4,2 }\times t_{1,2}+t_{4,2 }\times t_{1,3}+t_{4,3 }\times t_{1,2}+t_{4,3 }\times t_{1,3}+t_{4,4 }\times t_{1,1})

x_{3,4}=1/4 \times (t_{1,2 }\times t_{4,4}+t_{1,3 }\times t_{4,4}+t_{1,4 }\times t_{4,2}+t_{1,4 }\times t_{4,3}+t_{2,2 }\times t_{2,4}+t_{2,3 }\times t_{2,4}+t_{2,4 }\times t_{2,2}+t_{2,4 }\times t_{2,3}+t_{2,2 }\times t_{3,4}+t_{2,3 }\times t_{3,4}+t_{2,4 }\times t_{3,2}+t_{2,4 }\times t_{3,3}+t_{3,2 }\times t_{2,4}+t_{3,3 }\times t_{2,4}+t_{3,4 }\times t_{2,2}+t_{3,4 }\times t_{2,3}+t_{3,2 }\times t_{3,4}+t_{3,3 }\times t_{3,4}+t_{3,4 }\times t_{3,2}+t_{3,4 }\times t_{3,3}+t_{4,2 }\times t_{1,4}+t_{4,3 }\times t_{1,4}+t_{4,4 }\times t_{1,2}+t_{4,4 }\times t_{1,3})

x_{3,5}=t_{1,4 }\times t_{4,4}+t_{2,4 }\times t_{2,4}+t_{2,4 }\times t_{3,4}+t_{3,4 }\times t_{2,4}+t_{3,4 }\times t_{3,4}+t_{4,4 }\times t_{1,4}

x_{4,1}=t_{2,1 }\times t_{4,1}+t_{3,1 }\times t_{4,1}+t_{4,1 }\times t_{2,1}+t_{4,1 }\times t_{3,1}

x_{4,2}=1/4 \times (t_{2,1 }\times t_{4,2}+t_{2,1 }\times t_{4,3}+t_{2,2 }\times t_{4,1}+t_{2,3 }\times t_{4,1}+t_{3,1 }\times t_{4,2}+t_{3,1 }\times t_{4,3}+t_{3,2 }\times t_{4,1}+t_{3,3 }\times t_{4,1}+t_{4,1 }\times t_{2,2}+t_{4,1 }\times t_{2,3}+t_{4,2 }\times t_{2,1}+t_{4,3 }\times t_{2,1}+t_{4,1 }\times t_{3,2}+t_{4,1 }\times t_{3,3}+t_{4,2 }\times t_{3,1}+t_{4,3 }\times t_{3,1})

x_{4,3}=1/6 \times (t_{2,1 }\times t_{4,4}+t_{2,2 }\times t_{4,2}+t_{2,2 }\times t_{4,3}+t_{2,3 }\times t_{4,2}+t_{2,3 }\times t_{4,3}+t_{2,4 }\times t_{4,1}+t_{3,1 }\times t_{4,4}+t_{3,2 }\times t_{4,2}+t_{3,2 }\times t_{4,3}+t_{3,3 }\times t_{4,2}+t_{3,3 }\times t_{4,3}+t_{3,4 }\times t_{4,1}+t_{4,1 }\times t_{2,4}+t_{4,2 }\times t_{2,2}+t_{4,2 }\times t_{2,3}+t_{4,3 }\times t_{2,2}+t_{4,3 }\times t_{2,3}+t_{4,4 }\times t_{2,1}+t_{4,1 }\times t_{3,4}+t_{4,2 }\times t_{3,2}+t_{4,2 }\times t_{3,3}+t_{4,3 }\times t_{3,2}+t_{4,3 }\times t_{3,3}+t_{4,4 }\times t_{3,1})

x_{4,4}=1/4 \times (t_{2,2 }\times t_{4,4}+t_{2,3 }\times t_{4,4}+t_{2,4 }\times t_{4,2}+t_{2,4 }\times t_{4,3}+t_{3,2 }\times t_{4,4}+t_{3,3 }\times t_{4,4}+t_{3,4 }\times t_{4,2}+t_{3,4 }\times t_{4,3}+t_{4,2 }\times t_{2,4}+t_{4,3 }\times t_{2,4}+t_{4,4 }\times t_{2,2}+t_{4,4 }\times t_{2,3}+t_{4,2 }\times t_{3,4}+t_{4,3 }\times t_{3,4}+t_{4,4 }\times t_{3,2}+t_{4,4 }\times t_{3,3})

x_{4,5}=t_{2,4 }\times t_{4,4}+t_{3,4 }\times t_{4,4}+t_{4,4 }\times t_{2,4}+t_{4,4 }\times t_{3,4}

x_{5,1}=t_{4,1 }\times t_{4,1}

x_{5,2}=1/4 \times (t_{4,1 }\times t_{4,2}+t_{4,1 }\times t_{4,3}+t_{4,2 }\times t_{4,1}+t_{4,3 }\times t_{4,1})

x_{5,3}=1/6 \times (t_{4,1 }\times t_{4,4}+t_{4,2 }\times t_{4,2}+t_{4,2 }\times t_{4,3}+t_{4,3 }\times t_{4,2}+t_{4,3 }\times t_{4,3}+t_{4,4 }\times t_{4,1})

x_{5,4}=1/4 \times (t_{4,2 }\times t_{4,4}+t_{4,3 }\times t_{4,4}+t_{4,4 }\times t_{4,2}+t_{4,4 }\times t_{4,3})

x_{5,5}=t_{4,4 }\times t_{4,4}


terminal_classes The terminal methylation classes

average_methylation_level The average methylation level after [n] cell cycle(s).


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


# MethylCalculation(original_classes,u,d,p)

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