{"id":813,"date":"2024-10-21T17:18:26","date_gmt":"2024-10-21T09:18:26","guid":{"rendered":"https:\/\/yunshangtulv.com.cn\/?p=813"},"modified":"2024-10-21T17:21:47","modified_gmt":"2024-10-21T09:21:47","slug":"%e5%9f%ba%e5%9b%a0%e7%9b%b8%e5%85%b3%e6%80%a7%e5%9c%88%e5%9b%be%ef%bc%88circos%e5%9b%be%ef%bc%89","status":"publish","type":"post","link":"https:\/\/yunshangtulv.com.cn\/?p=813","title":{"rendered":"\u57fa\u56e0\u76f8\u5173\u6027\u5708\u56fe\uff08Circos\u56fe\uff09"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-817\" src=\"https:\/\/yunshangtulv.com.cn\/wp-content\/uploads\/2024\/10\/Rplot13.png\" alt=\"\" width=\"660\" height=\"485\" srcset=\"https:\/\/yunshangtulv.com.cn\/wp-content\/uploads\/2024\/10\/Rplot13.png 1760w, https:\/\/yunshangtulv.com.cn\/wp-content\/uploads\/2024\/10\/Rplot13-600x441.png 600w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><\/p>\n<h3>1.\u56fe\u7247\u7279\u70b9<\/h3>\n<h4>\u8fd9\u662f\u4e00\u5e45\u57fa\u56e0\u76f8\u5173\u6027\u5708\u56fe\uff0c\u901a\u5e38\u88ab\u79f0\u4e3a Circos \u56fe\uff0c\u5b83\u7528\u4e8e\u53ef\u89c6\u5316\u591a\u4e2a\u57fa\u56e0\u4e4b\u95f4\u7684\u76f8\u5173\u6027\u5173\u7cfb\u3002\u5305\u62ec\u4ee5\u4e0b\u7ed3\u6784\uff1a<\/h4>\n<p style=\"text-align: left;\">\u5916\u56f4\u73af\uff1a\u6bcf\u4e2a\u5916\u90e8\u7684\u957f\u65b9\u5f62\u5757\u4ee3\u8868\u4e00\u4e2a\u57fa\u56e0\uff0c\u6bcf\u4e2a\u57fa\u56e0\u90fd\u6709\u5176\u5bf9\u5e94\u7684\u989c\u8272\u6765\u533a\u5206\u3002<br \/>\n\u8fde\u7ebf\uff1a\u5708\u5185\u7684\u7ebf\u6761\u4ee3\u8868\u57fa\u56e0\u4e4b\u95f4\u7684\u76f8\u5173\u6027\uff1a<br \/>\n\u7ea2\u8272\u8fde\u7ebf\u8868\u793a\u57fa\u56e0\u4e4b\u95f4\u5b58\u5728\u6b63\u76f8\u5173\u6027\u3002<br \/>\n\u84dd\u8272\u8fde\u7ebf\u8868\u793a\u57fa\u56e0\u4e4b\u95f4\u5b58\u5728\u8d1f\u76f8\u5173\u6027\u3002<br \/>\n\u7ebf\u6761\u5bc6\u96c6\u7a0b\u5ea6\uff1a\u7ebf\u6761\u5bc6\u96c6\u533a\u57df\u610f\u5473\u7740\u5b58\u5728\u5927\u91cf\u76f8\u5173\u6027\u5f3a\u7684\u57fa\u56e0\u5bf9\u3002<br \/>\n\u56fe\u4f8b\uff1a\u53f3\u4e0b\u89d2\u56fe\u4f8b\u6307\u51fa\u4e86\u989c\u8272\u6240\u4ee3\u8868\u7684\u76f8\u5173\u6027\u65b9\u5411\u2014\u2014\u7ea2\u8272\u4e3a\u6b63\u76f8\u5173\uff0c\u84dd\u8272\u4e3a\u8d1f\u76f8\u5173\u3002<\/p>\n<h3>2.\u6570\u636e\u8981\u6c42<\/h3>\n<p>\u57fa\u56e0\u5217\u8868\uff1a\u9700\u8981\u4e00\u7ec4\u57fa\u56e0\u540d\u79f0\uff0c\u901a\u5e38\u5728\u56fe\u4e2d\u5916\u56f4\u90e8\u5206\u8fdb\u884c\u6807\u8bc6\u3002<br \/>\n\u57fa\u56e0\u95f4\u76f8\u5173\u6027\uff1a\u6bcf\u5bf9\u57fa\u56e0\u4e4b\u95f4\u7684 Spearman \u76f8\u5173\u6027\u7cfb\u6570\uff0c\u9700\u8981\u6307\u5b9a\u5176\u503c\u4ee5\u5224\u65ad\u5176\u662f\u6b63\u76f8\u5173\u8fd8\u662f\u8d1f\u76f8\u5173\u3002<br \/>\n\u663e\u8457\u6027\u6c34\u5e73\uff1a\u9700\u8981\u786e\u5b9a\u54ea\u4e9b\u57fa\u56e0\u5bf9\u4e4b\u95f4\u7684\u76f8\u5173\u6027\u8fbe\u5230\u7edf\u8ba1\u663e\u8457\u6027\uff0c\u624d\u80fd\u5728\u56fe\u4e2d\u5c55\u793a\u8fde\u7ebf\u3002<br \/>\n\u989c\u8272\u6807\u6ce8\uff1a\u5b9a\u4e49\u6b63\u8d1f\u76f8\u5173\u6027\u7684\u989c\u8272\uff0c\u901a\u5e38\u6b63\u76f8\u5173\u4e3a\u7ea2\u8272\uff0c\u8d1f\u76f8\u5173\u4e3a\u84dd\u8272\u3002<\/p>\n<h3>3.\u7528R\u4ee3\u7801\u751f\u6210\u865a\u62df\u6570\u636e<\/h3>\n<pre class=\"corepress-code-pre\"><code># \u5b89\u88c5\u548c\u52a0\u8f7d\u5fc5\u8981\u7684\u5305\r\nif (!require('circlize')) install.packages('circlize')\r\nif (!require('dplyr')) install.packages('dplyr')\r\nif (!require('ComplexHeatmap')) install.packages('ComplexHeatmap')\r\nif (!require('RColorBrewer')) install.packages('RColorBrewer')\r\n\r\nlibrary(circlize)\r\nlibrary(dplyr)\r\nlibrary(ComplexHeatmap)\r\nlibrary(RColorBrewer)\r\n\r\n# \u751f\u6210\u865a\u62df\u7684\u57fa\u56e0\u76f8\u5173\u6027\u6570\u636e\r\nset.seed(123) # \u8bbe\u7f6e\u968f\u673a\u79cd\u5b50\u4ee5\u786e\u4fdd\u53ef\u91cd\u590d\u6027\r\ngenes &lt;- c('WTAP', 'YTHDF1', 'YTHDC1', 'FTO', 'YTHDF2', 'ALKBH5', 'RBM15B', 'VIRMA', 'IGF2BP2', 'HNRNPA2B1', 'IGF2BP1', 'YTHDF3', 'IGF2BP3', 'HNRNPC', 'RBM15', 'RBMX', 'METTL4', 'YTHDC2', 'METTL3', 'ZC3H13')\r\n\r\n# \u521b\u5efa\u4e00\u4e2a\u5305\u542b\u57fa\u56e0\u76f8\u5173\u6027\u7684\u865a\u62df\u6570\u636e\u6846\r\ngene_pairs &lt;- expand.grid(genes, genes) %&gt;% filter(Var1 != Var2)\r\ncorrelation_values &lt;- runif(nrow(gene_pairs), min = -1, max = 1)\r\n\r\ncorrelation_data &lt;- data.frame(\r\n  gene1 = gene_pairs$Var1,\r\n  gene2 = gene_pairs$Var2,\r\n  correlation = correlation_values\r\n)\r\n\r\n# \u5c06\u76f8\u5173\u6027\u6570\u636e\u4fdd\u5b58\u4e3aCSV\u6587\u4ef6\r\nwrite.csv(correlation_data, file = 'gene_correlation_data.csv', row.names = FALSE)\r\ngene_correlation_data &lt;- correlation_data<\/code><\/pre>\n<p>&nbsp;<\/p>\n<h3>4.\u7ed8\u56fe<\/h3>\n<pre class=\"corepress-code-pre\"><code># \u8bfb\u53d6CSV\u6587\u4ef6\r\ngene_correlation_data &lt;- read.csv('gene_correlation_data.csv')\r\n\r\ngene_correlation_data &lt;- correlation_data\r\n# \u7b5b\u9009\u51fa\u663e\u8457\u76f8\u5173\u7684\u57fa\u56e0\u5bf9\uff08\u5047\u8bbe\u7edd\u5bf9\u503c\u5927\u4e8e0.7\u7684\u76f8\u5173\u6027\u4e3a\u663e\u8457\uff09\r\nsignificant_data &lt;- gene_correlation_data %&gt;% filter(abs(correlation) &gt; 0.7)\r\n\r\n# \u5b9a\u4e49\u989c\u8272\u6620\u5c04\r\nlink_colors &lt;- ifelse(significant_data$correlation &gt; 0, \"#FF6347\", \"#4682B4\")\r\nsector_colors &lt;- colorRampPalette(brewer.pal(8, \"Set3\"))(length(genes))\r\n\r\n# \u7ed8\u5236\u57fa\u56e0\u76f8\u5173\u6027\u5708\u56fe\r\ncircos.clear() # \u6e05\u9664\u4e4b\u524d\u7684circos\u8bbe\u7f6e\r\ncircos.par(gap.degree = 2) # \u8bbe\u7f6e\u6bcf\u4e2a\u6247\u533a\u4e4b\u95f4\u7684\u95f4\u9699\r\ncircos.initialize(factors = genes, xlim = c(0, 1))\r\n\r\n# \u7ed8\u5236\u6bcf\u4e2a\u57fa\u56e0\u7684\u6247\u533a\u5e76\u6dfb\u52a0\u989c\u8272\r\ncircos.trackPlotRegion(\r\n  factors = genes, ylim = c(0, 1), panel.fun = function(x, y) {\r\n    circos.text(CELL_META$xcenter, CELL_META$ylim[2] + mm_y(5), CELL_META$sector.index, facing = \"bending.inside\", niceFacing = TRUE)\r\n    circos.rect(CELL_META$xlim[1], 0, CELL_META$xlim[2], 1, col = sector_colors[CELL_META$sector.numeric.index], border = NA)\r\n  }\r\n)<\/code><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-815\" src=\"https:\/\/yunshangtulv.com.cn\/wp-content\/uploads\/2024\/10\/Rplot11.png\" alt=\"\" width=\"496\" height=\"364\" srcset=\"https:\/\/yunshangtulv.com.cn\/wp-content\/uploads\/2024\/10\/Rplot11.png 1760w, https:\/\/yunshangtulv.com.cn\/wp-content\/uploads\/2024\/10\/Rplot11-600x441.png 600w\" sizes=\"auto, (max-width: 496px) 100vw, 496px\" \/><\/p>\n<pre class=\"corepress-code-pre\"><code># \u7ed8\u5236\u57fa\u56e0\u4e4b\u95f4\u7684\u76f8\u5173\u6027\u8fde\u7ebf\r\nfor (i in 1:nrow(significant_data)) {\r\n  circos.link(\r\n    significant_data$gene1[i], runif(1), \r\n    significant_data$gene2[i], runif(1), \r\n    col = link_colors[i], border = NA\r\n  )\r\n}<\/code><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-816\" src=\"https:\/\/yunshangtulv.com.cn\/wp-content\/uploads\/2024\/10\/Rplot12.png\" alt=\"\" width=\"483\" height=\"355\" srcset=\"https:\/\/yunshangtulv.com.cn\/wp-content\/uploads\/2024\/10\/Rplot12.png 1760w, https:\/\/yunshangtulv.com.cn\/wp-content\/uploads\/2024\/10\/Rplot12-600x441.png 600w\" sizes=\"auto, (max-width: 483px) 100vw, 483px\" \/><\/p>\n<pre class=\"corepress-code-pre\"><code># \u6dfb\u52a0\u56fe\u4f8b\r\nlegend(\"bottomright\", legend = c(\"Positive Correlation\", \"Negative Correlation\"), \r\n       col = c(\"#FF6347\", \"#4682B4\"), lty = 1, lwd = 2, bty = \"n\", cex = 0.8)\r\n<\/code><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-817\" src=\"https:\/\/yunshangtulv.com.cn\/wp-content\/uploads\/2024\/10\/Rplot13.png\" alt=\"\" width=\"484\" height=\"356\" srcset=\"https:\/\/yunshangtulv.com.cn\/wp-content\/uploads\/2024\/10\/Rplot13.png 1760w, https:\/\/yunshangtulv.com.cn\/wp-content\/uploads\/2024\/10\/Rplot13-600x441.png 600w\" sizes=\"auto, (max-width: 484px) 100vw, 484px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1.\u56fe\u7247\u7279\u70b9 \u8fd9\u662f\u4e00\u5e45\u57fa\u56e0\u76f8\u5173\u6027\u5708\u56fe\uff0c\u901a\u5e38\u88ab\u79f0\u4e3a Circos \u56fe\uff0c\u5b83\u7528\u4e8e\u53ef\u89c6\u5316\u591a\u4e2a\u57fa\u56e0\u4e4b\u95f4\u7684\u76f8\u5173\u6027\u5173\u7cfb\u3002\u5305\u62ec [&hellip;]<\/p>\n","protected":false},"author":104,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-813","post","type-post","status-publish","format-standard","hentry","category-r"],"_links":{"self":[{"href":"https:\/\/yunshangtulv.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/813","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yunshangtulv.com.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yunshangtulv.com.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yunshangtulv.com.cn\/index.php?rest_route=\/wp\/v2\/users\/104"}],"replies":[{"embeddable":true,"href":"https:\/\/yunshangtulv.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=813"}],"version-history":[{"count":0,"href":"https:\/\/yunshangtulv.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/813\/revisions"}],"wp:attachment":[{"href":"https:\/\/yunshangtulv.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=813"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yunshangtulv.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=813"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yunshangtulv.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=813"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}