KrishnaswamyLab / MAGIC

MAGIC (Markov Affinity-based Graph Imputation of Cells), is a method for imputing missing values restoring structure of large biological datasets.
GNU General Public License v2.0
341 stars 97 forks source link

Running UMAP after Magic - is it valid? #205

Open Natacoman opened 2 years ago

Natacoman commented 2 years ago

Hello,

I would like to run UMAP based on a selected set of genes to see how well different cell types are separated only based on these genes. I tried running UMAP directly and running UMAP on the MAGIC output using Seurat:

# Running UMAP directly-----------------------------
data<- SCTransform(data,variable.features.n = 18171) 
data<- RunPCA(data,features = unique(rec$Gene))
data <- RunUMAP(data,dims = 1:20,seed.use = 123)

# Running UMAP after MAGIC------------------------
data.magic <- magic(data, genes=unique(rec$Gene))
data.magic@active.assay <- 'MAGIC_SCT'
data.magic = ScaleData(data.magic)
data.magic<- RunPCA(data.magic,features = unique(rec$Gene),assay = 'MAGIC_SCT')
data.magic <- RunUMAP(data.magic,dims = 1:10,metric = "euclidean",n.neighbors = 100,seed.use = 123,assay = 'MAGIC_SCT')

Running UMAP after MAGIC seems to be able to separate cell type much more nicely than running UMAP by itself. My question is : is it valid at all to calculate UMAP on the MAGIC output? I just want to make sure the nice results is not because of artifacts or invalid analysis.

Thank you so much!

Screen Shot 2022-09-25 at 12 45 59 PM