{"id":68617,"date":"2026-12-05T09:10:35","date_gmt":"2026-12-05T01:10:35","guid":{"rendered":"https:\/\/www.biocloudservice.com\/wordpress\/?p=68617"},"modified":"2026-12-05T09:10:35","modified_gmt":"2026-12-05T01:10:35","slug":"r-guide-hdwgcna-practice","status":"publish","type":"post","link":"https:\/\/www.biocloudservice.com\/wordpress\/r-guide-hdwgcna-practice\/","title":{"rendered":"hdWGCNA \u805a\u5408\u4e86\u5f88\u591a metacell\uff0c\u7f51\u7edc\u5b9e\u9645\u7531\u591a\u5c11\u4f9b\u4f53\u652f\u6301\uff1f"},"content":{"rendered":"<div class=\"ysx-r-practice\" id=\"ysx-r-hdwgcna\" 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\">\u628a\u5f88\u591a\u7ec6\u80de\u805a\u6210 metacell \u80fd\u8ba9\u4f4e\u8986\u76d6\u8868\u8fbe\u66f4\u5bb9\u6613\u6bd4\u8f83\u3002\u4ee3\u4ef7\u662f\u540c\u4e00\u4e2a\u7ec6\u80de\u53ef\u80fd\u8fdb\u5165\u4e0d\u6b62\u4e00\u4e2a\u805a\u5408\u5355\u5143\uff0c\u6765\u81ea\u540c\u4e00\u4f4d\u4f9b\u4f53\u7684\u5355\u5143\u4e5f\u5171\u4eab\u4f9b\u4f53\u80cc\u666f\u3002\u753b\u5171\u8868\u8fbe\u56fe\u65f6\uff0c\u5e94\u80fd\u4ece\u56fe\u4e0a\u7684\u6bcf\u4e2a\u70b9\u8ffd\u5230\u5b83\u6765\u81ea\u8c01\u3001\u5b83\u7528\u4e86\u54ea\u4e9b\u7ec6\u80de\u3002<\/p>\n<h2 style=\"margin:2em 0 .6em;color:#205CAC;font-size:1.38em;line-height:1.5;\">hdWGCNA \u7684\u8f93\u5165\u548c\u5206\u6790\u5bf9\u8c61<\/h2>\n<p style=\"margin:.5em 0 1em\">obj \u4e3a\u5df2 SetupForWGCNA \u7684 Seurat \u5bf9\u8c61\uff0c\u5305\u542b donor\u3001cell_type \u4e0e PCA\uff0c\u76ee\u6807\u7ec4\u6709\u8db3\u591f\u90bb\u5c45\u3002\u5148\u9009\u5b9a\u5b9e\u9645\u805a\u5408\u53c2\u6570\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">MetacellsByGroups\u51fd\u6570\u7684\u6267\u884c\u4f9d\u8d56\u4e8e\u4e00\u7cfb\u5217\u8f93\u5165\u53c2\u6570\uff0c\u5305\u62ecgroup.by\u3001reduction\u3001k\u548cident.group\u7b49\u3002\u5176\u4e2dgroup.by\u53c2\u6570\u6307\u5b9a\u5206\u7ec4\u4f9d\u636e\uff0creduction\u5b9a\u4e49\u964d\u7ef4\u65b9\u6cd5\uff0ck\u63a7\u5236\u90bb\u8fd1\u7ec6\u80de\u6570\u91cf\uff0cident.group\u5219\u7528\u4e8e\u8bbe\u5b9a\u5143\u7ec6\u80de\u7684\u6807\u8bc6\u3002\u8fd9\u4e9b\u53c2\u6570\u5171\u540c\u51b3\u5b9a\u4e86\u805a\u5408\u5355\u5143\u7684\u5f62\u6210\u8fc7\u7a0b\u3002\u5728\u5b9e\u9645\u64cd\u4f5c\u4e2d\uff0c\u5e94\u9996\u5148\u68c0\u67e5group.by\u4e2d\u6307\u5b9a\u7684\u53d8\u91cf\u662f\u5426\u5728meta.data\u4e2d\u5b58\u5728\uff0c\u518d\u786e\u8ba4reduction\u662f\u5426\u4e3a\u5df2\u8ba1\u7b97\u7684\u964d\u7ef4\u65b9\u6cd5\u3002\u5982\u679c\u8fd9\u4e9b\u53c2\u6570\u8bbe\u7f6e\u4e0d\u5f53\uff0c\u53ef\u80fd\u5bfc\u81f4\u805a\u5408\u7ed3\u679c\u4e0d\u51c6\u786e\uff0c\u8fdb\u800c\u5f71\u54cd\u540e\u7eed\u7f51\u7edc\u6784\u5efa\u3002\u4f8b\u5982\uff0c\u82e5k\u503c\u8bbe\u7f6e\u8fc7\u5c0f\uff0c\u53ef\u80fd\u65e0\u6cd5\u5f62\u6210\u7a33\u5b9a\u7684\u805a\u5408\u5355\u5143\u3002\u82e5group.by\u53d8\u91cf\u4e0d\u6b63\u786e\uff0c\u5219\u53ef\u80fd\u5bfc\u81f4\u8de8\u4f9b\u4f53\u7684\u7ec6\u80de\u88ab\u9519\u8bef\u5730\u5408\u5e76\u3002\u56e0\u6b64\uff0c\u6bcf\u4e00\u6b65\u53c2\u6570\u7684\u8bbe\u5b9a\u90fd\u5e94\u57fa\u4e8e\u5bf9\u6570\u636e\u7ed3\u6784\u7684\u6df1\u5165\u7406\u89e3\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u5728\u5177\u4f53\u64cd\u4f5c\u4e2d\uff0cMetacellsByGroups\u51fd\u6570\u4f1a\u6839\u636e\u8bbe\u5b9a\u7684\u53c2\u6570\u5bf9\u7ec6\u80de\u8fdb\u884c\u805a\u7c7b\uff0c\u5f62\u6210\u5143\u7ec6\u80de\u5355\u5143\u3002\u8fd9\u4e9b\u5355\u5143\u4ee3\u8868\u4e86\u539f\u59cb\u7ec6\u80de\u7684\u805a\u5408\u7ed3\u679c\uff0c\u5176\u6570\u91cf\u548c\u5206\u5e03\u76f4\u63a5\u5f71\u54cd\u540e\u7eed\u7f51\u7edc\u5206\u6790\u7684\u8f93\u5165\u3002\u5728\u672c\u4f8b\u4e2d\uff0c\u4e24\u4e2a\u5404\u542b\u5341\u4e94\u4e2a\u7ec6\u80de\u7684\u805a\u5408\u5355\u5143\u5171\u4eab\u7f16\u53f7\u5341\u4e00\u81f3\u5341\u4e94\u7684\u7ec6\u80de\uff0c\u5408\u8ba1\u6709\u4e8c\u5341\u4e94\u4e2a\u4e0d\u540c\u7684\u7ec6\u80de\u3002\u5982\u679c\u8fd9\u4e9b\u7ec6\u80de\u5168\u90e8\u6765\u81ea\u540c\u4e00\u4f9b\u4f53\uff0c\u90a3\u4e48\u8fd9\u4e24\u4e2a\u5355\u5143\u4ecd\u7136\u4ee3\u8868\u4e00\u4e2a\u4f9b\u4f53\u7684\u6837\u672c\uff0c\u4e0d\u80fd\u7b80\u5355\u5730\u8ba4\u4e3a\u662f\u4e24\u4e2a\u72ec\u7acb\u6837\u672c\u3002\u8fd9\u79cd\u73b0\u8c61\u63d0\u9192\u7814\u7a76\u8005\uff0c\u5728\u8fdb\u884c\u6a21\u5757\u8bc6\u522b\u65f6\uff0c\u5fc5\u987b\u8003\u8651\u4f9b\u4f53\u7684\u6765\u6e90\uff0c\u907f\u514d\u5c06\u4f9b\u4f53\u95f4\u7684\u751f\u7269\u5b66\u5dee\u5f02\u8bef\u8ba4\u4e3a\u662f\u6a21\u5757\u7ed3\u6784\u3002\u901a\u8fc7\u68c0\u67e5\u805a\u5408\u5355\u5143\u7684\u5171\u4eab\u7ec6\u80de\u6570\u91cf\uff0c\u53ef\u4ee5\u5224\u65ad\u662f\u5426\u9700\u8981\u8c03\u6574\u53c2\u6570\uff0c\u4ee5\u786e\u4fdd\u6bcf\u4e2a\u5355\u5143\u4ee3\u8868\u4e00\u4e2a\u72ec\u7acb\u7684\u751f\u7269\u5b66\u6837\u672c\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u5728\u540c\u4e00\u4f9b\u4f53\u548c\u7ec6\u80de\u7c7b\u578b\u5185\u7528 <code>MetacellsByGroups()<\/code> \u805a\u5408\u76f8\u4f3c\u7ec6\u80de\uff0c\u51c6\u5907\u8868\u8fbe\u77e9\u9635\u3001\u8bd5\u8f6f\u9608\u503c\uff0c\u518d\u7528 <code>ConstructNetwork()<\/code> \u5efa\u7f51\u7edc\u3002 <a href=\"https:\/\/smorabit.github.io\/hdWGCNA\/articles\/basic_tutorial.html\" style=\"color:#185CB7;text-decoration:underline;\">hdWGCNA \u4f5c\u8005\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;\">obj &lt;- hdWGCNA::MetacellsByGroups(obj, group.by = c(\"donor\",\"cell_type\"), reduction = \"pca\", k = 15, ident.group = \"cell_type\")\nobj &lt;- hdWGCNA::NormalizeMetacells(obj)\n<\/code><\/pre>\n<h2 style=\"margin:2em 0 .6em;color:#205CAC;font-size:1.38em;line-height:1.5;\">\u4e24\u4e2a\u805a\u5408\u5355\u5143\u4e00\u5171\u7528\u4e86\u591a\u5c11\u4e2a\u4e0d\u540c\u7ec6\u80de<\/h2>\n<p style=\"margin:.5em 0 1em\">\u4e24\u4e2a\u5404\u5341\u4e94\u7ec6\u80de\u7684\u805a\u5408\u5355\u5143\u5171\u4eab\u7f16\u53f7\u5341\u4e00\u81f3\u5341\u4e94\uff0c\u5408\u8ba1\u4e8c\u5341\u4e94\u4e2a\u4e0d\u540c\u7ec6\u80de\u3002\u5982\u679c\u5168\u6765\u81ea\u4e00\u4eba\uff0c\u4e24\u4e2a\u805a\u5408\u5355\u5143\u4ecd\u7136\u53ea\u4ee3\u8868\u4e00\u4f4d\u4f9b\u4f53\uff0c\u63a8\u5e7f\u5230\u53d7\u8bd5\u8005\u9700\u8981\u53e6\u4e00\u4e2a\u5c42\u6b21\u7684\u8bc1\u636e\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(1:15),length(11:25),length(union(1:15,11:25)))\nnames(v) &lt;- c(\"\u5355\u5143\u7532\", \"\u5355\u5143\u4e59\", \"\u4e0d\u540c\u7ec6\u80de\")\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;\">\u5355\u5143\u7532<\/td>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">15<\/td>\n<\/tr>\n<tr>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">\u5355\u5143\u4e59<\/td>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">15<\/td>\n<\/tr>\n<tr>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">\u4e0d\u540c\u7ec6\u80de<\/td>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">25<\/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-hdwgcna-practice-cade104e.png?resize=1120%2C690&#038;ssl=1\" alt=\"\u4e24\u4e2a\u805a\u5408\u5355\u5143\u4e00\u5171\u7528\u4e86\u591a\u5c11\u4e2a\u4e0d\u540c\u7ec6\u80de\u3002\u5355\u5143\u7532 15\uff0c\u5355\u5143\u4e59 15\uff0c\u4e0d\u540c\u7ec6\u80de 25\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;\">\u5171\u7528\u591a\u5c11\u7ec6\u80de\u8981\u6709\u660e\u786e\u5206\u6bcd<\/h2>\n<p style=\"margin:.5em 0 1em\">\u5171\u4eab\u4e94\u4e2a\u7ec6\u80de\uff0c\u5360\u5355\u4e2a\u805a\u5408\u5355\u5143\u4e09\u5206\u4e4b\u4e00\uff0c\u6309\u5e76\u96c6\u4f5c\u5206\u6bcd\u5219\u4e3a\u4e94\u5206\u4e4b\u4e00\u3002\u62a5\u544a\u91cd\u53e0\u65f6\u5199\u6e05\u662f\u54ea\u79cd\u53e3\u5f84\u3002\u82e5\u5927\u91cf\u805a\u5408\u5355\u5143\u90fd\u5171\u4eab\u540c\u4e00\u6279\u6838\u5fc3\u7ec6\u80de\uff0c\u590d\u6838\u7ed3\u679c\u5728\u4e0d\u540c\u4f9b\u4f53\u4e2d\u7684\u6a21\u5757\u6210\u5458\u548c\u8d8b\u52bf\u5c24\u4e3a\u91cd\u8981\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;\">a &lt;- 1:15\nb &lt;- 11:25\nc(shared=length(intersect(a,b)),of_a=length(intersect(a,b))\/length(a),J=length(intersect(a,b))\/length(union(a,b)))\n<\/code><\/pre>\n<p style=\"margin:.5em 0 1em\">\u805a\u5408\u5355\u5143\u4e2d\u7ec6\u80de\u5171\u4eab\u8fc7\u591a\uff0c\u662f\u53e6\u4e00\u4e2a\u5e38\u89c1\u95ee\u9898\u3002\u82e5k\u503c\u8bbe\u7f6e\u4e0d\u5f53\uff0c\u4f8b\u5982\u53d6\u503c\u8fc7\u5c0f\uff0c\u53ef\u80fd\u65e0\u6cd5\u5f62\u6210\u7a33\u5b9a\u7684\u90bb\u8fd1\u7ec6\u80de\u96c6\u5408\uff0c\u5bfc\u81f4\u805a\u5408\u5355\u5143\u6570\u91cf\u504f\u591a\u4e14\u7ed3\u6784\u677e\u6563\u3002\u53cd\u4e4b\uff0c\u82e5k\u503c\u8fc7\u5927\uff0c\u53ef\u80fd\u5c06\u4e0d\u540c\u4f9b\u4f53\u7684\u7ec6\u80de\u7eb3\u5165\u540c\u4e00\u5355\u5143\uff0c\u9020\u6210\u4f9b\u4f53\u4fe1\u606f\u88ab\u63a9\u76d6\u3002\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u5373\u4f7f\u5355\u5143\u5185\u7ec6\u80de\u6570\u91cf\u8db3\u591f\uff0c\u5176\u8868\u8fbe\u8c31\u4ecd\u53ef\u80fd\u53cd\u6620\u4f9b\u4f53\u95f4\u7684\u5dee\u5f02\uff0c\u800c\u975e\u7ec6\u80de\u7c7b\u578b\u7279\u5f02\u6027\u3002\u56e0\u6b64\uff0c\u5fc5\u987b\u68c0\u67e5\u805a\u5408\u5355\u5143\u7684\u5171\u4eab\u60c5\u51b5\uff0c\u786e\u4fdd\u6bcf\u4e2a\u5355\u5143\u4ee3\u8868\u72ec\u7acb\u6837\u672c\uff0c\u907f\u514d\u56e0\u53c2\u6570\u8bbe\u7f6e\u4e0d\u5f53\u5bfc\u81f4\u7684\u8bef\u5bfc\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u5728\u5b9e\u9645\u64cd\u4f5c\u4e2d\uff0c\u82e5\u672a\u5bf9\u805a\u5408\u5355\u5143\u7684\u4f9b\u4f53\u5206\u5e03\u8fdb\u884c\u68c0\u67e5\uff0c\u53ef\u80fd\u5bfc\u81f4\u9519\u8bef\u7ed3\u8bba\u3002\u4f8b\u5982\uff0c\u4e24\u4e2a\u805a\u5408\u5355\u5143\u867d\u5404\u81ea\u5305\u542b\u5341\u4e94\u4e2a\u7ec6\u80de\uff0c\u4f46\u82e5\u5176\u5171\u4eab\u7f16\u53f7\u5341\u4e00\u81f3\u5341\u4e94\u7684\u7ec6\u80de\uff0c\u5408\u8ba1\u4e3a\u4e8c\u5341\u4e94\u4e2a\u4e0d\u540c\u7ec6\u80de\uff0c\u800c\u8fd9\u4e9b\u7ec6\u80de\u5168\u90e8\u6765\u81ea\u540c\u4e00\u4f9b\u4f53\uff0c\u5219\u8fd9\u4e24\u4e2a\u5355\u5143\u4e0d\u80fd\u4ee3\u8868\u4e24\u4e2a\u72ec\u7acb\u4f9b\u4f53\u3002\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u82e5\u672a\u8fdb\u884c\u4f9b\u4f53\u5206\u5e03\u7684\u9a8c\u8bc1\uff0c\u53ef\u80fd\u9519\u8bef\u5730\u5c06\u4f9b\u4f53\u5dee\u5f02\u8bc6\u522b\u4e3a\u6a21\u5757\u7ed3\u6784\u3002<\/p>\n<h2 style=\"margin:2em 0 .6em;color:#205CAC;font-size:1.38em;line-height:1.5;\">\u5728 hdWGCNA \u4f5c\u8005\u5bf9\u8c61\u4e2d\u9010\u5217\u6570\u771f\u5b9e\u4f9b\u4f53<\/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;\">p&lt;-tempfile()\nutils::download.file(\"https:\/\/raw.githubusercontent.com\/smorabit\/hdWGCNA\/e3344d1f7bbac4264adf94f7aa31e0802fa8282d\/data\/test_seurat.rda\",p,mode=\"wb\",quiet=TRUE)\ne&lt;-new.env()\nload(p,envir=e)\ns&lt;-e$test_seurat\nmeta&lt;-s@meta.data\nstopifnot(all(c(\"individualID\",\"cell_type\") %in% names(meta)))\nc(nrow(meta),length(unique(na.omit(meta$individualID))),length(unique(na.omit(meta$cell_type))))\n<\/code><\/pre>\n<p style=\"margin:.5em 0 1em\">\u7528 R 4.5.2 \u8bfb\u53d6 hdWGCNA \u4f5c\u8005\u63d0\u4f9b\u7684\u6559\u7a0b\u6570\u636e\uff08e3344d1f\uff09\uff0c\u8f93\u51fa\u4f9d\u6b21\u4e3a\u539f\u59cb\u7ec6\u80de 1,206\uff0c\u72ec\u7acb\u4e2a\u4f53 11\uff0c\u4e0d\u540c\u7ec6\u80de\u7c7b\u578b 1\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\">\u68c0\u67e5\u7a00\u6709\u7fa4\u80fd\u5f62\u6210\u591a\u5c11\u4e2a metacell\uff0c\u4ee5\u53ca\u76f8\u90bb metacell \u5171\u4eab\u591a\u5c11\u7ec6\u80de\uff0c\u907f\u514d\u628a\u4f9b\u4f53\u5dee\u5f02\u8bef\u8ba4\u4f5c\u6a21\u5757\u7ed3\u6784\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u5728hdWGCNA\u5206\u6790\u4e2d\uff0c\u82e5\u805a\u5408\u5355\u5143\u7684\u4f9b\u4f53\u5206\u5e03\u4e0e\u9884\u671f\u4e0d\u7b26\uff0c\u53ef\u80fd\u5f71\u54cd\u540e\u7eed\u6a21\u5757\u8bc6\u522b\u7684\u51c6\u786e\u6027\u3002\u4f8b\u5982\uff0c\u82e5\u805a\u5408\u5355\u5143\u4e2d\u4f9b\u4f53\u5206\u5e03\u4e0d\u5747\uff0c\u53ef\u80fd\u5bfc\u81f4\u7f51\u7edc\u4e2d\u51fa\u73b0\u4e0d\u5408\u7406\u7684\u8fde\u63a5\uff0c\u4ece\u800c\u8bef\u5bfc\u6a21\u5757\u8bc6\u522b\u3002\u82e5\u53d1\u73b0\u5f02\u5e38\uff0c\u5e94\u91cd\u65b0\u8bbe\u5b9a\u805a\u5408\u53c2\u6570\uff0c\u786e\u4fdd\u6bcf\u4e2a\u5355\u5143\u4ee3\u8868\u72ec\u7acb\u4f9b\u4f53\u7684\u6837\u672c\u3002\u8fd9\u79cd\u9a8c\u8bc1\u65b9\u6cd5\u6709\u52a9\u4e8e\u63d0\u9ad8\u5206\u6790\u7ed3\u679c\u7684\u53ef\u4fe1\u5ea6\uff0c\u907f\u514d\u56e0\u4f9b\u4f53\u5206\u5e03\u6df7\u6dc6\u5bfc\u81f4\u7684\u9519\u8bef\u7ed3\u8bba\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u5728hdWGCNA\u5206\u6790\u4e2d\uff0c\u6a21\u5757\u8bc6\u522b\u7684\u51c6\u786e\u6027\u4f9d\u8d56\u4e8e\u805a\u5408\u5355\u5143\u662f\u5426\u771f\u6b63\u4ee3\u8868\u72ec\u7acb\u6837\u672c\u3002\u82e5\u805a\u5408\u5355\u5143\u4e2d\u4f9b\u4f53\u5206\u5e03\u4e0d\u5747\uff0c\u53ef\u80fd\u5bfc\u81f4\u6a21\u5757\u8bc6\u522b\u8fc7\u7a0b\u4e2d\u5c06\u4f9b\u4f53\u5dee\u5f02\u8bef\u8ba4\u4e3a\u6a21\u5757\u7ed3\u6784\u3002\u4f8b\u5982\uff0c\u82e5\u4e24\u4e2a\u805a\u5408\u5355\u5143\u5206\u522b\u6765\u81ea\u4e0d\u540c\u4f9b\u4f53\uff0c\u4f46\u5176\u8868\u8fbe\u8c31\u76f8\u4f3c\uff0c\u53ef\u80fd\u88ab\u9519\u8bef\u8bc6\u522b\u4e3a\u540c\u4e00\u6a21\u5757\u3002\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u5e94\u901a\u8fc7\u68c0\u67e5\u805a\u5408\u5355\u5143\u7684\u4f9b\u4f53\u5206\u5e03\uff0c\u786e\u8ba4\u5176\u662f\u5426\u4ee3\u8868\u72ec\u7acb\u6837\u672c\u3002\u82e5\u53d1\u73b0\u4f9b\u4f53\u5206\u5e03\u5f02\u5e38\uff0c\u5e94\u8c03\u6574\u805a\u5408\u53c2\u6570\uff0c\u786e\u4fdd\u6bcf\u4e2a\u5355\u5143\u4ee3\u8868\u72ec\u7acb\u4f9b\u4f53\u7684\u6837\u672c\uff0c\u4ece\u800c\u907f\u514d\u56e0\u4f9b\u4f53\u6df7\u6dc6\u5bfc\u81f4\u7684\u6a21\u5757\u8bc6\u522b\u9519\u8bef\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u5728\u6a21\u5757\u8bc6\u522b\u8fc7\u7a0b\u4e2d\uff0c\u82e5\u4f9b\u4f53\u95f4\u5dee\u5f02\u88ab\u9519\u8bef\u8bc6\u522b\u4e3a\u6a21\u5757\u7ed3\u6784\uff0c\u53ef\u80fd\u5f71\u54cd\u7f51\u7edc\u7684\u62d3\u6251\u7ed3\u6784\u3002\u4f8b\u5982\uff0c\u82e5\u4f9b\u4f53\u95f4\u8868\u8fbe\u8c31\u7684\u5dee\u5f02\u88ab\u9519\u8bef\u5730\u89c6\u4e3a\u6a21\u5757\u95f4\u7684\u8fde\u63a5\uff0c\u53ef\u80fd\u5bfc\u81f4\u7f51\u7edc\u4e2d\u51fa\u73b0\u4e0d\u5408\u7406\u7684\u8fde\u63a5\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\">\u628a\u6bcf\u4e2a metacell \u5c55\u5f00\u4e3a\u539f\u59cb\u6761\u7801\uff0c\u5e76\u5217\u51fa\u5176\u4f9b\u4f53\u3001\u7ec6\u80de\u7c7b\u578b\u4e0e\u53c2\u4e0e\u805a\u5408\u7684\u6b21\u6570\u3002\u540c\u4e00\u7ec6\u80de\u53ef\u51fa\u73b0\u5728\u591a\u4e2a\u76f8\u90bb\u7684\u805a\u5408\u5355\u5143\u4e2d\uff0c\u56e0\u6b64\u8fd9\u4e9b\u5355\u5143\u7684\u8868\u8fbe\u5747\u503c\u76f8\u5173\u3002\u53ef\u4ee5\u6311\u4e00\u5bf9\u5171\u8868\u8fbe\u57fa\u56e0\uff0c\u5148\u5728\u6240\u6709\u805a\u5408\u70b9\u770b\u8d8b\u52bf\uff0c\u518d\u6309\u4f9b\u4f53\u5206\u9762\u3002\u5982\u679c\u663e\u8457\u8d8b\u52bf\u53ea\u6765\u81ea\u4e24\u4e2a\u4f9b\u4f53\u7684\u6574\u4f53\u5747\u503c\u5dee\uff0c\u800c\u6bcf\u4e2a\u4f9b\u4f53\u5185\u90e8\u770b\u4e0d\u5230\u76f8\u540c\u65b9\u5411\uff0c\u4f18\u5148\u5c06\u5b83\u89e3\u91ca\u4e3a\u4f9b\u4f53\u95f4\u5dee\u5f02\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u4ece\u51c6\u5907\u91cd\u70b9\u89e3\u91ca\u7684\u7c7b\u522b\u91cc\u9009\u4e09\u79cd\u4e0d\u540c\u4f4d\u7f6e\u7684\u89c2\u6d4b\u3002\u4e00\u79cd\u6700\u7b26\u5408\u8be5\u7c7b\u7279\u5f81\uff0c\u4e00\u79cd\u521a\u521a\u8de8\u8fc7\u5206\u7c7b\u6216\u7b5b\u9009\u8fb9\u754c\uff0c\u4e00\u79cd\u4e0e\u90bb\u8fd1\u7c7b\u578b\u5bb9\u6613\u6df7\u6dc6\u3002\u5206\u522b\u7559\u4e0b\u539f\u59cb\u8ba1\u6570\u6216\u539f\u59cb\u6d4b\u91cf\u3001\u6240\u5c5e\u6837\u672c\u3001\u51b3\u5b9a\u5b83\u5f52\u5c5e\u7684\u90a3\u6761\u8bc1\u636e\u3002\u5bf9\u8fb9\u754c\u5bf9\u8c61\uff0c\u518d\u9009\u4e00\u4e2a\u4f1a\u652f\u6301\u76f8\u53cd\u89e3\u91ca\u7684\u72ec\u7acb\u6807\u5fd7\u3002\u82e5\u8fd9\u4e2a\u6807\u5fd7\u53ea\u5728\u51e0\u6761\u4f4e\u8d28\u91cf\u8bb0\u5f55\u4e2d\u68c0\u51fa\uff0c\u4e0e\u5728\u591a\u4f4d\u4f9b\u4f53\u4e2d\u540c\u65f6\u68c0\u51fa\uff0c\u540e\u7eed\u8981\u67e5\u7684\u662f\u4e24\u4ef6\u4e0d\u540c\u7684\u4e8b\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u6b63\u5f0f\u62a5\u544a\u6837\u672c\u6784\u6210\u65f6\uff0c\u6bcf\u4f4d\u4f9b\u4f53\u5355\u5217\u4e00\u884c\uff0c\u540c\u65f6\u8bb0\u4e0b\u901a\u8fc7\u8d28\u63a7\u4e14\u80fd\u53c2\u4e0e\u8fd9\u4e00\u6b65\u7684\u603b\u6570\u3002\u5047\u5982\u9ad8\u5206\u5bf9\u8c61\u51e0\u4e4e\u90fd\u6765\u81ea\u4e00\u4f4d\u53d7\u8bd5\u8005\uff0c\u5e94\u628a\u8fd9\u4f4d\u53d7\u8bd5\u8005\u7684\u6587\u5e93\u6df1\u5ea6\u3001\u5904\u7406\u65e5\u671f\u548c\u7ec4\u7ec7\u6765\u6e90\u53d6\u51fa\u6765\uff0c\u4e0e\u5176\u4f59\u6837\u672c\u5e76\u5217\u6838\u5bf9\u3002\u82e5\u53e6\u4e00\u6279\u72ec\u7acb\u8d44\u6599\u4e2d\u7f3a\u5c11\u540c\u7c7b\u89c2\u6d4b\uff0c\u4fdd\u7559\u8fd9\u6b21\u53ef\u89c1\u7684\u8bc1\u636e\uff0c\u5e76\u628a\u63a8\u65ad\u8303\u56f4\u6536\u56de\u5230\u539f\u6765\u7684\u6837\u672c\u96c6\u5408\u3002\u8fd9\u6837\u7684\u8bb0\u5f55\u4e5f\u80fd\u5e2e\u52a9\u4e0b\u4e00\u4f4d\u5408\u4f5c\u8005\u6709\u9488\u5bf9\u6027\u5730\u8865\u505a\u67d3\u8272\u3001\u7a7a\u95f4\u5b9a\u4f4d\u6216\u989d\u5916\u53d6\u6837\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\/017-hdwgcna-code-5d80d1608c2ba103.zip\">\u4e0b\u8f7d\u672c\u7bc7 R \u4ee3\u7801\uff08ZIP\uff0c3.4 KiB\uff09<\/a> \u00b7 <a style=\"color:#1458a5;text-decoration:underline;\" href=\"https:\/\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/r-practice-labs\/017-hdwgcna-data-74beda4b27acc382.zip\">\u4e0b\u8f7d\u914d\u5957\u793a\u4f8b\u6570\u636e\uff08ZIP\uff0c3.0 MiB\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;\">017-hdwgcna<\/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 hdWGCNA \u4f5c\u8005\u5bf9\u8c61\u4e2d\u9010\u5217\u6570\u771f\u5b9e\u4f9b\u4f53\u201d\u3002Linux x86_64\u3001R 4.3.3 \u7684\u8f93\u51fa\u4e3a\u539f\u59cb\u7ec6\u80de 1206\uff0c\u72ec\u7acb\u4e2a\u4f53 11\uff0c\u4e0d\u540c\u7ec6\u80de\u7c7b\u578b 1\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u5c06 individualID \u4e0e cell_type \u4ea4\u53c9\u5236\u8868\uff0c\u518d\u5728\u6bcf\u4e2a\u7ec6\u80de\u7c7b\u578b\u5185\u6570\u6709\u7ec6\u80de\u7684\u4e2a\u4f53\u6570\u3002\u5168\u5bf9\u8c61\u7684\u72ec\u7acb\u4e2a\u4f53\u6570\u53ea\u662f\u4e0a\u754c\u3002\u82e5\u67d0\u7c7b\u53ea\u6765\u81ea\u5c11\u6570\u4eba\uff0c\u6784\u9020\u518d\u591a metacell \u4e5f\u65e0\u6cd5\u589e\u52a0\u8fd9\u4e00\u7c7b\u7684\u4f9b\u4f53\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\">\u540c\u4e00\u4efd\u4f5c\u8005\u5bf9\u8c61\u91cc\u80fd\u540c\u65f6\u8bfb\u5230\u7ec6\u80de\u6570\u3001\u72ec\u7acb\u4e2a\u4f53\u6570\u548c\u7c7b\u578b\u6570\u3002\u8fd9\u4e09\u4e2a\u5206\u6bcd\u56de\u7b54\u7684\u95ee\u9898\u4e0d\u540c\u3002\u628a\u6bcf\u4e2a\u4f9b\u4f53\u7684\u76f8\u8fd1\u7ec6\u80de\u805a\u5408\u53ef\u4ee5\u51cf\u5c11\u8ba1\u6570\u7a00\u758f\uff0c\u4f46\u4e00\u4f4d\u4f9b\u4f53\u5373\u4fbf\u4ea7\u751f\u6570\u5341\u4e2a\u805a\u5408\u5355\u5143\uff0c\u4ecd\u53ea\u8d21\u732e\u4e00\u4f4d\u751f\u7269\u5b66\u91cd\u590d\u3002\u6bd4\u8f83\u7f51\u7edc\u5173\u8054\u65f6\u8981\u56de\u67e5\u539f\u59cb\u4f9b\u4f53\uff0c\u5c24\u5176\u5173\u6ce8\u662f\u4e0d\u662f\u5355\u4e00\u4e2a\u4f53\u8d21\u732e\u4e86\u5927\u90e8\u5206\u6a21\u5757\u4fe1\u53f7\u3002<\/p>\n<p style=\"border-top:1px solid #DAE6F2;margin-top:2em;padding-top:1em;\">\u628a\u8fd9\u4efd\u5c0f\u4f8b\u6362\u6210\u81ea\u5df1\u7684\u6837\u672c\u5e76\u6838\u5bf9\u7ed3\u679c\u540e\uff0c\u5982\u679c\u8fd8\u6709\u591a\u4e2a\u961f\u5217\u9700\u8981\u91cd\u590d\u5206\u6790\uff0c\u53ef\u4ee5\u628a\u56fa\u5b9a\u7248\u672c\u7684 R \u73af\u5883\u548c\u811a\u672c\u653e\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\u7ee7\u7eed\u8fd0\u884c\u3002<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u4e24\u4e2a\u5404\u5341\u4e94\u7ec6\u80de\u7684\u805a\u5408\u5355\u5143\u5171\u4eab\u7f16\u53f7\u5341\u4e00\u81f3\u5341\u4e94\uff0c\u5408\u8ba1\u4e8c\u5341\u4e94\u4e2a\u4e0d\u540c\u7ec6\u80de\u3002<\/p>\n","protected":false},"author":1,"featured_media":68616,"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":[1,71],"tags":[725,728,733],"class_list":["post-68617","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-part","category-single-cell","tag-hdwgcna","tag-r","tag-733"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2026\/11\/r-guide-hdwgcna-practice-cade104e.png?fit=1120%2C690&ssl=1","_links":{"self":[{"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts\/68617","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=68617"}],"version-history":[{"count":5,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts\/68617\/revisions"}],"predecessor-version":[{"id":70910,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts\/68617\/revisions\/70910"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/media\/68616"}],"wp:attachment":[{"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/media?parent=68617"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/categories?post=68617"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/tags?post=68617"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}