Description Usage Arguments Value Examples

View source: R/hummingbirdEM.R

This function reads input data, sets initial values, executes the Expectation-Maximization (EM) algorithm for the Bayesian HMM and infers the best sequence of methylation states.

1 | ```
hummingbirdEM(experimentInfoControl, experimentInfoCase, binSize)
``` |

`experimentInfoControl` |
A SummarizedExperiment object containing the input data for the control group: The two assays: normM, normUM and the CpG position information: pos. normM is a matrix containing the methylated read count data of the normal group and normUM is a matrix containing the unmethylated read count data of the normal group. Each column of a matrix represents a replicate and each row represents a CpG position. |

`experimentInfoCase` |
A SummarizedExperiment object containing the input data for the case group: The two assays: abnormM, abnormUM and the CpG position information: pos. abnormM is a matrix containing the methylated read count data of the abnormal group and abnormUM is a matrix containing the unmethylated read count data of the abnormal group. Each column of a matrix represents a replicate and each row represents a CpG position. |

`binSize` |
The size of a bin. Default value is: 40. |

A GenomicRanges object that contains the start and end positions of each bin, the distance between the current bin the bin ahead of it, the average methylation rate of normal and abnormal groups and the predicted direction of methylation change ("0" means a predicted normal bin; "1" means a predicted hypermethylated bin; "-1" means a predicted hypomethylated bin).

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | ```
library(GenomicRanges)
library(SummarizedExperiment)
data(exampleHummingbird)
# CpG position vector
pos <- pos[,1]
# Assays for the normal group
assaysControl <- list(normM = normM, normUM = normUM)
# Assays for the case group
assaysCase <- list(abnormM = abnormM, abnormUM = abnormUM)
# SummarizedExperiment objects
exampleSEControl <- SummarizedExperiment(assaysControl,
rowRanges = GPos("chr29", pos))
exampleSECase <- SummarizedExperiment(assaysCase,
rowRanges = GPos("chr29", pos))
emInfo <- hummingbirdEM(experimentInfoControl = exampleSEControl,
experimentInfoCase = exampleSECase, binSize = 40)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.