library(survival)
library(survminer)
e<- exprSet[gene_name,]
e=log2(e+1)
dim(e)
dat=cbind(phe,e)
colnames(dat)[ncol(dat)]<- gene_name
dat$pathologic_T[grepl('T1',phe$pathologic_T)]<- 'T1'
dat$pathologic_T[grepl('T2',phe$pathologic_T)]<- 'T2'
dat$pathologic_T[grepl('T3',phe$pathologic_T)]<- 'T3'
dat$pathologic_T[grepl('T4',phe$pathologic_T)]<- 'T4'
dat$pathologic_N[grepl('N0',phe$pathologic_N)]<- 'N0'
dat$pathologic_N[grepl('N1',phe$pathologic_N)]<- 'N1'
dat$pathologic_N[grepl('N2',phe$pathologic_N)]<- 'N2'
dat$pathologic_N[grepl('N3',phe$pathologic_N)]<- 'N3'
# dat$pathologic_N[grepl('M0',phe$pathologic_M)]<- 'M0'
# dat$pathologic_M[grepl('M1',phe$pathologic_M)]<- 'M1'
dat$T_stage=as.numeric(factor(dat$pathologic_T))
dat$N_stage=as.numeric(factor(dat$pathologic_N))
colnames(dat)
dat2<- na.omit(dat)
mfl<- as.formula(paste0('Surv(time, event) ~ ',paste0(gene_name,collapse = '+')))
# mfl<- as.formula(paste0('Surv(time, event) ~ ',paste0(gene_name,collapse = '+'),'+ T_stage + N_stage'))
mfl
# s=Surv(time, event) ~ NUTM2A + AP003481.1 + CAMSAP3 + LAMC1 + APCDD1L+ SIAE+ UFM1+SRC+ABHD12
model <- coxph(mfl, data = dat )
summary(model,data=dat)
image.png
网友评论