Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use MAGIC on SEURAT data #192

Open
millersan opened this issue Nov 3, 2020 · 0 comments
Open

Use MAGIC on SEURAT data #192

millersan opened this issue Nov 3, 2020 · 0 comments
Labels

Comments

@millersan
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant