{"id":68691,"date":"2026-12-06T09:01:27","date_gmt":"2026-12-06T01:01:27","guid":{"rendered":"https:\/\/www.biocloudservice.com\/wordpress\/?p=68691"},"modified":"2026-12-06T09:01:27","modified_gmt":"2026-12-06T01:01:27","slug":"r-guide-consensusclusterplus-practice","status":"publish","type":"post","link":"https:\/\/www.biocloudservice.com\/wordpress\/r-guide-consensusclusterplus-practice\/","title":{"rendered":"ConsensusClusterPlus \u7684\u5171\u8bc6\u70ed\u56fe\uff0c\u6bcf\u4e2a\u683c\u5b50\u7684\u5206\u6bcd\u662f\u4ec0\u4e48\uff1f"},"content":{"rendered":"<div class=\"ysx-r-practice\" id=\"ysx-r-consensusclusterplus\" style=\"max-width:820px;margin:0 auto;color:#203449;font-size:17px;line-height:1.88;overflow-wrap:break-word;\">\n<p style=\"margin:.5em 0 1em\">\u4e00\u5bf9\u6837\u672c\u5728\u4e8c\u5341\u8f6e\u62bd\u6837\u4e2d\u53ea\u6709\u5341\u8f6e\u540c\u65f6\u5165\u9009\uff0c\u5176\u4e2d\u516b\u8f6e\u540c\u7c07\uff0c\u5b83\u4eec\u7684\u5171\u8bc6\u5e94\u8bb0\u4f5c\u516b\u6210\u3002\u628a\u7f3a\u5e2d\u7684\u8f6e\u6b21\u5f53\u4f5c\u4e0d\u540c\u7c07\u4f1a\u4eba\u4e3a\u964d\u4f4e\u5171\u8bc6\u3002\u7531\u8fd9\u4e2a\u683c\u5b50\u7684\u5206\u6bcd\u5165\u624b\uff0c\u6bd4\u5355\u770b\u70ed\u56fe\u989c\u8272\u66f4\u5bb9\u6613\u53d1\u73b0\u7f55\u89c1\u4e9a\u578b\u7684\u8bc1\u636e\u662f\u5426\u5145\u5206\u3002<\/p>\n<h2 style=\"margin:2em 0 .6em;color:#205CAC;font-size:1.38em;line-height:1.5;\">ConsensusClusterPlus \u7684\u8f93\u5165\u548c\u5206\u6790\u5bf9\u8c61<\/h2>\n<p style=\"margin:.5em 0 1em\">x \u4e3a\u7279\u5f81\u00d7\u6837\u672c\u7684\u5df2\u6309\u5206\u6790\u76ee\u6807\u9884\u5904\u7406\u7684\u77e9\u9635\uff0c\u5217\u540d\u4e3a\u552f\u4e00\u53d7\u8bd5\u8005\u3002\u6559\u5b66\u53c2\u6570\u53ea\u7528\u4f5c\u5c0f\u89c4\u6a21\u590d\u8dd1\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">ConsensusClusterPlus \u51fd\u6570\u7528\u4e8e\u4ece\u91cd\u590d\u62bd\u6837\u4e2d\u751f\u6210\u5171\u8bc6\u805a\u7c7b\u7ed3\u679c\uff0c\u5176\u6838\u5fc3\u662f\u6784\u5efa\u6837\u672c\u95f4\u76f8\u4f3c\u6027\u77e9\u9635\u3002\u8f93\u5165\u77e9\u9635\u4e3a\u7279\u5f81\u884c\u4e0e\u6837\u672c\u5217\u6784\u6210\u7684\u4e8c\u7ef4\u6570\u636e\uff0c\u5217\u540d\u9700\u552f\u4e00\u6807\u8bc6\u6837\u672c\uff0c\u4ee5\u4fdd\u8bc1\u6bcf\u6b21\u62bd\u6837\u4e2d\u6837\u672c\u4e00\u81f4\u6027\u3002\u8be5\u77e9\u9635\u5e94\u5df2\u6839\u636e\u5206\u6790\u76ee\u6807\u5b8c\u6210\u9884\u5904\u7406\uff0c\u5305\u62ec\u6807\u51c6\u5316\u3001\u7f3a\u5931\u503c\u5904\u7406\u7b49\u3002\u8f93\u5165\u6570\u636e\u7684\u7ed3\u6784\u51b3\u5b9a\u4e86\u540e\u7eed\u805a\u7c7b\u5206\u6790\u7684\u7a33\u5b9a\u6027\u548c\u53ef\u91cd\u590d\u6027\u3002\u5728\u6784\u5efa\u5171\u8bc6\u70ed\u56fe\u65f6\uff0c\u6bcf\u4e2a\u6837\u672c\u5bf9\u7684\u5171\u8bc6\u503c\u57fa\u4e8e\u5176\u5728\u591a\u6b21\u62bd\u6837\u4e2d\u662f\u5426\u88ab\u5206\u914d\u81f3\u76f8\u540c\u7c07\u3002\u5171\u8bc6\u8ba1\u7b97\u4f9d\u8d56\u4e8e\u6837\u672c\u5bf9\u662f\u5426\u540c\u65f6\u51fa\u73b0\u5728\u6bcf\u6b21\u62bd\u6837\u4e2d\uff0c\u56e0\u6b64\u5206\u6bcd\u5e94\u4e3a\u6837\u672c\u5bf9\u5171\u540c\u5165\u9009\u7684\u8f6e\u6570\uff0c\u800c\u975e\u603b\u62bd\u6837\u6b21\u6570\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u5171\u8bc6\u70ed\u56fe\u7684\u6784\u5efa\u4f9d\u8d56\u4e8e\u6837\u672c\u5bf9\u7684\u5171\u540c\u5165\u9009\u4e0e\u540c\u7c07\u9891\u7387\u3002\u6bcf\u4e2a\u6837\u672c\u5bf9\u7684\u5171\u8bc6\u503c\u8ba1\u7b97\u4e2d\uff0c\u5206\u6bcd\u4e3a\u6837\u672c\u5bf9\u5728\u6240\u6709\u62bd\u6837\u4e2d\u540c\u65f6\u51fa\u73b0\u7684\u6b21\u6570\u3002\u4f8b\u5982\uff0c\u82e5\u4e00\u5bf9\u6837\u672c\u5728\u4e8c\u5341\u6b21\u62bd\u6837\u4e2d\u5341\u6b21\u540c\u65f6\u51fa\u73b0\uff0c\u5176\u4e2d\u516b\u6b21\u88ab\u5f52\u4e3a\u540c\u4e00\u7c07\uff0c\u5219\u5171\u8bc6\u503c\u4e3a\u516b\u6210\u3002\u82e5\u8be5\u5bf9\u6837\u672c\u4ec5\u51fa\u73b0\u4e00\u6b21\uff0c\u5171\u8bc6\u503c\u5373\u4e3a\u8be5\u6b21\u7684\u5f52\u5c5e\u60c5\u51b5\u3002\u6b64\u65b9\u6cd5\u786e\u4fdd\u5171\u8bc6\u503c\u7684\u8ba1\u7b97\u57fa\u4e8e\u5b9e\u9645\u53ef\u6bd4\u6570\u636e\uff0c\u907f\u514d\u4e86\u56e0\u6837\u672c\u672a\u88ab\u62bd\u4e2d\u800c\u5bfc\u81f4\u7684\u8bef\u5224\u3002\u5728\u5b9e\u9645\u64cd\u4f5c\u4e2d\uff0c\u6837\u672c\u5bf9\u7684\u8986\u76d6\u60c5\u51b5\u4e0e\u62bd\u6837\u7b56\u7565\u5bc6\u5207\u76f8\u5173\u3002\u62bd\u6837\u6bd4\u4f8bpItem\u51b3\u5b9a\u4e86\u6bcf\u6b21\u62bd\u6837\u4e2d\u6837\u672c\u7684\u9009\u53d6\u6bd4\u4f8b\uff0c\u82e5\u8be5\u503c\u8fc7\u4f4e\uff0c\u53ef\u80fd\u5bfc\u81f4\u90e8\u5206\u6837\u672c\u672a\u88ab\u591a\u6b21\u62bd\u4e2d\uff0c\u4ece\u800c\u5f71\u54cd\u5171\u8bc6\u77e9\u9635\u7684\u5b8c\u6574\u6027\u3002\u56e0\u6b64\uff0c\u62bd\u6837\u7b56\u7565\u5e94\u786e\u4fdd\u6837\u672c\u5728\u591a\u6b21\u62bd\u6837\u4e2d\u5177\u6709\u8db3\u591f\u8986\u76d6\u7387\uff0c\u4ee5\u83b7\u5f97\u7a33\u5b9a\u5171\u8bc6\u503c\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">ConsensusClusterPlus \u51fd\u6570\u901a\u8fc7\u8bbe\u5b9a\u91cd\u590d\u6570reps\u63a7\u5236\u62bd\u6837\u6b21\u6570\uff0c\u6bcf\u6b21\u62bd\u6837\u4e2d\u6837\u672c\u6309 pItem \u6bd4\u4f8b\u62bd\u53d6\u3002\u62bd\u6837\u8fc7\u7a0b\u4fdd\u8bc1\u4e86\u6bcf\u6b21\u805a\u7c7b\u5206\u6790\u7684\u72ec\u7acb\u6027\uff0c\u540c\u65f6\u901a\u8fc7\u91cd\u590d\u62bd\u6837\u8bc4\u4f30\u805a\u7c7b\u7ed3\u679c\u7684\u7a33\u5b9a\u6027\u3002\u6bcf\u6b21\u62bd\u6837\u540e\uff0c\u805a\u7c7b\u7ed3\u679c\u88ab\u8bb0\u5f55\u5e76\u7528\u4e8e\u6784\u5efa\u5171\u8bc6\u77e9\u9635\u3002\u8be5\u77e9\u9635\u7684\u6784\u5efa\u4f9d\u8d56\u4e8e\u6837\u672c\u5bf9\u5728\u6240\u6709\u62bd\u6837\u4e2d\u662f\u5426\u88ab\u5212\u5206\u81f3\u76f8\u540c\u7c07\u3002\u82e5\u67d0\u5bf9\u6837\u672c\u5728\u6240\u6709\u62bd\u6837\u4e2d\u5747\u672a\u540c\u65f6\u51fa\u73b0\uff0c\u5219\u8be5\u5bf9\u4e0d\u53c2\u4e0e\u5171\u8bc6\u8ba1\u7b97\u3002\u5171\u8bc6\u503c\u7684\u8ba1\u7b97\u65b9\u5f0f\u662f\u5c06\u6837\u672c\u5bf9\u540c\u65f6\u51fa\u73b0\u4e14\u540c\u7c07\u7684\u6b21\u6570\u9664\u4ee5\u5171\u540c\u51fa\u73b0\u7684\u603b\u6b21\u6570\u3002\u8be5\u65b9\u6cd5\u786e\u4fdd\u5171\u8bc6\u503c\u57fa\u4e8e\u5b9e\u9645\u53ef\u6bd4\u8f83\u7684\u6570\u636e\uff0c\u907f\u514d\u4e86\u56e0\u6837\u672c\u672a\u88ab\u62bd\u4e2d\u800c\u5f15\u5165\u7684\u504f\u5dee\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u8f93\u5165\u201c\u7279\u5f81 \u00d7 \u6837\u672c\u201d\u77e9\u9635\uff0c\u7528 <code>ConsensusClusterPlus()<\/code> \u8bbe\u5b9a\u5019\u9009\u6700\u5927\u7c07\u6570\u3001\u62bd\u6837\u6bd4\u4f8b\u548c\u91cd\u590d\u6570\uff0c\u68c0\u67e5\u5171\u8bc6\u77e9\u9635\u4e0e\u6837\u672c\u5f52\u5c5e\u3002 <a href=\"https:\/\/bioconductor.org\/packages\/release\/bioc\/vignettes\/ConsensusClusterPlus\/inst\/doc\/ConsensusClusterPlus.pdf\" style=\"color:#185CB7;text-decoration:underline;\">ConsensusClusterPlus \u5b98\u65b9\u6559\u7a0b<\/a><\/p>\n<pre style=\"white-space:pre;overflow:auto;max-width:100%;padding:14px;background:#F0F7FF;border:1px solid #D1E7FF;border-radius:8px;color:#183551;font-size:14px;line-height:1.6;box-sizing:border-box;\"><code class=\"language-r\" style=\"font-family:Consolas,monospace;white-space:pre;overflow-wrap:normal;word-break:normal;\">cc &lt;- ConsensusClusterPlus::ConsensusClusterPlus(x,maxK=4,reps=50,pItem=.8,pFeature=1,clusterAlg=\"hc\",distance=\"pearson\",seed=31,plot=NULL)\nhead(cc[[3]]$consensusClass)\n<\/code><\/pre>\n<h2 style=\"margin:2em 0 .6em;color:#205CAC;font-size:1.38em;line-height:1.5;\">\u540c\u4e00\u5bf9\u6837\u672c\u7684\u6b63\u786e\u5206\u6bcd<\/h2>\n<p style=\"margin:.5em 0 1em\">\u4e8c\u5341\u8f6e\u91cc\u4e00\u5bf9\u6837\u672c\u53ea\u6709\u5341\u8f6e\u540c\u65f6\u5165\u9009\uff0c\u5176\u4e2d\u516b\u6b21\u540c\u7c07\uff0c\u6761\u4ef6\u5171\u8bc6\u4e3a\u516b\u6210\uff0c\u5206\u6bcd\u4e0d\u80fd\u5199\u4e8c\u5341\u3002\u53e6\u4e00\u4e2a\u6837\u672c\u5bf9\u53ea\u6709\u4e00\u8f6e\u53ef\u6bd4\u8f83\u65f6\uff0c\u5373\u4f7f\u5171\u8bc6\u4e00\u4e5f\u9700\u8981\u6807\u6ce8\u8986\u76d6\u3002<\/p>\n<pre style=\"white-space:pre;overflow:auto;max-width:100%;padding:14px;background:#F0F7FF;border:1px solid #D1E7FF;border-radius:8px;color:#183551;font-size:14px;line-height:1.6;box-sizing:border-box;\"><code class=\"language-r\" style=\"font-family:Consolas,monospace;white-space:pre;overflow-wrap:normal;word-break:normal;\">v &lt;- c(20,10,8)\nnames(v) &lt;- c(\"\u603b\u8f6e\u6570\", \"\u5171\u540c\u5165\u9009\", \"\u5171\u540c\u5165\u9009\u4e14\u540c\u7c07\")\nprint(v)\n<\/code><\/pre>\n<table style=\"width:100%;border-collapse:collapse;margin:1em 0;font-size:15px\">\n<thead>\n<tr>\n<th style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#ECF6FF;\">\u8f93\u5165\u6216\u6bd4\u8f83\u9879<\/th>\n<th style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#ECF6FF;\">R \u8ba1\u7b97\u7ed3\u679c<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">\u603b\u8f6e\u6570<\/td>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">20<\/td>\n<\/tr>\n<tr>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">\u5171\u540c\u5165\u9009<\/td>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">10<\/td>\n<\/tr>\n<tr>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">\u5171\u540c\u5165\u9009\u4e14\u540c\u7c07<\/td>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">8<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<figure style=\"margin:1.5em 0;\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2026\/11\/r-guide-consensusclusterplus-practice-5c233290.png?resize=1120%2C690&#038;ssl=1\" alt=\"\u540c\u4e00\u5bf9\u6837\u672c\u7684\u6b63\u786e\u5206\u6bcd\u3002\u603b\u8f6e\u6570 20\uff0c\u5171\u540c\u5165\u9009 10\uff0c\u5171\u540c\u5165\u9009\u4e14\u540c\u7c07 8\u3002\" width=\"1120\" height=\"690\" style=\"max-width:100%;width:100%;height:auto;display:block\"><figcaption style=\"font-size:14px;color:#455970;line-height:1.6;\">\u6559\u5b66\u7b97\u4f8b\uff0c\u6570\u636e\u4e0e\u8ba1\u7b97\u5f0f\u89c1\u56fe\u4e0a\u65b9\u3002<\/figcaption><\/figure>\n<h2 style=\"margin:2em 0 .6em;color:#205CAC;font-size:1.38em;line-height:1.5;\">\u4e00\u6761\u5171\u8bc6\u8fb9\u770b\u8fc7\u591a\u5c11\u8f6e\uff1f<\/h2>\n<p style=\"margin:.5em 0 1em\">\u56db\u8f6e\u4e2d\u4e24\u8f6e\u770b\u5230\u4e86\u8fd9\u5bf9\u6837\u672c\uff0c\u6709\u4e00\u8f6e\u540c\u7c07\uff0c\u6761\u4ef6\u5171\u8bc6\u662f\u4e8c\u5206\u4e4b\u4e00\u3002\u5c06\u53e6\u5916\u4e24\u8f6e\u7f3a\u5931\u8865\u4e3a\u4e0d\u540c\u7c07\u4f1a\u9519\u8bef\u964d\u4f4e\u5171\u8bc6\u3002\u7f55\u89c1\u4e9a\u578b\u8981\u540c\u65f6\u770b\u6210\u5458\u95f4\u5171\u8bc6\u3001\u5171\u540c\u5165\u9009\u6b21\u6570\u4e0e\u6574\u4f53\u6837\u672c\u91cf\u3002<\/p>\n<pre style=\"white-space:pre;overflow:auto;max-width:100%;padding:14px;background:#F0F7FF;border:1px solid #D1E7FF;border-radius:8px;color:#183551;font-size:14px;line-height:1.6;box-sizing:border-box;\"><code class=\"language-r\" style=\"font-family:Consolas,monospace;white-space:pre;overflow-wrap:normal;word-break:normal;\">seen &lt;- c(TRUE,TRUE,FALSE,FALSE)\nsame &lt;- c(TRUE,FALSE,NA,NA)\nc(used=sum(seen),consensus=mean(same[seen]))\n<\/code><\/pre>\n<p style=\"margin:.5em 0 1em\">\u5728\u5171\u8bc6\u77e9\u9635\u6784\u5efa\u8fc7\u7a0b\u4e2d\uff0c\u6bcf\u4e2a\u6837\u672c\u5bf9\u7684\u5171\u8bc6\u503c\u7531\u5176\u5728\u6240\u6709\u62bd\u6837\u4e2d\u662f\u5426\u540c\u65f6\u51fa\u73b0\u4e14\u540c\u7c07\u51b3\u5b9a\u3002\u82e5\u6837\u672c\u5bf9\u5728\u6240\u6709\u62bd\u6837\u4e2d\u5747\u672a\u540c\u65f6\u51fa\u73b0\uff0c\u5219\u5171\u8bc6\u503c\u4e3a\u7f3a\u5931\u3002\u82e5\u6837\u672c\u5bf9\u5728\u90e8\u5206\u62bd\u6837\u4e2d\u51fa\u73b0\uff0c\u5219\u5171\u8bc6\u503c\u57fa\u4e8e\u5176\u5728\u8fd9\u4e9b\u62bd\u6837\u4e2d\u7684\u540c\u7c07\u9891\u7387\u8ba1\u7b97\u3002\u82e5 pItem \u8fc7\u4f4e\uff0c\u53ef\u80fd\u5bfc\u81f4\u90e8\u5206\u6837\u672c\u672a\u88ab\u591a\u6b21\u62bd\u4e2d\uff0c\u4ece\u800c\u5f71\u54cd\u5171\u8bc6\u77e9\u9635\u7684\u5b8c\u6574\u6027\u3002\u8be5\u8fc7\u7a0b\u8fd8\u6d89\u53ca\u5bf9\u6837\u672c\u5f52\u5c5e\u7a33\u5b9a\u6027\u7684\u8bc4\u4f30\uff0c\u4ee5\u5224\u65ad\u805a\u7c7b\u7ed3\u679c\u662f\u5426\u53ef\u9760\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u4ee5\u6837\u672c\u5bf9\u5728\u4e8c\u5341\u6b21\u62bd\u6837\u4e2d\u5341\u6b21\u540c\u65f6\u51fa\u73b0\uff0c\u5176\u4e2d\u516b\u6b21\u540c\u7c07\u4e3a\u4f8b\uff0c\u5171\u8bc6\u503c\u4e3a\u516b\u6210\u3002\u8be5\u503c\u7684\u5206\u6bcd\u4e3a\u5171\u540c\u5165\u9009\u7684\u6b21\u6570\uff0c\u5373\u5341\u6b21\uff0c\u800c\u975e\u603b\u62bd\u6837\u6b21\u6570\u4e8c\u5341\u6b21\u3002\u82e5\u6837\u672c\u5bf9\u4ec5\u5728\u4e00\u6b21\u62bd\u6837\u4e2d\u51fa\u73b0\uff0c\u5219\u5171\u8bc6\u503c\u5373\u4e3a\u8be5\u6b21\u7684\u5f52\u5c5e\u60c5\u51b5\u3002\u5728\u5b9e\u9645\u64cd\u4f5c\u4e2d\uff0c\u9700\u7279\u522b\u5173\u6ce8\u6837\u672c\u5bf9\u7684\u8986\u76d6\u60c5\u51b5\uff0c\u5c24\u5176\u5728\u5904\u7406\u7a00\u6709\u4e9a\u578b\u65f6\uff0c\u5e94\u786e\u4fdd\u5176\u5728\u591a\u6b21\u62bd\u6837\u4e2d\u5177\u6709\u4ee3\u8868\u6027\u3002\u82e5\u6837\u672c\u5bf9\u672a\u5728\u4efb\u4f55\u62bd\u6837\u4e2d\u540c\u65f6\u51fa\u73b0\uff0c\u5219\u8be5\u5bf9\u4e0d\u53c2\u4e0e\u5171\u8bc6\u8ba1\u7b97\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u5171\u8bc6\u503c\u7684\u8ba1\u7b97\u65b9\u5f0f\u786e\u4fdd\u4e86\u5176\u57fa\u4e8e\u5b9e\u9645\u53ef\u6bd4\u8f83\u7684\u6570\u636e\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u6837\u672c\u5bf9\u7684\u8986\u76d6\u60c5\u51b5\u4e0e\u62bd\u6837\u7b56\u7565\u5bc6\u5207\u76f8\u5173\uff0c\u9700\u786e\u4fdd\u6837\u672c\u5728\u591a\u6b21\u62bd\u6837\u4e2d\u5177\u6709\u8db3\u591f\u8986\u76d6\u7387\uff0c\u4ee5\u83b7\u5f97\u7a33\u5b9a\u5171\u8bc6\u503c\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">ConsensusClusterPlus\u5728\u4e0d\u540c\u805a\u7c7b\u7b97\u6cd5\u4e0b\u7684\u8868\u73b0\u5b58\u5728\u5dee\u5f02\u3002\u82e5\u4f7f\u7528\u5c42\u6b21\u805a\u7c7b\uff08hc\uff09\u4e0e\u5206\u533a\u805a\u7c7b\uff08pam\uff09\u65f6\uff0c\u7ed3\u679c\u53ef\u80fd\u4e0d\u540c\u3002\u82e5\u4f7f\u7528\u4e0d\u540c\u8ddd\u79bb\u5ea6\u91cf\uff0c\u5982\u76ae\u5c14\u900a\u76f8\u5173\u4e0e\u6b27\u51e0\u91cc\u5f97\u8ddd\u79bb\uff0c\u7ed3\u679c\u4e5f\u53ef\u80fd\u4e0d\u540c\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u9700\u6839\u636e\u6570\u636e\u7279\u70b9\u9009\u62e9\u5408\u9002\u7684\u805a\u7c7b\u7b97\u6cd5\u4e0e\u8ddd\u79bb\u5ea6\u91cf\u3002\u82e5\u5171\u8bc6\u77e9\u9635\u4e2d\u5b58\u5728\u5927\u91cf\u7f3a\u5931\u503c\uff0c\u9700\u91cd\u65b0\u68c0\u67e5\u62bd\u6837\u7b56\u7565\u4e0e\u805a\u7c7b\u7b97\u6cd5\uff0c\u786e\u4fdd\u6837\u672c\u5bf9\u7684\u8986\u76d6\u60c5\u51b5\u3002<\/p>\n<h2 style=\"margin:2em 0 .6em;color:#205CAC;font-size:1.38em;line-height:1.5;\">\u771f\u5b9e\u91cd\u62bd\u6837\u540e\u6838\u5bf9\u5171\u8bc6\u77e9\u9635<\/h2>\n<pre style=\"white-space:pre;overflow:auto;max-width:100%;padding:14px;background:#F0F7FF;border:1px solid #D1E7FF;border-radius:8px;color:#183551;font-size:14px;line-height:1.6;box-sizing:border-box;\"><code class=\"language-r\" style=\"font-family:Consolas,monospace;white-space:pre;overflow-wrap:normal;word-break:normal;\">set.seed(12)\nx&lt;-matrix(rnorm(30*12),30,12,dimnames=list(paste0(\"g\",1:30),paste0(\"s\",1:12)))\nf&lt;-ConsensusClusterPlus::ConsensusClusterPlus(x,maxK=3,reps=15,pItem=.8,pFeature=.9,clusterAlg=\"hc\",distance=\"pearson\",seed=17,plot=NULL,title=tempfile(),verbose=FALSE)\nm&lt;-f[[2]]$consensusMatrix\nc(nrow(m),ncol(m),sum(diag(m)==1))\n<\/code><\/pre>\n<p style=\"margin:.5em 0 1em\">\u5728 R 4.5.2\u3001ConsensusClusterPlus 1.74.0 \u4e2d\u8fd0\u884c\uff0c\u8f93\u51fa\u4f9d\u6b21\u4e3a\u53c2\u4e0e\u6837\u672c 12\uff0c\u5171\u8bc6\u77e9\u9635\u5217 12\uff0c\u5bf9\u89d2\u7ebf\u4e3a\u4e00 12\u3002<\/p>\n<h2 style=\"margin:2em 0 .6em;color:#205CAC;font-size:1.38em;line-height:1.5;\">\u9047\u5230\u5f02\u5e38\uff0c\u5148\u6838\u5bf9\u54ea\u4e00\u9879<\/h2>\n<p style=\"margin:.5em 0 1em\">\u591a\u68c0\u67e5\u7a00\u6709\u4e9a\u578b\u5728\u6bcf\u6b21\u62bd\u6837\u4e2d\u7684\u8986\u76d6\uff0c\u4ee5\u53ca\u4e9a\u578b\u4e0e\u5b9e\u9a8c\u6279\u6b21\u7684\u5173\u7cfb\u3002\u5355\u4e2a\u6f02\u4eae\u7684\u70ed\u56fe\u4e0d\u80fd\u56de\u7b54\u5206\u578b\u662f\u5426\u7a33\u5b9a\u3002<\/p>\n<h2 style=\"margin:2em 0 .6em;color:#205CAC;font-size:1.38em;line-height:1.5;\">\u6362\u5230\u771f\u5b9e\u6837\u672c\u65f6\u600e\u4e48\u9a8c\u8bc1<\/h2>\n<p style=\"margin:.5em 0 1em\">\u5171\u8bc6\u77e9\u9635\u4e2d\u4e00\u5bf9\u6837\u672c\u5fc5\u987b\u540c\u65f6\u88ab\u62bd\u4e2d\uff0c\u624d\u6709\u673a\u4f1a\u8d21\u732e\u4e00\u6b21\u540c\u7fa4\u6216\u5f02\u7fa4\u7684\u5224\u65ad\u3002\u53ef\u4ece\u4e24\u4efd\u624b\u5de5\u8bb0\u5f55\u63a8\u56de\u5206\u6bcd\u3002\u4f8b\u5982\u4e00\u5bf9\u75c5\u4f8b\u5171\u73b0\u4e24\u6b21\u4e14\u540c\u7fa4\u4e24\u6b21\uff0c\u53e6\u4e00\u5bf9\u5171\u73b0\u56db\u5341\u6b21\u4e14\u540c\u7fa4\u56db\u5341\u6b21\uff0c\u683c\u5b50\u90fd\u7b49\u4e8e\u4e00\uff0c\u7cbe\u5ea6\u5374\u5f88\u4e0d\u76f8\u540c\u3002\u68c0\u67e5\u4e0d\u7a33\u5b9a\u6837\u672c\u65f6\uff0c\u540c\u65f6\u4fdd\u7559\u5171\u73b0\u6b21\u6570\u77e9\u9635\u3002\u82e5\u5c0f\u4e9a\u7ec4\u53ea\u6709\u6781\u5c11\u6210\u5458\uff0c\u4f4e\u62bd\u6837\u6bd4\u4f8b\u53ef\u80fd\u4f7f\u5b83\u5f88\u5c11\u5b8c\u6574\u51fa\u73b0\uff0c\u8981\u628a\u8fd9\u4e00\u70b9\u4e0e\u771f\u5b9e\u5f02\u8d28\u6027\u5206\u522b\u8ba8\u8bba\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u82e5\u6709\u4e24\u5957\u53c2\u6570\u7684\u7ed3\u679c\u90fd\u503c\u5f97\u8003\u8651\uff0c\u5148\u5728\u4e00\u5957\u56fa\u5b9a\u7684\u8bad\u7ec3\u6216\u91cd\u62bd\u6837\u5212\u5206\u4e0a\u6bd4\u8f83\u3002\u4e3a\u4e86\u8ffd\u6c42\u66f4\u597d\u770b\u7684\u6570\u5b57\u53cd\u590d\u6362\u5212\u5206\uff0c\u4f1a\u8ba9\u53c2\u6570\u5dee\u5f02\u548c\u6837\u672c\u6784\u6210\u7684\u5dee\u5f02\u6df7\u5728\u4e00\u8d77\u3002\u628a\u540c\u4e00\u4eba\u7684\u591a\u4efd\u6750\u6599\u653e\u5728\u540c\u4e00\u4fa7\uff0c\u5e76\u4fdd\u5b58\u7528\u4e8e\u62df\u5408\u7684\u53d7\u8bd5\u8005\u6e05\u5355\u3002\u5982\u679c\u5206\u6790\u5305\u62ec\u76d1\u7763\u9884\u6d4b\uff0c\u7f3a\u5931\u586b\u8865\u3001\u7279\u5f81\u7b5b\u9009\u4ee5\u53ca\u7528\u5230\u6837\u672c\u6574\u4f53\u5206\u5e03\u7684\u9884\u5904\u7406\u4e5f\u5e94\u5728\u8bad\u7ec3\u90e8\u5206\u5b66\u4e60\uff0c\u518d\u5e26\u5230\u8bc4\u4f30\u90e8\u5206\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u5bf9\u4e8e\u63a2\u7d22\u6027\u5206\u578b\uff0c\u7b2c\u4e00\u6b21\u8fd0\u884c\u7ed3\u679c\u53ea\u8d1f\u8d23\u63d0\u51fa\u53ef\u68c0\u9a8c\u7684\u5206\u578b\u63cf\u8ff0\uff0c\u53ef\u4ee5\u901a\u8fc7\u91cd\u65b0\u62bd\u53d6\u6837\u672c\u3001\u6539\u53d8\u968f\u673a\u521d\u503c\u6216\u5728\u53e6\u4e00\u6279\u4eba\u4e0a\u6838\u67e5\u6765\u68c0\u9a8c\u7a33\u5b9a\u6027\u3002\u5bf9\u4e8e\u5df2\u7ecf\u8981\u6c42\u8bc4\u4ef7\u5206\u7c7b\u6216\u751f\u5b58\u9884\u6d4b\u7684\u7814\u7a76\uff0c\u5219\u9700\u5728\u89c2\u5bdf\u8bc4\u4f30\u7ed3\u5c40\u524d\u56fa\u5b9a\u7279\u5f81\u3001\u9884\u5904\u7406\u548c\u5224\u5b9a\u89c4\u5219\u3002\u4e24\u7c7b\u4efb\u52a1\u7684\u6307\u6807\u4e0d\u540c\uff0c\u90fd\u8981\u8bf4\u6e05\u5206\u6bcd\u7a76\u7adf\u662f\u60a3\u8005\u3001\u6837\u672c\u5bf9\u3001\u6a21\u578b\u8f6e\u6b21\uff0c\u8fd8\u662f\u53ef\u8bc4\u4ef7\u7684\u4e8b\u4ef6\u3002<\/p>\n<h2 style=\"margin:2em 0 .6em;color:#205CAC;font-size:1.38em;line-height:1.5;\">\u4e0b\u8f7d\u4ee3\u7801\u548c\u793a\u4f8b\u6570\u636e\uff0c\u5728 Linux \u4e0a\u590d\u73b0<\/h2>\n<p style=\"margin:.5em 0 1em\"><a style=\"color:#1458a5;text-decoration:underline;\" href=\"https:\/\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/r-practice-labs\/047-consensusclusterplus-code-528cca63a50997ac.zip\">\u4e0b\u8f7d\u672c\u7bc7 R \u4ee3\u7801\uff08ZIP\uff0c4.4 KiB\uff09<\/a> \u00b7 <a style=\"color:#1458a5;text-decoration:underline;\" href=\"https:\/\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/r-practice-labs\/047-consensusclusterplus-data-fcf18953af59589d.zip\">\u4e0b\u8f7d\u914d\u5957\u793a\u4f8b\u6570\u636e\uff08ZIP\uff0c7.5 KiB\uff09<\/a><\/p>\n<p style=\"margin:.5em 0 1em\">\u5c06\u4e24\u4e2a ZIP \u89e3\u538b\u5230\u540c\u4e00\u4f4d\u7f6e\uff0c\u8fdb\u5165 <code style=\"background:#edf5fc;padding:.05em .25em;border-radius:3px;\">047-consensusclusterplus<\/code> \u76ee\u5f55\uff0c\u8fd0\u884c <code style=\"background:#edf5fc;padding:.05em .25em;border-radius:3px;\">Rscript --vanilla run.R<\/code>\u3002\u6253\u5f00 <code style=\"background:#edf5fc;padding:.05em .25em;border-radius:3px;\">results\/metrics.tsv<\/code> \u67e5\u770b\u7ed3\u679c\uff0c\u4ee3\u7801\u5305\u4e2d\u7684 <code style=\"background:#edf5fc;padding:.05em .25em;border-radius:3px;\">expected\/metrics.tsv<\/code> \u53ef\u4f9b\u9010\u884c\u6838\u5bf9\u3002\u8981\u91cd\u505a\u6587\u4e2d\u7684\u4e24\u4e2a\u6570\u503c\u7ec3\u4e60\uff0c\u53ef\u7ee7\u7eed\u8fd0\u884c <code style=\"background:#edf5fc;padding:.05em .25em;border-radius:3px;\">Rscript --vanilla checks.R<\/code>\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u672c\u6b21\u4ece\u4e0b\u8f7d\u5305\u590d\u73b0\u7684\u6b65\u9aa4\u662f\u201c\u771f\u5b9e\u91cd\u62bd\u6837\u540e\u6838\u5bf9\u5171\u8bc6\u77e9\u9635\u201d\u3002Linux x86_64\u3001R 4.3.3\u3001ConsensusClusterPlus 1.60.0 \u7684\u8f93\u51fa\u4e3a\u53c2\u4e0e\u6837\u672c 12\uff0c\u5171\u8bc6\u77e9\u9635\u5217 12\uff0c\u5bf9\u89d2\u7ebf\u4e3a\u4e00 12\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u4ece K=2 \u7684\u5171\u8bc6\u77e9\u9635\u627e\u4e24\u4e2a\u53cd\u590d\u88ab\u5206\u5728\u4e00\u8d77\u7684\u4e0d\u540c\u6837\u672c\uff0c\u518d\u627e\u4e00\u4e2a\u4e0e\u4e24\u7ec4\u7684\u5173\u7cfb\u90fd\u4e0d\u7a33\u5b9a\u7684\u6837\u672c\u3002\u5bf9\u89d2\u7ebf\u4e3a\u4e00\u662f\u81ea\u6bd4\u8f83\uff0c\u53ea\u6709\u68c0\u67e5\u975e\u5bf9\u89d2\u9879\u624d\u6709\u52a9\u4e8e\u89e3\u91ca\u54ea\u4e9b\u6837\u672c\u7684\u5f52\u5c5e\u53ef\u91cd\u590d\u3002<\/p>\n<h2 style=\"margin:2em 0 .6em;color:#205CAC;font-size:1.38em;line-height:1.5;\">\u5b9e\u8dd1\u540e\u7684\u7ecf\u9a8c\u603b\u7ed3<\/h2>\n<p style=\"margin:.5em 0 1em\">\u771f\u5b9e\u62bd\u6837\u540e\uff0c\u5171\u8bc6\u77e9\u9635\u662f\u4e00\u5f20\u5341\u4e8c\u4e58\u5341\u4e8c\u7684\u6837\u672c\u5bf9\u77e9\u9635\u3002\u672c\u4f8b\u6bcf\u4e2a\u5bf9\u89d2\u7ebf\u90fd\u4e3a\u4e00\uff0c\u8fd9\u53ea\u80fd\u8bf4\u660e\u540c\u4e00\u6837\u672c\u4e0e\u81ea\u8eab\u4e00\u81f4\u3002\u66f4\u503c\u5f97\u6838\u67e5\u7684\u662f\u975e\u5bf9\u89d2\u5143\u7d20\u5728\u591a\u5c11\u6b21\u5171\u540c\u5165\u9009\u7684\u57fa\u7840\u4e0a\u5f97\u5230\uff0c\u4ee5\u53ca\u770b\u8d77\u6765\u7a33\u5b9a\u7684\u5c0f\u7c7b\u7a76\u7adf\u7531\u51e0\u4f4d\u72ec\u7acb\u53d7\u8bd5\u8005\u6784\u6210\u3002<\/p>\n<p style=\"border-top:1px solid #DAE6F2;margin-top:2em;padding-top:1em;\">\u5f53\u6570\u636e\u4e0e\u4ee3\u7801\u5df2\u7ecf\u5728\u5c0f\u89c4\u6a21\u8f93\u5165\u4e0a\u5bf9\u9f50\uff0c\u540e\u9762\u9700\u8981\u6309\u540c\u4e00\u53e3\u5f84\u5206\u6790\u6574\u6279\u9879\u76ee\u65f6\uff0c\u53ef\u4ee5\u6309\u5b9e\u9645\u4efb\u52a1\u4f7f\u7528<a href=\"https:\/\/www.biocloudservice.com\/wordpress\/compute-services\/\" style=\"color:#185CB7;text-decoration:underline;\" data-ysx-event=\"contact_click\">\u4e91\u751f\u4fe1\u751f\u7269\u4fe1\u606f\u5b66\u5206\u6790\u670d\u52a1\u5668<\/a>\u3002<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u4e8c\u5341\u8f6e\u91cc\u4e00\u5bf9\u6837\u672c\u53ea\u6709\u5341\u8f6e\u540c\u65f6\u5165\u9009\uff0c\u5176\u4e2d\u516b\u6b21\u540c\u7c07\uff0c\u6761\u4ef6\u5171\u8bc6\u4e3a\u516b\u6210\uff0c\u5206\u6bcd\u4e0d\u80fd\u5199\u4e8c\u5341\u3002<\/p>\n","protected":false},"author":1,"featured_media":68690,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[47,1],"tags":[766,728,761],"class_list":["post-68691","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-r","category-part","tag-consensusclusterplus","tag-r","tag-761"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2026\/11\/r-guide-consensusclusterplus-practice-5c233290.png?fit=1120%2C690&ssl=1","_links":{"self":[{"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts\/68691","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/comments?post=68691"}],"version-history":[{"count":3,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts\/68691\/revisions"}],"predecessor-version":[{"id":70822,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts\/68691\/revisions\/70822"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/media\/68690"}],"wp:attachment":[{"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/media?parent=68691"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/categories?post=68691"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/tags?post=68691"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}