-
Notifications
You must be signed in to change notification settings - Fork 11
Description
Hello, I'm using PHATE to visualize my single-cell transcriptome data. When I only visualized the clustering, it was successful. However, when I wanted to visualize the expression level of a certain gene, the graph suddenly became very small. Could you please tell me if there's something wrong with my code?
My code is as follows:
DefaultAssay(seurat_obj) <- "RNA"
set.seed(123)
seurat_obj <- NormalizeData(seurat_obj, assay = "RNA", normalization.method = "LogNormalize", scale.factor = 10000)
seurat_obj <- FindVariableFeatures(seurat_obj, assay = "RNA", selection.method = "vst", nfeatures = 2000)
seurat_obj <- ScaleData(seurat_obj, assay = "RNA", features = rownames(seurat_obj))
eml_qc <- RunPCA(seurat_obj, assay = "RNA", features = VariableFeatures(seurat_obj), npcs = 30)
pca_coords <- seurat_obj@reductions$pca@cell.embeddings
pca_coords <- as.matrix(pca_coords)
dim(pca_coords)
phate_emb <- phate(pca_coords)
mat <- phate_emb$embedding
dim(mat)
rownames(mat) <- Cells(seurat_obj)
colnames(mat) <- c("PHATE_1", "PHATE_2")
seurat_obj[["phate"]] <- CreateDimReducObject(
embeddings = mat,
key = "PHATE_",
assay = DefaultAssay(seurat_obj)
)
DimPlot(seurat_obj,reduction = "phate",group.by = "seurat_clusters",label = T )
FeaturePlot(seurat_obj,reduction = "phate", features = 'Cd34',order=T,label = F)
Thank you very much.