Contents

0.1 Introduction

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.

0.2 Installation

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")

0.3 Example Workflow for Single-Group Analysis

In this section, we will estimate parameters and perform differential methylation analysis using single-group data.

1 Step 1: Load Example 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"))

2 Step 2: Estimate Parameters Using 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.269886 -0.434972663  0.45097003  0.23519298 -0.03200845
## ENSMUSG00000000003 1.561606  1.597564553  2.18905377 -1.16192592 -2.91636311
## ENSMUSG00000000028 1.268028 -0.004361925  0.06314426  0.04559212  0.01073450
## ENSMUSG00000000037 1.037235 -4.759976994 12.89705052 -5.34557244 -2.82175916
## ENSMUSG00000000049 1.026960 -0.070240911  0.08690631  0.07744858  0.06356127
##                     Sigma2_1  Sigma2_2 Sigma2_3 Sigma2_4
## ENSMUSG00000000001  5.909933 13.935984 4.008168 1.796797
## ENSMUSG00000000003 25.125446  4.754137 5.479802 8.729371
## ENSMUSG00000000028  7.939914  6.491030 3.547648 2.237362
## ENSMUSG00000000037  8.994953 14.404410 8.035084 2.183000
## ENSMUSG00000000049  5.789267  8.870885 3.698852 1.249785

3 Step 3: Perform Differential Methylation Analysis Using 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.063894711        0.031829942        0.010849290        0.007172231 
## ENSMUSG00000000028 
##        0.004707744

4 Step 4: Perform Differential Methylation Analysis Using 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")

4.1 Example Workflow for Two-Group Analysis

In this section, we will estimate parameters and perform DM analysis using data from two phenotypic groups.

5 Step 1: Load Two-Group Data

# 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"))

6 Step 2: Estimate Parameters Using 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.272800 -0.50532792 0.42394404  0.27440485  0.05726484
## ENSMUSG00000000003 1.531456  1.67212227 1.59003844 -1.07021328 -2.36694571
## ENSMUSG00000000028 1.271012 -0.01969503 0.09172916  0.04922725  0.01135157
##                     Sigma2_1  Sigma2_2 Sigma2_3 Sigma2_4
## ENSMUSG00000000001  5.884785 14.235909 3.560069 1.851488
## ENSMUSG00000000003 24.796543  4.229369 6.735029 8.632212
## ENSMUSG00000000028  7.830500  6.308654 3.137662 2.373018
head(rowData(Dat_sce_g2)$mist_pars, n = 3)
##                        Beta_0     Beta_1    Beta_2     Beta_3     Beta_4
## ENSMUSG00000000001  1.9029902 -6.5569482 34.576979 -47.638607 19.5345260
## ENSMUSG00000000003 -0.8448866 -1.7075464  4.614680  -1.582352 -1.2943741
## ENSMUSG00000000028  2.3131442 -0.2684893  1.339347  -0.365961 -0.6132374
##                     Sigma2_1  Sigma2_2 Sigma2_3 Sigma2_4
## ENSMUSG00000000001  4.925260  5.806440 3.924334 1.543102
## ENSMUSG00000000003  6.589473 11.564588 4.417369 3.101734
## ENSMUSG00000000028 12.029131  4.731656 3.217623 2.910648

7 Step 3: Perform Differential Methylation Analysis for Two-Group Comparison Using 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 ENSMUSG00000000001 ENSMUSG00000000003 ENSMUSG00000000049 
##        0.062668436        0.038332125        0.031090102        0.011220554 
## ENSMUSG00000000028 
##        0.003502165

7.1 Conclusion

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.

Session info

## R version 4.6.1 (2026-06-24)
## Platform: x86_64-pc-linux-gnu
## Running under: Ubuntu 24.04.5 LTS
## 
## Matrix products: default
## BLAS:   /home/biocbuild/bbs-3.24-bioc/R/lib/libRblas.so 
## LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.12.0  LAPACK version 3.12.0
## 
## locale:
##  [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
##  [3] LC_TIME=en_GB              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: America/New_York
## tzcode source: system (glibc)
## 
## attached base packages:
## [1] stats4    stats     graphics  grDevices utils     datasets  methods  
## [8] base     
## 
## other attached packages:
##  [1] ggplot2_4.0.4               SingleCellExperiment_1.36.0
##  [3] SummarizedExperiment_1.44.0 Biobase_2.74.0             
##  [5] GenomicRanges_1.66.0        Seqinfo_1.4.0              
##  [7] IRanges_2.48.0              S4Vectors_0.52.0           
##  [9] BiocGenerics_0.60.0         generics_0.1.4             
## [11] MatrixGenerics_1.26.0       matrixStats_1.5.0          
## [13] mist_1.6.0                  BiocStyle_2.42.0           
## 
## loaded via a namespace (and not attached):
##  [1] tidyselect_1.2.1         dplyr_1.2.1              farver_2.1.2            
##  [4] Biostrings_2.82.0        S7_1.0.0                 bitops_1.1-0            
##  [7] fastmap_1.2.0            RCurl_1.98-1.20          GenomicAlignments_1.50.0
## [10] XML_3.99-0.25            digest_0.6.39            lifecycle_1.0.5         
## [13] survival_3.8-13          magrittr_2.0.5           compiler_4.6.1          
## [16] rlang_1.3.0              sass_0.5.0               tools_4.6.1             
## [19] yaml_2.3.12              rtracklayer_1.74.0       knitr_1.52              
## [22] labeling_0.4.3           S4Arrays_1.14.0          curl_8.2.0              
## [25] DelayedArray_0.40.0      RColorBrewer_1.1-3       abind_1.4-8             
## [28] BiocParallel_1.48.0      withr_3.0.3              grid_4.6.1              
## [31] scales_1.4.0             MASS_7.3-66              mcmc_0.9-8              
## [34] tinytex_0.61             dichromat_2.0-1          cli_3.6.6               
## [37] mvtnorm_1.4-2            rmarkdown_2.32           crayon_1.5.3            
## [40] otel_0.3.0               httr_1.4.9               rjson_0.2.23            
## [43] BiocBaseUtils_1.16.0     cachem_1.1.0             splines_4.6.1           
## [46] parallel_4.6.1           BiocManager_1.30.27      XVector_0.54.0          
## [49] restfulr_0.0.17          vctrs_0.7.3              Matrix_1.7-6            
## [52] jsonlite_2.0.0           SparseM_1.84-2           carData_3.0-6           
## [55] bookdown_0.48            car_3.1-5                MCMCpack_1.7-2          
## [58] Formula_1.2-6            magick_2.9.1             jquerylib_0.1.4         
## [61] glue_1.8.1               codetools_0.2-20         gtable_0.3.6            
## [64] BiocIO_1.24.0            tibble_3.3.1             pillar_1.11.1           
## [67] htmltools_0.5.9          quantreg_6.1             R6_2.6.1                
## [70] evaluate_1.0.5           lattice_0.23-1           Rsamtools_2.30.0        
## [73] cigarillo_1.4.0          bslib_0.12.0             MatrixModels_0.5-4      
## [76] Rcpp_1.1.2               coda_0.19-4.1            SparseArray_1.14.0      
## [79] xfun_0.62                pkgconfig_2.0.3