MAGIC
MAGIC copied to clipboard
Use MAGIC on SEURAT data
Hi Scott, I have a single dataset, and I used to analyze this data with the suggested SEURAT workflow. When I imputed the MAGIC_RNA, the feature plot of some genes seems like more closer to reality in the umap than the Seurat workflow. But I confused about whether I should run scale data, PCA, UMAP, FindNeighbors, and FindClusters before find markers in the MAGIC_RNA assay? Here is my code.
dev.off()
library(Seurat)
library(ggplot2)
library(Rmagic)
library(viridis)
library(readr)
library(dplyr)
#mm contain normolization, scaledata, run pca and run umap
mm<-readRDS("F:\\mouse.rds")
FeaturePlot(mm,features =c("Cdh1","Cdh2"),min.cutoff = "q5",max.cutoff = "q95")
mm_magic<-magic(mm)
DefaultAssay(mm_magic)<-"MAGIC_RNA"
FeaturePlot(mm_magic,features =c("Cdh1","Cdh2"),min.cutoff = "q5",max.cutoff = "q95")
mm_magic<-FindVariableFeatures(mm_magic, selection.method = "vst", nfeatures = 2000)
mm_magic <- ScaleData(mm_magic, features = rownames(mm_magic))
mm_magic <- RunPCA(mm_magic, features = VariableFeatures(object = mm_magic))
mm_magic_marker_wilcox<-FindAllMarkers(mm_magic,test.use = "wilcox",logfc.threshold = 0.25)
top10 <- mm_magic_marker_wilcox %>% group_by(cluster) %>% top_n(n = 10, wt = avg_logFC)
DoHeatmap(mm_magic, features = top10$gene) + NoLegend()
kind regard, Miller