{"id":24297,"date":"2024-01-11T17:03:57","date_gmt":"2024-01-11T09:03:57","guid":{"rendered":"http:\/\/www.biocloudservice.com\/wordpress\/?p=24297"},"modified":"2024-01-11T17:03:59","modified_gmt":"2024-01-11T09:03:59","slug":"%e5%8f%aa%e9%9c%80%e4%b8%89%e5%88%86%e9%92%9f%ef%bc%8c%e6%8e%8c%e6%8f%a1%e7%94%9f%e5%ad%98%e7%9b%b8%e5%85%b3%e6%9c%ba%e5%99%a8%e5%ad%a6%e4%b9%a0%e7%ae%97%e6%b3%95-superpc%e5%92%8cridge","status":"publish","type":"post","link":"http:\/\/www.biocloudservice.com\/wordpress\/?p=24297","title":{"rendered":"\u53ea\u9700\u4e09\u5206\u949f\uff0c\u638c\u63e1\u751f\u5b58\u76f8\u5173\u673a\u5668\u5b66\u4e60\u7b97\u6cd5-superpc\u548cRidge"},"content":{"rendered":"<p>\u673a\u5668\u5b66\u4e60\uff0c\u5728\u751f\u4fe1\u6587\u7ae0\u4e2d\u51fa\u73b0\u7684\u9891\u7387\u8d8a\u6765\u8d8a\u9ad8\uff0c\u6210\u4e3a\u4e0d\u53ef\u6216\u7f3a\u7684\u4e00\u90e8\u5206\u5206\u6790\u5185\u5bb9\uff0c\u4eca\u5929\u5c0f\u679c\u60f3\u5e26\u7740\u5927\u5bb6\u5b66\u4e60\u4e00\u4e0b\u751f\u5b58\u76f8\u5173\u673a\u5668\u5b66\u4e60\u7684\u4e24\u79cd\u7b97\u6cd5-superpc\u548cRidge,\u63a5\u4e0b\u6765\u5c0f\u679c\u4e3a\u5927\u5bb6\u5bf9\u8fd9\u4e24\u79cd\u7b97\u6cd5\u505a\u4e00\u4e0b\u7b80\u5355\u4ecb\u7ecd\uff0csuperpc\u8fd9\u4e2a\u7b97\u6cd5\u7684\u4e2d\u6587\u540d\u79f0\u53eb\u505a\u76d1\u7763\u4e3b\u6210\u5206\u5206\u6790\uff0cRidge\u56de\u5f52\u4e5f\u662f\u5bf9\u53c2\u6570\u8fdb\u884c\u7ea6\u675f\u7684\u4e00\u79cd\u6c42\u89e3\u65b9\u7a0b\uff0cRidge\u56de\u5f52\u662f\u5728\u5747\u65b9\u635f\u5931\u51fd\u6570\u540e\u9762\u6dfb\u52a0L2\u6b63\u5219\u5316\u9879\uff0c\u80fd\u591f\u53c2\u6570\u65e0\u9650\u63a5\u8fd1\u96f6\uff1b\u901a\u8fc7\u8bad\u7ec3\u96c6\u6570\u636e\u8fdb\u884c\u6a21\u578b\u6784\u5efa\uff0c\u7136\u540e\u5229\u7528\u6d4b\u8bd5\u6570\u636e\u8fdb\u884c\u6a21\u578b\u9884\u6d4b\uff0c\u5e76\u8ba1\u7b97\u6a21\u578b\u7684\u9884\u6d4b\u6548\u80fd\u7684C\u6307\u6570\uff0c\u901a\u8fc7\u8be5\u6307\u6570\u6765\u5224\u65ad\u6a21\u578b\u7684\u597d\u574f\uff0c\u9009\u62e9\u6700\u9002\u5408\u7684\u6a21\u578b\uff0c\u5982\u679c\u89c9\u5f97\u63a8\u6587\u4e0d\u9519\uff0c\u70b9\u8d5e\u52a0\u5173\u6ce8\u5965\uff0c\u8bdd\u4e0d\u591a\u8bf4\uff0c\u5c0f\u679c\u5f00\u59cb\u4eca\u5929\u7684\u5206\u4eab\u5566\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<ol>\n<li>\u5b89\u88c5\u9700\u8981\u7684R\u5305<\/li>\n<\/ol>\n<p>install.packages(\u201ctidyverse\u201d)<\/p>\n<p>BiocManager::install(&#8220;survcomp&#8221;)<\/p>\n<p>install.packages(&#8220;superpc&#8221;)<\/p>\n<p>install.packages(\u201csurvival\u201d)<\/p>\n<p>install.packages(&#8220;glmnet&#8221;)<\/p>\n<ol>\n<li>\u8f7d\u5165\u9700\u8981\u7684R\u5305<\/li>\n<\/ol>\n<p>library(superpc)<\/p>\n<p>library(survival)<\/p>\n<p>library(survcomp)<\/p>\n<p>library(tidyverse)<\/p>\n<p>library(glmnet)<\/p>\n<ol>\n<li>\u8bfb\u53d6\u6570\u636e<\/li>\n<\/ol>\n<p>#TCGA.txt-\u8bad\u7ec3\u96c6\u6570\u636e\uff0c\u7b2c\u4e00\u5217\u4e3a\u6837\u672c\u4fe1\u606f\uff0c\u7b2c\u4e8c\u5217\u8868\u793a\u751f\u5b58\u72b6\u6001\uff0c\u7b2c\u4e09\u5217\u8868\u793a\u751f\u5b58\u65f6\u95f4\uff0c\u5176\u4ed6\u5217\u4e3a\u57fa\u56e0\u540d<\/p>\n<p>tcga &lt;- read.table(&#8220;TCGA.txt&#8221;, header = T,sep = &#8220;\\t&#8221;, quote = &#8220;&#8221;, check.names = F)<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"640\" height=\"170\" class=\"wp-image-24298\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/01\/dingtalk_20230626145325.jpeg?resize=640%2C170\" alt=\"Dingtalk_20230626145325\" srcset=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/01\/dingtalk_20230626145325.jpeg?w=1268 1268w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/01\/dingtalk_20230626145325.jpeg?resize=300%2C79 300w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/01\/dingtalk_20230626145325.jpeg?resize=1024%2C271 1024w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/01\/dingtalk_20230626145325.jpeg?resize=768%2C204 768w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/01\/dingtalk_20230626145325.jpeg?resize=600%2C159 600w\" sizes=\"(max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/><\/p>\n<p>#GSE57303-\u6d4b\u8bd5\u96c6\u6570\u636e\uff0c\u7b2c\u4e00\u5217\u4e3a\u6837\u672c\u4fe1\u606f\uff0c\u7b2c\u4e8c\u5217\u8868\u793a\u751f\u5b58\u72b6\u6001\uff0c\u7b2c\u4e09\u5217\u8868\u793a\u751f\u5b58\u65f6\u95f4\uff0c\u5176\u4ed6\u5217\u4e3a\u57fa\u56e0\u540d.<\/p>\n<p>GSE57303 &lt;- read.table(&#8220;GSE57303.txt&#8221;, header = T, sep = &#8220;\\t&#8221;, quote = &#8220;&#8221;, check.names = F)<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"640\" height=\"155\" class=\"wp-image-24299\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/01\/dingtalk_20230626150339.jpeg?resize=640%2C155\" alt=\"Dingtalk_20230626150339\" srcset=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/01\/dingtalk_20230626150339.jpeg?w=1269 1269w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/01\/dingtalk_20230626150339.jpeg?resize=300%2C73 300w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/01\/dingtalk_20230626150339.jpeg?resize=1024%2C248 1024w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/01\/dingtalk_20230626150339.jpeg?resize=768%2C186 768w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/01\/dingtalk_20230626150339.jpeg?resize=600%2C145 600w\" sizes=\"(max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/><\/p>\n<ol>\n<li>\u6240\u9700\u6570\u636e\u683c\u5f0f\u6574\u7406<\/li>\n<\/ol>\n<p># \u751f\u6210\u5305\u542b2\u4e2a\u6570\u636e\u96c6\u7684\u5217\u8868<\/p>\n<p>mm &lt;- list(TCGA = tcga,<\/p>\n<p>GSE57303 = GSE57303)<\/p>\n<p># \u6570\u636e\u6807\u51c6\u5316<\/p>\n<p>mm &lt;- lapply(mm,function(x){<\/p>\n<p>x[,-c(1:3)] &lt;- scale(x[,-c(1:3)])<\/p>\n<p>return(x)})<\/p>\n<p>result &lt;- data.frame()<\/p>\n<p># TCGA\u4f5c\u4e3a\u8bad\u7ec3\u96c6<\/p>\n<p>est_data &lt;- mm$TCGA<\/p>\n<p>#GSE57303\u4f5c\u4e3a\u6d4b\u8bd5\u96c6<\/p>\n<p>w&lt;-mm$GSE57303<\/p>\n<p>#\u83b7\u5f97\u57fa\u56e0\u540d<\/p>\n<p>pre_var &lt;- colnames(est_data)[-c(1:3)]<\/p>\n<p>#\u63d0\u53d6\u8bad\u7ec3\u96c6\u9700\u8981\u7684\u5217\u6570\u636e<\/p>\n<p>est_dd &lt;- est_data[, c(&#8216;OS.time&#8217;, &#8216;OS&#8217;, pre_var)]<\/p>\n<p>#\u63d0\u53d6\u6d4b\u8bd5\u96c6\u9700\u8981\u7684\u5217\u6570\u636e<\/p>\n<p>w &lt;- w[, c(&#8216;OS.time&#8217;, &#8216;OS&#8217;, pre_var)]<\/p>\n<p>5.superpc\u7b97\u6cd5\u8fdb\u884c\u6a21\u578b\u6784\u5efa<\/p>\n<p>#\u8bad\u7ec3\u96c6\u6570\u636e\u5217\u8868<\/p>\n<p>data &lt;- list(x = t(est_dd[, -c(1,2)]), y = est_dd$OS.time, censoring.status = est_dd$OS, featurenames = colnames(est_dd)[-c(1, 2)])<\/p>\n<p>set.seed(123)<\/p>\n<p>#\u5229\u7528\u8bad\u7ec3\u96c6\u8fdb\u884c\u6a21\u578b\u6784\u5efa<\/p>\n<p>fit &lt;- superpc.train(data = data,type = &#8216;survival&#8217;, s0.perc = 0.5) #default<\/p>\n<p>cv.fit &lt;- superpc.cv(fit, data, n.threshold = 20, #default<\/p>\n<p>n.fold = 10,<\/p>\n<p>n.components = 3,<\/p>\n<p>min.features = 5,<\/p>\n<p>max.features = nrow(data$x),<\/p>\n<p>compute.fullcv = TRUE,<\/p>\n<p>compute.preval = TRUE)<\/p>\n<p>#\u6d4b\u8bd5\u96c6\u6570\u636e\u5217\u8868<\/p>\n<p>test &lt;- list(x = t(w[,-c(1,2)]), y = w$OS.time, censoring.status = w$OS, featurenames = colnames(w)[-c(1,2)])<\/p>\n<p>#\u5229\u7528\u8bad\u7ec3\u96c6\u8fdb\u884c\u6a21\u578b\u9884\u6d4b<\/p>\n<p>ff &lt;- superpc.predict(fit, data, test, threshold = cv.fit$thresholds[which.max(cv.fit[[&#8220;scor&#8221;]][1,])], n.components = 1)<\/p>\n<p>#\u5c06\u6570\u636e\u7c7b\u578b\u6539\u4e3a\u6570\u5b57<\/p>\n<p>rr &lt;- as.numeric(ff$v.pred)<\/p>\n<p>rr2 &lt;- cbind(w[,1:2], RS = rr)<\/p>\n<p>#\u8ba1\u7b97\u6a21\u578b\u7684\u9884\u6d4b\u6548\u80fd\u7684C\u6307\u6570<\/p>\n<p>cc&lt;-data.frame(Cindex=as.numeric(summary(coxph(Surv(OS.time,OS)~ RS,rr2))$concordance[1])) %&gt;%<\/p>\n<p>rownames_to_column(&#8216;ID&#8217;)<\/p>\n<p>cc$Model &lt;- paste0(&#8216;SuperPC&#8217;)<\/p>\n<p>result &lt;- rbind(result, cc)<\/p>\n<p>6.Ridge\u7b97\u6cd5\u8fdb\u884c\u6a21\u578b\u6784\u5efa<\/p>\n<p>#\u6a21\u578b\u6784\u5efa<\/p>\n<p>x1 &lt;- as.matrix(est_dd[, pre_var])<\/p>\n<p>x2 &lt;- as.matrix(Surv(est_dd$OS.time, est_dd$OS))<\/p>\n<p>set.seed(seed)<\/p>\n<p>fit = glmnet(x1, x2, family = &#8220;binomial&#8221;, alpha = 0, lambda = NULL)<\/p>\n<p>cvfit = cv.glmnet(x1, x2,<\/p>\n<p>nfold = 10, #\u4f8b\u6587\u63cf\u8ff0\uff1a10-fold cross-validation<\/p>\n<p>family = &#8220;binomial&#8221;,<\/p>\n<p>type.measure = &#8220;class&#8221;<\/p>\n<p>)<\/p>\n<p>#\u6a21\u578b\u9884\u6d4b<\/p>\n<p>rs = as.numeric(predict(fit, type = &#8216;response&#8217;, newx = as.matrix(w[, -c(1,2)]), s = cvfit$lambda.min))<\/p>\n<p>rr2 &lt;- cbind(w[,1:2], RS = rs)<\/p>\n<p>##\u8ba1\u7b97\u6a21\u578b\u7684\u9884\u6d4b\u6548\u80fd\u7684C\u6307\u6570<\/p>\n<p>cc &lt;- data.frame(Cindex = as.numeric(summary(coxph(Surv(OS.time,OS) ~ RS, rr2))$concordance[1])) %&gt;%<\/p>\n<p>rownames_to_column(&#8216;ID&#8217;)<\/p>\n<p>cc$Model &lt;- paste0(&#8216;Ridge&#8217;)<\/p>\n<p>Result &lt;- rbind(result, cc)<\/p>\n<p>write.table(Result,file=&#8221;superpc_ridge.txt&#8221;,row.names=F,col.names=T,sep=&#8221;\\t&#8221;,quote=F)<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"640\" height=\"45\" class=\"wp-image-24300\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/01\/dingtalk_20230626163309.jpeg?resize=640%2C45\" alt=\"Dingtalk_20230626163309\" srcset=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/01\/dingtalk_20230626163309.jpeg?w=1268 1268w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/01\/dingtalk_20230626163309.jpeg?resize=300%2C21 300w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/01\/dingtalk_20230626163309.jpeg?resize=1024%2C72 1024w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/01\/dingtalk_20230626163309.jpeg?resize=768%2C54 768w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/01\/dingtalk_20230626163309.jpeg?resize=600%2C42 600w\" sizes=\"(max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/><\/p>\n<p>\u5c0f\u679c\u6700\u7ec8\u987a\u5229\u7684\u5229\u7528supersc\u548cRidge\u4e24\u79cd\u7b97\u6cd5\u8fdb\u884c\u4e86\u6a21\u578b\u6784\u5efa\u548c\u9884\u6d4b\uff0c\u5e76\u8ba1\u7b97\u4e86\u9884\u6d4b\u6548\u80fdC\u6307\u6570\uff0c\u6765\u5224\u65ad\u6a21\u578b\u7684\u597d\u574f\uff0c\u673a\u5668\u5b66\u4e60\u76f8\u5173\u7684\u5176\u4ed6\u5206\u6790\u5185\u5bb9\u6b22\u8fce\u5c1d\u8bd5\u672c\u516c\u53f8\u65b0\u5f00\u53d1\u7684\u4e91\u5e73\u53f0\u751f\u7269\u4fe1\u606f\u5206\u6790\u5c0f\u5de5\u5177\uff0c\u96f6\u4ee3\u7801\u5b8c\u6210\u5206\u6790\uff0c\u4e91\u5e73\u53f0\u7f51\u5740\uff1ahttp:\/\/www.biocloudservice.com\/home.html\uff0c\u4e3b\u8981\u5305\u62eclasso\u56de\u5f52\u6a21\u578b\u7b5b\u9009\u7279\u5f81\u57fa\u56e0(http:\/\/www.biocloudservice.com\/116\/116.php),\u968f\u673a\u68ee\u6797\u7684\u5341\u6298\u4ea4\u53c9\u9a8c\u8bc1(http:\/\/www.biocloudservice.com\/646\/646.php),svm-ref\u652f\u6301\u5411\u91cf\u673a\u7684\u673a\u5668\u5b66\u4e60(http:\/\/www.biocloudservice.com\/372\/372.php)\u7b49\u673a\u5668\u5b66\u4e60\u76f8\u5173\u7684\u5c0f\u5de5\u5177\uff0c\u4eca\u5929\u5c0f\u679c\u7684\u5206\u4eab\u5c31\u5230\u8fd9\u91cc\uff0c\u6b22\u8fce\u5927\u5bb6\u548c\u5c0f\u679c\u4e00\u8d77\u8ba8\u8bba\u5b66\u4e60\uff0c\u4e0b\u671f\u518d\u89c1\u5965\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u673a\u5668\u5b66\u4e60\uff0c\u5728\u751f\u4fe1\u6587\u7ae0\u4e2d\u51fa\u73b0\u7684\u9891\u7387\u8d8a\u6765\u8d8a\u9ad8\uff0c\u6210\u4e3a\u4e0d\u53ef\u6216\u7f3a\u7684\u4e00\u90e8\u5206\u5206\u6790\u5185\u5bb9\uff0c\u4eca\u5929\u5c0f\u679c\u60f3\u5e26\u7740\u5927\u5bb6\u5b66\u4e60\u4e00\u4e0b\u751f\u5b58\u76f8\u5173\u673a\u5668 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":""},"categories":[1],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/24297"}],"collection":[{"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=24297"}],"version-history":[{"count":1,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/24297\/revisions"}],"predecessor-version":[{"id":24301,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/24297\/revisions\/24301"}],"wp:attachment":[{"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=24297"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=24297"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=24297"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}