+5
-1
R/seurat_maps.R
+5
-1
R/seurat_maps.R
···
15
15
seurat_Heatmap <- function(count,genematrix,ssGSEA_result,filename){
16
16
17
17
count <- count[, !duplicated(colnames(count))]
18
+
celltype <- intersect(colnames(count),ssGSEA_result[,1])
19
+
labels <- ssGSEA_result[which(ssGSEA_result[,1]%in%celltype),]
20
+
count <- count[,labels[,1]]
21
+
18
22
seurat.data <- CreateSeuratObject(counts = count, project = filename)#, min.cells = 3, min.features = 200)
19
23
seurat.data
20
24
seurat.data[["percent.mt"]] <- PercentageFeatureSet(seurat.data, pattern = "^MT-")
···
59
63
head(seurat.data@reductions$tsne@cell.embeddings)
60
64
61
65
#Add annotation information to Seurat object
62
-
seurat.data@meta.data$cell_type_pred <- ssGSEA_result[,2]
66
+
seurat.data@meta.data$cell_type_pred <-labels[,2]
63
67
64
68
pdf(paste(filename, "_tSNE", ".pdf", sep=""), width=12, height=10)
65
69
p1 <- DimPlot(seurat.data, reduction = "tsne", group.by = "cell_type_pred",label = TRUE, pt.size=1)