{"id":68607,"date":"2026-12-03T09:09:22","date_gmt":"2026-12-03T01:09:22","guid":{"rendered":"https:\/\/www.biocloudservice.com\/wordpress\/?p=68607"},"modified":"2026-12-03T09:09:22","modified_gmt":"2026-12-03T01:09:22","slug":"r-guide-cellchat-practice","status":"publish","type":"post","link":"https:\/\/www.biocloudservice.com\/wordpress\/r-guide-cellchat-practice\/","title":{"rendered":"CellChat \u7684\u5019\u9009\u901a\u4fe1\u4e3a\u4f55\u6d88\u5931\uff1f\u4ece\u53d1\u9001\u7fa4\u3001\u53d7\u4f53\u4e9a\u57fa\u67e5\u8d77"},"content":{"rendered":"<div class=\"ysx-r-practice\" id=\"ysx-r-cellchat\" 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\">\u770b\u5230\u4e00\u6761\u914d\u4f53\u2013\u53d7\u4f53\u901a\u4fe1\u7ebf\u4e4b\u524d\uff0c\u81f3\u5c11\u6709\u4e09\u4ef6\u4e8b\u53ef\u4ee5\u5206\u522b\u68c0\u67e5\uff0c\u53d1\u9001\u7fa4\u662f\u5426\u8868\u8fbe\u914d\u4f53\uff0c\u63a5\u6536\u7fa4\u7684\u5fc5\u8981\u53d7\u4f53\u4e9a\u57fa\u662f\u5426\u6709\u8868\u8fbe\uff0c\u4ee5\u53ca\u8fd9\u4e9b\u8bc1\u636e\u6765\u81ea\u591a\u5c11\u4e2a\u6837\u672c\u3002\u5c24\u5176\u5f53\u53d7\u4f53\u7531\u591a\u4e2a\u4e9a\u57fa\u7ec4\u6210\uff0c\u7fa4\u5e73\u5747\u4f1a\u906e\u4f4f\u201c\u5b83\u4eec\u662f\u5426\u5728\u540c\u4e00\u6279\u7ec6\u80de\u4e2d\u51fa\u73b0\u201d\u3002<\/p>\n<h2 style=\"margin:2em 0 .6em;color:#205CAC;font-size:1.38em;line-height:1.5;\">CellChat \u7684\u8f93\u5165\u548c\u5206\u6790\u5bf9\u8c61<\/h2>\n<p style=\"margin:.5em 0 1em\">cc \u4e3a\u5df2\u9009\u6b63\u786e\u7269\u79cd\u6570\u636e\u5e93\u3001\u5b8c\u6210 subsetData \u53ca\u8fc7\u8868\u8fbe\u57fa\u56e0\u4e0e\u4e92\u4f5c\u7b5b\u9009\u7684 CellChat \u5bf9\u8c61\u3002\u5206\u7ec4\u6807\u7b7e\u4e0e\u975e\u8d1f\u5f52\u4e00\u5316\u8868\u8fbe\u7ec6\u80de\u5217\u4e00\u81f4\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u5728\u7ec6\u80de\u901a\u4fe1\u5206\u6790\u4e2d\uff0c\u5019\u9009\u4fe1\u53f7\u7684\u6d88\u5931\u901a\u5e38\u6e90\u4e8e\u8868\u8fbe\u6c34\u5e73\u6216\u68c0\u6d4b\u6bd4\u4f8b\u7684\u4e0d\u8db3\u3002\u5f53\u4f7f\u7528 CellChat \u8fdb\u884c\u901a\u4fe1\u6982\u7387\u63a8\u65ad\u65f6\uff0c\u82e5\u67d0\u4e9b\u4fe1\u53f7\u901a\u8def\u7684\u5019\u9009\u4e92\u4f5c\u672a\u80fd\u4fdd\u7559\uff0c\u9700\u9996\u5148\u68c0\u67e5\u8f93\u5165\u6570\u636e\u662f\u5426\u7b26\u5408\u5206\u6790\u8981\u6c42\u3002\u8f93\u5165\u5bf9\u8c61\u9700\u5305\u542b\u975e\u8d1f\u5f52\u4e00\u5316\u8868\u8fbe\u77e9\u9635\u548c\u7ec6\u80de\u5206\u7ec4\u6807\u7b7e\uff0c\u4e14\u4e8c\u8005\u5728\u7ef4\u5ea6\u4e0a\u4fdd\u6301\u4e00\u81f4\u3002\u82e5\u8868\u8fbe\u77e9\u9635\u672a\u7ecf\u8fc7\u9002\u5f53\u5f52\u4e00\u5316\u5904\u7406\uff0c\u6216\u5206\u7ec4\u6807\u7b7e\u5b58\u5728\u7f3a\u5931\uff0c\u5c06\u76f4\u63a5\u5f71\u54cd\u540e\u7eed\u7684\u901a\u4fe1\u63a8\u65ad\u7ed3\u679c\u3002\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u5373\u4f7f\u4fe1\u53f7\u57fa\u56e0\u5728\u7406\u8bba\u4e0a\u5b58\u5728\u8868\u8fbe\uff0c\u4e5f\u53ef\u80fd\u56e0\u8868\u8fbe\u6c34\u5e73\u8fc7\u4f4e\u6216\u68c0\u6d4b\u6bd4\u4f8b\u4e0d\u8db3\u800c\u88ab\u8fc7\u6ee4\u6389\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u901a\u4fe1\u6982\u7387\u7684\u8ba1\u7b97\u4f9d\u8d56\u4e8e\u53d1\u9001\u7ec6\u80de\u548c\u63a5\u6536\u7ec6\u80de\u7684\u8868\u8fbe\u60c5\u51b5\uff0c\u4ee5\u53ca\u4fe1\u53f7\u901a\u8def\u7684\u751f\u7269\u5b66\u673a\u5236\u3002\u5728 CellChat \u4e2d\uff0c<code>computeCommunProb()<\/code> \u51fd\u6570\u901a\u8fc7\u6574\u5408\u4fe1\u53f7\u57fa\u56e0\u8868\u8fbe\u548c\u5148\u9a8c\u77e5\u8bc6\u6765\u4f30\u7b97\u901a\u4fe1\u6982\u7387\uff0c\u5176\u9ed8\u8ba4\u4f7f\u7528 <code>triMean<\/code> \u65b9\u6cd5\u8fdb\u884c\u805a\u5408\u3002\u8be5\u65b9\u6cd5\u8981\u6c42\u6bcf\u4e2a\u7ec6\u80de\u7fa4\u4e2d\u7684\u4fe1\u53f7\u57fa\u56e0\u8868\u8fbe\u5747\u503c\u9700\u8fbe\u5230\u4e00\u5b9a\u9608\u503c\uff0c\u82e5\u67d0\u7fa4\u4e2d\u8868\u8fbe\u7ec6\u80de\u6570\u4e0d\u8db3\u6216\u8868\u8fbe\u6c34\u5e73\u504f\u4f4e\uff0c\u5c06\u5bfc\u81f4\u901a\u4fe1\u6982\u7387\u8ba1\u7b97\u5931\u8d25\u3002\u56e0\u6b64\uff0c\u5373\u4f7f\u4fe1\u53f7\u57fa\u56e0\u672c\u8eab\u5b58\u5728\uff0c\u82e5\u5176\u5728\u7279\u5b9a\u7ec6\u80de\u7fa4\u4e2d\u7684\u8868\u8fbe\u4e0d\u6ee1\u8db3\u805a\u5408\u65b9\u6cd5\u7684\u6700\u4f4e\u8981\u6c42\uff0c\u4e5f\u4f1a\u88ab\u7cfb\u7edf\u6027\u5730\u6392\u9664\u5728\u901a\u4fe1\u7f51\u7edc\u4e4b\u5916\u3002\u8fd9\u79cd\u7b5b\u9009\u673a\u5236\u662f\u57fa\u4e8e\u751f\u7269\u5b66\u5408\u7406\u6027\u7684\uff0c\u4f46\u9700\u6ce8\u610f\u5176\u5bf9\u4f4e\u8868\u8fbe\u4fe1\u53f7\u7684\u654f\u611f\u6027\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u628a\u975e\u8d1f\u5f52\u4e00\u5316\u8868\u8fbe\u4e0e\u5206\u7fa4\u4f20\u7ed9 <code>createCellChat()<\/code>\uff0c\u9009\u5b9a\u7269\u79cd\u6570\u636e\u5e93\uff0c\u7b5b\u9009\u4fe1\u53f7\u57fa\u56e0\u548c\u8fc7\u8868\u8fbe\u4e92\u4f5c\uff0c\u518d\u7528 <code>computeCommunProb()<\/code> \u63a8\u65ad\u7fa4\u95f4\u901a\u4fe1\u3002 <a href=\"https:\/\/github.com\/jinworks\/CellChat\/blob\/main\/tutorial\/CellChat-vignette.Rmd\" style=\"color:#185CB7;text-decoration:underline;\">CellChat \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;\">cc &lt;- CellChat::computeCommunProb(cc, type = \"triMean\")\ncc &lt;- CellChat::filterCommunication(cc, min.cells = 10)\nhead(CellChat::subsetCommunication(cc))\n<\/code><\/pre>\n<h2 style=\"margin:2em 0 .6em;color:#205CAC;font-size:1.38em;line-height:1.5;\">\u63a5\u6536\u7fa4\u4e8c\u5341\u4e2a\u7ec6\u80de\u7684\u68c0\u51fa\u6bd4\u4f8b<\/h2>\n<p style=\"margin:.5em 0 1em\">\u793a\u610f\u540c\u4e00\u63a5\u6536\u7fa4\u4e2d\u4e24\u4e2a\u4e9a\u57fa\u5206\u522b\u5341\u516d\u4e0e\u56db\u4e2a\u7ec6\u80de\u68c0\u51fa\uff0c\u540c\u65f6\u68c0\u51fa\u7684\u53ea\u6709\u4e09\u4e2a\u3002\u8054\u5408\u68c0\u51fa\u7528\u4e8e\u6838\u67e5\u5171\u540c\u8868\u8fbe\uff0c\u4e0d\u80fd\u628a\u4e09\u4e2a\u9664\u4ee5\u4e8c\u5341\u76f4\u63a5\u5f53\u901a\u4fe1\u6982\u7387\uff0c\u5355\u7ec6\u80de\u6389\u843d\u548c\u7a7a\u95f4\u63a5\u89e6\u4ecd\u9700\u8bc4\u4f30\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(16\/20,4\/20,3\/20)\nnames(v) &lt;- c(\"\u4e9a\u57fa\u7532\", \"\u4e9a\u57fa\u4e59\", \"\u4e24\u8005\u540c\u68c0\u51fa\")\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;\">\u4e9a\u57fa\u7532<\/td>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">80%<\/td>\n<\/tr>\n<tr>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">\u4e9a\u57fa\u4e59<\/td>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">20%<\/td>\n<\/tr>\n<tr>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">\u4e24\u8005\u540c\u68c0\u51fa<\/td>\n<td style=\"border-bottom:1px solid #CBDEEB;text-align:left;padding:8px;background:#FFF;\">15%<\/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-cellchat-practice-35656bf4.png?resize=1120%2C690&#038;ssl=1\" alt=\"\u63a5\u6536\u7fa4\u4e8c\u5341\u4e2a\u7ec6\u80de\u7684\u68c0\u51fa\u6bd4\u4f8b\u3002\u4e9a\u57fa\u7532 80%\uff0c\u4e9a\u57fa\u4e59 20%\uff0c\u4e24\u8005\u540c\u68c0\u51fa 15%\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;\">\u4e24\u4e2a\u53d7\u4f53\u4e9a\u57fa\u5206\u522b\u68c0\u51fa\uff0c\u662f\u5426\u5728\u540c\u4e00\u6279\u7ec6\u80de\uff1f<\/h2>\n<p style=\"margin:.5em 0 1em\">\u4e24\u4e2a\u4e9a\u57fa\u5404\u6709\u4e00\u534a\u7ec6\u80de\u68c0\u51fa\uff0c\u5374\u6ca1\u6709\u4e00\u4e2a\u7ec6\u80de\u540c\u65f6\u68c0\u51fa\u3002\u8fd9\u4e2a\u6781\u7aef\u53cd\u4f8b\u80fd\u533a\u5206\u6309\u7fa4\u6c47\u603b\u548c\u6309\u7ec6\u80de\u89c2\u5bdf\u7684\u8bc1\u636e\u5c42\u7ea7\u3002\u6b63\u5f0f\u6570\u636e\u8fd8\u53d7\u6d4b\u5e8f\u6389\u843d\u5f71\u54cd\uff0c\u522b\u636e\u8fd9\u4e00\u5f20\u8054\u5408\u68c0\u51fa\u8868\u5c31\u6392\u9664\u5168\u90e8\u4fe1\u53f7\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;- c(TRUE,TRUE,FALSE,FALSE)\nb &lt;- c(FALSE,FALSE,TRUE,TRUE)\nc(mean(a),mean(b),mean(a&amp;b))\n<\/code><\/pre>\n<p style=\"margin:.5em 0 1em\">\u5728\u901a\u4fe1\u63a8\u65ad\u4e2d\uff0c\u5019\u9009\u4fe1\u53f7\u7684\u8868\u8fbe\u6bd4\u4f8b\u662f\u5224\u65ad\u5176\u662f\u5426\u88ab\u4fdd\u7559\u7684\u5173\u952e\u56e0\u7d20\u3002\u4f8b\u5982\uff0c\u5728\u63a5\u6536\u7ec6\u80de\u7fa4\u4e2d\uff0c\u82e5\u67d0\u4e00\u4fe1\u53f7\u57fa\u56e0\u7684\u8868\u8fbe\u7ec6\u80de\u6570\u4e3a\u5341\u516d\u4e2a\uff0c\u800c\u53e6\u4e00\u4e9a\u57fa\u7684\u8868\u8fbe\u7ec6\u80de\u6570\u4e3a\u56db\u4e2a\uff0c\u540c\u65f6\u4e24\u8005\u5171\u540c\u8868\u8fbe\u7684\u7ec6\u80de\u6570\u4e3a\u4e09\u4e2a\uff0c\u5219\u8be5\u4fe1\u53f7\u7684\u8054\u5408\u68c0\u51fa\u6bd4\u4f8b\u4e3a 15%\uff083\/20\uff09\u3002\u8fd9\u4e00\u6bd4\u4f8b\u867d\u4f4e\uff0c\u4f46\u82e5\u672a\u8fbe\u5230\u8bbe\u5b9a\u7684\u6700\u4f4e\u9608\u503c\uff0c\u5c06\u88ab\u7cfb\u7edf\u6027\u5730\u6392\u9664\u5728\u901a\u4fe1\u7f51\u7edc\u4e4b\u5916\u3002\u56e0\u6b64\uff0c\u5373\u4f7f\u5728\u8868\u8fbe\u6c34\u5e73\u4e0a\u5b58\u5728\u4fe1\u53f7\uff0c\u82e5\u5176\u5728\u63a5\u6536\u7fa4\u4e2d\u7684\u8868\u8fbe\u7ec6\u80de\u6570\u4e0d\u8db3\uff0c\u4e5f\u4f1a\u56e0\u65e0\u6cd5\u6ee1\u8db3\u805a\u5408\u65b9\u6cd5\u7684\u6700\u4f4e\u8981\u6c42\u800c\u88ab\u6392\u9664\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u5728\u5224\u65ad\u901a\u4fe1\u6982\u7387\u65f6\uff0c\u9700\u6ce8\u610f\u8054\u5408\u68c0\u51fa\u6bd4\u4f8b\u4e0e\u8868\u8fbe\u7ec6\u80de\u6570\u4e4b\u95f4\u7684\u5173\u7cfb\u3002\u82e5\u67d0\u4e00\u4fe1\u53f7\u57fa\u56e0\u5728\u63a5\u6536\u7fa4\u4e2d\u8868\u8fbe\u7ec6\u80de\u6570\u8f83\u5c11\uff0c\u5373\u4f7f\u5176\u8868\u8fbe\u6c34\u5e73\u8f83\u9ad8\uff0c\u4e5f\u53ef\u80fd\u56e0\u8868\u8fbe\u7ec6\u80de\u6570\u4e0d\u8db3\u800c\u88ab\u6392\u9664\u3002\u4f8b\u5982\uff0c\u63a5\u6536\u7fa4\u4e2d\u8868\u8fbe\u7ec6\u80de\u6570\u4e3a\u4e8c\u5341\u4e2a\uff0c\u5176\u4e2d\u4e9a\u57fa\u7532\u8868\u8fbe\u7ec6\u80de\u6570\u4e3a\u5341\u516d\u4e2a\uff0c\u4e9a\u57fa\u4e59\u8868\u8fbe\u7ec6\u80de\u6570\u4e3a\u56db\u4e2a\uff0c\u4e24\u8005\u5171\u540c\u8868\u8fbe\u7684\u7ec6\u80de\u6570\u4e3a\u4e09\u4e2a\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u8054\u5408\u68c0\u51fa\u6bd4\u4f8b\u4e3a 15%\uff0c\u82e5\u8be5\u6bd4\u4f8b\u4f4e\u4e8e\u8bbe\u5b9a\u7684\u6700\u4f4e\u9608\u503c\uff0c\u5219\u8be5\u4fe1\u53f7\u5c06\u4e0d\u4f1a\u88ab\u7eb3\u5165\u901a\u4fe1\u7f51\u7edc\u3002\u8fd9\u79cd\u673a\u5236\u901a\u8fc7\u8bbe\u5b9a\u6700\u4f4e\u8868\u8fbe\u7ec6\u80de\u6570\u548c\u8868\u8fbe\u5747\u503c\u6765\u7b5b\u9009\u4fe1\u53f7\uff0c\u786e\u4fdd\u901a\u4fe1\u7f51\u7edc\u7684\u751f\u7269\u5b66\u5408\u7406\u6027\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u5728\u5206\u6790\u8fc7\u7a0b\u4e2d\uff0c\u9700\u7279\u522b\u5173\u6ce8\u8868\u8fbe\u6bd4\u4f8b\u4e0e\u8868\u8fbe\u5747\u503c\u4e4b\u95f4\u7684\u5173\u7cfb\u3002\u56e0\u6b64\uff0c\u5728\u5206\u6790\u8fc7\u7a0b\u4e2d\u9700\u7ed3\u5408\u8868\u8fbe\u6bd4\u4f8b\u548c\u8868\u8fbe\u5747\u503c\uff0c\u7efc\u5408\u5224\u65ad\u4fe1\u53f7\u57fa\u56e0\u7684\u53ef\u9760\u6027\uff0c\u907f\u514d\u56e0\u8868\u8fbe\u6bd4\u4f8b\u4e0d\u8db3\u5bfc\u81f4\u7684\u8bef\u5224\u3002<\/p>\n<h2 style=\"margin:2em 0 .6em;color:#205CAC;font-size:1.38em;line-height:1.5;\">\u4ece\u4f5c\u8005\u53d1\u5e03\u7684\u4eba\u7c7b\u4e92\u4f5c\u6570\u636e\u5e93\u67e5\u56de\u53d7\u4f53\u4e9a\u57fa<\/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;\">dbfile&lt;-tempfile(fileext=\".rda\")\nutils::download.file(\"https:\/\/raw.githubusercontent.com\/jinworks\/CellChat\/75253cd0c9e68410e6e721a6d3a0419a1d7e358f\/data\/CellChatDB.human.rda\",dbfile,mode=\"wb\",quiet=TRUE)\ndb_env&lt;-new.env()\nload(dbfile,envir=db_env)\ndb&lt;-db_env$CellChatDB.human\nstopifnot(\"TGFbR1_R2\" %in% rownames(db$complex))\nsubunits&lt;-as.character(unlist(db$complex[\"TGFbR1_R2\",],use.names=FALSE))\nc(nrow(db$interaction),sum(db$interaction$receptor==\"TGFbR1_R2\"),sum(!is.na(subunits)&amp;nzchar(subunits)))\n<\/code><\/pre>\n<p style=\"margin:.5em 0 1em\">\u5728 R 4.5.2 \u4e2d\u8bfb\u53d6\u4f5c\u8005\u7684\u4eba\u7c7b\u4e92\u4f5c\u6570\u636e\u5e93\uff0c\u91c7\u7528 CellChatDB.human git 75253cd0\uff0c\u8f93\u51fa\u4f9d\u6b21\u4e3a\u6570\u636e\u5e93\u7684\u4e92\u4f5c\u884c 3,233\uff0c\u6307\u5b9a\u590d\u5408\u7269\u4f5c\u53d7\u4f53\u7684\u4e92\u4f5c\u884c 3\uff0c\u8be5\u590d\u5408\u7269\u7684\u4e9a\u57fa\u6570 2\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\">\u4e92\u4f5c\u9aa4\u51cf\u65f6\uff0c\u68c0\u67e5\u6570\u636e\u5e93\u7269\u79cd\u3001\u6bcf\u7fa4\u7ec6\u80de\u6570\u4e0e\u7fa4\u5e73\u5747\u8868\u8fbe\u65b9\u6cd5\uff0c\u5e76\u56de\u770b\u914d\u4f53\u548c\u53d7\u4f53\u7684\u8868\u8fbe\u6bd4\u4f8b\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u53e6\u4e00\u7c7b\u6545\u969c\u662f\u7ec6\u80de\u7fa4\u5927\u5c0f\u4e0d\u8db3\uff0c\u5bfc\u81f4\u65e0\u6cd5\u6ee1\u8db3\u901a\u4fe1\u6982\u7387\u8ba1\u7b97\u6240\u9700\u7684\u6700\u4f4e\u7ec6\u80de\u6570\u3002\u4f8b\u5982\uff0c\u82e5\u67d0\u4e00\u7ec6\u80de\u7fa4\u4e2d\u8868\u8fbe\u7ec6\u80de\u6570\u5c11\u4e8e\u8bbe\u5b9a\u7684\u6700\u4f4e\u9608\u503c\uff08\u5982 10 \u4e2a\uff09\uff0c\u5219\u8be5\u7fa4\u4e2d\u7684\u4fe1\u53f7\u57fa\u56e0\u5c06\u88ab\u6392\u9664\u3002\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u9700\u68c0\u67e5\u5206\u7ec4\u6807\u7b7e\u662f\u5426\u6b63\u786e\uff0c\u6216\u662f\u5426\u5b58\u5728\u67d0\u4e9b\u7ec6\u80de\u7fa4\u8868\u8fbe\u6c34\u5e73\u8fc7\u4f4e\u7684\u95ee\u9898\u3002\u82e5\u7ec6\u80de\u7fa4\u5927\u5c0f\u4e0d\u8db3\uff0c\u9700\u91cd\u65b0\u68c0\u67e5\u5206\u7ec4\u6807\u7b7e\u6216\u8868\u8fbe\u77e9\u9635\uff0c\u786e\u4fdd\u5176\u6ee1\u8db3\u5206\u6790\u8981\u6c42\u3002\u6b64\u5916\uff0c\u8fd8\u9700\u6ce8\u610f\u8868\u8fbe\u77e9\u9635\u662f\u5426\u7ecf\u8fc7\u9002\u5f53\u5f52\u4e00\u5316\u5904\u7406\uff0c\u82e5\u672a\u8fdb\u884c\u5f52\u4e00\u5316\u5904\u7406\uff0c\u5219\u53ef\u80fd\u5bfc\u81f4\u8868\u8fbe\u6c34\u5e73\u8fc7\u4f4e\uff0c\u4ece\u800c\u88ab\u6392\u9664\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u5728\u901a\u4fe1\u63a8\u65ad\u4e2d\uff0c\u4e0d\u540c\u805a\u5408\u65b9\u6cd5\u5bf9\u4fe1\u53f7\u57fa\u56e0\u7684\u7b5b\u9009\u7ed3\u679c\u5177\u6709\u663e\u8457\u5f71\u54cd\u3002\u4f8b\u5982\uff0c<code>triMean<\/code> \u65b9\u6cd5\u8981\u6c42\u6bcf\u4e2a\u7ec6\u80de\u7fa4\u4e2d\u7684\u4fe1\u53f7\u57fa\u56e0\u8868\u8fbe\u5747\u503c\u9700\u8fbe\u5230\u4e00\u5b9a\u9608\u503c\uff0c\u82e5\u672a\u8fbe\u5230\u5219\u4f1a\u88ab\u6392\u9664\u3002\u800c <code>mean<\/code> \u65b9\u6cd5\u5219\u53ef\u80fd\u4fdd\u7559\u66f4\u591a\u4f4e\u8868\u8fbe\u4fe1\u53f7\uff0c\u4f46\u5176\u7ed3\u679c\u7684\u53ef\u9760\u6027\u8f83\u4f4e\u3002\u56e0\u6b64\uff0c\u5728\u5206\u6790\u8fc7\u7a0b\u4e2d\u9700\u6839\u636e\u5177\u4f53\u7814\u7a76\u76ee\u7684\u9009\u62e9\u5408\u9002\u7684\u805a\u5408\u65b9\u6cd5\u3002\u82e5\u7814\u7a76\u5173\u6ce8\u7684\u662f\u9ad8\u8868\u8fbe\u4fe1\u53f7\uff0c\u53ef\u9009\u62e9 <code>triMean<\/code> \u65b9\u6cd5\u3002\u901a\u8fc7\u4e0d\u540c\u65b9\u6cd5\u7684\u5bf9\u6bd4\u5206\u6790\uff0c\u53ef\u4ee5\u66f4\u5168\u9762\u5730\u8bc4\u4f30\u4fe1\u53f7\u57fa\u56e0\u7684\u53ef\u9760\u6027\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\">\u5728\u4e00\u4e2a\u5019\u9009\u4e92\u4f5c\u4e2d\uff0c\u5148\u628a\u53d1\u9001\u7aef\u7684\u914d\u4f53\u4e0e\u63a5\u6536\u7aef\u53d7\u4f53\u7684\u6bcf\u4e2a\u5fc5\u8981\u4e9a\u57fa\u5206\u5f00\u5217\u51fa\uff0c\u518d\u7ed9\u6bcf\u4e2a\u7fa4\u8bb0\u5f55\u6709\u591a\u5c11\u4f9b\u4f53\u53ca\u7ec6\u80de\u63d0\u4f9b\u89c2\u6d4b\u3002\u82e5\u7532\u4e9a\u57fa\u4e3b\u8981\u51fa\u73b0\u5728\u4e00\u6279\u7ec6\u80de\uff0c\u4e59\u4e9a\u57fa\u4e3b\u8981\u5728\u53e6\u4e00\u6279\uff0c\u4e24\u79cd\u7fa4\u5747\u503c\u90fd\u9ad8\u4ecd\u4e0d\u80fd\u8bf4\u660e\u4e00\u4e2a\u7ec6\u80de\u4e2d\u6709\u5b8c\u6574\u53d7\u4f53\u3002\u5355\u7ec6\u80de\u672a\u68c0\u51fa\u4e5f\u53ef\u80fd\u6765\u81ea\u6d45\u6d4b\uff0c\u56e0\u800c\u5171\u68c0\u51fa\u6570\u9002\u5408\u4f5c\u4e3a\u56de\u67e5\u5165\u53e3\u3002\u9a8c\u8bc1\u8fd9\u6761\u901a\u4fe1\u8fd8\u5e94\u7ed3\u5408\u7a7a\u95f4\u90bb\u8fd1\u3001\u86cb\u767d\u5b9a\u4f4d\u6216\u963b\u65ad\u5b9e\u9a8c\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\/011-cellchat-code-1c7a2d8bb1ccdcae.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\/011-cellchat-data-92a241d2f57f93cf.zip\">\u4e0b\u8f7d\u914d\u5957\u793a\u4f8b\u6570\u636e\uff08ZIP\uff0c1.5 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;\">011-cellchat<\/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\u4ece\u4f5c\u8005\u53d1\u5e03\u7684\u4eba\u7c7b\u4e92\u4f5c\u6570\u636e\u5e93\u67e5\u56de\u53d7\u4f53\u4e9a\u57fa\u201d\u3002Linux x86_64\u3001R 4.3.3 \u7684\u8f93\u51fa\u4e3a\u6570\u636e\u5e93\u7684\u4e92\u4f5c\u884c 3233\uff0c\u6307\u5b9a\u590d\u5408\u7269\u4f5c\u53d7\u4f53\u7684\u4e92\u4f5c\u884c 3\uff0c\u8be5\u590d\u5408\u7269\u7684\u4e9a\u57fa\u6570 2\u3002<\/p>\n<p style=\"margin:.5em 0 1em\">\u6cbf\u7740 TGFbR1_R2 \u5148\u627e interaction \u8868\u4e2d\u7684\u53d7\u4f53\u884c\uff0c\u518d\u5728 complex \u8868\u67e5\u975e\u7a7a\u4e9a\u57fa\u3002\u968f\u540e\u5728\u81ea\u5df1\u7684\u63a5\u6536\u7fa4\u5185\u6570\u540c\u65f6\u68c0\u51fa\u8fd9\u4e9b\u4e9a\u57fa\u7684\u6761\u7801\u3002\u6570\u636e\u5e93\u767b\u8bb0\u7684\u4e92\u4f5c\u884c\u6570\u548c\u6837\u672c\u4e2d\u63d0\u4f9b\u53d7\u4f53\u8bc1\u636e\u7684\u7ec6\u80de\u6570\u662f\u4e24\u4e2a\u5206\u6bcd\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\u53d1\u5e03\u7684\u4eba\u7c7b\u4e92\u4f5c\u5e93\u6709\u4e09\u5343\u4e8c\u767e\u4e09\u5341\u4e09\u6761\u4e92\u4f5c\uff0c\u5176\u4e2d\u4e09\u6761\u5f15\u7528\u540c\u4e00\u4e2a\u8f6c\u5316\u751f\u957f\u56e0\u5b50\u53d7\u4f53\u590d\u5408\u7269\u3002\u6253\u5f00\u590d\u5408\u7269\u8868\uff0c\u786e\u8ba4\u8be5\u53d7\u4f53\u7531\u4e24\u4e2a\u4e9a\u57fa\u7ec4\u6210\uff0c\u624d\u77e5\u9053\u56de\u5230\u63a5\u6536\u7ec6\u80de\u65f6\u5e94\u8be5\u5171\u540c\u6838\u67e5\u54ea\u4e9b\u57fa\u56e0\u3002\u5e93\u91cc\u4e00\u6761\u6709\u540d\u79f0\u7684\u8bb0\u5f55\u63d0\u4f9b\u5019\u9009\u5173\u7cfb\uff1b\u662f\u5426\u540c\u65f6\u8868\u8fbe\u3001\u7a7a\u95f4\u662f\u5426\u53ef\u8fbe\u53ca\u4e0b\u6e38\u662f\u5426\u54cd\u5e94\u8fd8\u9700\u5728\u81ea\u5df1\u7684\u6837\u672c\u4e2d\u9a8c\u8bc1\u3002<\/p>\n<p style=\"border-top:1px solid #DAE6F2;margin-top:2em;padding-top:1em;\">\u5f53\u6570\u636e\u4e0e\u4ee3\u7801\u5df2\u7ecf\u5728\u5c0f\u89c4\u6a21\u8f93\u5165\u4e0a\u5bf9\u9f50\uff0c\u540e\u9762\u9700\u8981\u6309\u540c\u4e00\u53e3\u5f84\u5206\u6790\u6574\u6279\u9879\u76ee\u65f6\uff0c\u53ef\u4ee5\u6309\u5b9e\u9645\u4efb\u52a1\u4f7f\u7528<a href=\"https:\/\/www.biocloudservice.com\/wordpress\/compute-services\/\" style=\"color:#185CB7;text-decoration:underline;\" data-ysx-event=\"contact_click\">\u4e91\u751f\u4fe1\u751f\u7269\u4fe1\u606f\u5b66\u5206\u6790\u670d\u52a1\u5668<\/a>\u3002<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u793a\u610f\u540c\u4e00\u63a5\u6536\u7fa4\u4e2d\u4e24\u4e2a\u4e9a\u57fa\u5206\u522b\u5341\u516d\u4e0e\u56db\u4e2a\u7ec6\u80de\u68c0\u51fa\uff0c\u540c\u65f6\u68c0\u51fa\u7684\u53ea\u6709\u4e09\u4e2a\u3002<\/p>\n","protected":false},"author":1,"featured_media":68606,"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":[676,728,733],"class_list":["post-68607","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-part","category-single-cell","tag-cellchat","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-cellchat-practice-35656bf4.png?fit=1120%2C690&ssl=1","_links":{"self":[{"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts\/68607","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=68607"}],"version-history":[{"count":2,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts\/68607\/revisions"}],"predecessor-version":[{"id":70776,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/posts\/68607\/revisions\/70776"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/media\/68606"}],"wp:attachment":[{"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/media?parent=68607"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/categories?post=68607"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.biocloudservice.com\/wordpress\/wp-json\/wp\/v2\/tags?post=68607"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}