{"id":68693,"date":"2026-12-05T09:10:33","date_gmt":"2026-12-05T01:10:33","guid":{"rendered":"https:\/\/www.biocloudservice.com\/wordpress\/?p=68693"},"modified":"2026-12-05T09:10:33","modified_gmt":"2026-12-05T01:10:33","slug":"r-guide-snftool-practice","status":"publish","type":"post","link":"https:\/\/www.biocloudservice.com\/wordpress\/r-guide-snftool-practice\/","title":{"rendered":"SNFtool \u878d\u5408\u524d\u600e\u6837\u67e5\u51fa\u54ea\u4e00\u5c42\u628a\u90bb\u5c45\u5173\u7cfb\u5e26\u504f\u4e86\uff1f"},"content":{"rendered":"<div class=\"ysx-r-practice\" id=\"ysx-r-snftool\" 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\">\u7f51\u7edc\u878d\u5408\u65f6\uff0c\u4e24\u5f20\u7ec4\u5b66\u8868\u53ef\u4ee5\u6709\u5b8c\u5168\u4e0d\u540c\u7684\u5217\uff0c\u5374\u5fc5\u987b\u6307\u5411\u540c\u4e00\u6279\u53d7\u8bd5\u8005\u3002SNF \u878d\u5408\u7684\u662f\u6837\u672c\u4e4b\u95f4\u7684\u5173\u7cfb\u3002\u5148\u5bf9\u9f50\u6837\u672c\u3001\u5206\u522b\u68c0\u67e5\u5404\u5c42\u8fd1\u90bb\uff0c\u518d\u67e5\u878d\u5408\u540e\u7684\u76f8\u4f3c\u6027\uff0c\u624d\u80fd\u770b\u51fa\u662f\u54ea\u4e00\u5c42\u6539\u53d8\u4e86\u60a3\u8005\u7684\u4f4d\u7f6e\u3002<\/p>\n<h2 style=\"margin:2em 0 .6em;color:#205CAC;font-size:1.38em;line-height:1.5;\">SNFtool \u7684\u8f93\u5165\u548c\u5206\u6790\u5bf9\u8c61<\/h2>\n<p style=\"margin:.5em 0 1em\">views \u4e3a\u547d\u540d\u6837\u672c\u00d7\u7279\u5f81\u6570\u503c\u77e9\u9635\u5217\u8868\uff0c\u5404\u6837\u672c\u5df2\u5bf9\u9f50\u3001\u5404\u5c42\u6309\u9009\u5b9a\u65b9\u6cd5\u7f29\u653e\uff0c\u65e0\u7f3a\u5931\u3002\u793a\u4f8b\u6bcf\u5c42\u81f3\u5c11\u6709\u5341\u4e8c\u4e2a\u6837\u672c\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u6837\u672c\u5728\u591a\u7ec4\u5b66\u7f51\u7edc\u4e2d\u90bb\u5c45\u5173\u7cfb\u7684\u8bc6\u522b\u662f\u878d\u5408\u5206\u6790\u4e2d\u7684\u5173\u952e\u73af\u8282\uff0c\u5c24\u5176\u5728\u76f8\u4f3c\u6027\u7f51\u7edc\u878d\u5408\uff08SNF\uff09\u65b9\u6cd5\u4e2d\uff0c\u4e0d\u540c\u89c6\u56fe\u7684\u90bb\u5c45\u7ed3\u6784\u76f4\u63a5\u5f71\u54cd\u6700\u7ec8\u805a\u7c7b\u7ed3\u679c\u3002\u6bcf\u5c42\u89c6\u56fe\u57fa\u4e8e\u4e0d\u540c\u7ec4\u5b66\u6570\u636e\u6784\u5efa\uff0c\u9700\u786e\u4fdd\u6837\u672c\u5bf9\u9f50\u4e0e\u7f29\u653e\u4e00\u81f4\uff0c\u4ee5\u907f\u514d\u56e0\u6570\u636e\u5c3a\u5ea6\u5dee\u5f02\u5bfc\u81f4\u90bb\u5c45\u5173\u7cfb\u504f\u79fb\u3002\u8fd9\u79cd\u7ed3\u6784\u8bbe\u8ba1\u65e8\u5728\u53cd\u6620\u540c\u4e00\u53d7\u8bd5\u8005\u5728\u4e0d\u540c\u7ef4\u5ea6\u4e0b\u7684\u76f8\u4f3c\u6027\uff0c\u4ece\u800c\u5728\u878d\u5408\u540e\u56fe\u4e2d\u4f53\u73b0\u5176\u6574\u4f53\u7279\u5f81\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u6837\u672c\u5728\u4e0d\u540c\u7ec4\u5b66\u89c6\u56fe\u4e2d\u7684\u90bb\u5c45\u96c6\u5408\u53ef\u7528\u6765\u8861\u91cf\u5176\u5728\u5404\u5c42\u7684\u76f8\u4f3c\u6027\u7a0b\u5ea6\uff0c\u96c6\u5408\u4ea4\u96c6\u4e0e\u5e76\u96c6\u7684\u6bd4\u503c\u5373\u4e3a Jaccard \u76f8\u4f3c\u5ea6\u3002\u4f8b\u5982\uff0c\u540c\u4e00\u53d7\u8bd5\u8005\u5728\u7532\u3001\u4e59\u4e24\u5c42\u5404\u6709\u56db\u4e2a\u90bb\u5c45\uff0c\u5176\u4e2d\u4e24\u4e2a\u4e3a\u5171\u540c\u90bb\u5c45\uff0cJaccard \u503c\u4e3a\u4e8c\u9664\u4ee5\u516d\uff0c\u8868\u793a\u5176\u5728\u4e24\u5c42\u4e2d\u7684\u90bb\u5c45\u7ed3\u6784\u5dee\u5f02\u3002\u8fd9\u79cd\u8ba1\u7b97\u65b9\u6cd5\u7528\u4e8e\u5b9a\u4f4d\u90bb\u5c45\u5173\u7cfb\u7684\u504f\u79bb\uff0c\u800c\u975e\u76f4\u63a5\u7528\u4e8e SNF \u66f4\u65b0\u65b9\u7a0b\u3002\u901a\u8fc7\u6bd4\u8f83\u5404\u5c42\u90bb\u5c45\u7ed3\u6784\uff0c\u53ef\u4ee5\u5224\u65ad\u662f\u5426\u5b58\u5728\u67d0\u4e00\u5c42\u7684\u90bb\u5c45\u9009\u62e9\u673a\u5236\u504f\u79bb\u4e86\u771f\u5b9e\u6837\u672c\u5173\u7cfb\uff0c\u4ece\u800c\u5f71\u54cd\u878d\u5408\u56fe\u7684\u6784\u5efa\u3002\u8fd9\u79cd\u65b9\u6cd5\u4e3a\u8bca\u65ad\u878d\u5408\u5931\u8d25\u63d0\u4f9b\u76f4\u63a5\u4f9d\u636e\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u6309\u6837\u672c ID \u5bf9\u9f50\u5e76\u5206\u522b\u7f29\u653e\u5404\u7ec4\u5b66\uff0c\u9010\u7ec4\u5b66\u8ba1\u7b97\u6837\u672c\u8ddd\u79bb\uff0c\u7528 <code>affinityMatrix()<\/code> \u5efa\u76f8\u4f3c\u7f51\u7edc\uff0c\u4ea4\u7ed9 <code>SNF()<\/code> \u8fed\u4ee3\u878d\u5408\u3002 <a href=\"https:\/\/cran.r-project.org\/web\/packages\/SNFtool\/refman\/SNFtool.html#SNF\" style=\"color:#185CB7;text-decoration:underline;\">SNFtool 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;\">aff &lt;- lapply(views,function(x) SNFtool::affinityMatrix(as.matrix(dist(x)),K=5,sigma=.5))\nnet &lt;- SNFtool::SNF(aff,K=5,t=10)\ndim(net)\n<\/code><\/pre>\n<h2 style=\"margin:2em 0 .6em;color:#205CAC;font-size:1.38em;line-height:1.5;\">\u4e24\u4e2a\u89c6\u56fe\u5404\u6709\u56db\u4e2a\u90bb\u5c45\uff0c\u5171\u4eab\u591a\u5c11<\/h2>\n<p style=\"margin:.5em 0 1em\">\u540c\u4e00\u53d7\u8bd5\u8005\u5728\u4e24\u5c42\u5404\u6709\u56db\u4e2a\u90bb\u5c45\u3001\u5171\u540c\u4e24\u4e2a\uff0c\u96c6\u5408 Jaccard \u4e3a\u4e8c\u9664\u4ee5\u516d\u3002\u6b64\u68c0\u67e5\u7528\u6765\u5b9a\u4f4d\u6539\u53d8\u7684\u90bb\u5c45\uff0c\u4e0d\u662f SNF \u66f4\u65b0\u65b9\u7a0b\u3002\u6bd4\u8f83\u6280\u672f\u56e0\u7d20\u4e0e\u8bca\u65ad\u6807\u7b7e\u7684\u5bf9\u5e94\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(length(c(2,3,4,5)),length(c(3,4,6,7)),length(intersect(c(2,3,4,5),c(3,4,6,7))))\nnames(v) &lt;- c(\"\u7532\u5c42\u90bb\u5c45\", \"\u4e59\u5c42\u90bb\u5c45\", \"\u5171\u540c\u90bb\u5c45\")\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\u5c42\u90bb\u5c45<\/td>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">4<\/td>\n<\/tr>\n<tr>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">\u4e59\u5c42\u90bb\u5c45<\/td>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">4<\/td>\n<\/tr>\n<tr>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">\u5171\u540c\u90bb\u5c45<\/td>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">2<\/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-snftool-practice-9455b229.png?resize=1120%2C690&#038;ssl=1\" alt=\"\u4e24\u4e2a\u89c6\u56fe\u5404\u6709\u56db\u4e2a\u90bb\u5c45\uff0c\u5171\u4eab\u591a\u5c11\u3002\u7532\u5c42\u90bb\u5c45 4\uff0c\u4e59\u5c42\u90bb\u5c45 4\uff0c\u5171\u540c\u90bb\u5c45 2\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;\">\u6309\u884c\u770b\u4f3c\u4e00\u6837\u7684\u7ec4\u5b66\u8868\u5176\u5b9e\u5bf9\u9f50\u4e86\u5417\uff1f<\/h2>\n<p style=\"margin:.5em 0 1em\">\u7b2c\u4e8c\u5f20\u8868\u8981\u6309\u7b2c\u4e8c\u3001\u7b2c\u4e09\u3001\u7b2c\u4e00\u884c\u91cd\u6392\u3002\u878d\u5408\u7684\u662f\u6837\u672c\u5bf9\u7684\u76f8\u4f3c\u6027\uff0c\u6bcf\u5c42\u8ddd\u79bb\u65b9\u9635\u4e24\u4e2a\u8f74\u5fc5\u987b\u5bf9\u540c\u4e00\u6279\u4eba\u3002\u53ea\u628a\u884c\u540d\u6539\u6210\u987a\u773c\u7684\u987a\u5e8f\u800c\u6ca1\u6709\u6362\u6570\u503c\uff0c\u4f1a\u628a\u4e0d\u540c\u4eba\u7684\u90bb\u5c45\u786c\u5408\u5728\u4e00\u8d77\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;\">orderA &lt;- c(\"p1\",\"p2\",\"p3\")\norderB &lt;- c(\"p3\",\"p1\",\"p2\")\nmatch(orderA,orderB)\n<\/code><\/pre>\n<p style=\"margin:.5em 0 1em\">\u878d\u5408\u56fe\u6784\u5efa\u5b8c\u6210\u540e\uff0c\u5176\u7ed3\u6784\u53ef\u4f5c\u4e3a\u5224\u65ad\u5404\u5c42\u90bb\u5c45\u5173\u7cfb\u662f\u5426\u4e00\u81f4\u7684\u4f9d\u636e\u3002\u82e5\u67d0\u5c42\u90bb\u5c45\u7ed3\u6784\u5728\u878d\u5408\u56fe\u4e2d\u8868\u73b0\u51fa\u5f02\u5e38\u7684\u7a00\u758f\u6027\u6216\u5bc6\u96c6\u6027\uff0c\u53ef\u80fd\u6e90\u4e8e\u8be5\u5c42\u6570\u636e\u7684\u504f\u5dee\u3002\u901a\u8fc7\u89c2\u5bdf\u878d\u5408\u56fe\u7684\u90bb\u63a5\u77e9\u9635\uff0c\u53ef\u8bc6\u522b\u51fa\u54ea\u4e9b\u6837\u672c\u7684\u90bb\u5c45\u5173\u7cfb\u5728\u878d\u5408\u4e2d\u88ab\u8fc7\u5ea6\u5f3a\u8c03\u6216\u5ffd\u7565\u3002\u82e5\u67d0\u5c42\u56fe\u5728\u878d\u5408\u540e\u56fe\u4e2d\u8868\u73b0\u5f02\u5e38\uff0c\u53ef\u8fdb\u4e00\u6b65\u5206\u6790\u5176\u90bb\u63a5\u77e9\u9635\u7684\u7a00\u758f\u5ea6\u548c\u5bc6\u5ea6\uff0c\u5224\u65ad\u5176\u662f\u5426\u5bf9\u878d\u5408\u8fc7\u7a0b\u4ea7\u751f\u4e86\u504f\u79fb\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u82e5\u878d\u5408\u56fe\u4e2d\u5b58\u5728\u660e\u663e\u504f\u79bb\u9884\u671f\u7684\u805a\u7c7b\u7ed3\u6784\uff0c\u5e94\u68c0\u67e5\u5404\u5c42\u89c6\u56fe\u7684\u90bb\u5c45\u96c6\u5408\u662f\u5426\u4e00\u81f4\u3002\u4f8b\u5982\uff0c\u82e5\u67d0\u5c42\u90bb\u5c45\u96c6\u5408\u5728\u878d\u5408\u540e\u56fe\u4e2d\u88ab\u663e\u8457\u653e\u5927\uff0c\u53ef\u80fd\u6e90\u4e8e\u8be5\u5c42\u7684\u90bb\u5c45\u9009\u62e9\u673a\u5236\u5b58\u5728\u504f\u5dee\u3002\u901a\u8fc7\u8ba1\u7b97\u6bcf\u5c42\u90bb\u5c45\u96c6\u5408\u7684 Jaccard \u76f8\u4f3c\u5ea6\uff0c\u53ef\u91cf\u5316\u5404\u5c42\u95f4\u90bb\u5c45\u7ed3\u6784\u7684\u5dee\u5f02\u3002\u82e5\u67d0\u5c42\u90bb\u5c45\u7ed3\u6784\u4e0e\u5176\u4f59\u5c42\u5dee\u5f02\u663e\u8457\uff0c\u8bf4\u660e\u8be5\u5c42\u53ef\u80fd\u5f15\u5165\u4e86\u5f02\u5e38\u90bb\u5c45\u5173\u7cfb\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u5728\u5b9e\u9645\u64cd\u4f5c\u4e2d\uff0c\u82e5\u672a\u5bf9\u5404\u5c42\u6570\u636e\u8fdb\u884c\u4e00\u81f4\u7684\u7f29\u653e\u5904\u7406\uff0c\u53ef\u80fd\u4f7f\u67d0\u4e00\u5c42\u7684\u90bb\u5c45\u7ed3\u6784\u5728\u878d\u5408\u8fc7\u7a0b\u4e2d\u88ab\u5f02\u5e38\u653e\u5927\u3002\u4f8b\u5982\uff0c\u67d0\u5c42\u6570\u636e\u672a\u6309\u6807\u51c6\u6b63\u5219\u5316\u5904\u7406\uff0c\u5bfc\u81f4\u5176\u6837\u672c\u95f4\u8ddd\u79bb\u88ab\u4eba\u4e3a\u538b\u7f29\uff0c\u4ece\u800c\u5728 <code>affinityMatrix()<\/code> \u51fd\u6570\u4e2d\u751f\u6210\u8fc7\u591a\u8fd1\u90bb\u3002\u8fd9\u79cd\u504f\u5dee\u5728\u878d\u5408\u56fe\u4e2d\u8868\u73b0\u4e3a\u8be5\u5c42\u90bb\u5c45\u5173\u7cfb\u5f02\u5e38\u5bc6\u96c6\uff0c\u8fdb\u800c\u5f71\u54cd\u6574\u4f53\u805a\u7c7b\u5212\u5206\u3002\u82e5\u672a\u53ca\u65f6\u53d1\u73b0\u6b64\u7c7b\u95ee\u9898\uff0c\u878d\u5408\u56fe\u5c06\u65e0\u6cd5\u51c6\u786e\u53cd\u6620\u6837\u672c\u7684\u771f\u5b9e\u76f8\u4f3c\u6027\u7ed3\u6784\u3002\u56e0\u6b64\uff0c\u5fc5\u987b\u5728\u6bcf\u5c42\u6784\u5efa\u540e\u68c0\u67e5\u5176\u90bb\u63a5\u77e9\u9635\u7684\u7a00\u758f\u6027\u4e0e\u5bc6\u5ea6\uff0c\u4ee5\u8bc6\u522b\u6f5c\u5728\u504f\u5dee\u3002<\/p>\n<h2 style=\"margin:2em 0 .6em;color:#205CAC;font-size:1.38em;line-height:1.5;\">\u6784\u9020\u4e24\u5c42\u76f8\u4f3c\u7f51\u7edc\u5e76\u5b9e\u9645\u878d\u5408<\/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(30)\na&lt;-matrix(rnorm(14*5),14)\nb&lt;-matrix(rnorm(14*3),14)\nw&lt;-lapply(list(a,b),function(v)SNFtool::affinityMatrix(as.matrix(dist(v)),K=4,sigma=.5))\nm&lt;-SNFtool::SNF(w,K=4,t=5)\nc(nrow(m),ncol(m),sum(is.finite(m)))\n<\/code><\/pre>\n<p style=\"margin:.5em 0 1em\">\u5728 R 4.5.2\u3001SNFtool 2.3.1 \u4e2d\u8fd0\u884c\uff0c\u8f93\u51fa\u4f9d\u6b21\u4e3a\u53c2\u4e0e\u6837\u672c 14\uff0c\u7f51\u7edc\u5217 14\uff0c\u6709\u9650\u8fb9\u683c 196\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\">\u5404\u5c42\u5fc5\u987b\u4ee3\u8868\u540c\u4e00\u6279\u53d7\u8bd5\u8005\u4e14\u987a\u5e8f\u4e00\u81f4\u3002\u68c0\u67e5\u8fd1\u90bb\u6570\u76f8\u5bf9\u6837\u672c\u91cf\u662f\u5426\u5408\u9002\uff0c\u5e76\u56de\u770b\u662f\u5426\u7531\u67d0\u4e00\u5e73\u53f0\u4e3b\u5bfc\u5206\u7fa4\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u5728\u76f8\u4f3c\u6027\u7f51\u7edc\u878d\u5408\u5206\u6790\u4e2d\uff0c\u82e5\u67d0\u4e00\u5c42\u89c6\u56fe\u7684\u90bb\u5c45\u7ed3\u6784\u4e0e\u5176\u4f59\u5c42\u663e\u8457\u4e0d\u540c\uff0c\u53ef\u80fd\u8bef\u5bfc\u6700\u7ec8\u805a\u7c7b\u7ed3\u679c\u3002\u8fd9\u79cd\u504f\u5dee\u53ef\u80fd\u6e90\u4e8e\u6837\u672c\u7f29\u653e\u65b9\u5f0f\u4e0d\u4e00\u81f4\uff0c\u6216\u67d0\u4e00\u5c42\u6570\u636e\u56e0\u5e73\u53f0\u5dee\u5f02\u4e3b\u5bfc\u4e86\u90bb\u5c45\u9009\u62e9\u3002\u4f8b\u5982\uff0c\u82e5\u67d0\u5c42\u56e0\u53d8\u91cf\u5c3a\u5ea6\u8f83\u5927\uff0c\u5bfc\u81f4\u5176\u8fd1\u90bb\u6570\u88ab\u538b\u7f29\uff0c\u6216\u56e0\u6837\u672c\u7ec4\u6210\u4e0d\u5747\u4f7f\u90bb\u5c45\u5173\u7cfb\u504f\u5411\u67d0\u4e00\u7c7b\uff0c\u8fd9\u5c06\u5f71\u54cd\u878d\u5408\u56fe\u7684\u6784\u5efa\u3002\u6b64\u7c7b\u95ee\u9898\u5728\u6570\u636e\u9884\u5904\u7406\u9636\u6bb5\u672a\u88ab\u8bc6\u522b\uff0c\u4f1a\u5bfc\u81f4\u540e\u7eed\u805a\u7c7b\u7ed3\u679c\u504f\u79bb\u771f\u5b9e\u5206\u7fa4\u3002\u56e0\u6b64\uff0c\u5fc5\u987b\u5bf9\u6bcf\u5c42\u89c6\u56fe\u7684\u90bb\u5c45\u7ed3\u6784\u8fdb\u884c\u72ec\u7acb\u8bc4\u4f30\uff0c\u4ee5\u786e\u4fdd\u878d\u5408\u56fe\u7684\u7a33\u5065\u6027\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u4f8b\u5982\uff0c\u82e5\u67d0\u5c42\u90bb\u5c45\u96c6\u5408\u4e0e\u5176\u4f59\u5c42\u76f8\u6bd4\u663e\u8457\u4e0d\u540c\uff0c\u8bf4\u660e\u8be5\u5c42\u53ef\u80fd\u5f15\u5165\u4e86\u504f\u5dee\u3002\u5177\u4f53\u800c\u8a00\uff0c\u82e5\u67d0\u5c42\u90bb\u5c45\u7ed3\u6784\u4e0e\u878d\u5408\u56fe\u4e2d\u805a\u7c7b\u5212\u5206\u4e0d\u4e00\u81f4\uff0c\u53ef\u63a8\u6d4b\u8be5\u5c42\u90bb\u5c45\u9009\u62e9\u673a\u5236\u5b58\u5728\u5f02\u5e38\u3002\u8fd9\u79cd\u7ed3\u6784\u5dee\u5f02\u53ef\u901a\u8fc7\u89c2\u5bdf\u90bb\u63a5\u77e9\u9635\u4e2d\u7684\u5f02\u5e38\u7a00\u758f\u6216\u5bc6\u96c6\u533a\u57df\u8fdb\u884c\u5b9a\u4f4d\u3002\u82e5\u67d0\u5c42\u56fe\u4e2d\u90e8\u5206\u6837\u672c\u90bb\u5c45\u6570\u8fdc\u8d85\u5176\u4ed6\u5c42\uff0c\u5e94\u6000\u7591\u5176\u7f29\u653e\u6216\u6837\u672c\u7ec4\u6210\u95ee\u9898\u3002\u590d\u67e5\u65f6\u5e94\u4f18\u5148\u68c0\u67e5\u8be5\u5c42\u7684\u6837\u672c\u5bf9\u9f50\u60c5\u51b5\u4e0e\u7f29\u653e\u53c2\u6570\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u82e5\u878d\u5408\u56fe\u4e2d\u51fa\u73b0\u4e0e\u9884\u671f\u4e0d\u7b26\u7684\u805a\u7c7b\u5212\u5206\uff0c\u53ef\u901a\u8fc7\u5bf9\u6bd4\u5404\u5c42\u90bb\u5c45\u7ed3\u6784\u8fdb\u884c\u8bca\u65ad\u3002\u8fd9\u79cd\u654f\u611f\u6027\u5206\u6790\u6709\u52a9\u4e8e\u786e\u4fdd\u878d\u5408\u56fe\u7684\u7a33\u5065\u6027\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\">\u4e3a\u6bcf\u79cd\u7ec4\u5b66\u5355\u72ec\u5217\u51fa\u67d0\u4e2a\u6837\u672c\u6700\u8fd1\u7684\u4e94\u4e2a\u90bb\u5c45\uff0c\u6309\u540d\u79f0\u6838\u5bf9\u8fd9\u4e94\u4e2a\u4eba\u5728\u539f\u59cb\u6570\u636e\u4e2d\u54ea\u4e9b\u7279\u5f81\u6700\u76f8\u4f3c\u3002\u82e5\u878d\u5408\u540e\u6240\u6709\u90bb\u5c45\u90fd\u6cbf\u7740\u4e00\u4e2a\u6d4b\u5e8f\u6279\u6b21\u6392\u5217\uff0c\u5148\u770b\u8be5\u5c42\u8ddd\u79bb\u662f\u5426\u53d7\u5230\u5c3a\u5ea6\u3001\u5f02\u5e38\u6837\u672c\u6216\u7f3a\u5931\u5904\u7406\u5f71\u54cd\u3002\u628a\u4e00\u5c42\u53bb\u6389\u540e\u91cd\u65b0\u878d\u5408\uff0c\u53ea\u6bd4\u8f83\u4e24\u6b21\u90fd\u5b58\u5728\u7684\u540c\u4e00\u7ec4\u6837\u672c\u3002\u770b\u5230\u90bb\u5c45\u53d8\u5316\u53ea\u80fd\u8bf4\u660e\u8be5\u5c42\u53c2\u4e0e\u4e86\u76f8\u4f3c\u6027\u6784\u9020\uff0c\u5224\u65ad\u662f\u5426\u6709\u4e34\u5e8a\u4fe1\u606f\u4ecd\u8981\u72ec\u7acb\u9a8c\u8bc1\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u53ef\u7ed9\u540c\u4e00\u6279\u5bf9\u8c61\u753b\u4e24\u4efd\u5c0f\u56fe\uff0c\u7b2c\u4e00\u4efd\u6309\u5df2\u77e5\u6280\u672f\u6765\u6e90\u7740\u8272\uff0c\u7b2c\u4e8c\u4efd\u6309\u72ec\u7acb\u83b7\u5f97\u7684\u751f\u7269\u5b66\u4fe1\u606f\u7740\u8272\u3002\u4e24\u56fe\u5fc5\u987b\u6cbf\u7528\u540c\u4e00\u5957\u70b9\u548c\u7f16\u53f7\uff0c\u8f74\u7684\u5c3a\u5ea6\u4e5f\u8981\u4e00\u81f4\u3002\u82e5\u67d0\u4e2a\u5c0f\u7fa4\u5728\u5176\u4e2d\u4e00\u5f20\u56fe\u4e0a\u5206\u5f97\u5f88\u5e72\u51c0\uff0c\u5148\u628a\u8fd9\u4e9b\u70b9\u7684\u7f16\u53f7\u62ff\u56de\u539f\u8868\uff0c\u6570\u4e00\u6570\u5b83\u4eec\u7a76\u7adf\u6765\u81ea\u51e0\u4f4d\u53d7\u8bd5\u8005\u3001\u51e0\u4e2a\u6587\u5e93\u6216\u51e0\u4e2a\u5b9e\u9645\u89c6\u91ce\u3002\u4e00\u4e2a\u6280\u672f\u6765\u6e90\u72ec\u5360\u4e00\u4e2a\u533a\u57df\u65f6\uff0c\u53ea\u51ed\u5206\u79bb\u5f97\u6e05\u695a\u4e0d\u8db3\u4ee5\u5224\u5b9a\u5b83\u6709\u72ec\u7acb\u7684\u751f\u7269\u5b66\u89e3\u91ca\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u6311\u51e0\u5904\u53d8\u5316\u6700\u5927\u7684\u5bf9\u8c61\uff0c\u7ecf\u5e38\u6bd4\u53ea\u7b97\u5168\u56fe\u5e73\u5747\u66f4\u6709\u4fe1\u606f\u3002\u5206\u522b\u8bb0\u4e0b\u5b83\u4eec\u5728\u53d8\u52a8\u524d\u540e\u9760\u8fd1\u8c01\u3001\u8fdc\u79bb\u8c01\uff0c\u518d\u770b\u539f\u59cb\u6d4b\u91cf\u662f\u5426\u4e5f\u652f\u6301\u8fd9\u79cd\u6539\u53d8\u3002\u9488\u5bf9\u672c\u6765\u5c31\u5f88\u7a00\u5c11\u7684\u7c7b\u522b\uff0c\u5148\u5728\u8be5\u7c7b\u522b\u9002\u7528\u7684\u8303\u56f4\u5185\u8ba1\u7b97\uff0c\u518d\u51b3\u5b9a\u662f\u5426\u5408\u5e76\u6c47\u603b\u3002\u82e5\u7a00\u5c11\u7c7b\u522b\u53ea\u5b58\u5728\u4e8e\u4e00\u4e2a\u6765\u6e90\uff0c\u660e\u786e\u6807\u8bb0\u8de8\u6765\u6e90\u590d\u6838\u7f3a\u5c11\u5bf9\u5e94\u89c2\u6d4b\uff0c\u522b\u628a\u8fd9\u79cd\u8bbe\u8ba1\u9650\u5236\u6df7\u8fdb\u7b97\u6cd5\u8868\u73b0\u7684\u6570\u5b57\u91cc\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\/048-snftool-code-51ab96fe581d60fc.zip\">\u4e0b\u8f7d\u672c\u7bc7 R \u4ee3\u7801\uff08ZIP\uff0c4.1 KiB\uff09<\/a> \u00b7 <a style=\"color:#1458a5;text-decoration:underline;\" href=\"https:\/\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/r-practice-labs\/048-snftool-data-4d3470417a2808ac.zip\">\u4e0b\u8f7d\u914d\u5957\u793a\u4f8b\u6570\u636e\uff08ZIP\uff0c5.4 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;\">048-snftool<\/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\u6784\u9020\u4e24\u5c42\u76f8\u4f3c\u7f51\u7edc\u5e76\u5b9e\u9645\u878d\u5408\u201d\u3002Linux x86_64\u3001R 4.5.2\u3001SNFtool 2.3.1 \u7684\u8f93\u51fa\u4e3a\u53c2\u4e0e\u6837\u672c 14\uff0c\u7f51\u7edc\u5217 14\uff0c\u6709\u9650\u8fb9\u683c 196\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u4e3a\u6bcf\u5f20\u7ec4\u5b66\u77e9\u9635\u4fdd\u5b58\u540c\u4e00\u4efd\u6837\u672c\u987a\u5e8f\uff0c\u6784\u5efa\u76f8\u4f3c\u7f51\u7edc\u524d\u6309 ID \u91cd\u65b0\u6392\u5e8f\u3002\u518d\u9009\u4e00\u5bf9\u6837\u672c\u6bd4\u8f83\u4e24\u5c42\u7684\u539f\u59cb\u76f8\u4f3c\u5ea6\u4e0e\u878d\u5408\u503c\u3002\u4e24\u5f20\u65b9\u9635\u7ef4\u5ea6\u76f8\u540c\u5e76\u4e0d\u80fd\u6392\u9664\u6837\u672c\u884c\u5e8f\u98a0\u5012\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\">\u4e24\u4e2a\u89c6\u56fe\u90fd\u53ea\u6709\u5341\u56db\u4f4d\u53d7\u8bd5\u8005\uff0c\u878d\u5408\u77e9\u9635\u5374\u6709\u4e00\u767e\u4e5d\u5341\u516d\u4e2a\u6709\u9650\u683c\u3002\u56fe\u7684\u884c\u5217\u8eab\u4efd\u90fd\u662f\u4eba\uff0c\u63a5\u53e3\u4e2d\u7684\u76f8\u4f3c\u6838\u5c3a\u5ea6\u53c2\u6570\u8fd8\u5e94\u6309\u672c\u7248\u6b63\u5f0f\u540d\u79f0\u4f20\u5165\u3002\u628a\u6837\u672c\u987a\u5e8f\u3001\u8fd1\u90bb\u6570\u548c\u6bcf\u5c42\u89c4\u6a21\u4fdd\u5b58\u4e0b\u6765\uff0c\u4e0b\u4e00\u6b21\u624d\u5206\u5f97\u6e05\u662f\u67d0\u4eba\u6362\u4e86\u90bb\u5c45\uff0c\u8fd8\u662f\u6574\u5c42\u7684\u7d22\u5f15\u9519\u4f4d\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>\u540c\u4e00\u53d7\u8bd5\u8005\u5728\u4e24\u5c42\u5404\u6709\u56db\u4e2a\u90bb\u5c45\u3001\u5171\u540c\u4e24\u4e2a\uff0c\u96c6\u5408 Jaccard \u4e3a\u4e8c\u9664\u4ee5\u516d\u3002<\/p>\n","protected":false},"author":1,"featured_media":68692,"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":[728,767,761],"class_list":["post-68693","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-r","category-part","tag-r","tag-snftool","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-snftool-practice-9455b229.png?fit=1120%2C690&ssl=1","_links":{"self":[{"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts\/68693","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=68693"}],"version-history":[{"count":3,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts\/68693\/revisions"}],"predecessor-version":[{"id":70823,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts\/68693\/revisions\/70823"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/media\/68692"}],"wp:attachment":[{"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/media?parent=68693"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/categories?post=68693"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/tags?post=68693"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}