{"id":29449,"date":"2024-02-22T18:06:15","date_gmt":"2024-02-22T10:06:15","guid":{"rendered":"http:\/\/www.biocloudservice.com\/wordpress\/?p=29449"},"modified":"2024-02-22T18:06:17","modified_gmt":"2024-02-22T10:06:17","slug":"%e8%b7%9f%e7%9d%80%e8%80%81%e4%bf%8a%e4%bf%8a%e5%a4%a7%e7%a5%9e%e5%ad%a6%e4%b9%a0clustergvis%e8%bf%9b%e8%a1%8c%e5%8d%95%e7%bb%86%e8%83%9e%e6%95%b0%e6%8d%ae%e5%8f%af%e8%a7%86%e5%8c%96","status":"publish","type":"post","link":"http:\/\/www.biocloudservice.com\/wordpress\/?p=29449","title":{"rendered":"\u8ddf\u7740\u8001\u4fca\u4fca\u5927\u795e\u5b66\u4e60ClusterGVis\u8fdb\u884c\u5355\u7ec6\u80de\u6570\u636e\u53ef\u89c6\u5316"},"content":{"rendered":"<p>\u4eca\u5929\u5c0f\u679c\u60f3\u4e3a\u5927\u5bb6\u5b89\u5229\u4e00\u4e2aR\u5305ClusterGVis\uff0c\u8be5\u5305\u7531\u8001\u4fca\u4fca\u5f00\u53d1\uff0c\u524d\u671f\u8be5\u5305\u53ef\u4ee5\u8fdb\u884cBluk-seq\u8868\u8fbe\u77e9\u9635\u7684\u5904\u7406\uff0c\u53ef\u4ee5\u540c\u65f6\u7ed8\u5236\u805a\u7c7b+\u5206\u7ec4\u8868\u8fbe\u8d8b\u52bf\u6298\u7ebf\u56fe+\u529f\u80fd\u6ce8\u91ca\u7684\u7ec4\u5408\u56fe\uff0c\u901a\u8fc7\u4e00\u5f20\u70ed\u56fe\u53ef\u4ee5\u4e86\u89e3\u5dee\u5f02\u57fa\u56e0\u53ef\u4ee5\u5212\u5206\u6210\u51e0\u4e2acluster,\u6bcf\u4e2acluster\u7684\u8868\u8fbe\u968f\u7740\u65f6\u95f4\u662f\u5982\u4f55\u53d8\u5316\uff0c\u4ee5\u53ca\u8fd9\u4e9bcluster\u53d8\u5316\u7684\u57fa\u56e0\u901a\u8fc7GO\u6216\u8005KEGG\u529f\u80fd\u6ce8\u91ca\u4e86\u89e3\u5176\u529f\u80fd\uff1b\u6700\u8fd1\u770b\u5230\u8be5\u5305\u53ef\u4ee5\u5bf9\u63a5\u5355\u7ec6\u80de\u6570\u636e\u4e86\uff0c\u589e\u52a0\u4e86 prepareDataFromscRNA \u51fd\u6570\u6765\u6574\u7406\u51c6\u5907\u5355\u7ec6\u80de\u7684\u6570\u636e\uff0c\u53ef\u4ee5\u7ed8\u5236\u51fa\u50cfBluk-seq\u4e00\u6837\u7684\u7ec4\u5408\u56fe\uff0c\u6548\u679c\u975e\u5e38\u4e0d\u9519\uff0c\u5c0f\u679c\u63a5\u4e0b\u6765\u5c31\u548c\u5927\u5bb6\u4e00\u8d77\u5b66\u4e60\u8be5\u5305\u7684\u7528\u6cd5\uff0c\u5982\u4f55\u5bf9\u63a5\u5355\u7ec6\u80de\u6570\u636e\uff0c\u8bdd\u4e0d\u591a\u8bf4\u5f00\u59cb\u4eca\u5929\u7684\u5206\u4eab\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<ol>\n<li>\u5b89\u88c5\u9700\u8981\u7684R\u5305<\/li>\n<\/ol>\n<p>#\u91cd\u65b0\u5b89\u88c5\u83b7\u5f97\u6b64\u529f\u80fd\uff0c\u5982\u679c\u4ee5\u524d\u6ca1\u6709\u5b89\u88c5\u53ef\u4ee5\u5ffd\u7565\uff0c\u76f4\u63a5\u5b89\u88c5\u5c31\u53ef\u4ee5<\/p>\n<p>install.packages(&#8220;devtools&#8221;)<\/p>\n<p>devtools::install_github(&#8220;junjunlab\/ClusterGVis&#8221;)<\/p>\n<p>BiocManager::install(\u201corg.Hs.eg.db\u201d)<\/p>\n<p>install.packages(\u201cggplot2\u201d)<\/p>\n<ol>\n<li>\u5bfc\u5165\u9700\u8981\u7684R\u5305<\/li>\n<\/ol>\n<p>library(ClusterGVis)<\/p>\n<p>library(org.Hs.eg.db)<\/p>\n<p>library(ggplot2)<\/p>\n<ol>\n<li>\u4ee3\u7801\u5c55\u793a<\/li>\n<\/ol>\n<p>#\u5bfc\u5165\u5355\u7ec6\u80de\u4e0a\u6e38\u5206\u6790\u7ed3\u679c\u6587\u4ef6<\/p>\n<p>load(&#8220;pbmc.rda&#8221;)<\/p>\n<p>#\u5355\u7ec6\u80de\u6570\u636e\u7ec6\u80de\u7fa4\u8fdb\u884c\u6ce8\u91ca<\/p>\n<p>new.cluster.ids &lt;- c(&#8220;Naive CD4 T&#8221;, &#8220;CD14+ Mono&#8221;, &#8220;Memory CD4 T&#8221;, &#8220;B&#8221;, &#8220;CD8 T&#8221;, &#8220;FCGR3A+ Mono&#8221;\uff0c&#8221;NK&#8221;, &#8220;DC&#8221;, &#8220;Platelet&#8221;)<\/p>\n<p>names(new.cluster.ids) &lt;- levels(pbmc)<\/p>\n<p>pbmc &lt;- RenameIdents(pbmc, new.cluster.ids)<\/p>\n<p>#\u5bfb\u627emarker\u57fa\u56e0<\/p>\n<p>pbmc.markers.all &lt;- Seurat::FindAllMarkers(pbmc,<\/p>\n<p>only.pos = TRUE,<\/p>\n<p>min.pct = 0.25,<\/p>\n<p>logfc.threshold = 0.25)<\/p>\n<p>#\u6311\u9009\u8868\u8fbe\u91cf\u524d\u5341\u7684marker\u57fa\u56e0<\/p>\n<p>pbmc.markers &lt;- pbmc.markers.all %&gt;%<\/p>\n<p>dplyr::group_by(cluster) %&gt;%<\/p>\n<p>dplyr::top_n(n = 20, wt = avg_log2FC)<\/p>\n<p>#\u5229\u7528prepareDataFromscRNA\u51fd\u6570\u51c6\u5907\u6570\u636e,showAverage \u53c2\u6570\u8bbe\u4e3a TRUE \u5219\u8868\u793a\u5bf9 \u57fa\u56e0\u7ec6\u80de\u4e9a\u7fa4\u4e00\u6837\u7684\u7ec6\u80de\u53d6\u5747\u503c\u8fdb\u884c\u7ed8\u56fe,\u5426\u5219\u5c31\u662f\u6240\u6709\u7ec6\u80de\u8fdb\u884c\u7ed8\u56fe,\u9ed8\u8ba4\u4f7f\u7528 seurat \u5bf9\u8c61\u7684 RNA assay \u7684 data \u6570\u636e\u3002<\/p>\n<p>st.data &lt;- prepareDataFromscRNA(object = pbmc,<\/p>\n<p>diffData = pbmc.markers,<\/p>\n<p>showAverage = TRUE)<\/p>\n<p>#\u5bf9\u6bcf\u4e2acluster\u8fdb\u884c\u5bcc\u96c6\u5206\u6790\uff0c\u8fd9\u91cc\u91c7\u7528GO\u5bcc\u96c6\u5206\u6790\uff0c\u6709\u9700\u8981\u7684\u53ef\u4ee5\u9009\u62e9kegg\u5bcc\u96c6\u5206\u6790<\/p>\n<p>enrich &lt;- enrichCluster(object = st.data,<\/p>\n<p>OrgDb = org.Hs.eg.db,<\/p>\n<p>type = &#8220;BP&#8221;,<\/p>\n<p>organism = &#8220;hsa&#8221;,<\/p>\n<p>pvalueCutoff = 0.5,<\/p>\n<p>topn = 5,<\/p>\n<p>seed = 5201314)<\/p>\n<p>#\u6311\u9009\u9700\u8981\u5c55\u793a\u7684marker\u57fa\u56e0<\/p>\n<p>markGenes = unique(pbmc.markers$gene)[sample(1:length(unique(pbmc.markers$gene)),40,<\/p>\n<p>replace = F)]<\/p>\n<p>#\u7ed8\u5236cluster\u57fa\u56e0\u8868\u8fbe\u6298\u7ebf\u56fe<\/p>\n<p>visCluster(object = st.data,<\/p>\n<p>plot.type = &#8220;line&#8221;)<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"540\" height=\"516\" class=\"wp-image-29450\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230316134356.jpeg?resize=540%2C516\" alt=\"Dingtalk_20230316134356\" srcset=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230316134356.jpeg?w=540 540w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230316134356.jpeg?resize=300%2C287 300w\" sizes=\"(max-width: 540px) 100vw, 540px\" data-recalc-dims=\"1\" \/><\/p>\n<p>#\u7ed8\u5236\u70ed\u56fe<\/p>\n<p>pdf(&#8216;sc1.pdf&#8217;,height = 10,width = 6,onefile = F)<\/p>\n<p>visCluster(object = st.data,<\/p>\n<p>plot.type = &#8220;heatmap&#8221;,<\/p>\n<p>column_names_rot = 45,<\/p>\n<p>markGenes = markGenes,<\/p>\n<p>cluster.order = c(1:9))<\/p>\n<p>dev.off()<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"473\" height=\"737\" class=\"wp-image-29451\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230316134610.jpeg?resize=473%2C737\" alt=\"Dingtalk_20230316134610\" srcset=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230316134610.jpeg?w=473 473w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230316134610.jpeg?resize=193%2C300 193w\" sizes=\"(max-width: 473px) 100vw, 473px\" data-recalc-dims=\"1\" \/><\/p>\n<p>#\u7ed8\u5236\u70ed\u56fe\u5e76\u6dfb\u52a0\u5bcc\u96c6\u6ce8\u91ca\u548c\u5206\u7ec4\u6298\u7ebf\u56fe<\/p>\n<p>pdf(&#8216;sc2.pdf&#8217;,height = 10,width = 14,onefile = F)<\/p>\n<p>visCluster(object = st.data,<\/p>\n<p>plot.type = &#8220;both&#8221;,<\/p>\n<p>column_names_rot = 45,<\/p>\n<p>show_row_dend = F,<\/p>\n<p>markGenes = markGenes,<\/p>\n<p>markGenes.side = &#8220;left&#8221;,<\/p>\n<p>annoTerm.data = enrich,<\/p>\n<p>line.side = &#8220;left&#8221;,<\/p>\n<p>cluster.order = c(1:9),<\/p>\n<p>go.col = rep(jjAnno::useMyCol(&#8220;stallion&#8221;,n = 9),each = 5),<\/p>\n<p>add.bar = T)<\/p>\n<p>dev.off()<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" width=\"640\" height=\"457\" class=\"wp-image-29452\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230316135010.jpeg?resize=640%2C457\" alt=\"Dingtalk_20230316135010\" srcset=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230316135010.jpeg?w=1051 1051w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230316135010.jpeg?resize=300%2C214 300w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230316135010.jpeg?resize=1024%2C732 1024w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230316135010.jpeg?resize=768%2C549 768w, https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/02\/dingtalk_20230316135010.jpeg?resize=600%2C429 600w\" sizes=\"(max-width: 640px) 100vw, 640px\" data-recalc-dims=\"1\" \/><\/p>\n<p>\u5c0f\u679c\u4eca\u5929\u5bf9ClusterGVis\u5305\u7684\u5206\u4eab\u5c31\u5230\u8fd9\u91cc\uff0c\u8be5\u5305\u5bf9\u4e8e\u8f6c\u5f55\u7ec4\u6570\u636e\u7684\u53ef\u89c6\u5316\u6548\u679c\u975e\u5e38\u4e0d\u9519\uff0c\u53ef\u4ee5\u7528\u4e00\u5f20\u70ed\u56fe\u6765\u5c55\u793a\u57fa\u56e0\u7684\u8868\u8fbe\u6a21\u5f0f\uff0c\u805a\u7c7b\u548c\u529f\u80fd\u6ce8\u91ca\uff0c\u529f\u80fd\u6ce8\u91ca\u5305\u62ec\u4e86\u5e38\u89c1\u7684GO\u548cKEGG,\u7528\u8d77\u6765\u8d85\u7ea7\u65b9\u4fbf\uff0c\u503c\u5f97\u63a8\u8350\uff0c\u611f\u5174\u8da3\u7684\u53ef\u4ee5\u53bbgithub(https:\/\/github.com\/junjunlab\/ClusterGVis)\u6df1\u5165\u5b66\u4e60\uff0c\u6b22\u8fce\u5927\u5bb6\u548c\u5c0f\u679c\u4e00\u8d77\u8ba8\u8bba\u5b66\u4e60\u5965\uff0c\u4eca\u5929\u7684\u5206\u4eab\u5c31\u5230\u8fd9\u91cc\u4e86,\u89c9\u5f97\u4e0d\u9519\u7684\u5c0f\u4f19\u4f34\u53ef\u4ee5\u70b9\u8d5e\u52a0\u5173\u6ce8\u5965\uff0c\u4e0b\u671f\u518d\u89c1\u5965\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4eca\u5929\u5c0f\u679c\u60f3\u4e3a\u5927\u5bb6\u5b89\u5229\u4e00\u4e2aR\u5305ClusterGVis\uff0c\u8be5\u5305\u7531\u8001\u4fca\u4fca\u5f00\u53d1\uff0c\u524d\u671f\u8be5\u5305\u53ef\u4ee5\u8fdb\u884cBluk-seq\u8868\u8fbe\u77e9\u9635 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":""},"categories":[1],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/29449"}],"collection":[{"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=29449"}],"version-history":[{"count":1,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/29449\/revisions"}],"predecessor-version":[{"id":29453,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/29449\/revisions\/29453"}],"wp:attachment":[{"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=29449"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=29449"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=29449"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}