estiParamdmSingleplotGene
estiParamdmTwoGroups
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:
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.257015 -0.65800319 0.6704662 0.32695987 -0.08499720
## ENSMUSG00000000003 1.471712 -1.98260993 21.6039110 -31.83201490 12.07746686
## ENSMUSG00000000028 1.271675 -0.02297926 0.1485149 0.02632135 -0.01554607
## ENSMUSG00000000037 1.030785 -3.32235755 9.4311356 -3.99782693 -2.10490453
## ENSMUSG00000000049 1.007810 -0.15717413 0.1539206 0.11523266 0.06806295
## Sigma2_1 Sigma2_2 Sigma2_3 Sigma2_4
## ENSMUSG00000000001 5.828935 12.959841 4.167344 1.873990
## ENSMUSG00000000003 22.864332 6.077657 6.864039 9.200033
## ENSMUSG00000000028 6.976134 7.393192 3.089782 2.181497
## ENSMUSG00000000037 8.678554 12.579597 7.849311 2.080902
## ENSMUSG00000000049 6.054738 8.846405 2.712944 1.164296
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.048409699 0.042298489 0.014047292 0.008632123
## ENSMUSG00000000028
## 0.005896315
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.253647 -0.592552440 0.65865851 0.27654906 -0.095457532
## ENSMUSG00000000003 1.650630 0.494163681 9.21592020 -12.59531173 2.536845310
## ENSMUSG00000000028 1.280625 0.003525885 0.08087772 0.03246609 -0.001020308
## Sigma2_1 Sigma2_2 Sigma2_3 Sigma2_4
## ENSMUSG00000000001 5.278502 15.802456 3.468277 1.836472
## ENSMUSG00000000003 24.718098 2.537163 5.278427 9.015078
## ENSMUSG00000000028 7.432052 6.877211 3.113405 2.122135
head(rowData(Dat_sce_g2)$mist_pars, n = 3)
## Beta_0 Beta_1 Beta_2 Beta_3 Beta_4
## ENSMUSG00000000001 1.8990254 -1.350243 6.779308 -4.465056 -1.1466590
## ENSMUSG00000000003 -0.8209654 -1.929623 5.501995 -2.777593 -0.7370982
## ENSMUSG00000000028 2.2941125 -2.552121 10.631275 -11.706371 3.7471348
## Sigma2_1 Sigma2_2 Sigma2_3 Sigma2_4
## ENSMUSG00000000001 5.334782 6.657836 3.549807 1.316962
## ENSMUSG00000000003 6.392179 10.688400 4.686338 2.841845
## ENSMUSG00000000028 10.169537 4.504655 3.258572 3.180957
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.047826754 0.036407517 0.023629350 0.011315551
## ENSMUSG00000000028
## 0.009396238
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 Under development (unstable) (2025-11-04 r88984)
## Platform: aarch64-apple-darwin20
## Running under: macOS Ventura 13.7.8
##
## Matrix products: default
## BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
## LAPACK: /Library/Frameworks/R.framework/Versions/4.6-arm64/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.1 SingleCellExperiment_1.33.0
## [3] SummarizedExperiment_1.41.0 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.1 BiocStyle_2.39.0
##
## loaded via a namespace (and not attached):
## [1] tidyselect_1.2.1 dplyr_1.1.4 farver_2.1.2
## [4] Biostrings_2.79.4 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.20 digest_0.6.39 lifecycle_1.0.5
## [13] survival_3.8-3 magrittr_2.0.4 compiler_4.6.0
## [16] rlang_1.1.6 sass_0.4.10 tools_4.6.0
## [19] yaml_2.3.12 rtracklayer_1.71.3 knitr_1.51
## [22] labeling_0.4.3 S4Arrays_1.11.1 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 grid_4.6.0
## [31] scales_1.4.0 MASS_7.3-65 mcmc_0.9-8
## [34] tinytex_0.58 dichromat_2.0-0.1 cli_3.6.5
## [37] mvtnorm_1.3-3 rmarkdown_2.30 crayon_1.5.3
## [40] otel_0.2.0 httr_1.4.7 rjson_0.2.23
## [43] cachem_1.1.0 splines_4.6.0 parallel_4.6.0
## [46] BiocManager_1.30.27 XVector_0.51.0 restfulr_0.0.16
## [49] vctrs_0.6.5 Matrix_1.7-4 jsonlite_2.0.0
## [52] SparseM_1.84-2 carData_3.0-5 bookdown_0.46
## [55] car_3.1-3 MCMCpack_1.7-1 Formula_1.2-5
## [58] magick_2.9.0 jquerylib_0.1.4 glue_1.8.0
## [61] codetools_0.2-20 gtable_0.3.6 BiocIO_1.21.0
## [64] tibble_3.3.0 pillar_1.11.1 htmltools_0.5.9
## [67] quantreg_6.1 R6_2.6.1 evaluate_1.0.5
## [70] lattice_0.22-7 Rsamtools_2.27.0 cigarillo_1.1.0
## [73] bslib_0.9.0 MatrixModels_0.5-4 Rcpp_1.1.0.8.2
## [76] coda_0.19-4.1 SparseArray_1.11.10 xfun_0.55
## [79] pkgconfig_2.0.3