library(GSVA)
setwd(“F:\ESCC\chen_data\DSR+SSR结果\未转移的病人\ssGSEA”)
data <- read.table(“F:\ESCC\chen_data\DSR+SSR结果\未转移的病人\data_weizhuanyi_symbol_log2.txt”,stringsAsFactors = F)
cluster <- read.csv(“F:\ESCC\chen_data\DSR+SSR结果\未转移的病人\cluster_k=2.csv”,stringsAsFactors = F)
rownames(cluster) <- cluster[,1]
data <- data[,cluster[,1]]
data <- as.matrix(data)
gs <- read.csv(“F:\各种marker\成纤维细胞.csv”,stringsAsFactors = F,row.names = 1)
gs <- t(gs)
gs <- as.data.frame(gs)
gs <- as.list(gs)
gs <- lapply(gs, function(x) x[which(x != “”)])
jieguo <- gsva(data,gs, method = “ssgsea”, ssgsea.norm = TRUE, verbose = TRUE)
jieguo <- jieguo[,cluster[,1]]

write.csv(jieguo,”成纤维细胞的ssGSEA结果.csv”,quote = F)