{"id":68771,"date":"2026-12-05T09:10:34","date_gmt":"2026-12-05T01:10:34","guid":{"rendered":"https:\/\/www.biocloudservice.com\/wordpress\/?p=68771"},"modified":"2026-12-05T09:10:34","modified_gmt":"2026-12-05T01:10:34","slug":"r-guide-phangorn-practice","status":"publish","type":"post","link":"https:\/\/www.biocloudservice.com\/wordpress\/r-guide-phangorn-practice\/","title":{"rendered":"phangorn \u81ea\u4e3e\u652f\u6301\u7387\u4f4e\uff0c\u5148\u589e\u52a0\u91cd\u590d\u6570\u8fd8\u662f\u56de\u67e5\u591a\u5e8f\u5217\u6bd4\u5bf9\uff1f"},"content":{"rendered":"<div class=\"ysx-r-practice\" id=\"ysx-r-phangorn\" 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\">\u6700\u5927\u4f3c\u7136\u6811\u4e0a\u67d0\u6761\u5206\u652f\u652f\u6301\u4f4e\uff0c\u591a\u505a\u81ea\u4e3e\u53ef\u4ee5\u51cf\u5c11\u8499\u7279\u5361\u6d1b\u6ce2\u52a8\uff0c\u5374\u4fee\u4e0d\u597d\u4e00\u6bb5\u9519\u6bd4\u5bf9\u3002\u628a\u539f\u59cb\u6bd4\u5bf9\u3001\u8d77\u59cb\u6811\u548c\u66ff\u6362\u6a21\u578b\u5148\u6838\u5bf9\u6e05\u695a\uff0c\u518d\u89e3\u91ca\u540c\u4e00\u5206\u652f\u5728\u591a\u5c11\u6b21\u5217\u91cd\u62bd\u6837\u4e2d\u51fa\u73b0\u3002<\/p>\n<h2 style=\"margin:2em 0 .6em;color:#205CAC;font-size:1.38em;line-height:1.5;\">phangorn \u7684\u8f93\u5165\u548c\u5206\u6790\u5bf9\u8c61<\/h2>\n<p style=\"margin:.5em 0 1em\">dat \u4e3a\u8d28\u91cf\u68c0\u67e5\u540e\u7684 DNA phyDat\uff0ctree \u4e3a\u53f6\u540d\u543b\u5408\u7684\u8d77\u59cb\u6811\u3002\u7ed9\u5b9a\u4f18\u5316\u9009\u9879\u53ea\u4e3a\u8bf4\u660e\u6d41\u7a0b\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u81ea\u4e3e\u652f\u6301\u7387\u4f4e\u7684\u95ee\u9898\u5728\u7cfb\u7edf\u53d1\u80b2\u5206\u6790\u4e2d\u5e38\u89c1\uff0c\u5c24\u5176\u662f\u5f53\u8f93\u5165\u6570\u636e\u5b58\u5728\u6bd4\u5bf9\u9519\u8bef\u6216\u6a21\u578b\u8bbe\u5b9a\u4e0d\u5f53\u7684\u60c5\u51b5\u3002\u672c\u7814\u7a76\u4ece\u591a\u5e8f\u5217\u6bd4\u5bf9\u5f00\u59cb\uff0c\u6784\u5efa\u521d\u59cb\u6811\u5e76\u8fdb\u884c\u6700\u5927\u4f3c\u7136\u4f30\u8ba1\uff0c\u4e4b\u540e\u4f7f\u7528\u81ea\u4e3e\u65b9\u6cd5\u8bc4\u4f30\u5206\u652f\u652f\u6301\u5ea6\u3002\u8fd9\u4e00\u6d41\u7a0b\u7684\u6838\u5fc3\u5728\u4e8e\u7406\u89e3\u81ea\u4e3e\u91cd\u590d\u6b21\u6570\u4e0e\u652f\u6301\u7387\u4e4b\u95f4\u7684\u5173\u7cfb\uff0c\u4ee5\u53ca\u5982\u4f55\u5224\u65ad\u652f\u6301\u7387\u662f\u5426\u771f\u5b9e\u53cd\u6620\u5206\u652f\u53ef\u9760\u6027\u3002\u8f93\u5165\u6570\u636e\u4e3a\u7ecf\u8fc7\u8d28\u91cf\u68c0\u67e5\u7684DNA\u6bd4\u5bf9\uff0c\u8d77\u59cb\u6811\u4e0e\u6bd4\u5bf9\u7684\u53f6\u8282\u70b9\u540d\u79f0\u4e00\u81f4\u3002\u6d41\u7a0b\u4e2d\u4f7f\u7528\u7684\u51fd\u6570\u5305\u62ec<code>pml()<\/code>\u6784\u5efa\u6a21\u578b\u3001<code>optim.pml()<\/code>\u4f18\u5316\u53c2\u6570\uff0c\u4ee5\u53ca<code>bootstrap.pml()<\/code>\u8fdb\u884c\u81ea\u4e3e\u91cd\u62bd\u6837\u3002\u8fd9\u4e9b\u6b65\u9aa4\u5171\u540c\u6784\u6210\u4e86\u5206\u6790\u6d41\u7a0b\u7684\u8d77\u70b9\uff0c\u4e5f\u662f\u540e\u7eed\u5224\u65ad\u652f\u6301\u7387\u662f\u5426\u5408\u7406\u7684\u57fa\u7840\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u8f93\u5165\u5bf9\u8c61<code>dat<\/code>\u4e3a<code>phyDat<\/code>\u7c7b\u578b\uff0c\u5305\u542bDNA\u5e8f\u5217\u4fe1\u606f\uff0c\u5176\u683c\u5f0f\u5fc5\u987b\u4e0e\u8d77\u59cb\u6811\u4e2d\u8282\u70b9\u540d\u79f0\u5339\u914d\u3002<code>tree<\/code>\u4e3a\u7cfb\u7edf\u53d1\u80b2\u6811\u5bf9\u8c61\uff0c\u5176\u53f6\u8282\u70b9\u540d\u79f0\u9700\u4e0e\u6bd4\u5bf9\u4e2d\u5e8f\u5217\u540d\u79f0\u5b8c\u5168\u4e00\u81f4\u3002\u82e5\u6bd4\u5bf9\u9519\u8bef\u6216\u5e8f\u5217\u91cd\u590d\uff0c\u5c06\u5bfc\u81f4\u81ea\u4e3e\u652f\u6301\u7387\u504f\u4f4e\u3002\u6d41\u7a0b\u4e2d\u4f7f\u7528<code>pml()<\/code>\u51fd\u6570\u5efa\u7acb\u6700\u5927\u4f3c\u7136\u6a21\u578b\uff0c\u8be5\u6a21\u578b\u5305\u542b\u4e86\u5e8f\u5217\u6bd4\u5bf9\u548c\u66ff\u6362\u6a21\u578b\u7684\u8bbe\u5b9a\u3002<code>optim.pml()<\/code>\u7528\u4e8e\u4f18\u5316\u6a21\u578b\u53c2\u6570\uff0c\u786e\u4fdd\u4f3c\u7136\u503c\u8fbe\u5230\u5c40\u90e8\u6700\u4f18\u3002\u8fd9\u4e9b\u6b65\u9aa4\u7684\u8f93\u5165\u548c\u8f93\u51fa\u90fd\u51b3\u5b9a\u4e86\u540e\u7eed\u81ea\u4e3e\u5206\u6790\u7684\u53ef\u9760\u6027\u3002\u82e5\u6bd4\u5bf9\u6216\u6a21\u578b\u8bbe\u5b9a\u6709\u8bef\uff0c\u5373\u4f7f\u81ea\u4e3e\u6b21\u6570\u589e\u52a0\uff0c\u4e5f\u65e0\u6cd5\u83b7\u5f97\u53ef\u9760\u7684\u5206\u652f\u652f\u6301\u7387\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u4ece\u591a\u5e8f\u5217\u6bd4\u5bf9\u751f\u6210 <code>phyDat<\/code> \u548c\u8d77\u59cb\u6811\uff0c\u7528 <code>pml()<\/code> \u5efa\u6a21\u578b\u3001<code>optim.pml()<\/code> \u4f18\u5316\uff0c\u518d\u7528 <code>bootstrap.pml()<\/code> \u91cd\u62bd\u6837\u8bc4\u4f30\u5206\u652f\u652f\u6301\u5ea6\u3002 <a href=\"https:\/\/cran.r-project.org\/web\/packages\/phangorn\/refman\/phangorn.html#bootstrap.pml\" style=\"color:#185CB7;text-decoration:underline;\">phangorn CRAN \u51fd\u6570\u624b\u518c<\/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;\">fit &lt;- phangorn::pml(tree,dat)\nfit &lt;- phangorn::optim.pml(fit,model=\"GTR\",optNni=TRUE)\nset.seed(11)\nbs &lt;- phangorn::bootstrap.pml(fit,bs=100,optNni=TRUE)\nlength(bs)\n<\/code><\/pre>\n<h2 style=\"margin:2em 0 .6em;color:#205CAC;font-size:1.38em;line-height:1.5;\">\u540c\u4e00\u5206\u652f\u7684\u793a\u4f8b\u81ea\u4e3e\u652f\u6301<\/h2>\n<p style=\"margin:.5em 0 1em\">\u4e09\u6b21\u6f14\u7b97\u652f\u6301\u6bd4\u4f8b\u540c\u4e3a\u4e03\u6210\uff0c\u4f46\u8f6e\u6570\u4e0d\u540c\uff0c\u8499\u7279\u5361\u6d1b\u4e0d\u786e\u5b9a\u6027\u5e76\u4e0d\u4e00\u6837\u3002\u91cd\u590d\u5217\u7684\u81ea\u4e3e\u652f\u6301\u4e0d\u80fd\u7ffb\u8bd1\u4e3a\u8be5\u5206\u652f\u4e3a\u771f\u7684\u540e\u9a8c\u6982\u7387\uff0c\u9996\u5148\u68c0\u67e5\u6bd4\u5bf9\u4e0e\u4fe1\u606f\u4f4d\u70b9\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(7\/10,70\/100,140\/200)\nnames(v) &lt;- c(\"\u5341\u8f6e\u4e03\u6b21\", \"\u767e\u8f6e\u4e03\u5341\u6b21\", \"\u4e24\u767e\u8f6e\u4e00\u767e\u56db\u5341\u6b21\")\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;\">\u5341\u8f6e\u4e03\u6b21<\/td>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">70%<\/td>\n<\/tr>\n<tr>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">\u767e\u8f6e\u4e03\u5341\u6b21<\/td>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">70%<\/td>\n<\/tr>\n<tr>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">\u4e24\u767e\u8f6e\u4e00\u767e\u56db\u5341\u6b21<\/td>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">70%<\/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-phangorn-practice-e3eef186.png?resize=1120%2C690&#038;ssl=1\" alt=\"\u540c\u4e00\u5206\u652f\u7684\u793a\u4f8b\u81ea\u4e3e\u652f\u6301\u3002\u5341\u8f6e\u4e03\u6b21 70%\uff0c\u767e\u8f6e\u4e03\u5341\u6b21 70%\uff0c\u4e24\u767e\u8f6e\u4e00\u767e\u56db\u5341\u6b21 70%\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;\">\u589e\u52a0\u91cd\u590d\u6570\u80fd\u628a\u4f30\u8ba1\u7cbe\u5ea6\u63d0\u5347\u591a\u5c11\uff1f<\/h2>\n<p style=\"margin:.5em 0 1em\">\u4ee5\u5206\u652f\u51fa\u73b0\u6982\u7387\u7ea6\u4e03\u6210\u4e3a\u6761\u4ef6\uff0c\u7b80\u5355\u4e8c\u9879\u8fd1\u4f3c\u53ef\u89c1\u6807\u51c6\u8bef\u968f\u91cd\u590d\u6570\u5e73\u65b9\u6839\u4e0b\u964d\u3002\u8fd9\u91cc\u53ea\u4f30\u8ba1\u91cd\u62bd\u6837\u968f\u673a\u6ce2\u52a8\uff0c\u4e0d\u8986\u76d6\u6bd4\u5bf9\u3001\u66ff\u6362\u6a21\u578b\u6216\u7269\u79cd\u91c7\u6837\u5e26\u6765\u7684\u8bef\u5dee\u3002\u4e0d\u80fd\u7528\u7ee7\u7eed\u589e\u52a0\u8f6e\u6570\u4fee\u590d\u8fd9\u4e9b\u7cfb\u7edf\u95ee\u9898\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;\">n &lt;- c(10,100,200)\nsqrt(.7*(1-.7)\/n)\n<\/code><\/pre>\n<p style=\"margin:.5em 0 1em\">\u81ea\u4e3e\u652f\u6301\u7387\u7684\u8ba1\u7b97\u57fa\u4e8e\u6bd4\u5bf9\u5217\u7684\u91cd\u62bd\u6837\uff0c\u800c\u975e\u53f6\u8282\u70b9\u7684\u91cd\u62bd\u6837\u3002\u82e5\u6bd4\u5bf9\u4e2d\u5b58\u5728\u5927\u91cf\u4fe1\u606f\u7f3a\u5931\u6216\u91cd\u590d\u5e8f\u5217\uff0c\u4f1a\u5bfc\u81f4\u652f\u6301\u7387\u4f30\u8ba1\u4e0d\u7a33\u5b9a\u3002\u4f8b\u5982\uff0c\u82e5\u67d0\u5217\u5728\u6bd4\u5bf9\u4e2d\u51e0\u4e4e\u5168\u4e3a\u7f3a\u5931\u6570\u636e\uff0c\u8be5\u4f4d\u70b9\u5bf9\u7cfb\u7edf\u53d1\u80b2\u63a8\u65ad\u65e0\u8d21\u732e\uff0c\u81ea\u4e3e\u7ed3\u679c\u81ea\u7136\u504f\u4f4e\u3002\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u5373\u4f7f\u91cd\u590d\u6b21\u6570\u589e\u52a0\uff0c\u4e5f\u65e0\u6cd5\u5f25\u8865\u4fe1\u606f\u4e0d\u8db3\u5e26\u6765\u7684\u504f\u5dee\u3002\u9519\u8bef\u7684\u5206\u6790\u6d41\u7a0b\u53ef\u80fd\u5c06\u652f\u6301\u7387\u504f\u4f4e\u5f52\u56e0\u4e8e\u91cd\u590d\u6b21\u6570\u4e0d\u8db3\uff0c\u800c\u5ffd\u7565\u4e86\u6570\u636e\u672c\u8eab\u7684\u7ed3\u6784\u6027\u7f3a\u9677\u3002\u56e0\u6b64\uff0c\u5fc5\u987b\u9996\u5148\u786e\u8ba4\u6bd4\u5bf9\u8d28\u91cf\uff0c\u518d\u8bc4\u4f30\u91cd\u590d\u6b21\u6570\u662f\u5426\u8db3\u591f\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u5728\u81ea\u4e3e\u652f\u6301\u7387\u504f\u4f4e\u65f6\uff0c\u5e94\u9996\u5148\u68c0\u67e5\u6bd4\u5bf9\u4e2d\u7684\u4fe1\u606f\u4f4d\u70b9\u5206\u5e03\u3002\u82e5\u4fe1\u606f\u4f4d\u70b9\u7a00\u758f\u6216\u5206\u5e03\u4e0d\u5747\uff0c\u5373\u4f7f\u589e\u52a0\u91cd\u590d\u6b21\u6570\uff0c\u652f\u6301\u7387\u4f30\u8ba1\u4ecd\u4e0d\u7a33\u5b9a\u3002\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u652f\u6301\u7387\u7684\u4f4e\u503c\u5e76\u975e\u56e0\u91cd\u590d\u6b21\u6570\u4e0d\u8db3\uff0c\u800c\u662f\u56e0\u6570\u636e\u672c\u8eab\u7f3a\u4e4f\u8db3\u591f\u7684\u7cfb\u7edf\u53d1\u80b2\u4fe1\u606f\u3002\u82e5\u6bd4\u5bf9\u4e2d\u5b58\u5728\u5927\u91cf\u7f3a\u5931\u6570\u636e\u6216\u4f4e\u8d28\u91cf\u4f4d\u70b9\uff0c\u5e94\u4f18\u5148\u8fdb\u884c\u6bd4\u5bf9\u8d28\u91cf\u63a7\u5236\uff0c\u800c\u975e\u589e\u52a0\u91cd\u590d\u6b21\u6570\u3002\u901a\u8fc7\u6bd4\u5bf9\u8d28\u91cf\u8bc4\u4f30\uff0c\u53ef\u4ee5\u660e\u786e\u652f\u6301\u7387\u504f\u4f4e\u7684\u6839\u672c\u539f\u56e0\uff0c\u4ece\u800c\u907f\u514d\u65e0\u6548\u7684\u91cd\u590d\u8ba1\u7b97\uff0c\u63d0\u9ad8\u5206\u6790\u6548\u7387\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u82e5\u6bd4\u5bf9\u4e2d\u5b58\u5728\u4fe1\u606f\u4f4d\u70b9\u7a00\u758f\u95ee\u9898\uff0c\u5373\u4f7f\u66f4\u6362\u4e0d\u540c\u91cd\u590d\u6b21\u6570\uff0c\u652f\u6301\u7387\u63d0\u5347\u6709\u9650\u3002\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u589e\u52a0\u91cd\u590d\u6b21\u6570\u65e0\u6cd5\u6539\u5584\u4f30\u8ba1\u7cbe\u5ea6\uff0c\u8bf4\u660e\u95ee\u9898\u51fa\u5728\u6570\u636e\u7ed3\u6784\u800c\u975e\u4f30\u8ba1\u65b9\u6cd5\u3002\u901a\u8fc7\u5bf9\u6bd4\u4e0d\u540c\u91cd\u590d\u6b21\u6570\u4e0b\u7684\u652f\u6301\u7387\u53d8\u5316\u8d8b\u52bf\uff0c\u53ef\u4ee5\u5224\u65ad\u662f\u5426\u8fbe\u5230\u4f30\u8ba1\u7cbe\u5ea6\u4e0a\u9650\u3002\u82e5\u652f\u6301\u7387\u5728\u91cd\u590d\u6b21\u6570\u589e\u52a0\u540e\u8d8b\u4e8e\u7a33\u5b9a\uff0c\u8bf4\u660e\u5f53\u524d\u91cd\u590d\u6b21\u6570\u5df2\u8db3\u591f\uff0c\u65e0\u9700\u7ee7\u7eed\u589e\u52a0\u3002\u8fd9\u79cd\u5206\u6790\u6709\u52a9\u4e8e\u660e\u786e\u4f30\u8ba1\u7cbe\u5ea6\u7684\u8fb9\u754c\uff0c\u907f\u514d\u65e0\u610f\u4e49\u7684\u91cd\u590d\u8ba1\u7b97\u3002<\/p>\n<h2 style=\"margin:2em 0 .6em;color:#205CAC;font-size:1.38em;line-height:1.5;\">\u7528\u56db\u6761\u4eba\u5de5 DNA \u6bd4\u5bf9\u5b9e\u9645\u62df\u5408\u8d77\u59cb\u6811\u4f3c\u7136<\/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;\">s&lt;-c(a=\"ACGTACGTACGTACGTACGTACGTACGTACGTACGTACGT\",b=\"ACGTACGTACGTACGTACGTACGTACGTACGTACGTACGA\",c=\"ACGAACGTACGTACGTACGTACGTACGTACGTACGTTCGT\",d=\"TCGAACGTACGTACGTACGTACGTACGTACGTACGTTCGT\")\nmat&lt;-do.call(rbind,strsplit(s,\"\"))\nd&lt;-phangorn::phyDat(mat,type=\"DNA\")\ntr&lt;-ape::read.tree(text=\"((a:0.1,b:0.1):0.1,c:0.2,d:0.2);\")\nf&lt;-phangorn::pml(tr,d)\nc(length(tr$tip.label),length(attr(d,\"weight\")),as.numeric(logLik(f)))\n<\/code><\/pre>\n<p style=\"margin:.5em 0 1em\">\u5728 R 4.5.2\u3001phangorn 2.12.1 \u4e2d\u8fd0\u884c\uff0c\u8f93\u51fa\u4f9d\u6b21\u4e3a\u53f6\u6570 4\uff0c\u6bd4\u5bf9\u6a21\u5f0f\u6570 8\uff0c\u8d77\u59cb\u5bf9\u6570\u4f3c\u7136 -94.98\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\">\u5bf9\u9f50\u9519\u8bef\u3001\u8fd1\u4e4e\u91cd\u590d\u7684\u53f6\u548c\u66ff\u6362\u6a21\u578b\u90fd\u4f1a\u5f71\u54cd\u6811\u3002\u5148\u68c0\u67e5\u6bd4\u5bf9\u548c\u4f3c\u7136\u4f18\u5316\uff0c\u518d\u6bd4\u8f83\u91cd\u590d\u8fd0\u884c\u7684\u5206\u652f\u7a33\u5b9a\u6027\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u5728\u81ea\u4e3e\u5206\u6790\u4e2d\uff0c\u82e5\u6bd4\u5bf9\u5217\u5b58\u5728\u9519\u8bef\u6216\u5e8f\u5217\u91cd\u590d\uff0c\u5373\u4f7f\u91cd\u590d\u6b21\u6570\u589e\u52a0\uff0c\u652f\u6301\u7387\u4f9d\u7136\u504f\u4f4e\u3002\u8fd9\u79cd\u73b0\u8c61\u5e38\u88ab\u8bef\u8ba4\u4e3a\u662f\u81ea\u4e3e\u6b21\u6570\u4e0d\u8db3\u6240\u81f4\uff0c\u4ece\u800c\u5bfc\u81f4\u5206\u6790\u65b9\u5411\u504f\u79bb\u6838\u5fc3\u95ee\u9898\u3002\u6bd4\u5bf9\u9519\u8bef\u53ef\u80fd\u8868\u73b0\u4e3a\u63d2\u5165\u7f3a\u5931\u6216\u78b1\u57fa\u8bc6\u522b\u504f\u5dee\uff0c\u8fd9\u4e9b\u9519\u8bef\u4f1a\u5e72\u6270\u7cfb\u7edf\u53d1\u80b2\u6811\u7684\u6784\u5efa\u8fc7\u7a0b\u3002\u82e5\u672a\u5148\u68c0\u67e5\u6bd4\u5bf9\u8d28\u91cf\uff0c\u76f4\u63a5\u589e\u52a0\u91cd\u590d\u6b21\u6570\uff0c\u4f1a\u6d6a\u8d39\u8ba1\u7b97\u8d44\u6e90\u5e76\u8bef\u5bfc\u7ed3\u8bba\u3002\u8fd9\u79cd\u8bef\u5224\u6e90\u4e8e\u5bf9\u652f\u6301\u7387\u8ba1\u7b97\u539f\u7406\u7684\u8bef\u89e3\uff0c\u5373\u652f\u6301\u7387\u5e76\u975e\u76f4\u63a5\u53cd\u6620\u5206\u652f\u4e3a\u771f\u7684\u6982\u7387\uff0c\u800c\u662f\u53d7\u6570\u636e\u8d28\u91cf\u5f71\u54cd\u7684\u4f30\u8ba1\u503c\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u82e5\u6bd4\u5bf9\u4e2d\u5b58\u5728\u63a5\u8fd1\u91cd\u590d\u7684\u5e8f\u5217\uff0c\u4f1a\u663e\u8457\u5f71\u54cd\u81ea\u4e3e\u652f\u6301\u7387\u7684\u4f30\u8ba1\u3002\u8fd9\u7c7b\u5e8f\u5217\u5728\u6bd4\u5bf9\u4e2d\u53ef\u80fd\u8868\u73b0\u4e3a\u9ad8\u5ea6\u4fdd\u5b88\u7684\u4f4d\u70b9\uff0c\u5bfc\u81f4\u7cfb\u7edf\u53d1\u80b2\u6811\u6784\u5efa\u65f6\u51fa\u73b0\u504f\u5dee\u3002\u5373\u4f7f\u4f7f\u7528\u5927\u91cf\u91cd\u590d\u6b21\u6570\uff0c\u4e5f\u65e0\u6cd5\u7ea0\u6b63\u8fd9\u79cd\u56e0\u5e8f\u5217\u76f8\u4f3c\u6027\u5f15\u8d77\u7684\u4f30\u8ba1\u504f\u5dee\u3002\u8fd9\u79cd\u73b0\u8c61\u5728\u5b9e\u9645\u5206\u6790\u4e2d\u5e38\u88ab\u5ffd\u7565\uff0c\u56e0\u4e3a\u91cd\u590d\u6b21\u6570\u589e\u52a0\u540e\u652f\u6301\u7387\u53ef\u80fd\u7565\u6709\u63d0\u5347\uff0c\u4f46\u65e0\u6cd5\u8fbe\u5230\u5408\u7406\u6c34\u5e73\u3002\u6b64\u65f6\u82e5\u7ee7\u7eed\u589e\u52a0\u91cd\u590d\u6b21\u6570\uff0c\u53ea\u4f1a\u5ef6\u957f\u8ba1\u7b97\u65f6\u95f4\u800c\u65e0\u5b9e\u9645\u6536\u76ca\u3002\u56e0\u6b64\uff0c\u5e94\u4f18\u5148\u68c0\u67e5\u5e8f\u5217\u7684\u591a\u6837\u6027\uff0c\u786e\u8ba4\u662f\u5426\u5b58\u5728\u91cd\u590d\u6216\u9ad8\u5ea6\u76f8\u4f3c\u7684\u5e8f\u5217\uff0c\u518d\u51b3\u5b9a\u662f\u5426\u9700\u8981\u589e\u52a0\u91cd\u590d\u6b21\u6570\u3002<\/p>\n<h2 style=\"margin:2em 0 .6em;color:#205CAC;font-size:1.38em;line-height:1.5;\">\u5982\u4f55\u7528\u81ea\u5df1\u7684\u6570\u636e\u590d\u6838<\/h2>\n<p style=\"margin:.5em 0 1em\">\u9488\u5bf9\u4f4e\u652f\u6301\u7684\u4e00\u4e2a\u5206\u652f\uff0c\u628a\u652f\u6301\u548c\u53cd\u5bf9\u8be5\u5206\u652f\u7684\u6bd4\u5bf9\u5217\u5206\u522b\u627e\u51fa\u6765\uff0c\u6838\u67e5\u5b83\u4eec\u662f\u5426\u96c6\u4e2d\u5728\u8fb9\u7f18\u3001\u7f3a\u53e3\u591a\u7684\u7247\u6bb5\u6216\u5c11\u6570\u53ef\u7591\u5e8f\u5217\u3002\u4f4d\u70b9\u81ea\u4e3e\u80fd\u53cd\u6620\u6309\u65e2\u5b9a\u6bd4\u5bf9\u91cd\u65b0\u62bd\u5217\u65f6\u8be5\u5206\u652f\u6709\u591a\u7a33\u5b9a\uff0c\u7ee7\u7eed\u589e\u52a0\u91cd\u590d\u4e3b\u8981\u4f1a\u4f7f\u8fd9\u4e2a\u9891\u7387\u4f30\u8ba1\u66f4\u7cbe\u786e\u3002\u82e5\u6709\u6548\u53d8\u5f02\u4f4d\u70b9\u5f88\u5c11\uff0c\u6216\u4e0d\u540c\u4f4d\u70b9\u5b58\u5728\u7cfb\u7edf\u51b2\u7a81\uff0c\u53ef\u4ee5\u6bd4\u8f83\u5408\u7406\u7684\u4fee\u526a\u548c\u66ff\u6362\u6a21\u578b\uff0c\u5e76\u4fdd\u7559\u4e0d\u786e\u5b9a\u7684\u5206\u652f\u89e3\u91ca\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u4ece\u5904\u7406\u524d\u7684\u8f93\u5165\u7ed9\u6bcf\u6761\u5e8f\u5217\u3001\u7279\u5f81\u6216\u6837\u672c\u4e00\u4e2a\u7a33\u5b9a\u540d\u5b57\u3002\u5728\u5904\u7406\u540e\u9010\u9879\u6807\u6ce8\u4fdd\u7559\u3001\u4e22\u5f03\u548c\u6682\u65f6\u65e0\u6cd5\u6bd4\u8f83\u7684\u539f\u56e0\u3002\u9700\u8981\u628a ID \u5e26\u5230\u53e6\u4e00\u5f20\u8868\u65f6\uff0c\u7528\u540d\u5b57\u505a\u663e\u5f0f\u8fde\u63a5\uff0c\u968f\u540e\u6838\u5bf9\u5339\u914d\u524d\u540e\u6bcf\u4e2a\u6837\u672c\u7684\u603b\u91cf\u3002\u4e00\u4e2a\u5168\u5c40\u4fdd\u7559\u7387\u53ef\u80fd\u5f88\u9ad8\uff0c\u5374\u521a\u597d\u628a\u4e00\u4e2a\u5c0f\u6837\u672c\u4e2d\u6700\u5e38\u89c1\u7684\u7279\u5f81\u5168\u90e8\u4e22\u6389\u3002\u8fd9\u65f6\u4e0b\u6e38\u8ddd\u79bb\u3001\u76f8\u5bf9\u4e30\u5ea6\u6216\u6811\u4e0a\u7684\u4f4d\u7f6e\u90fd\u4f1a\u53d7\u5230\u5f71\u54cd\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u6362\u4e00\u4e2a\u5408\u7406\u7684\u8fc7\u6ee4\u89c4\u5219\u65f6\uff0c\u4fdd\u7559\u4e24\u6b21\u90fd\u51fa\u73b0\u7684\u5bf9\u8c61\u4f5c\u5bf9\u7167\u3002\u82e5\u89c6\u89c9\u4e0a\u53d8\u5316\u5f88\u5927\uff0c\u5148\u770b\u6539\u53d8\u7684\u662f\u7279\u5f81\u96c6\u5408\u3001\u6bcf\u6761\u5e8f\u5217\u7684\u6709\u6548\u8986\u76d6\uff0c\u8fd8\u662f\u540c\u4e00\u5bf9\u8c61\u5728\u4e24\u79cd\u8bbe\u7f6e\u4e2d\u7684\u4f30\u8ba1\u503c\u3002\u62a5\u544a\u65f6\u8bf4\u660e\u54ea\u4e00\u9879\u7ed3\u8bba\u5728\u4e24\u6b21\u90fd\u6210\u7acb\uff0c\u54ea\u4e00\u9879\u53ea\u5728\u7279\u5b9a\u95e8\u69db\u51fa\u73b0\u3002\u989d\u5916\u7684\u5b9e\u9a8c\u91cd\u590d\u6216\u72ec\u7acb\u6d4b\u91cf\u5e94\u8be5\u9488\u5bf9\u540e\u8005\uff0c\u8fd9\u6bd4\u6cdb\u6cdb\u5730\u8bf4\u201c\u9700\u8981\u8fdb\u4e00\u6b65\u9a8c\u8bc1\u201d\u66f4\u80fd\u6307\u660e\u4e0b\u4e00\u6b65\u91c7\u4ec0\u4e48\u6837\u672c\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\/084-phangorn-code-d276d61a8807a15e.zip\">\u4e0b\u8f7d\u672c\u7bc7 R \u4ee3\u7801\uff08ZIP\uff0c4.2 KiB\uff09<\/a> \u00b7 <a style=\"color:#1458a5;text-decoration:underline;\" href=\"https:\/\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/r-practice-labs\/084-phangorn-data-d838adfb445cd88e.zip\">\u4e0b\u8f7d\u914d\u5957\u793a\u4f8b\u6570\u636e\uff08ZIP\uff0c899 B\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;\">084-phangorn<\/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\u7528\u56db\u6761\u4eba\u5de5 DNA \u6bd4\u5bf9\u5b9e\u9645\u62df\u5408\u8d77\u59cb\u6811\u4f3c\u7136\u201d\u3002Linux x86_64\u3001R 4.5.2\u3001phangorn 2.12.1 \u7684\u8f93\u51fa\u4e3a\u53f6\u6570 4\uff0c\u6bd4\u5bf9\u6a21\u5f0f\u6570 8\uff0c\u8d77\u59cb\u5bf9\u6570\u4f3c\u7136 -94.982696\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u628a\u8d77\u59cb\u6811\u7684 logLik \u4f5c\u4e3a\u57fa\u51c6\uff0c\u4fdd\u6301\u8f93\u5165\u6bd4\u5bf9\u4e0d\u53d8\u518d\u4f18\u5316\u679d\u957f\u6216\u62d3\u6251\u3002\u4f3c\u7136\u7528\u4e8e\u6bd4\u8f83\u540c\u4e00\u6570\u636e\u548c\u6a21\u578b\u5b9a\u4e49\u4e0b\u7684\u62df\u5408\u3002\u91cd\u590d\u4f4d\u70b9\u7ecf\u538b\u7f29\u6210\u4e3a\u6a21\u5f0f\u540e\uff0c\u4ecd\u6309\u5176\u539f\u59cb\u9891\u6b21\u8d21\u732e\u4f3c\u7136\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\">\u5728\u56db\u6761\u4eba\u5de5 DNA \u6bd4\u5bf9\u4e0e\u4e00\u68f5\u5df2\u77e5\u62d3\u6251\u7684\u8d77\u59cb\u6811\u4e0a\uff0c\u53ef\u4ee5\u5148\u5b9e\u9645\u7b97\u51fa\u6811\u7684\u4f3c\u7136\uff0c\u8bf4\u660e\u8f93\u5165\u6a21\u5f0f\u3001\u6811\u53f6\u548c\u6a21\u578b\u5f7c\u6b64\u76f8\u5bb9\u3002\u8fd9\u4e0e\u5206\u652f\u83b7\u5f97\u9ad8\u81ea\u4e3e\u652f\u6301\u662f\u4e24\u4ef6\u4e8b\u3002\u5f00\u59cb\u957f\u65f6\u95f4\u91cd\u62bd\u6837\u524d\u5148\u6838\u67e5\u53f6\u540d\u3001\u6709\u6548\u5217\u548c\u6a21\u578b\u8bbe\u7f6e\uff0c\u80fd\u907f\u514d\u5728\u6709\u7f3a\u9677\u7684\u8d77\u59cb\u6bd4\u5bf9\u4e0a\u53cd\u590d\u8ba1\u7b97\u3002<\/p>\n<p style=\"border-top:1px solid #DAE6F2;margin-top:2em;padding-top:1em;\">\u5c0f\u6837\u672c\u7684\u8ba1\u6570\u548c\u5224\u65ad\u6807\u51c6\u6838\u5bf9\u6e05\u695a\u540e\uff0c\u82e5\u8981\u628a\u540c\u4e00\u6d41\u7a0b\u7528\u4e8e\u6574\u6279\u6837\u672c\uff0c\u53ef\u4ee5\u5e26\u4e0a\u8f93\u5165\u89c4\u6a21\u548c\u5df2\u7ecf\u8dd1\u901a\u7684 R \u811a\u672c\uff0c\u6309\u9879\u76ee\u5468\u671f\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>\u4e09\u6b21\u6f14\u7b97\u652f\u6301\u6bd4\u4f8b\u540c\u4e3a\u4e03\u6210\uff0c\u4f46\u8f6e\u6570\u4e0d\u540c\uff0c\u8499\u7279\u5361\u6d1b\u4e0d\u786e\u5b9a\u6027\u5e76\u4e0d\u4e00\u6837\u3002<\/p>\n","protected":false},"author":1,"featured_media":68770,"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":[810,728,807],"class_list":["post-68771","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-r","category-part","tag-phangorn","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-phangorn-practice-e3eef186.png?fit=1120%2C690&ssl=1","_links":{"self":[{"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts\/68771","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=68771"}],"version-history":[{"count":2,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts\/68771\/revisions"}],"predecessor-version":[{"id":70879,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts\/68771\/revisions\/70879"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/media\/68770"}],"wp:attachment":[{"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/media?parent=68771"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/categories?post=68771"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/tags?post=68771"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}