estiParamdmSingleplotGeneestiParamdmTwoGroupsmist (Methylation Inference for Single-cell along Trajectory) is an R package for differential methylation (DM) analysis of single-cell DNA methylation (scDNAm) data. The package employs a Bayesian approach to model methylation changes along pseudotime and estimates developmental-stage-specific biological variations. It supports both single-group and two-group analyses, enabling users to identify genomic features exhibiting temporal changes in methylation levels or different methylation patterns between groups.
This vignette demonstrates how to use mist for:
1. Single-group analysis.
2. Two-group analysis.
To install the latest version of mist, run the following commands:
if (!requireNamespace("BiocManager", quietly = TRUE)) {
install.packages("BiocManager")
}
# Install mist from GitHub
BiocManager::install("https://github.com/dxd429/mist")
From Bioconductor:
if (!requireNamespace("BiocManager", quietly = TRUE)) {
install.packages("BiocManager")
}
BiocManager::install("mist")
To view the package vignette in HTML format, run the following lines in R:
library(mist)
vignette("mist")
In this section, we will estimate parameters and perform differential methylation analysis using single-group data.
Here we load the example data from GSE121708.
library(mist)
library(SingleCellExperiment)
# Load sample scDNAm data
Dat_sce <- readRDS(system.file("extdata", "group1_sampleData_sce.rds", package = "mist"))
estiParam# Estimate parameters for single-group
Dat_sce <- estiParam(
Dat_sce = Dat_sce,
Dat_name = "Methy_level_group1",
ptime_name = "pseudotime"
)
# Check the output
head(rowData(Dat_sce)$mist_pars)
## Beta_0 Beta_1 Beta_2 Beta_3 Beta_4
## ENSMUSG00000000001 1.271313 -0.50793275 0.4365466 0.27866409 0.02679800
## ENSMUSG00000000003 1.647654 1.56675122 3.3382719 -2.06733392 -3.22477710
## ENSMUSG00000000028 1.261077 -0.04378009 0.1209270 0.06658032 0.01251169
## ENSMUSG00000000037 0.994900 -5.25898897 14.2047227 -6.19140701 -2.72930100
## ENSMUSG00000000049 1.013856 -0.16674944 0.1605187 0.10872098 0.07593292
## Sigma2_1 Sigma2_2 Sigma2_3 Sigma2_4
## ENSMUSG00000000001 5.901772 13.331691 3.637391 1.728134
## ENSMUSG00000000003 26.186113 3.564131 5.912982 10.033361
## ENSMUSG00000000028 7.084435 6.959695 2.734435 2.441855
## ENSMUSG00000000037 7.809150 12.998296 6.719913 2.440611
## ENSMUSG00000000049 5.729566 7.707187 3.298185 1.206046
dmSingle# Perform differential methylation analysis for the single-group
Dat_sce <- dmSingle(Dat_sce)
# View the top genomic features with drastic methylation changes
head(rowData(Dat_sce)$mist_int)
## ENSMUSG00000000037 ENSMUSG00000000003 ENSMUSG00000000001 ENSMUSG00000000049
## 0.071969468 0.033052046 0.011892965 0.008559639
## ENSMUSG00000000028
## 0.006494479
plotGene# Produce scatterplot with fitted curve of a specific gene
library(ggplot2)
plotGene(Dat_sce = Dat_sce,
Dat_name = "Methy_level_group1",
ptime_name = "pseudotime",
gene_name = "ENSMUSG00000000037")
In this section, we will estimate parameters and perform DM analysis using data from two phenotypic groups.
# Load two-group scDNAm data
Dat_sce_g1 <- readRDS(system.file("extdata", "group1_sampleData_sce.rds", package = "mist"))
Dat_sce_g2 <- readRDS(system.file("extdata", "group2_sampleData_sce.rds", package = "mist"))
estiParam# Estimate parameters for both groups
Dat_sce_g1 <- estiParam(
Dat_sce = Dat_sce_g1,
Dat_name = "Methy_level_group1",
ptime_name = "pseudotime"
)
Dat_sce_g2 <- estiParam(
Dat_sce = Dat_sce_g2,
Dat_name = "Methy_level_group2",
ptime_name = "pseudotime"
)
# Check the output
head(rowData(Dat_sce_g1)$mist_pars, n = 3)
## Beta_0 Beta_1 Beta_2 Beta_3 Beta_4
## ENSMUSG00000000001 1.269741 -0.34112354 0.31725077 0.21031075 0.045386499
## ENSMUSG00000000003 1.673649 1.33572608 3.17384651 -1.59041743 -3.267118593
## ENSMUSG00000000028 1.261550 -0.01662145 0.09576343 0.04431927 -0.002475955
## Sigma2_1 Sigma2_2 Sigma2_3 Sigma2_4
## ENSMUSG00000000001 6.129998 12.932854 3.857139 1.971748
## ENSMUSG00000000003 26.518987 4.189147 5.493221 9.399217
## ENSMUSG00000000028 7.263119 7.256250 3.283320 2.218796
head(rowData(Dat_sce_g2)$mist_pars, n = 3)
## Beta_0 Beta_1 Beta_2 Beta_3 Beta_4
## ENSMUSG00000000001 1.9323753 -0.8473455 6.524153 -6.300489 0.4653986
## ENSMUSG00000000003 -0.8294146 -1.3087520 3.707014 -1.362563 -0.9875100
## ENSMUSG00000000028 2.2792524 -14.2769955 67.050069 -93.672565 41.0529932
## Sigma2_1 Sigma2_2 Sigma2_3 Sigma2_4
## ENSMUSG00000000001 5.849123 6.975520 4.011081 1.523075
## ENSMUSG00000000003 6.766641 11.746602 4.744021 2.893335
## ENSMUSG00000000028 9.381572 5.492129 3.533295 3.004886
dmTwoGroups# Perform DM analysis to compare the two groups
dm_results <- dmTwoGroups(
Dat_sce_g1 = Dat_sce_g1,
Dat_sce_g2 = Dat_sce_g2
)
# View the top genomic features with different temporal patterns between groups
head(dm_results)
## ENSMUSG00000000037 ENSMUSG00000000028 ENSMUSG00000000003 ENSMUSG00000000001
## 0.05654514 0.04039809 0.02854613 0.02146671
## ENSMUSG00000000049
## 0.01163252
mist provides a comprehensive suite of tools for analyzing scDNAm data along pseudotime, whether you are working with a single group or comparing two phenotypic groups. With the combination of Bayesian modeling and differential methylation analysis, mist is a powerful tool for identifying significant genomic features in scDNAm data.
## R version 4.5.1 Patched (2025-09-10 r88807)
## Platform: x86_64-apple-darwin20
## Running under: macOS Monterey 12.7.6
##
## Matrix products: default
## BLAS: /Library/Frameworks/R.framework/Versions/4.5-x86_64/Resources/lib/libRblas.0.dylib
## LAPACK: /Library/Frameworks/R.framework/Versions/4.5-x86_64/Resources/lib/libRlapack.dylib; LAPACK version 3.12.1
##
## locale:
## [1] C/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
##
## time zone: America/New_York
## tzcode source: internal
##
## attached base packages:
## [1] stats4 stats graphics grDevices utils datasets methods
## [8] base
##
## other attached packages:
## [1] ggplot2_4.0.0 SingleCellExperiment_1.32.0
## [3] SummarizedExperiment_1.40.0 Biobase_2.70.0
## [5] GenomicRanges_1.62.0 Seqinfo_1.0.0
## [7] IRanges_2.44.0 S4Vectors_0.48.0
## [9] BiocGenerics_0.56.0 generics_0.1.4
## [11] MatrixGenerics_1.22.0 matrixStats_1.5.0
## [13] mist_1.2.0 BiocStyle_2.38.0
##
## loaded via a namespace (and not attached):
## [1] tidyselect_1.2.1 dplyr_1.1.4 farver_2.1.2
## [4] Biostrings_2.78.0 S7_0.2.0 bitops_1.0-9
## [7] fastmap_1.2.0 RCurl_1.98-1.17 GenomicAlignments_1.46.0
## [10] XML_3.99-0.19 digest_0.6.37 lifecycle_1.0.4
## [13] survival_3.8-3 magrittr_2.0.4 compiler_4.5.1
## [16] rlang_1.1.6 sass_0.4.10 tools_4.5.1
## [19] yaml_2.3.10 rtracklayer_1.70.0 knitr_1.50
## [22] labeling_0.4.3 S4Arrays_1.10.0 curl_7.0.0
## [25] DelayedArray_0.36.0 RColorBrewer_1.1-3 abind_1.4-8
## [28] BiocParallel_1.44.0 withr_3.0.2 grid_4.5.1
## [31] scales_1.4.0 MASS_7.3-65 mcmc_0.9-8
## [34] tinytex_0.57 dichromat_2.0-0.1 cli_3.6.5
## [37] mvtnorm_1.3-3 rmarkdown_2.30 crayon_1.5.3
## [40] httr_1.4.7 rjson_0.2.23 cachem_1.1.0
## [43] splines_4.5.1 parallel_4.5.1 BiocManager_1.30.26
## [46] XVector_0.50.0 restfulr_0.0.16 vctrs_0.6.5
## [49] Matrix_1.7-4 jsonlite_2.0.0 SparseM_1.84-2
## [52] carData_3.0-5 bookdown_0.45 car_3.1-3
## [55] MCMCpack_1.7-1 Formula_1.2-5 magick_2.9.0
## [58] jquerylib_0.1.4 glue_1.8.0 codetools_0.2-20
## [61] gtable_0.3.6 BiocIO_1.20.0 tibble_3.3.0
## [64] pillar_1.11.1 htmltools_0.5.8.1 quantreg_6.1
## [67] R6_2.6.1 evaluate_1.0.5 lattice_0.22-7
## [70] Rsamtools_2.26.0 cigarillo_1.0.0 bslib_0.9.0
## [73] MatrixModels_0.5-4 Rcpp_1.1.0 coda_0.19-4.1
## [76] SparseArray_1.10.0 xfun_0.53 pkgconfig_2.0.3