永远积极向上,满怀梦想 亚卡达力biu 我生命中出现了最美好的东西,是因为我做了原本不敢做的事 hubgenes=c('TYROBP','ETS1','CTSB','HLA-A','LEF1','SIRT1','CEBPA','IRF4') hubgenes_probeID<-ids$probe_id[match(hubgenes ,ids$symbol)] hubgenes_expression<-exprSet[match(hubgenes,rownames (exprSet)),] install.packages('pROC') library(pROC) hubgenes_expression=t(hubgenes_expression) par (mfrow=c(2,4)) for(i in 1:length(hubgenes)){ x_color=c('blue', 'red', 'green', 'black', 'yellow' , 'orange','yellow' , 'orange') plot.roc(group_list,hubgenes_expression[i,],main=hubgenes[i], col=x_color[i],print.auc=T,percent=T,cex.lab=1.5,print.auc.cex=1.5) } roc1<- roc(group_list, hubgenes_expression[1,]) roc1<- roc(controls=hubgenes_expression[7,][group_list=='control'], cases=hubgenes_expression[7,][group_list=='case']) roc2<- roc(group_list, hubgenes_expression[2,]) roc3<- roc(group_list, hubgenes_expression[3,]) roc4<- roc(group_list, hubgenes_expression[4,]) roc5<- roc(group_list, hubgenes_expression[5,]) plot(roc1,col='red',legacy.axes=T) plot(roc2, add=TRUE, col='blue') plot(roc3, add=TRUE, col='green') plot(roc4, add=TRUE, col='yellow') plot(roc5, add=TRUE, col='orange') round(auc(roc1),3)##AUC round(ci(roc1),3)##95%CI round(auc(roc2),3)##AUC round(ci(roc2),3)##95%CI round(auc(roc3),3)##AUC round(ci(roc3),3)##95%CI round(auc(roc4),3)##AUC round(ci(roc4),3)##95%CI round(auc(roc5),3)##AUC round(ci(roc5),3)##95%CI legend('bottomright', legend=c('VEGFA-auc0.62','MMP9-auc0.6','TBX21-auc0.609','CCR5-auc0.587','LCN2-auc0.63'), col=c('red','blue','green','yellow','orange'),lty=1) plot(roc1, add = FALSE, col = 'red', legacy.axes = TRUE, main='IRF4', xlab = '1-Specificity', print.auc =TRUE, print.auc.x = 0.5, print.auc.y = 0.5) text(0.4,0.4, '95%CI=0.447-0.991') |
|
来自: 昵称69125444 > 《知识》