MAGICR provides seamless integration with Seurat objects, supporting both Seurat v4 and v5. This vignette demonstrates how to use MAGIC within a typical Seurat workflow.
# Gene-gene relationships are clearer after MAGIC
DefaultAssay(seurat_obj) <- "RNA"
p1 <- FeatureScatter(seurat_obj, feature1 = "Gene1", feature2 = "Gene2") +
ggtitle("Original")
DefaultAssay(seurat_obj) <- "MAGIC_RNA"
p2 <- FeatureScatter(seurat_obj, feature1 = "Gene1", feature2 = "Gene2") +
ggtitle("After MAGIC")
p1 | p2MAGICR automatically detects your Seurat version and uses the appropriate API:
MAGIC-imputed data often improves trajectory inference:
✅ Recommended: - Visualizing gene expression patterns - Gene-gene correlation analysis - Trajectory/pseudotime analysis - Identifying gene regulatory relationships
❌ Not Recommended: - Differential expression testing (use raw counts) - Cell type annotation (use normalized counts) - Integration with other datasets
sessionInfo()
#> R version 4.6.1 (2026-06-24)
#> Platform: x86_64-pc-linux-gnu
#> Running under: Ubuntu 26.04 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.32.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=en_US.UTF-8
#> [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] stats graphics grDevices utils datasets methods base
#>
#> other attached packages:
#> [1] Matrix_1.7-5 MAGICR_1.0.0 rmarkdown_2.31
#>
#> loaded via a namespace (and not attached):
#> [1] cli_3.6.6 knitr_1.51 rlang_1.2.0 xfun_0.59
#> [5] otel_0.2.0 jsonlite_2.0.0 listenv_1.0.0 buildtools_1.0.0
#> [9] htmltools_0.5.9 maketools_1.3.2 sys_3.4.3 sass_0.4.10
#> [13] grid_4.6.1 evaluate_1.0.5 jquerylib_0.1.4 fastmap_1.2.0
#> [17] yaml_2.3.12 lifecycle_1.0.5 compiler_4.6.1 codetools_0.2-20
#> [21] irlba_2.3.7 Rcpp_1.1.1-1.1 future_1.70.0 lattice_0.22-9
#> [25] digest_0.6.39 R6_2.6.1 RANN_2.6.2 parallelly_1.48.0
#> [29] parallel_4.6.1 bslib_0.11.0 tools_4.6.1 globals_0.19.1
#> [33] cachem_1.1.0