mist (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:
In this section, we will estimate parameters and perform differential methylation analysis using single-group data.
Here we load the example data from GSE121708.
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.249315 -0.75688631 0.83990638 0.25305405 -0.075124695
## ENSMUSG00000000003 1.663704 1.75090926 1.82475207 -1.67600026 -2.142791626
## ENSMUSG00000000028 1.301798 -0.01339871 0.09732184 0.03481975 -0.004168715
## ENSMUSG00000000037 1.033909 -4.73075685 13.14827770 -6.53468041 -1.863469258
## ENSMUSG00000000049 1.020749 -0.08974517 0.10956047 0.09573961 0.048371556
## Sigma2_1 Sigma2_2 Sigma2_3 Sigma2_4
## ENSMUSG00000000001 5.629495 15.438401 3.523591 1.889857
## ENSMUSG00000000003 25.092873 3.863266 5.019510 9.538348
## ENSMUSG00000000028 7.987438 8.109885 3.175586 2.223405
## ENSMUSG00000000037 8.487805 13.145907 6.973365 2.289861
## ENSMUSG00000000049 5.767685 10.077434 2.870993 1.245483
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.062295828 0.027857225 0.015139958 0.007632219
## ENSMUSG00000000028
## 0.004765713
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.
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.252232 -0.84172699 0.9617276 0.2408050 -0.110907620
## ENSMUSG00000000003 1.689843 1.84493810 1.8487037 -1.6767720 -2.315851518
## ENSMUSG00000000028 1.305150 -0.02776465 0.1108717 0.0454136 0.004629789
## Sigma2_1 Sigma2_2 Sigma2_3 Sigma2_4
## ENSMUSG00000000001 5.513174 15.324467 3.313357 1.668908
## ENSMUSG00000000003 26.067412 3.118637 5.287560 8.836438
## ENSMUSG00000000028 7.743948 7.909834 3.412835 2.284116
## Beta_0 Beta_1 Beta_2 Beta_3 Beta_4
## ENSMUSG00000000001 1.9178091 -0.196991543 2.8518444 -1.10544968 -1.6960524
## ENSMUSG00000000003 -0.8161927 0.001022862 0.2469463 -0.01373307 -0.1256855
## ENSMUSG00000000028 2.3827969 -0.275684197 1.6390187 -0.59702533 -0.6793150
## Sigma2_1 Sigma2_2 Sigma2_3 Sigma2_4
## ENSMUSG00000000001 5.999452 5.489644 3.691746 1.379696
## ENSMUSG00000000003 6.849291 10.773767 5.107686 2.822874
## ENSMUSG00000000028 11.903167 6.592537 3.843091 3.061391
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 ENSMUSG00000000003 ENSMUSG00000000001 ENSMUSG00000000049
## 0.05500748 0.02661294 0.02326583 0.01104033
## ENSMUSG00000000028
## 0.00418820
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.2 (2025-10-31)
## Platform: x86_64-pc-linux-gnu
## Running under: Ubuntu 24.04.4 LTS
##
## Matrix products: default
## BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
## LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.26.so; LAPACK version 3.12.0
##
## locale:
## [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
## [3] LC_TIME=en_US.UTF-8 LC_COLLATE=C
## [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
## [7] LC_PAPER=en_US.UTF-8 LC_NAME=C
## [9] LC_ADDRESS=C LC_TELEPHONE=C
## [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
##
## time zone: Etc/UTC
## tzcode source: system (glibc)
##
## attached base packages:
## [1] stats4 stats graphics grDevices utils datasets methods
## [8] base
##
## other attached packages:
## [1] ggplot2_4.0.2 SingleCellExperiment_1.33.0
## [3] SummarizedExperiment_1.41.1 Biobase_2.71.0
## [5] GenomicRanges_1.63.1 Seqinfo_1.1.0
## [7] IRanges_2.45.0 S4Vectors_0.49.0
## [9] BiocGenerics_0.57.0 generics_0.1.4
## [11] MatrixGenerics_1.23.0 matrixStats_1.5.0
## [13] mist_1.3.3 BiocStyle_2.39.0
##
## loaded via a namespace (and not attached):
## [1] tidyselect_1.2.1 dplyr_1.2.0 farver_2.1.2
## [4] Biostrings_2.79.5 S7_0.2.1 bitops_1.0-9
## [7] fastmap_1.2.0 RCurl_1.98-1.17 GenomicAlignments_1.47.0
## [10] XML_3.99-0.22 digest_0.6.39 lifecycle_1.0.5
## [13] survival_3.8-6 magrittr_2.0.4 compiler_4.5.2
## [16] rlang_1.1.7 sass_0.4.10 tools_4.5.2
## [19] yaml_2.3.12 rtracklayer_1.71.3 knitr_1.51
## [22] S4Arrays_1.11.1 labeling_0.4.3 curl_7.0.0
## [25] DelayedArray_0.37.0 RColorBrewer_1.1-3 abind_1.4-8
## [28] BiocParallel_1.45.0 withr_3.0.2 sys_3.4.3
## [31] grid_4.5.2 scales_1.4.0 MASS_7.3-65
## [34] mcmc_0.9-8 cli_3.6.5 mvtnorm_1.3-3
## [37] rmarkdown_2.30 crayon_1.5.3 httr_1.4.8
## [40] rjson_0.2.23 cachem_1.1.0 splines_4.5.2
## [43] parallel_4.5.2 BiocManager_1.30.27 XVector_0.51.0
## [46] restfulr_0.0.16 vctrs_0.7.1 Matrix_1.7-4
## [49] jsonlite_2.0.0 SparseM_1.84-2 carData_3.0-6
## [52] car_3.1-5 MCMCpack_1.7-1 Formula_1.2-5
## [55] maketools_1.3.2 jquerylib_0.1.4 glue_1.8.0
## [58] codetools_0.2-20 gtable_0.3.6 BiocIO_1.21.0
## [61] tibble_3.3.1 pillar_1.11.1 htmltools_0.5.9
## [64] quantreg_6.1 R6_2.6.1 evaluate_1.0.5
## [67] lattice_0.22-9 Rsamtools_2.27.1 cigarillo_1.1.0
## [70] bslib_0.10.0 MatrixModels_0.5-4 coda_0.19-4.1
## [73] SparseArray_1.11.10 xfun_0.56 buildtools_1.0.0
## [76] pkgconfig_2.0.3
estiParamdmSingleplotGene
estiParamdmTwoGroups