setwd(“F:\ESCC\免疫治疗数据的验证\Riaz_Melanoma_PD1_RNAseq\pre_treatment51”)
clinical <- read.csv(“clinical.csv”,stringsAsFactors = F)
cox <- matrix(,1,7)
colnames(cox) <- c(‘lower .95’,’upper .95’,’coef’, ‘exp(coef)’,’se(coef)’,’z’,’Pr(>|z|)’ )
clinical1 <- clinical[,c(16,3,9,10,11,12,4,5)]
for (i in 3:6){
a <- summary(coxph(Surv(clinical1OS) ~ clinical1[,i]))
cox <- rbind(cox,c(acoefficients[,1:5]))
cox <- rbind(cox,cbind(acoefficients[,1:5]))
}
cox <- cox[-1,]
cox_name <- c(“cluster: III vs I/II”,”Response_infor: 1 vs 0”,’Mutation_load’,”Neoantigen_load”,”Neopeptide_load”
,”Cytolytic_score”)
rownames(cox) <- cox_name
cox[,7] <- round(cox[,7],3)
cox <- cbind(cox,paste(round(cox[,4],3),” (“,round(cox[,1],3),” - “,round(cox[,2],3),”)”,sep = “”))
write.csv(cox,”os单cox森林图.csv”,quote = F)
data <- read.csv(“os单cox森林图.csv”,stringsAsFactors = F)
forestplot(as.matrix(data[,c(1,4,9)]),datalower..95,
data$upper..95,zero = 1,xlog = F,
clip = c(0,5),
colgap = unit(6,”mm”),graphwidth=unit(70,”mm”),
lineheight = unit(0.8,”cm”),graph.pos = 3,
col = fpColors(box=”black”, lines=”black”, zero = “black”),boxsize = 0.3,
ci.vertices = T,ci.vertices.height = 0.2,
lty.ci = 7,lwd.zero=0.4,lwd.ci = 3,
txt_gp=fpTxtGp(label = gpar(cex=0.8),
ticks = gpar(cex=0.8)) ,
is.summary=c(TRUE,rep(FALSE,100))
)