Palantir-Magic: Run MAGIC for Gene Expression Smoothing

Palantir.MagicR Documentation

Run MAGIC for Gene Expression Smoothing

Description

Applies the MAGIC (Markov Affinity-based Graph Imputation of Cells) algorithm to a Seurat object to denoise and smooth gene expression data. This technique enhances data interpretability by imputing missing data and reducing technical noise.

Usage

Palantir.Magic(
  seu,
  n_top_genes = 2000,
  n_components = 20,
  conda_env = "seuratextend"
)

Arguments

seu

A Seurat object containing single-cell RNA-seq data to which the MAGIC algorithm will be applied.

n_top_genes

The number of top variable genes to consider in the MAGIC algorithm, which helps in focusing the smoothing on the most informative genes. Default: 2000

n_components

The number of principal components to use in dimensionality reduction before applying MAGIC. Useful for preprocessing the data to enhance the effects of MAGIC. Default: 20

conda_env

The name of the Conda environment where the necessary Python dependencies for running MAGIC are installed. This environment is used to run Python code from R, ensuring smooth integration of the two platforms. Default: 'seuratextend'

Details

MAGIC uses a graph-based approach to infer and smooth gene expression across similar cells, effectively filling in gaps in the data where measurements are sparse or noisy. This process is especially beneficial in datasets with high levels of technical noise or when trying to resolve subtle biological signals that might be obscured by this noise.

Value

Updates the provided Seurat object by adding a new assay named 'magic', which contains the denoised and smoothed gene expression data.

Examples

library(Seurat)
library(SeuratExtend)

# Download the example Seurat Object
mye_small <- readRDS(url("https://zenodo.org/records/10944066/files/pbmc10k_mye_small_velocyto.rds", "rb"))

# Run MAGIC
mye_small <- Palantir.Magic(mye_small)

# Visualizing the effects of MAGIC on selected genes
DimPlot2(mye_small, features = c("CD14", "magic_CD14", "FLT3", "magic_FLT3"))


huayc09/SeuratExtend documentation built on July 15, 2024, 6:22 p.m.