{"id":68775,"date":"2026-12-05T09:10:34","date_gmt":"2026-12-05T01:10:34","guid":{"rendered":"https:\/\/www.biocloudservice.com\/wordpress\/?p=68775"},"modified":"2026-12-05T09:10:34","modified_gmt":"2026-12-05T01:10:34","slug":"r-guide-ancombc-practice","status":"publish","type":"post","link":"https:\/\/www.biocloudservice.com\/wordpress\/r-guide-ancombc-practice\/","title":{"rendered":"ANCOM-BC2 \u62a5\u51fa\u7ed3\u6784\u96f6\uff0c\u600e\u6837\u5224\u65ad\u662f\u5426\u53ea\u662f\u67d0\u7ec4\u6d4b\u5f97\u592a\u6d45\uff1f"},"content":{"rendered":"<div class=\"ysx-r-practice\" id=\"ysx-r-ancombc\" 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\u79cd\u83cc\u5728\u5bf9\u7167\u7ec4\u5168\u90e8\u4e3a\u96f6\uff0c\u82e5\u5bf9\u7167\u6837\u672c\u666e\u904d\u8bfb\u5f97\u6d45\uff0c\u5c31\u4e0d\u80fd\u4ec5\u51ed\u8fd9\u4e32\u96f6\u5224\u65ad\u751f\u7269\u5b66\u7f3a\u5931\u3002\u7eb5\u5411\u8d44\u6599\u8fd8\u8981\u77e5\u9053\u96f6\u8bfb\u6570\u662f\u5426\u6765\u81ea\u540c\u4e00\u4eba\u7684\u591a\u6b21\u91c7\u6837\u3002\u628a\u68c0\u51fa\u7387\u548c\u6d4b\u5e8f\u6df1\u5ea6\u62c6\u5f00\uff0c\u662f\u89e3\u8bfb ANCOM-BC2 \u7684\u8d77\u70b9\u3002<\/p>\n<h2 style=\"margin:2em 0 .6em;color:#205CAC;font-size:1.38em;line-height:1.5;\">ANCOMBC \u7684\u8f93\u5165\u548c\u5206\u6790\u5bf9\u8c61<\/h2>\n<p style=\"margin:.5em 0 1em\">tse \u4e3a\u542b counts \u7684 TreeSummarizedExperiment\uff0ccolData \u6709 condition\u3001patient\u3002\u793a\u4f8b\u6709\u8db3\u591f\u91cd\u590d\u968f\u8bbf\uff0cgroup \u6307\u5411\u771f\u5b9e\u5206\u7ec4\uff0c\u91c7\u7528\u6b64\u9009\u9879\u524d\u6838\u67e5\u7248\u672c\u4e0e\u7814\u7a76\u76ee\u7684\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">ANCOM-BC2 \u62a5\u51fa\u7ed3\u6784\u96f6\u65f6\uff0c\u9700\u5224\u65ad\u662f\u5426\u4ec5\u4e3a\u67d0\u7ec4\u6d4b\u5e8f\u6df1\u5ea6\u4e0d\u8db3\u6240\u81f4\uff0c\u8fd9\u662f\u5206\u6790\u4e2d\u5e38\u89c1\u7684\u8bef\u5224\u6765\u6e90\u3002\u7ed3\u6784\u96f6\u7684\u5224\u65ad\u4f9d\u8d56\u4e8e\u6837\u672c\u4e2d\u8be5\u83cc\u662f\u5426\u5b9e\u9645\u672a\u68c0\u51fa\uff0c\u800c\u975e\u4ec5\u56e0\u6d4b\u5e8f\u6df1\u5ea6\u4f4e\u3002\u82e5\u67d0\u7ec4\u6837\u672c\u6574\u4f53\u6d4b\u5e8f\u91cf\u504f\u4f4e\uff0c\u53ef\u80fd\u5bfc\u81f4\u8be5\u83cc\u5728\u8be5\u7ec4\u4e2d\u5168\u4e3a\u96f6\uff0c\u4f46\u4e0d\u80fd\u636e\u6b64\u65ad\u5b9a\u5176\u5728\u751f\u7269\u5b66\u4e0a\u4e0d\u5b58\u5728\u3002\u6b64\u65f6\u5e94\u5148\u68c0\u67e5\u6bcf\u7ec4\u5b9e\u9645\u68c0\u51fa\u6837\u672c\u6570\uff0c\u786e\u8ba4\u662f\u5426\u56e0\u6d4b\u5e8f\u6df1\u5ea6\u5dee\u5f02\u5bfc\u81f4\u7684\u5047\u9634\u6027\u3002\u82e5\u67d0\u7ec4\u6837\u672c\u4e2d\u8be5\u83cc\u68c0\u51fa\u7387\u8fdc\u4f4e\u4e8e\u5176\u4ed6\u7ec4\uff0c\u5e94\u8fdb\u4e00\u6b65\u6838\u67e5\u662f\u5426\u56e0\u6d4b\u5e8f\u6df1\u5ea6\u4e0d\u5747\u6240\u81f4\uff0c\u800c\u975e\u751f\u7269\u5b66\u5dee\u5f02\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">ANCOM-BC2 \u7684\u7ed3\u6784\u96f6\u5224\u65ad\u4f9d\u8d56\u4e8e\u8f93\u5165\u6570\u636e\u7684\u5b8c\u6574\u6027\u4e0e\u8bbe\u8ba1\u7684\u5408\u7406\u6027\u3002\u8f93\u5165\u7684 TreeSummarizedExperiment \u5bf9\u8c61\u9700\u5305\u542b\u539f\u59cb\u8ba1\u6570\u6570\u636e\u548c\u6837\u672c\u4fe1\u606f\uff0c\u5176\u4e2d\u6837\u672c\u8868\u9700\u5305\u542b\u5206\u7ec4\u53d8\u91cf\u4e0e\u53d7\u8bd5\u8005\u4fe1\u606f\u3002\u56fa\u5b9a\u6548\u5e94\u8bbe\u8ba1\u5e94\u660e\u786e\u5206\u7ec4\u53d8\u91cf\uff0c\u968f\u673a\u6548\u5e94\u9700\u8003\u8651\u53d7\u8bd5\u8005\u95f4\u7684\u53d8\u5f02\u3002\u82e5\u8bbe\u8ba1\u4e2d\u672a\u5305\u542b\u8db3\u591f\u7684\u91cd\u590d\u6216\u914d\u5bf9\u4fe1\u606f\uff0c\u7ed3\u6784\u96f6\u5224\u65ad\u53ef\u80fd\u5931\u771f\u3002\u8f93\u5165\u6570\u636e\u7684\u5b8c\u6574\u6027\u662f\u5224\u65ad\u7ed3\u6784\u96f6\u7684\u524d\u63d0\uff0c\u4efb\u4f55\u8bbe\u8ba1\u7f3a\u9677\u90fd\u53ef\u80fd\u5bfc\u81f4\u8bef\u5224\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u7ed9 <code>ancombc2()<\/code> \u63d0\u4f9b\u539f\u59cb\u8ba1\u6570\u4e0e\u6837\u672c\u8868\uff0c\u6309\u8bbe\u8ba1\u5199\u56fa\u5b9a\u6548\u5e94\u53ca\u53d7\u8bd5\u8005\u968f\u673a\u6548\u5e94\uff0c\u9009\u62e9\u591a\u7ec4\u5bf9\u6bd4\u5e76\u68c0\u67e5\u7ed3\u6784\u96f6\u548c\u654f\u611f\u6027\u7ed3\u679c\u3002 <a href=\"https:\/\/bioconductor.org\/packages\/release\/bioc\/vignettes\/ANCOMBC\/inst\/doc\/ANCOMBC2.html\" style=\"color:#185CB7;text-decoration:underline;\">ANCOMBC \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;\">a &lt;- ANCOMBC::ancombc2(data=tse,assay_name=\"counts\",fix_formula=\"condition\",rand_formula=\"(1 | patient)\",group=\"condition\",struc_zero=TRUE)\nnames(a)\nhead(a$zero_ind)\n<\/code><\/pre>\n<h2 style=\"margin:2em 0 .6em;color:#205CAC;font-size:1.38em;line-height:1.5;\">\u6309\u6837\u672c\u8ba1\u7b97\u67d0\u83cc\u7684\u68c0\u51fa\u6bd4\u4f8b<\/h2>\n<p style=\"margin:.5em 0 1em\">\u4e24\u7ec4\u5404\u56db\u4efd\u6559\u5b66\u6837\u672c\uff0c\u7532\u5168\u96f6\uff0c\u4e59\u4e09\u4efd\u9633\u6027\uff0c\u5408\u5e76\u4e3a\u516b\u5206\u4e4b\u4e09\u3002\u7532\u82e5\u6df1\u5ea6\u666e\u904d\u504f\u4f4e\uff0c\u89c2\u5bdf\u5168\u96f6\u4e0d\u8db3\u4ee5\u786e\u8bc1\u81ea\u7136\u7f3a\u5931\u3002\u540c\u65f6\u767b\u8bb0\u914d\u5bf9\u5173\u7cfb\u3001\u6bcf\u7ec4\u8986\u76d6\u53ca\u54ea\u79cd\u8f93\u51fa\u6e20\u9053\u7ed9\u51fa\u7684\u5224\u5b9a\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;- 100*c(sum(c(0,0,0,0)&gt;0)\/4,sum(c(3,0,2,1)&gt;0)\/4,3\/8)\nnames(v) &lt;- c(\"\u7532\u7ec4\u56db\u6837\u672c\", \"\u4e59\u7ec4\u56db\u6837\u672c\", \"\u5408\u5e76\u516b\u6837\u672c\")\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;\">\u7532\u7ec4\u56db\u6837\u672c<\/td>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">0%<\/td>\n<\/tr>\n<tr>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">\u4e59\u7ec4\u56db\u6837\u672c<\/td>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">75%<\/td>\n<\/tr>\n<tr>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">\u5408\u5e76\u516b\u6837\u672c<\/td>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">37.5%<\/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-ancombc-practice-36df8592.png?resize=1120%2C690&#038;ssl=1\" alt=\"\u6309\u6837\u672c\u8ba1\u7b97\u67d0\u83cc\u7684\u68c0\u51fa\u6bd4\u4f8b\u3002\u7532\u7ec4\u56db\u6837\u672c 0%\uff0c\u4e59\u7ec4\u56db\u6837\u672c 75%\uff0c\u5408\u5e76\u516b\u6837\u672c 37.5%\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\u7ec4\u7eb5\u5411\u8d44\u6599\u4e2d\u201c\u96f6\u201d\u6765\u81ea\u54ea\u4f4d\u53d7\u8bd5\u8005\uff1f<\/h2>\n<p style=\"margin:.5em 0 1em\">\u4e24\u4f4d\u53d7\u8bd5\u8005\u4e24\u6b21\u91c7\u6837\uff0c\u53ea\u6709\u7532\u5728\u7b2c\u4e8c\u6b21\u68c0\u51fa\uff0c\u4e59\u4e24\u4e2a\u65f6\u95f4\u90fd\u672a\u68c0\u51fa\u3002\u628a\u6837\u672c\u6253\u6563\u540e\u53ea\u5269\u56db\u5206\u4e4b\u4e00\u9633\u6027\uff0c\u65e0\u6cd5\u5206\u8fa8\u65f6\u95f4\u4e0e\u4eba\u3002\u6309\u8bbe\u8ba1\u6784\u5efa\u6a21\u578b\u5e76\u53e0\u4e0a\u8bfb\u6df1\uff0c\u89e3\u91ca\u7ed3\u6784\u96f6\u65f6\u4e5f\u5e94\u4fdd\u7559\u8fd9\u4e2a\u5c42\u7ea7\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;\">m &lt;- data.frame(id=c(\"a\",\"a\",\"b\",\"b\"),visit=c(1,2,1,2),x=c(0,4,0,0))\nwith(m,tapply(x&gt;0,id,sum))\n<\/code><\/pre>\n<p style=\"margin:.5em 0 1em\">\u5728\u5b9e\u9645\u5206\u6790\u4e2d\uff0c\u82e5\u67d0\u7ec4\u6837\u672c\u4e2d\u67d0\u83cc\u5168\u4e3a\u96f6\uff0c\u9700\u7ed3\u5408\u8be5\u7ec4\u6837\u672c\u7684\u6d4b\u5e8f\u6df1\u5ea6\u4e0e\u68c0\u51fa\u7387\u8fdb\u884c\u7efc\u5408\u5224\u65ad\u3002\u82e5\u8be5\u7ec4\u6837\u672c\u5e73\u5747\u6d4b\u5e8f\u6df1\u5ea6\u663e\u8457\u4f4e\u4e8e\u5176\u4ed6\u7ec4\uff0c\u4e14\u8be5\u83cc\u5728\u5176\u4ed6\u7ec4\u4e2d\u68c0\u51fa\u7387\u6b63\u5e38\uff0c\u5219\u8be5\u7ed3\u6784\u96f6\u53ef\u80fd\u5e76\u975e\u751f\u7269\u5b66\u771f\u5b9e\u7f3a\u5931\u3002\u5e94\u901a\u8fc7\u67e5\u770b\u6bcf\u7ec4\u6837\u672c\u7684\u68c0\u51fa\u6bd4\u4f8b\uff0c\u5224\u65ad\u662f\u5426\u56e0\u6d4b\u5e8f\u6df1\u5ea6\u5dee\u5f02\u6240\u81f4\u3002\u82e5\u67d0\u7ec4\u4e2d\u8be5\u83cc\u68c0\u51fa\u7387\u4e3a\u96f6\uff0c\u4f46\u5176\u5e73\u5747\u6d4b\u5e8f\u6df1\u5ea6\u8fdc\u4f4e\u4e8e\u5176\u4ed6\u7ec4\uff0c\u5e94\u8003\u8651\u662f\u5426\u4e3a\u6d4b\u5e8f\u6df1\u5ea6\u4e0d\u8db3\u6240\u81f4\u3002\u7ed3\u6784\u96f6\u7684\u5224\u65ad\u9700\u7ed3\u5408\u591a\u7ec4\u6570\u636e\uff0c\u907f\u514d\u5355\u4e00\u7ec4\u522b\u5224\u65ad\u5931\u771f\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u5728 ANCOM-BC2 \u7684\u5206\u6790\u4e2d\uff0c\u7ed3\u6784\u96f6\u7684\u5224\u65ad\u9700\u7ed3\u5408\u5b9e\u9645\u6570\u636e\u4e0e\u7edf\u8ba1\u6a21\u578b\u8f93\u51fa\u3002\u8f93\u51fa\u5bf9\u8c61\u4e2d\u5305\u542b\u7ed3\u6784\u96f6\u7684\u5224\u5b9a\u7ed3\u679c\uff0c\u8be5\u7ed3\u679c\u9700\u4e0e\u6bcf\u7ec4\u6837\u672c\u7684\u68c0\u51fa\u7387\u3001\u6d4b\u5e8f\u6df1\u5ea6\u8fdb\u884c\u4ea4\u53c9\u9a8c\u8bc1\u3002\u82e5\u6d4b\u5e8f\u6df1\u5ea6\u5dee\u5f02\u663e\u8457\uff0c\u5e94\u8003\u8651\u662f\u5426\u56e0\u6df1\u5ea6\u4e0d\u8db3\u5bfc\u81f4\u7684\u5047\u96f6\u3002\u82e5\u67d0\u7ec4\u6837\u672c\u4e2d\u8be5\u83cc\u68c0\u51fa\u7387\u4e3a\u96f6\uff0c\u4f46\u5176\u4ed6\u7ec4\u4e2d\u68c0\u51fa\u7387\u6b63\u5e38\uff0c\u5e94\u5224\u65ad\u5176\u662f\u5426\u4e3a\u7ed3\u6784\u96f6\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u7ed3\u6784\u96f6\u5224\u65ad\u4e2d\u5e38\u89c1\u7684\u9519\u8bef\u662f\u5c06\u6d4b\u5e8f\u6df1\u5ea6\u4e0d\u8db3\u5bfc\u81f4\u7684\u5047\u96f6\u8bef\u5224\u4e3a\u751f\u7269\u5b66\u771f\u5b9e\u7f3a\u5931\u3002\u82e5\u67d0\u7ec4\u6837\u672c\u4e2d\u67d0\u83cc\u5168\u4e3a\u96f6\uff0c\u4f46\u5176\u6d4b\u5e8f\u6df1\u5ea6\u663e\u8457\u4f4e\u4e8e\u5176\u4ed6\u7ec4\uff0c\u5e94\u8003\u8651\u662f\u5426\u4e3a\u6df1\u5ea6\u4e0d\u8db3\u6240\u81f4\u3002\u6b64\u65f6\u5e94\u68c0\u67e5\u6bcf\u7ec4\u6837\u672c\u7684\u5e73\u5747\u6d4b\u5e8f\u6df1\u5ea6\uff0c\u82e5\u67d0\u7ec4\u663e\u8457\u504f\u4f4e\uff0c\u5e94\u91cd\u65b0\u8bc4\u4f30\u7ed3\u6784\u96f6\u7684\u5224\u65ad\u3002\u901a\u8fc7\u5bf9\u6bd4\u4e0d\u540c\u7ec4\u7684\u6d4b\u5e8f\u6df1\u5ea6\u4e0e\u68c0\u51fa\u7387\uff0c\u53ef\u6709\u6548\u907f\u514d\u8bef\u5224\u3002<\/p>\n<h2 style=\"margin:2em 0 .6em;color:#205CAC;font-size:1.38em;line-height:1.5;\">\u5728 ANCOMBC \u63d0\u4f9b\u7684\u80a0\u9053\u5fae\u751f\u7269\u8f93\u5165\u4e0a\u6309\u6837\u672c\u7edf\u8ba1\u68c0\u51fa<\/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;\">data(\"QMP\",package=\"ANCOMBC\")\nstopifnot(is.matrix(QMP))\nc(nrow(QMP),ncol(QMP),sum(QMP[,1]&gt;0,na.rm=TRUE))\n<\/code><\/pre>\n<p style=\"margin:.5em 0 1em\">\u5728 R 4.5.2\u3001ANCOMBC 2.12.1 \u4e2d\u8fd0\u884c\uff0c\u8f93\u51fa\u4f9d\u6b21\u4e3a\u8f93\u5165\u884c 106\uff0c\u8f93\u5165\u5217 91\uff0c\u9996\u5217\u6709\u8bb0\u5f55\u7684\u7279\u5f81 47\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\">\u533a\u5206\u7ed3\u6784\u96f6\u3001\u4f4e\u68c0\u51fa\u7387\u4e0e\u6d4b\u5e8f\u6df1\u5ea6\u5dee\u5f02\u3002\u9010\u83cc\u6c47\u603b\u6bcf\u7ec4\u5b9e\u9645\u68c0\u51fa\u6837\u672c\u6570\uff0c\u5e76\u68c0\u67e5\u7eb5\u5411\u914d\u5bf9\u662f\u5426\u9f50\u5168\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u5728 ANCOM-BC2 \u5206\u6790\u4e2d\uff0c\u7ed3\u6784\u96f6\u7684\u5224\u65ad\u9700\u7ed3\u5408\u591a\u4e2a\u8f93\u51fa\u5bf9\u8c61\u8fdb\u884c\u4ea4\u53c9\u9a8c\u8bc1\u3002\u8f93\u51fa\u5bf9\u8c61\u4e2d\u5305\u542b\u6bcf\u7ec4\u6837\u672c\u7684\u68c0\u51fa\u6837\u672c\u6570\u3001\u7ed3\u6784\u96f6\u5224\u5b9a\u7ed3\u679c\u4e0e\u6d4b\u5e8f\u6df1\u5ea6\u7b49\u4fe1\u606f\u3002\u82e5\u6d4b\u5e8f\u6df1\u5ea6\u663e\u8457\u504f\u4f4e\uff0c\u5e94\u8003\u8651\u662f\u5426\u4e3a\u6d4b\u5e8f\u6df1\u5ea6\u4e0d\u8db3\u6240\u81f4\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u5728 ANCOM-BC2 \u7684\u654f\u611f\u6027\u5206\u6790\u4e2d\uff0c\u9700\u5173\u6ce8\u7ed3\u6784\u96f6\u5224\u5b9a\u7684\u7a33\u5065\u6027\u3002\u82e5\u67d0\u7ec4\u6837\u672c\u4e2d\u67d0\u83cc\u5168\u4e3a\u96f6\uff0c\u5e94\u901a\u8fc7\u8c03\u6574\u53c2\u6570\u6216\u6539\u53d8\u5206\u6790\u8bbe\u8ba1\uff0c\u5224\u65ad\u7ed3\u6784\u96f6\u662f\u5426\u7a33\u5b9a\u3002\u82e5\u67d0\u7ec4\u6837\u672c\u4e2d\u8be5\u83cc\u68c0\u51fa\u7387\u4e3a\u96f6\uff0c\u4f46\u901a\u8fc7\u8c03\u6574\u53c2\u6570\u540e\u7ed3\u6784\u96f6\u5224\u5b9a\u53d1\u751f\u53d8\u5316\uff0c\u5e94\u8003\u8651\u662f\u5426\u4e3a\u53c2\u6570\u654f\u611f\u6027\u6240\u81f4\u3002\u82e5\u67d0\u7ec4\u6837\u672c\u4e2d\u8be5\u83cc\u68c0\u51fa\u7387\u4e3a\u96f6\uff0c\u4f46\u5176\u6d4b\u5e8f\u6df1\u5ea6\u663e\u8457\u4f4e\u4e8e\u5176\u4ed6\u7ec4\uff0c\u5e94\u901a\u8fc7\u8c03\u6574\u6d4b\u5e8f\u6df1\u5ea6\u53c2\u6570\uff0c\u5224\u65ad\u662f\u5426\u5f71\u54cd\u7ed3\u6784\u96f6\u7684\u5224\u5b9a\u3002\u901a\u8fc7\u654f\u611f\u6027\u5206\u6790\uff0c\u53ef\u6709\u6548\u8bc4\u4f30\u7ed3\u6784\u96f6\u5224\u65ad\u7684\u7a33\u5065\u6027\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u7ed3\u6784\u96f6\u7684\u5224\u65ad\u8fd8\u5e94\u8003\u8651\u6837\u672c\u7684\u7eb5\u5411\u914d\u5bf9\u60c5\u51b5\uff0c\u82e5\u67d0\u7ec4\u6837\u672c\u4e2d\u5b58\u5728\u5927\u91cf\u914d\u5bf9\u7f3a\u5931\uff0c\u53ef\u80fd\u5f71\u54cd\u7ed3\u6784\u96f6\u7684\u5224\u65ad\u3002\u82e5\u67d0\u7ec4\u6837\u672c\u4e2d\u5b58\u5728\u5927\u91cf\u672a\u5b8c\u6210\u968f\u8bbf\uff0c\u5e94\u8bc4\u4f30\u5176\u662f\u5426\u5f71\u54cd\u7ed3\u6784\u96f6\u7684\u5224\u5b9a\u3002\u82e5\u67d0\u7ec4\u6837\u672c\u4e2d\u8be5\u83cc\u68c0\u51fa\u7387\u4e3a\u96f6\uff0c\u4f46\u5176\u914d\u5bf9\u4e0d\u5168\uff0c\u5e94\u8003\u8651\u662f\u5426\u4e3a\u914d\u5bf9\u7f3a\u5931\u6240\u81f4\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">ANCOM-BC2 \u7684\u7ed3\u6784\u96f6\u5224\u65ad\u9700\u57fa\u4e8e\u5b9e\u9645\u6570\u636e\u4e0e\u7edf\u8ba1\u6a21\u578b\u7684\u7efc\u5408\u5206\u6790\u3002\u82e5\u67d0\u7ec4\u6837\u672c\u4e2d\u67d0\u83cc\u5168\u4e3a\u96f6\uff0c\u5e94\u7ed3\u5408\u8be5\u7ec4\u6837\u672c\u7684\u6d4b\u5e8f\u6df1\u5ea6\u4e0e\u68c0\u51fa\u7387\u8fdb\u884c\u5224\u65ad\uff0c\u907f\u514d\u56e0\u6d4b\u5e8f\u6df1\u5ea6\u4e0d\u8db3\u5bfc\u81f4\u7684\u5047\u96f6\u3002\u901a\u8fc7\u4ea4\u53c9\u9a8c\u8bc1\uff0c\u53ef\u6709\u6548\u907f\u514d\u8bef\u5224\u7ed3\u6784\u96f6\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\">\u5c06\u4e00\u4e2a\u5206\u7ec4\u4e2d\u5168\u96f6\u7684\u5fae\u751f\u7269\u7279\u5f81\u4e0e\u5404\u6837\u672c\u6587\u5e93\u6df1\u5ea6\u653e\u5728\u4e00\u8d77\uff0c\u770b\u96f6\u662f\u5426\u96c6\u4e2d\u5728\u6d4b\u5e8f\u6d45\u3001\u63d0\u53d6\u6279\u6b21\u7279\u6b8a\u6216\u4ec5\u6709\u5c11\u6570\u4eba\u7684\u4e00\u7ec4\u3002\u518d\u7528\u53e6\u4e00\u4e2a\u6df1\u5ea6\u8db3\u591f\u7684\u72ec\u7acb\u6279\u6b21\u67e5\u8fd9\u4e00\u7279\u5f81\u662f\u5426\u4ecd\u5b8c\u5168\u4e0d\u89c1\u3002\u5bf9\u7ed3\u6784\u96f6\u7684\u5224\u5b9a\u8981\u540c\u65f6\u8bf4\u660e\u5206\u6790\u53c2\u6570\u3001\u7ec4\u5185\u4eba\u6570\u548c\u68c0\u51fa\u754c\u9650\u3002\u4e30\u5ea6\u5f88\u4f4e\u65f6\uff0c\u4e00\u7ec4\u6837\u672c\u90fd\u6ca1\u6709\u8bfb\u6570\u7684\u89c2\u5bdf\u4ecd\u53ef\u80fd\u7531\u62bd\u6837\u4ea7\u751f\uff0c\u662f\u5426\u5177\u6709\u751f\u7269\u5b66\u7f3a\u5931\u7684\u8bc1\u636e\u5e94\u5355\u72ec\u8ba8\u8bba\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u53d6\u7ed3\u679c\u4e2d\u6700\u51c6\u5907\u89e3\u91ca\u7684\u4e00\u884c\uff0c\u628a\u6bcf\u4e2a\u72ec\u7acb\u6837\u672c\u7684\u539f\u59cb\u89c2\u6d4b\u3001\u6240\u5728\u6761\u4ef6\u4ee5\u53ca\u80fd\u591f\u652f\u6301\u8be5\u503c\u7684\u6d4b\u91cf\u6570\u6392\u5f00\u3002\u5148\u770b\u4e00\u4e2a\u6761\u4ef6\u5185\u90e8\u7684\u53d8\u5316\u8303\u56f4\uff0c\u518d\u770b\u4e24\u4e2a\u6761\u4ef6\u7684\u4e2d\u95f4\u4f4d\u7f6e\u3002\u82e5\u5dee\u5f02\u4e3b\u8981\u7531\u4e00\u4e2a\u6837\u672c\u8d21\u732e\uff0c\u67e5\u8be5\u6837\u672c\u540c\u6279\u5176\u4ed6\u6307\u6807\u662f\u5426\u4e5f\u504f\u79fb\uff0c\u7136\u540e\u4fdd\u7559\u5168\u6837\u672c\u548c\u6709\u4f9d\u636e\u7684\u654f\u611f\u6027\u5206\u6790\u4e24\u5957\u7ed3\u679c\u3002\u4ec5\u56e0\u67d0\u4e2a\u70b9\u4e0d\u7b26\u5408\u9884\u671f\u800c\u5220\u9664\uff0c\u4f1a\u540c\u65f6\u6539\u53d8\u6548\u5e94\u4f30\u8ba1\u548c\u4e0d\u786e\u5b9a\u6027\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u4ea4\u4ed8\u8868\u91cc\u6700\u597d\u4fdd\u7559\u4f30\u8ba1\u91cf\u7684\u65b9\u5411\u4ee5\u53ca\u54ea\u4e2a\u6761\u4ef6\u4f5c\u4e3a\u53c2\u7167\u3002\u7f3a\u6d4b\u548c\u6d4b\u51fa\u4e3a\u96f6\u8981\u5206\u522b\u7f16\u7801\uff0c\u67d0\u4f4d\u53d7\u8bd5\u8005\u6ca1\u6709\u8db3\u591f\u89c2\u6d4b\u65f6\uff0c\u5e94\u80fd\u4ece\u8868\u4e0a\u770b\u51fa\u4e3a\u4ec0\u4e48\u8fd9\u4e00\u6b21\u6ca1\u6709\u6570\u503c\u3002\u5bf9\u4e8e\u540c\u4e00\u4eba\u591a\u6b21\u6d4b\u91cf\u7684\u7814\u7a76\uff0c\u6309\u53d7\u8bd5\u8005\u8fde\u7ebf\u53ef\u8ba9\u65b9\u5411\u4e00\u81f4\u6027\u76f4\u63a5\u53ef\u89c1\u3002\u628a\u8fd9\u79cd\u6837\u672c\u5c42\u68c0\u67e5\u4e0e\u6a21\u578b\u7684\u591a\u91cd\u68c0\u9a8c\u7ed3\u679c\u914d\u5408\uff0c\u80fd\u533a\u5206\u201c\u91cd\u590d\u4e2d\u65b9\u5411\u4e00\u81f4\u4f46\u8bc1\u636e\u6709\u9650\u201d\u548c\u201c\u8868\u9762\u6548\u5e94\u5f88\u5927\u5374\u7531\u5355\u4e2a\u5bf9\u8c61\u63a8\u52a8\u201d\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\/086-ancombc-code-d93971dd795bbfd7.zip\">\u4e0b\u8f7d\u672c\u7bc7 R \u4ee3\u7801\uff08ZIP\uff0c3.8 KiB\uff09<\/a> \u00b7 <a style=\"color:#1458a5;text-decoration:underline;\" href=\"https:\/\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/r-practice-labs\/086-ancombc-data-c14689dddef0fcb4.zip\">\u4e0b\u8f7d\u914d\u5957\u793a\u4f8b\u6570\u636e\uff08ZIP\uff0c50.6 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;\">086-ancombc<\/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\u5728 ANCOMBC \u63d0\u4f9b\u7684\u80a0\u9053\u5fae\u751f\u7269\u8f93\u5165\u4e0a\u6309\u6837\u672c\u7edf\u8ba1\u68c0\u51fa\u201d\u3002Linux x86_64\u3001R 4.3.3 \u7684\u8f93\u51fa\u4e3a\u8f93\u5165\u884c 106\uff0c\u8f93\u5165\u5217 91\uff0c\u9996\u5217\u6709\u8bb0\u5f55\u7684\u7279\u5f81 47\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u53d6\u8f93\u5165\u77e9\u9635\u7684\u9996\u5217\uff0c\u6570\u5176\u4e2d\u6709\u6b63\u8bb0\u5f55\u7684\u7279\u5f81\uff0c\u518d\u4e0e\u77e9\u9635\u603b\u884c\u6570\u6bd4\u8f83\u3002\u4f60\u81ea\u5df1\u7684\u5b9e\u9a8c\u8fd8\u5e94\u6838\u5bf9\u77e9\u9635\u65b9\u5411\u548c\u7ed3\u6784\u96f6\u7684\u5206\u7ec4\u8bc1\u636e\u3002\u4ec5\u51ed\u67d0\u6837\u672c\u672a\u68c0\u51fa\u4e00\u9879\u7279\u5f81\uff0c\u4e0d\u80fd\u5728\u7ec4\u5c42\u9762\u65ad\u5b9a\u5b83\u7f3a\u5931\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\">\u4f5c\u8005\u63d0\u4f9b\u7684\u5fae\u751f\u7269\u793a\u4f8b\u4ee5\u77e9\u9635\u4fdd\u5b58\u3002\u5148\u8bfb\u5b9e\u9645\u7ef4\u5ea6\u548c\u6bcf\u4efd\u6837\u672c\u80fd\u68c0\u6d4b\u5230\u7684\u7279\u5f81\u6570\uff0c\u518d\u6309\u771f\u5b9e\u6837\u672c\u540d\u8fde\u63a5\u5206\u7ec4\u4e0e\u968f\u8bbf\u8868\u3002\u8fd9\u4e00\u524d\u7f6e\u6838\u67e5\u8fd8\u6ca1\u6709\u8fd0\u884c\u7ed3\u6784\u96f6\u68c0\u9a8c\uff0c\u4efb\u4f55\u5355\u5217\u5168\u96f6\u7684\u60c5\u51b5\u90fd\u5e94\u7ed3\u5408\u7ec4\u522b\u3001\u6df1\u5ea6\u548c\u53d7\u8bd5\u8005\u5206\u5e03\u518d\u89e3\u91ca\u3002<\/p>\n<p style=\"border-top:1px solid #DAE6F2;margin-top:2em;padding-top:1em;\">\u5b8c\u6210\u4e00\u4e2a\u4ee3\u8868\u6837\u672c\u7684\u590d\u6838\u540e\uff0c\u82e5\u8981\u5bf9\u66f4\u591a\u6587\u5e93\u91cd\u590d\u76f8\u540c\u7684\u5904\u7406\uff0c\u53ef\u628a\u6837\u672c\u6e05\u5355\u3001\u53c2\u6570\u548c\u8f93\u51fa\u8def\u5f84\u4e00\u8d77\u8fc1\u5230<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>\u4e0a\u6309\u6279\u6b21\u8fd0\u884c\u3002<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u4e24\u7ec4\u5404\u56db\u4efd\u6559\u5b66\u6837\u672c\uff0c\u7532\u5168\u96f6\uff0c\u4e59\u4e09\u4efd\u9633\u6027\uff0c\u5408\u5e76\u4e3a\u516b\u5206\u4e4b\u4e09\u3002<\/p>\n","protected":false},"author":1,"featured_media":68774,"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":[812,728,807],"class_list":["post-68775","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-r","category-part","tag-ancombc","tag-r","tag-807"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2026\/11\/r-guide-ancombc-practice-36df8592.png?fit=1120%2C690&ssl=1","_links":{"self":[{"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts\/68775","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=68775"}],"version-history":[{"count":3,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts\/68775\/revisions"}],"predecessor-version":[{"id":70882,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts\/68775\/revisions\/70882"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/media\/68774"}],"wp:attachment":[{"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/media?parent=68775"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/categories?post=68775"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/tags?post=68775"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}