{"id":56354,"date":"2024-06-16T17:35:11","date_gmt":"2024-06-16T09:35:11","guid":{"rendered":"http:\/\/www.biocloudservice.com\/wordpress\/?p=56354"},"modified":"2024-06-16T17:35:11","modified_gmt":"2024-06-16T09:35:11","slug":"%e5%b0%8f%e5%9b%be%e6%95%99%e4%bd%a0%e7%bb%98%e5%88%b6%e9%ab%98%e5%a4%a7%e4%b8%8a%e7%9a%84%e7%83%ad%e5%9b%be%ef%bc%81r%e5%8c%85complexheatmap%e7%83%ad%e5%9b%be%e7%a5%9e%e5%99%a8%e7%9a%84%e4%bd%bf","status":"publish","type":"post","link":"http:\/\/www.biocloudservice.com\/wordpress\/?p=56354","title":{"rendered":"\u5c0f\u56fe\u6559\u4f60\u7ed8\u5236\u9ad8\u5927\u4e0a\u7684\u70ed\u56fe\uff01R\u5305ComplexHeatmap\u70ed\u56fe\u795e\u5668\u7684\u4f7f\u7528\uff01\uff01\uff01"},"content":{"rendered":"<p><html><br \/>\n<head><br \/>\n<title><\/title><br \/>\n<meta charset=\"utf-8\"><br \/>\n<meta name=\"viewport\" content=\"width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0,viewport-fit=cover\"><\/p>\n<style>\n*{margin:0;padding:0}html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;line-height:1.6}img{z-index:999;position:relative;max-width:100%;margin:10px 0;}body{letter-spacing:.034em}h1,h2,h3,h4,h5,h6{font-weight:400;font-size:16px}a{color:#576b95;text-decoration:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}td,th{word-wrap:break-word;padding:5px 10px;border:1px solid #DDD;}table{margin-bottom:10px;border-collapse:collapse;display:table;width:100%!important;}.appmsg_skin_default .rich_media_area_primary{background-color:#fff}.appmsg_skin_default .rich_media_area_primary .weui-loadmore_line .weui-loadmore__tips{background-color:#fff}.rich_media_area_primary{padding:20px 16px 12px;background-color:#fafafa}@media (max-width:375px){.rich_media_area_primary{padding:20px 60px 15px 60px}.rich_media_area_extra{padding:0 60px 21px 60px}}@media (min-width:1024px){.rich_media_area_primary_inner,.rich_media_area_extra_inner,body{max-width:677px;margin-left:auto;margin-right:auto}.rich_media_area_primary{padding-top:32px}}.rich_media{padding:20px;overflow:hidden;}.appmsg_skin_default .rich_media_area_primary{background-color:#fff}.appmsg_skin_default .rich_media_area_primary .weui-loadmore_line .weui-loadmore__tips{background-color:#fff}@media screen and (min-width:1024px){.rich_media_area_primary_inner,.rich_media_area_extra_inner{max-width:677px;margin-left:auto;margin-right:auto}.rich_media_area_primary{padding-top:32px}}.rich_media_content{overflow:hidden;color:#333;font-size:17px;word-wrap:break-word;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;text-align:justify;position:relative;z-index:0}.rich_media_content *{max-width:100%!important;box-sizing:border-box!important;-webkit-box-sizing:border-box!important;word-wrap:break-word!important}.rich_media_content p{clear:both;min-height:1em}.rich_media_content em{font-style:italic}.rich_media_content fieldset{min-width:0}.rich_media_content .list-paddingleft-1,.rich_media_content .list-paddingleft-2,.rich_media_content .list-paddingleft-3{padding-left:2.2em}.rich_media_content .list-paddingleft-1 .list-paddingleft-2,.rich_media_content .list-paddingleft-2 .list-paddingleft-2,.rich_media_content .list-paddingleft-3 .list-paddingleft-2{padding-left:30px}.rich_media_content .list-paddingleft-1{padding-left:1.2em}.rich_media_content .list-paddingleft-3{padding-left:3.2em}.rich_media_content .code-snippet,.rich_media_content .code-snippet__fix{max-width:1000%!important}.rich_media_content .code-snippet *,.rich_media_content .code-snippet__fix *{max-width:1000%!important}.rich_media_title{font-size:22px;line-height:1.4;margin-bottom:13px;padding-bottom:13px;border-bottom:1px solid #e7e7eb;}@supports(-webkit-overflow-scrolling:touch){.rich_media_title{font-weight:700}}.rich_media_meta{display:inline-block;vertical-align:middle;padding:0 0 10px 0;font-size:15px;-webkit-tap-highlight-color:rgba(0,0,0,0)}.rich_media_meta.icon_appmsg_tag{margin-right:0px}.rich_media_meta.meta_tag_text{margin-right:0}.rich_media_meta_list em{font-style:normal}.rich_media_meta_text{color:#a5a5a5;}p{margin:0;}.msgBox{margin-top:20px;padding-top:20px;padding-left:50px;overflow:hidden;border-top:2px dashed #09a2ff;}.msg{padding-top:7px;clear:both;}.msgBody{float:right;width:100%;margin-left:55px;padding-bottom:15px;border-bottom:1px dashed #e0e0e0;}.userHeadImg{float:left;margin-left:-50px;}.userHeadImg img{width:40px;height:40px;margin-right:10px;border-radius:3px;}.userName{color:#888888;line-height:24px;font-size:14px;margin:5px 0 5px 0;height:24px;}.replyBody,.autherBody{color:#565656;font-size:15px;}.replyIcon{border-left:4px solid #33ab01;margin-right:5px;}.ad{text-decoration:none;color:#d6d4d4;font-size:12px;}.msgBodyReply{padding-top:5px;}.userName span{float:right;color:#afafaf;font-size:14px;}code{text-align:left;font-size:14px;display:block;white-space:pre;display:-webkit-box;display:-webkit-flex;display:flex;position:relative;}.code-snippet__fix{font-size:14px;margin:10px 0;display:block;color:#333;position:relative;background-color:rgba(0,0,0,0.03);border:1px solid #f0f0f0;border-radius:2px;display:-webkit-box;display:-webkit-flex;display:flex;padding-left:25px;line-height:26px}.code-snippet__fix code{text-align:left;font-size:14px;display:block;white-space:pre;display:-webkit-box;display:-webkit-flex;display:flex;position:relative;font-family:Consolas,\"Liberation Mono\",Menlo,Courier,monospace}.code-snippet__comment,.code-snippet__quote{color:#afafaf;font-style:italic}.code-snippet__keyword,.code-snippet__selector-tag,.code-snippet__subst{color:#ca7d37}.code-snippet__number,.code-snippet__literal,.code-snippet__variable,.code-snippet__template-variable,.code-snippet__tag .code-snippet__attr{color:#0e9ce5}.code-snippet__string,.code-snippet__doctag{color:#d14}.code-snippet__title,.code-snippet__section,.code-snippet__selector-id{color:#d14}.code-snippet__subst{font-weight:normal}.code-snippet__type,.code-snippet__class .code-snippet__title{color:#0e9ce5}.code-snippet__tag,.code-snippet__name,.code-snippet__attribute{color:#0e9ce5;font-weight:normal}.code-snippet__regexp,.code-snippet__link{color:#ca7d37}.code-snippet__symbol,.code-snippet__bullet{color:#d14}.code-snippet__built_in,.code-snippet__builtin-name{color:#ca7d37}.code-snippet__meta{color:#afafaf}.code-snippet__deletion{background:#fdd}.code-snippet__addition{background:#dfd}.code-snippet__emphasis{font-style:italic}.code-snippet__strong{font-weight:bold}.account_avatar{width:40px;height:40px;padding:0;}.account_info{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;padding:20px 0;align-items:center}.flex_bd{padding-left:14px;}.account_nickname{display:inline-block;vertical-align:middle;line-height:1.2;color:#576b95;font-size:14px}.account_desc{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;color:rgba(0,0,0,0.3);font-size:14px;line-height:1.2;padding-top:.4em}.msg_source_url{text-align:left;word-break:break-all;margin-top:20px;}.msg_source_url a{padding-right:10px;}.msg_source_url .url_text{color:#a8a8a8;}.video-desc{font-size:14px;margin-top:15px;color:#6c6c6c;}.msg_source_url{text-align:left;}.original_primary_card_tips{color:rgba(0,0,0,0.3);line-height:1.4;font-size:15px;}.weui-flex__item{margin-bottom:20px;padding:20px 16px;margin-top:16px;line-height:1.4;align-items:center;background-color:#f7f7f7;border-radius:8px;position:relative;}.original_primary_desc{color:rgba(0,0,0,0.5);font-size:14px;padding-top:4px;width:auto;overflow:hidden;text-overflow:ellipsis;}.msgBodyReplyList{border-top:1px solid #e1e1e1;margin-top:10px;}.msgBodyReplyListTop{border-top:0;}.reply_like_num{float:right;font-size:14px;color:#c7c7c7;}.msgData{margin-top:20px;color:#626262;}.msgData span{font-size:14px;padding-right:15px;}.msgData .likes{float:right;padding-right:0;}.js_text_content p{font-size:18px;}.rich_media_meta_link{font-size:15px;}blockquote {padding-left: 10px;border-left: 3px solid #dbdbdb;color: rgba(0,0,0,0.5);font-size: 15px;padding-top: 4px;margin: 1em 0;}.video_iframe{width:500px;height:400px;}.blockquote_info{color:#b5b5b5;margin-top:10px;}#copyright_logo{color:#bdbdbd;}.rich_media_meta_list{margin-bottom:10px;}.reprint{background:#efefef;border-radius:5px;padding:8px;color:#1f1f1f;}.reprint a{word-break:break-all;}.topic{color:#8e8e8e;background:#f7f7f7;border-radius:5px;padding:10px 8px;}.topic a{padding-right:5px;}.topic p{margin-bottom:5px;}\n<\/style>\n<link href=\"https:\/\/www.juyifx.cn\/config\/css\/wxArticle.css\" rel=\"stylesheet\"\/>\n<\/head><script>\nvar data={\"mp\":\"\u751f\u4fe1\u679c\",\"title\":\"\u5c0f\u56fe\u6559\u4f60\u7ed8\u5236\u9ad8\u5927\u4e0a\u7684\u70ed\u56fe\uff01R\u5305ComplexHeatmap\u70ed\u56fe\u795e\u5668\u7684\u4f7f\u7528\uff01\uff01\uff01\",\"time\":\"2023-09-11 19:00:19\",\"timeStamp\":\"1694430019\"};\n<\/script><br \/>\n<body><\/p>\n<div class=\"rich_media\">\n<h1 class=\"rich_media_title\" id=\"activity-name\"><a href=\"http:\/\/mp.weixin.qq.com\/s?__biz=Mzg3OTg3MjQyNg==&#038;mid=2247492116&#038;idx=2&#038;sn=be3c99fab27a06fb22ac042e4ed82e6f&#038;chksm=cf7f72d1f808fbc76dc8eec04b11a824b61e1d47b32da8417c6e0fba4d70a0522d80f93876a0#rd\" target=\"_blank\" rel=\"noopener\">\u5c0f\u56fe\u6559\u4f60\u7ed8\u5236\u9ad8\u5927\u4e0a\u7684\u70ed\u56fe\uff01R\u5305ComplexHeatmap\u70ed\u56fe\u795e\u5668\u7684\u4f7f\u7528\uff01\uff01\uff01<\/a><\/h1>\n<div id=\"meta_content\" class=\"rich_media_meta_list\"><span class=\"rich_media_meta rich_media_meta_text\">\u5c0f\u56fe&nbsp;&nbsp;<\/span><span class=\"rich_media_meta rich_media_meta_nickname\" id=\"profileBt\"><a href=\"javascript:void(0);\" class=\"wx_tap_link js_wx_tap_highlight weui-wa-hotarea\" id=\"js_name\">\u751f\u4fe1\u679c&nbsp;&nbsp;<\/a><\/span><em id=\"publish_time\" class=\"rich_media_meta rich_media_meta_text\">2023-09-11 19:00:19<\/em><\/div>\n<p><content><\/p>\n<div class=\"reprint\">\n<p>\u8f6c\u81ea\u516c\u4f17\u53f7\uff1a\u751f\u4fe1\u56fe<br \/><a href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzkxODUxNDgzNA==&#038;mid=2247484994&#038;idx=1&#038;sn=a373d7673bb90338ed7d846199a0c313\" target=\"_blank\" title=\"\u9605\u8bfb\u539f\u6587\" rel=\"noopener\">http:\/\/mp.weixin.qq.com\/s?__biz=MzkxODUxNDgzNA==&#038;mid=2247484994&#038;idx=1&#038;sn=a373d7673bb90338ed7d846199a0c313<\/a><\/p>\n<\/div>\n<section style=\"font-size: 16px;margin-bottom: 24px;\">\n<section style=\"display: flex;flex-flow: row;margin: 10px 0%;text-align: left;justify-content: flex-start;\" powered-by=\"xiumi.us\">\n<section style=\"display: inline-block;vertical-align: bottom;width: 50%;background-color: rgb(242, 183, 183);margin-right: 3px;flex: 0 0 auto;align-self: flex-end;height: auto;padding: 3px 10px;\">\n<section style=\"font-size: 17px;color: rgb(255, 255, 255);text-align: right;letter-spacing: 4px;\" powered-by=\"xiumi.us\">\n<p><strong>\u70b9\u51fb\u84dd\u5b57<\/strong><\/p>\n<\/section>\n<\/section>\n<section style=\"display: inline-block;vertical-align: top;width: auto;border-left: 4px solid rgb(242, 183, 183);border-bottom-left-radius: 0px;flex: 100 100 0%;align-self: stretch;height: auto;padding: 3px 10px;background-color: rgba(254, 245, 240, 0.8);\">\n<section style=\"color: rgb(181, 126, 121);font-size: 17px;letter-spacing: 4px;\" powered-by=\"xiumi.us\">\n<p><strong>\u5173\u6ce8\u5c0f\u56fe<\/strong><\/p>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"line-height: 1.8;letter-spacing: 1.5px;\" powered-by=\"xiumi.us\">\n<p style=\"white-space: normal;\">\u5c0f\u4f19\u4f34\u60f3\u5fc5\u5bf9\u70ed\u56fe\u5df2\u7ecf\u89c1\u4e86\u5f88\u591a\uff0c\u666e\u666e\u901a\u901a\u7684\u7684\u70ed\u56fe\u5df2\u7ecf\u6ee1\u8db3\u4e0d\u4e86\u5c0f\u4f19\u4f34\u7684\u201c\u80c3\u53e3\u201d\u4e86\u3002\u6211\u4eec\u5e73\u65f6\u7ed8\u5236\u70ed\u56fe\u76ee\u7684\u5c31\u662f\u8981\u53ef\u89c6\u5316\u6570\u636e\uff0c\u6709\u6548\u7684\u53ef\u89c6\u5316\u4e0d\u540c\u6765\u6e90\u6570\u636e\u96c6\u4e4b\u95f4\u5173\u8054\u5e76\u4e14\u53bb\u89e3\u91ca\u6f5c\u5728\u7684\u6a21\u5f0f\u3002\u800c\u666e\u901a\u7684\u70ed\u56fe\u6211\u4eec\u5df2\u7ecf\u5f88\u5e38\u89c1\u4e86\uff0c\u5c0f\u56fe\u8fd9\u91cc\u6559\u5927\u5bb6\u5982\u4f55\u7ed8\u5236\u9ad8\u5927\u4e0a\u7684\u70ed\u56fe\uff01\uff01<br  \/><\/p>\n<p style=\"white-space: normal;\"><br  \/><\/p>\n<p style=\"white-space: normal;\">\u8fd9\u91cc\u5c31\u662f\u4f7f\u7528\u76ee\u524d\u4e00\u79cd\u7ed8\u5236\u70ed\u56fe\u7684\u795e\u5668R\u5305ComplexHeatmap\uff0c\u5b83\u4e0d\u4ec5\u4ec5\u53ef\u4ee5\u7ed8\u5236\u7b80\u5355\u7684\u70ed\u56fe\uff0c\u8fd8\u53ef\u4ee5\u7ed8\u5236\u590d\u6742\u7684\u70ed\u56fe\uff0c\u90a3\u4e48\u63a5\u4e0b\u6765\u5c0f\u56fe\u5c31\u5e26\u5927\u5bb6\u53bb\u5b66\u4e60\u5427\uff01<\/p>\n<p style=\"white-space: normal;\"><br  \/><\/p>\n<p style=\"white-space: normal;\">\u8fd9\u91cc\u4f7f\u7528\u7684\u6570\u636e\u5462\uff0c<strong>\u5c0f\u56fe\u81ea\u5df1\u8bbe\u5b9a\u7684<\/strong>\uff0c\u5c0f\u4f19\u4f34\u53ef\u4ee5\u6309\u7167\u683c\u5f0f\u81ea\u884c\u53bb\u8bbe\u7f6e\u3002<\/p>\n<p style=\"white-space: normal;\"><br  \/><\/p>\n<p style=\"white-space: normal;\">\u56e0\u4e3aComplexHeatmap\u8fd9\u4e2a\u5305\u5462\u4e0d\u4f1a\u5bf9\u6570\u636e\u6807\u51c6\u8bdd\uff0c\u800c\u6211\u4eec\u5e73\u65f6\u7ed8\u5236\u6570\u636e\u65f6\u5019\uff0c\u4e00\u822c\u90fd\u9700\u8981\u5c06\u6570\u636e\u6807\u51c6\u5316\uff0c\u8fd9\u91cc\u5c0f\u56fe\u6559\u5927\u5bb6\uff0c\u53ef\u4ee5\u663e\u793a\u6709scale()\u51fd\u6570\u5bf9\u6570\u636e\u6807\u51c6\u5316\u3002<\/p>\n<\/section>\n<section style=\"margin: 10px 0%;text-align: left;justify-content: flex-start;display: flex;flex-flow: row;\" powered-by=\"xiumi.us\">\n<section style=\"display: inline-block;width: auto;vertical-align: top;border-left: 5px solid rgb(242, 203, 203);border-bottom-left-radius: 0px;padding-left: 9px;min-width: 10%;flex: 0 0 auto;height: auto;align-self: flex-start;\">\n<section style=\"margin: 2px 0%;\" powered-by=\"xiumi.us\">\n<section style=\"color: rgb(110, 75, 36);line-height: 1.5;text-align: justify;letter-spacing: 1px;\">\n<p style=\"white-space: normal;\"><strong>\u8fd9\u91cc\u6211\u4eec\u6f14\u793a\u968f\u673a\u751f\u6210\u7684\u6b63\u6001\u5206\u5e03\u7684\u6570\u636e\uff0c\u662f\u4e0d\u9700\u8981\u6807\u51c6\u5316<\/strong><\/p>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"c\"><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__built_in\">set<\/span>.seed(<span class=\"code-snippet__number\">123<\/span>)<\/span><\/code><code><span class=\"code-snippet_outer\">nr1 = <span class=\"code-snippet__number\">4<\/span>; nr2 = <span class=\"code-snippet__number\">8<\/span>; nr3 = <span class=\"code-snippet__number\">6<\/span>; nr = nr1 + nr2 + nr3<\/span><\/code><code><span class=\"code-snippet_outer\">nc1 = <span class=\"code-snippet__number\">6<\/span>; nc2 = <span class=\"code-snippet__number\">8<\/span>; nc3 = <span class=\"code-snippet__number\">10<\/span>; nc = nc1 + nc2 + nc3<\/span><\/code><code><span class=\"code-snippet_outer\">mat = cbind(rbind(matrix(rnorm(nr1*nc1, mean = <span class=\"code-snippet__number\">1<\/span>, &nbsp; sd = <span class=\"code-snippet__number\">0.5<\/span>), nr = nr1),<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;matrix(rnorm(nr2*nc1, mean = <span class=\"code-snippet__number\">0<\/span>, &nbsp; sd = <span class=\"code-snippet__number\">0.5<\/span>), nr = nr2),<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;matrix(rnorm(nr3*nc1, mean = <span class=\"code-snippet__number\">0<\/span>, &nbsp; sd = <span class=\"code-snippet__number\">0.5<\/span>), nr = nr3)),<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;rbind(matrix(rnorm(nr1*nc2, mean = <span class=\"code-snippet__number\">0<\/span>, &nbsp; sd = <span class=\"code-snippet__number\">0.5<\/span>), nr = nr1),<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;matrix(rnorm(nr2*nc2, mean = <span class=\"code-snippet__number\">1<\/span>, &nbsp; sd = <span class=\"code-snippet__number\">0.5<\/span>), nr = nr2),<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;matrix(rnorm(nr3*nc2, mean = <span class=\"code-snippet__number\">0<\/span>, &nbsp; sd = <span class=\"code-snippet__number\">0.5<\/span>), nr = nr3)),<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;rbind(matrix(rnorm(nr1*nc3, mean = <span class=\"code-snippet__number\">0.5<\/span>, sd = <span class=\"code-snippet__number\">0.5<\/span>), nr = nr1),<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;matrix(rnorm(nr2*nc3, mean = <span class=\"code-snippet__number\">0.5<\/span>, sd = <span class=\"code-snippet__number\">0.5<\/span>), nr = nr2),<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;matrix(rnorm(nr3*nc3, mean = <span class=\"code-snippet__number\">1<\/span>, &nbsp; sd = <span class=\"code-snippet__number\">0.5<\/span>), nr = nr3))<\/span><\/code><code><span class=\"code-snippet_outer\">)<\/span><\/code><code><span class=\"code-snippet_outer\">mat = mat[sample(nr, nr), sample(nc, nc)] <span class=\"code-snippet__meta\"># random shuffle rows and columns<\/span><\/span><\/code><code><span class=\"code-snippet_outer\">rownames(mat) = paste0(<span class=\"code-snippet__string\">\"row\"<\/span>, seq_len(nr))<\/span><\/code><code><span class=\"code-snippet_outer\">colnames(mat) = paste0(<span class=\"code-snippet__string\">\"column\"<\/span>, seq_len(nc))<\/span><\/code><\/pre>\n<\/section>\n<section style=\"text-align: center;margin-top: 10px;margin-bottom: 10px;line-height: 0;\" powered-by=\"xiumi.us\">\n<section style=\"vertical-align: middle;display: inline-block;line-height: 0;\"><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"0.40809968847352024\" data-s=\"300,640\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/06\/1_c51QHLHA9S5OCCB0V9OcsDS3xibWsw.png?w=640\" onerror=\"this.src='https:\/\/mmbiz.qpic.cn\/sz_mmbiz_png\/2wJ7bWfS0QsK3bt5BgR7soicwrXZEfsLPc9c347nPBbib3w4IfiabibcahwBOc51QHLHA9S5OCCB0V9OcsDS3xibWsw\/640?wx_fmt=png'\" data-type=\"png\" data-w=\"642\" style=\"vertical-align: middle;width: 100%;height: auto !important;\" data-recalc-dims=\"1\"><\/section>\n<\/section>\n<p style=\"white-space: normal;\" powered-by=\"xiumi.us\"><br  \/><\/p>\n<section style=\"margin: 10px 0%;text-align: left;justify-content: flex-start;display: flex;flex-flow: row;\" powered-by=\"xiumi.us\">\n<section style=\"display: inline-block;width: auto;vertical-align: top;border-left: 5px solid rgb(242, 203, 203);border-bottom-left-radius: 0px;padding-left: 9px;min-width: 10%;flex: 0 0 auto;height: auto;align-self: flex-start;\">\n<section style=\"margin: 2px 0%;\" powered-by=\"xiumi.us\">\n<section style=\"color: rgb(110, 75, 36);line-height: 1.3;text-align: justify;letter-spacing: 1px;\">\n<p style=\"white-space: normal;\"><strong>\u6211\u4eec\u5c06\u4e0a\u8ff0\u6570\u636e\u5148\u7ed8\u5236\u7b80\u5355\u7684\u70ed\u56fe<\/strong><\/p>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"c\"><code><span class=\"code-snippet_outer\">Heatmap(mat)<\/span><\/code><\/pre>\n<\/section>\n<section style=\"text-align: center;margin-top: 10px;margin-bottom: 10px;line-height: 0;\" powered-by=\"xiumi.us\">\n<section style=\"vertical-align: middle;display: inline-block;line-height: 0;\"><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"1.0106221547799696\" data-s=\"300,640\" src=\"\u56fe\u7247\/\u751f\u4fe1\u679c_2023-09-11_\u300c\u8f6c\u300d\u5c0f\u56fe\u6559\u4f60\u7ed8\u5236\u9ad8\u5927\u4e0a\u7684\u70ed\u56fe\uff01R\u5305ComplexHeatmap\u70ed\u56fe\u795e\u5668\u7684\u4f7f\u7528\uff01\uff01\uff01\/2_ot29OnfkibB0wPSgOOdKcIHyDqYBdw.png\" onerror=\"this.src='https:\/\/mmbiz.qpic.cn\/sz_mmbiz_png\/2wJ7bWfS0QsK3bt5BgR7soicwrXZEfsLPrK0kIZpXB9L9LVL6iaVOWb4yibhot29OnfkibB0wPSgOOdKcIHyDqYBdw\/640?wx_fmt=png'\" data-type=\"png\" data-w=\"659\" style=\"vertical-align: middle;width: 100%;height: auto !important;\"><\/section>\n<\/section>\n<section style=\"line-height: 1.8;letter-spacing: 1.5px;\" powered-by=\"xiumi.us\">\n<p style=\"white-space: normal;\">\u5176\u4e2dHeatmap()\u8be5\u51fd\u6570\u662f\u5c06\u77e9\u9635\u53ef\u89c6\u5316\u4e3a\u5177\u6709\u9ed8\u8ba4\u8bbe\u7f6e\u7684\u70ed\u56fe\u3002\u4e0e\u5176\u4ed6\u70ed\u56fe\u5de5\u5177\u975e\u5e38\u76f8\u4f3c\uff0c\u5b83\u7ed8\u5236\u6811\u72b6\u56fe\u3001\u884c\/\u5217\u540d\u79f0\u548c\u70ed\u56fe\u56fe\u4f8b\u3002\u9ed8\u8ba4\u989c\u8272\u6a21\u5f0f\u662f\u201c\u84dd-\u767d-\u7ea2\u201d\uff0c\u5b83\u6620\u5c04\u5230\u77e9\u9635\u4e2d\u7684\u6700\u5c0f-\u5e73\u5747-\u6700\u5927\u503c\u3002\u56fe\u4f8b\u7684\u6807\u9898\u5206\u914d\u6709\u5185\u90e8\u7d22\u5f15\u53f7\u3002<\/p>\n<p style=\"white-space: normal;\"><br  \/><\/p>\n<\/section>\n<section style=\"margin: 10px 0%;text-align: left;justify-content: flex-start;display: flex;flex-flow: row;\" powered-by=\"xiumi.us\">\n<section style=\"display: inline-block;width: auto;vertical-align: top;border-left: 5px solid rgb(242, 203, 203);border-bottom-left-radius: 0px;padding-left: 9px;min-width: 10%;flex: 0 0 auto;height: auto;align-self: flex-start;\">\n<section style=\"margin: 2px 0%;\" powered-by=\"xiumi.us\">\n<section style=\"color: rgb(110, 75, 36);line-height: 1.5;text-align: justify;letter-spacing: 1px;\">\n<p style=\"white-space: normal;\"><strong>\u8fd9\u662f\u7b80\u5355\u7684\u70ed\u56fe\uff0c\u7ed9\u5927\u5bb6\u6f14\u793a\u4e00\u4e0b\uff0c\u4e0b\u9762\u6211\u4eec\u53bb\u4fee\u6539\u989c\u8272\u548c\u6807\u9898<\/strong><\/p>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"line-height: 1.8;letter-spacing: 1.5px;\" powered-by=\"xiumi.us\">\n<p style=\"white-space: normal;\">\u5176\u4e2d\uff0c\u5bf9\u4e8e\u989c\u8272\u6765\u8bf4\uff0c\u53ef\u4ee5\u4f7f\u7528circlize\u5305\u4e2d\u7684colorRAMP2()\u51fd\u6570\u6765\u751f\u6210\uff0c\u6765\u770b\u4e00\u4e0b\u628a\uff1a<\/p>\n<\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"c\"><code><span class=\"code-snippet_outer\">library(circlize)<\/span><\/code><code><span class=\"code-snippet_outer\">## \u5bf9 <span class=\"code-snippet__number\">-2<\/span> \u548c <span class=\"code-snippet__number\">2<\/span> \u4e4b\u95f4\u7684\u503c\u8fdb\u884c\u7ebf\u6027\u63d2\u503c\u4ee5\u83b7\u5f97\u76f8\u5e94\u7684\u989c\u8272\uff0c\u5927\u4e8e <span class=\"code-snippet__number\">2<\/span> \u7684\u503c\u5168\u90e8\u6620\u5c04\u4e3a\u7ea2\u8272\uff0c\u5c0f\u4e8e <span class=\"code-snippet__number\">-2<\/span> \u7684\u503c\u5168\u90e8\u6620\u5c04\u4e3a\u7eff\u8272\u3002<\/span><\/code><code><span class=\"code-snippet_outer\">col_fun = colorRamp2(c(<span class=\"code-snippet__number\">-2<\/span>, <span class=\"code-snippet__number\">0<\/span>, <span class=\"code-snippet__number\">2<\/span>), c(<span class=\"code-snippet__string\">\"green\"<\/span>, <span class=\"code-snippet__string\">\"white\"<\/span>, <span class=\"code-snippet__string\">\"red\"<\/span>))<\/span><\/code><code><span class=\"code-snippet_outer\">Heatmap(mat, name = <span class=\"code-snippet__string\">\"mat\"<\/span>, col = col_fun, column_title = <span class=\"code-snippet__string\">\"I am a column title\"<\/span>, <\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp;row_title = <span class=\"code-snippet__string\">\"I am a row title\"<\/span>, column_title_gp = gpar(fontsize = <span class=\"code-snippet__number\">20<\/span>, fontface = <span class=\"code-snippet__string\">\"bold\"<\/span>))<\/span><\/code><\/pre>\n<\/section>\n<section style=\"text-align: center;margin-top: 10px;margin-bottom: 10px;line-height: 0;\" powered-by=\"xiumi.us\">\n<section style=\"vertical-align: middle;display: inline-block;line-height: 0;\"><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"0.9893939393939394\" data-s=\"300,640\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/06\/3_acTAPJcicZ2aIsmfct4Jheadcc1CWA.png?w=640\" onerror=\"this.src='https:\/\/mmbiz.qpic.cn\/sz_mmbiz_png\/2wJ7bWfS0QsK3bt5BgR7soicwrXZEfsLPohLhibfQZawwH0I7hfNPmTibneViacTAPJcicZ2aIsmfct4Jheadcc1CWA\/640?wx_fmt=png'\" data-type=\"png\" data-w=\"660\" style=\"vertical-align: middle;width: 100%;height: auto !important;\" data-recalc-dims=\"1\"><\/section>\n<\/section>\n<section style=\"line-height: 1.8;letter-spacing: 1.5px;\" powered-by=\"xiumi.us\">\n<p style=\"white-space: normal;\">\u8fd9\u6837\u4e00\u6765\u4e0d\u540c\u533a\u57df\u7684\u989c\u8272\u660e\u663e\u5206\u79bb\u51fa\u6765\uff0c\u4e0a\u8ff0\u53c2\u6570\u4e2dcol\u662f\u8868\u793a\u7528\u4e8e\u989c\u8272\u6620\u5c04\u7684\u8c03\u8272\u677f\u51fd\u6570\uff0c\u800ccolumu_title\u8868\u793a\u5217\u7684\u6807\u9898\uff0crow_title\u662f\u8868\u793a\u884c\u6807\u9898\uff0ccolumn_titile_gp\u8868\u793a\u8bbe\u7f6e\u5217\u6807\u9898\u6837\u5f0f\u7684\u56fe\u5f62\u53c2\u6570\u3002<\/p>\n<p style=\"white-space: normal;\"><br  \/><\/p>\n<\/section>\n<section style=\"margin: 10px 0%;text-align: left;justify-content: flex-start;display: flex;flex-flow: row;\" powered-by=\"xiumi.us\">\n<section style=\"display: inline-block;width: auto;vertical-align: top;border-left: 5px solid rgb(242, 203, 203);border-bottom-left-radius: 0px;padding-left: 9px;min-width: 10%;flex: 0 0 auto;height: auto;align-self: flex-start;\">\n<section style=\"margin: 2px 0%;\" powered-by=\"xiumi.us\">\n<section style=\"color: rgb(110, 75, 36);line-height: 1.3;text-align: justify;letter-spacing: 1px;\">\n<p style=\"white-space: normal;\"><strong>\u63a5\u4e0b\u91cc\u6211\u4eec\u5c31\u770b\u805a\u7c7b<\/strong><\/p>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"line-height: 1.8;letter-spacing: 1.5px;\" powered-by=\"xiumi.us\">\n<p style=\"white-space: normal;\">\u805a\u7c7b\u5728\u70ed\u56fe\u4e2d\u53ef\u89c6\u5316\u90e8\u5206\u662f\u5f88\u91cd\u8981\u7684\uff0c\u5728ComplexHeatmap\u5305\u4e2d\u5462\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u201ceuclidean&#8221;\u6216&#8221;pearson\u201d\u5b9a\u4e8e\u8ddd\u79bb\u7684\u805a\u7c7b\uff0c\u800c\u6211\u4eec\u4e5f\u53ef\u4ee5\u4f7f\u7528\u4e0d\u540c\u989c\u8272\u548c\u6837\u5f0f\u53bb\u5c55\u793a\u805a\u7c7b\u540e\u7684\u6811\u72b6\u56fe\uff08\u8fd9\u91cc\u6211\u4eec\u5c31\u53ef\u4ee5\u4f7f\u7528dendextend\u8fd9\u4e2a\u5305\uff0c\uff09\u3002\u6765\u770b\u4e00\u4e0b\uff1a<\/p>\n<\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"c\"><code><span class=\"code-snippet_outer\">library(dendextend)#\u5c0f\u56fe\u8fd9\u91cc\u63d0\u793a\u4e00\u4e0b\uff0c\u8fd9\u4e2a\u5305\u4e0d\u662f\u5f88\u597d\u4e0b\uff0c\u5c0f\u56fe\u662f\u5728\u5b98\u65b9\u63d0\u4f9b\u7684R\u5305\u4e0b\u8f7d\uff0c\u4ece\u5916\u90e8\u5bfc\u5165\uff0c\u5c0f\u4f19\u4f34\u8981\u6ce8\u610f\u54e6<\/span><\/code><code><span class=\"code-snippet_outer\">row_dend = as.dendrogram(hclust(dist(mat)))<\/span><\/code><code><span class=\"code-snippet_outer\">row_dend = color_branches(row_dend, k = <span class=\"code-snippet__number\">2<\/span>)<\/span><\/code><code><span class=\"code-snippet_outer\">Heatmap(mat, name = <span class=\"code-snippet__string\">\"mat\"<\/span>, cluster_columns = TRUE,show_column_dend = FALSE,<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp;clustering_distance_rows = <span class=\"code-snippet__string\">\"pearson\"<\/span>,<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp;row_dend_side = <span class=\"code-snippet__string\">\"left\"<\/span>,column_dend_side = <span class=\"code-snippet__string\">\"bottom\"<\/span>,<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp;cluster_rows = row_dend)<\/span><\/code><\/pre>\n<\/section>\n<section style=\"text-align: center;margin-top: 10px;margin-bottom: 10px;line-height: 0;\" powered-by=\"xiumi.us\">\n<section style=\"vertical-align: middle;display: inline-block;line-height: 0;\"><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"0.9878787878787879\" data-s=\"300,640\" src=\"\u56fe\u7247\/\u751f\u4fe1\u679c_2023-09-11_\u300c\u8f6c\u300d\u5c0f\u56fe\u6559\u4f60\u7ed8\u5236\u9ad8\u5927\u4e0a\u7684\u70ed\u56fe\uff01R\u5305ComplexHeatmap\u70ed\u56fe\u795e\u5668\u7684\u4f7f\u7528\uff01\uff01\uff01\/4_pA59Frr9vX1fBbZLXBrZMV7QGO2onA.png\" onerror=\"this.src='https:\/\/mmbiz.qpic.cn\/sz_mmbiz_png\/2wJ7bWfS0QsK3bt5BgR7soicwrXZEfsLPpicsbmz6g65XevBV4e7h33zaRpA59Frr9vX1fBbZLXBrZMV7QGO2onA\/640?wx_fmt=png'\" data-type=\"png\" data-w=\"660\" style=\"vertical-align: middle;width: 100%;height: auto !important;\"><\/section>\n<\/section>\n<section style=\"line-height: 1.8;letter-spacing: 1.5px;\" powered-by=\"xiumi.us\">\n<p style=\"white-space: normal;\">\u8fd9\u6837\u4e00\u6765\u662f\u4e0d\u662f\u6bd4\u5e73\u65f6\u7684\u805a\u7c7b\u6811\u72b6\u56fe\u597d\u770b\u591a\u4e86\u5462\uff0c\u4e0a\u8ff0\u53c2\u6570\u5462\u5c0f\u4f19\u4f34\u4eec\u53ef\u80fd\u4e0d\u592a\u7406\u89e3\uff0crow_dend\u662f\u5c06\u884c\u805a\u7c7b\u7ed3\u679c\u8f6c\u5316\u4e3a\u6811\u72b6\u56fe\u5f62\u5f0f\u7684\u805a\u7c7b\u6811\u3002<\/p>\n<p style=\"white-space: normal;\"><br  \/><\/p>\n<p style=\"white-space: normal;\">Color_branches\u662f\u5bf9\u884c\u805a\u7c7b\u4e66\u4e2d\u7684\u5206\u652f\u8fdb\u884c\u989c\u8272\u7684\u533a\u5206\u3002\u800ccluster_columns\u662f\u8868\u793a\u662f\u5426\u5bf9\u5217\u8fdb\u884c\u805a\u7c7b\uff0cclustering_distance_rows\u662f\u8868\u793a\u7528\u4e8e\u8ba1\u7b97\u884c\u805a\u7c7b\u8ddd\u79bb\u7684\u8ddd\u79bb\u5ea6\u91cf\u65b9\u6cd5.<\/p>\n<p style=\"white-space: normal;\"><br  \/><\/p>\n<\/section>\n<section style=\"margin: 10px 0%;text-align: left;justify-content: flex-start;display: flex;flex-flow: row;\" powered-by=\"xiumi.us\">\n<section style=\"display: inline-block;width: auto;vertical-align: top;border-left: 5px solid rgb(242, 203, 203);border-bottom-left-radius: 0px;padding-left: 9px;min-width: 10%;flex: 0 0 auto;height: auto;align-self: flex-start;\">\n<section style=\"margin: 2px 0%;\" powered-by=\"xiumi.us\">\n<section style=\"color: rgb(110, 75, 36);line-height: 1.5;text-align: justify;letter-spacing: 1px;\">\n<p style=\"white-space: normal;\"><strong>\u4e0b\u9762\u5462\u6211\u4eec\u8fd8\u53ef\u4ee5\u5c06\u70ed\u56fe\u8fdb\u884c\u5206\u5272\uff0c\u8fd9\u4e2a\u5c31\u662fComplexHeatmap\u5305\u4e00\u4e2a\u7279\u8272\uff0c\u5bf9\u529f\u80fd\u4e0d\u540c\u7684\u8fdb\u884c\u5206\u7ec4\u6765\u51f8\u663e\u529f\u80fd\uff0c\u6765\u8bd5\u8bd5\u5427\uff1a<\/strong><\/p>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"c\"><code><span class=\"code-snippet_outer\"><span class=\"code-snippet__built_in\">printf<\/span>(<span class=\"code-snippet__string\">\"hello world!\"<\/span>);## \u901a\u8fc7\u805a\u7c7b\u5206\u5272<\/span><\/code><code><span class=\"code-snippet_outer\">Heatmap(mat, name = <span class=\"code-snippet__string\">\"mat\"<\/span>, row_km = <span class=\"code-snippet__number\">2<\/span>, column_km = <span class=\"code-snippet__number\">3<\/span>)<\/span><\/code><\/pre>\n<\/section>\n<section style=\"text-align: center;margin-top: 10px;margin-bottom: 10px;line-height: 0;\" powered-by=\"xiumi.us\">\n<section style=\"vertical-align: middle;display: inline-block;line-height: 0;\"><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"1.0046583850931676\" data-s=\"300,640\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/06\/5_NR1FjXfcKEkS9nib7M3lUnhvBZ2Dmw.png?w=640\" onerror=\"this.src='https:\/\/mmbiz.qpic.cn\/sz_mmbiz_png\/2wJ7bWfS0QsK3bt5BgR7soicwrXZEfsLPWtpSHXWD1GM2ibKWr1NkiabJwU3NR1FjXfcKEkS9nib7M3lUnhvBZ2Dmw\/640?wx_fmt=png'\" data-type=\"png\" data-w=\"644\" style=\"vertical-align: middle;width: 100%;height: auto !important;\" data-recalc-dims=\"1\"><\/section>\n<\/section>\n<p style=\"white-space: normal;\" powered-by=\"xiumi.us\"><br  \/><\/p>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"c\"><code><span class=\"code-snippet_outer\">## \u81ea\u5b9a\u4e49\u5206\u5272<\/span><\/code><code><span class=\"code-snippet_outer\">Heatmap(mat, name = <span class=\"code-snippet__string\">\"mat\"<\/span>, row_split = rep(c(<span class=\"code-snippet__string\">\"A\"<\/span>, <span class=\"code-snippet__string\">\"B\"<\/span>), <span class=\"code-snippet__number\">9<\/span>), column_split = rep(c(<span class=\"code-snippet__string\">\"C\"<\/span>, <span class=\"code-snippet__string\">\"D\"<\/span>), <span class=\"code-snippet__number\">12<\/span>))<\/span><\/code><\/pre>\n<\/section>\n<section style=\"text-align: center;margin-top: 10px;margin-bottom: 10px;line-height: 0;\" powered-by=\"xiumi.us\">\n<section style=\"vertical-align: middle;display: inline-block;line-height: 0;\"><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"1.0168453292496171\" data-s=\"300,640\" src=\"\u56fe\u7247\/\u751f\u4fe1\u679c_2023-09-11_\u300c\u8f6c\u300d\u5c0f\u56fe\u6559\u4f60\u7ed8\u5236\u9ad8\u5927\u4e0a\u7684\u70ed\u56fe\uff01R\u5305ComplexHeatmap\u70ed\u56fe\u795e\u5668\u7684\u4f7f\u7528\uff01\uff01\uff01\/6_zhdYrVibH2hBTfKibhgicdvyz0CQfQ.png\" onerror=\"this.src='https:\/\/mmbiz.qpic.cn\/sz_mmbiz_png\/2wJ7bWfS0QsK3bt5BgR7soicwrXZEfsLPxTwvEMwj7qjy0wPFibNQoIteZ8cxzhdYrVibH2hBTfKibhgicdvyz0CQfQ\/640?wx_fmt=png'\" data-type=\"png\" data-w=\"653\" style=\"vertical-align: middle;width: 100%;height: auto !important;\"><\/section>\n<\/section>\n<p style=\"white-space: normal;\" powered-by=\"xiumi.us\"><br  \/><\/p>\n<section style=\"margin: 10px 0%;text-align: left;justify-content: flex-start;display: flex;flex-flow: row;\" powered-by=\"xiumi.us\">\n<section style=\"display: inline-block;width: auto;vertical-align: top;border-left: 5px solid rgb(242, 203, 203);border-bottom-left-radius: 0px;padding-left: 9px;min-width: 10%;flex: 0 0 auto;height: auto;align-self: flex-start;\">\n<section style=\"margin: 2px 0%;\" powered-by=\"xiumi.us\">\n<section style=\"color: rgb(110, 75, 36);line-height: 1.5;text-align: justify;letter-spacing: 1px;\">\n<p style=\"white-space: normal;\"><strong>\u4f46\u662f\u8fd9\u6837\u5982\u56fe\u4e2d\u4e5f\u53ea\u662f\u56fe\u7247\uff0c\u6211\u4eec\u8fd8\u4ee5\u5728\u70ed\u56fe\u4e0a\u6dfb\u52a0\u6570\u503c\uff1a<\/strong><\/p>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"c\"><code><span class=\"code-snippet_outer\">small_mat = mat[<span class=\"code-snippet__number\">1<\/span>:<span class=\"code-snippet__number\">9<\/span>, <span class=\"code-snippet__number\">1<\/span>:<span class=\"code-snippet__number\">9<\/span>]<\/span><\/code><code><span class=\"code-snippet_outer\">col_fun = colorRamp2(c(<span class=\"code-snippet__number\">-2<\/span>, <span class=\"code-snippet__number\">0<\/span>, <span class=\"code-snippet__number\">2<\/span>), c(<span class=\"code-snippet__string\">\"green\"<\/span>, <span class=\"code-snippet__string\">\"white\"<\/span>, <span class=\"code-snippet__string\">\"red\"<\/span>))<\/span><\/code><code><span class=\"code-snippet_outer\">Heatmap(small_mat, name = <span class=\"code-snippet__string\">\"mat\"<\/span>, col = col_fun,<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp;cell_fun = function(j, i, x, y, width, height, fill) {<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;grid.text(<span class=\"code-snippet__built_in\">sprintf<\/span>(<span class=\"code-snippet__string\">\"%.1f\"<\/span>, small_mat[i, j]), x, y, gp = gpar(fontsize = <span class=\"code-snippet__number\">10<\/span>))<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp;})<\/span><\/code><\/pre>\n<\/section>\n<section style=\"text-align: center;margin-top: 10px;margin-bottom: 10px;line-height: 0;\" powered-by=\"xiumi.us\">\n<section style=\"vertical-align: middle;display: inline-block;line-height: 0;\"><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"1.0076804915514592\" data-s=\"300,640\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/06\/7_aic0ZulEUBtibbzYCagEPafdqqqoVw.png?w=640\" onerror=\"this.src='https:\/\/mmbiz.qpic.cn\/sz_mmbiz_png\/2wJ7bWfS0QsK3bt5BgR7soicwrXZEfsLPPS70qniatxEAGOHuRxYSrmuLiboeiaic0ZulEUBtibbzYCagEPafdqqqoVw\/640?wx_fmt=png'\" data-type=\"png\" data-w=\"651\" style=\"vertical-align: middle;width: 100%;height: auto !important;\" data-recalc-dims=\"1\"><\/section>\n<\/section>\n<p style=\"white-space: normal;\" powered-by=\"xiumi.us\"><br  \/><\/p>\n<section style=\"margin: 10px 0%;text-align: left;justify-content: flex-start;display: flex;flex-flow: row;\" powered-by=\"xiumi.us\">\n<section style=\"display: inline-block;width: auto;vertical-align: top;border-left: 5px solid rgb(242, 203, 203);border-bottom-left-radius: 0px;padding-left: 9px;min-width: 10%;flex: 0 0 auto;height: auto;align-self: flex-start;\">\n<section style=\"margin: 2px 0%;\" powered-by=\"xiumi.us\">\n<section style=\"color: rgb(110, 75, 36);line-height: 1.5;text-align: justify;letter-spacing: 1px;\">\n<p style=\"white-space: normal;\"><strong>\u4e0b\u9762\u8fd9\u4e2a\u5c31\u6709\u610f\u601d\u4e86\uff0c\u6211\u4eec\u53ef\u4ee5\u9009\u62e9\u53ea\u4e3a\u5177\u6709\u6b63\u503c\u7684\u5355\u5143\u683c\u6dfb\u52a0\u6587\u672c\uff1a<\/strong><\/p>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"c\"><code><span class=\"code-snippet_outer\">Heatmap(small_mat, name = <span class=\"code-snippet__string\">\"mat\"<\/span>, &nbsp;col = col_fun,<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp;cell_fun = function(j, i, x, y, width, height, fill) {<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class=\"code-snippet__keyword\">if<\/span>(small_mat[i, j] &gt; <span class=\"code-snippet__number\">0<\/span>)<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;grid.text(<span class=\"code-snippet__built_in\">sprintf<\/span>(<span class=\"code-snippet__string\">\"%.1f\"<\/span>, small_mat[i, j]), x, y, gp = gpar(fontsize = <span class=\"code-snippet__number\">10<\/span>))<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp;})<\/span><\/code><\/pre>\n<\/section>\n<section style=\"text-align: center;margin-top: 10px;margin-bottom: 10px;line-height: 0;\" powered-by=\"xiumi.us\">\n<section style=\"vertical-align: middle;display: inline-block;line-height: 0;\"><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"1.0045592705167172\" data-s=\"300,640\" src=\"\u56fe\u7247\/\u751f\u4fe1\u679c_2023-09-11_\u300c\u8f6c\u300d\u5c0f\u56fe\u6559\u4f60\u7ed8\u5236\u9ad8\u5927\u4e0a\u7684\u70ed\u56fe\uff01R\u5305ComplexHeatmap\u70ed\u56fe\u795e\u5668\u7684\u4f7f\u7528\uff01\uff01\uff01\/8_RnoHH2J43Gmn0ZVSABD9whVUuComdw.png\" onerror=\"this.src='https:\/\/mmbiz.qpic.cn\/sz_mmbiz_png\/2wJ7bWfS0QsK3bt5BgR7soicwrXZEfsLP1DicIFnytWFqGfDGicpJ8dlpY7RnoHH2J43Gmn0ZVSABD9whVUuComdw\/640?wx_fmt=png'\" data-type=\"png\" data-w=\"658\" style=\"vertical-align: middle;width: 100%;height: auto !important;\"><\/section>\n<\/section>\n<p style=\"white-space: normal;\" powered-by=\"xiumi.us\"><br  \/><\/p>\n<section style=\"margin: 10px 0%;text-align: left;justify-content: flex-start;display: flex;flex-flow: row;\" powered-by=\"xiumi.us\">\n<section style=\"display: inline-block;width: auto;vertical-align: top;border-left: 5px solid rgb(242, 203, 203);border-bottom-left-radius: 0px;padding-left: 9px;min-width: 10%;flex: 0 0 auto;height: auto;align-self: flex-start;\">\n<section style=\"margin: 2px 0%;\" powered-by=\"xiumi.us\">\n<section style=\"color: rgb(110, 75, 36);line-height: 1.5;text-align: justify;letter-spacing: 1px;\">\n<p style=\"white-space: normal;\"><strong>\u6211\u4eec\u7ed8\u5236\u70ed\u56fe\u8fd8\u53ef\u4ee5\u663e\u793a\u53bbcorrplot\u5305\u7c7b\u7684\u76f8\u5173\u77e9\u9635\uff1a<\/strong><\/p>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"c\"><code><span class=\"code-snippet_outer\">cor_mat = cor(small_mat)<\/span><\/code><code><span class=\"code-snippet_outer\">od = hclust(dist(cor_mat))$order<\/span><\/code><code><span class=\"code-snippet_outer\">cor_mat = cor_mat[od, od]<\/span><\/code><code><span class=\"code-snippet_outer\">nm = rownames(cor_mat)<\/span><\/code><code><span class=\"code-snippet_outer\">col_fun = circlize::colorRamp2(c(<span class=\"code-snippet__number\">-1<\/span>, <span class=\"code-snippet__number\">0<\/span>, <span class=\"code-snippet__number\">1<\/span>), c(<span class=\"code-snippet__string\">\"green\"<\/span>, <span class=\"code-snippet__string\">\"white\"<\/span>, <span class=\"code-snippet__string\">\"red\"<\/span>))<\/span><\/code><code><span class=\"code-snippet_outer\"># `col = col_fun` here is used to generate the legend<\/span><\/code><code><span class=\"code-snippet_outer\">Heatmap(cor_mat, name = <span class=\"code-snippet__string\">\"correlation\"<\/span>, col = col_fun, rect_gp = gpar(type = <span class=\"code-snippet__string\">\"none\"<\/span>), <\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp;cell_fun = function(j, i, x, y, width, height, fill) {<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;grid.rect(x = x, y = y, width = width, height = height, <\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;gp = gpar(col = <span class=\"code-snippet__string\">\"grey\"<\/span>, fill = NA))<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class=\"code-snippet__keyword\">if<\/span>(i == j) {<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;grid.text(nm[i], x = x, y = y)<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} <span class=\"code-snippet__keyword\">else<\/span> <span class=\"code-snippet__keyword\">if<\/span>(i &gt; j) {<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;grid.circle(x = x, y = y, r = <span class=\"code-snippet__built_in\">abs<\/span>(cor_mat[i, j])\/<span class=\"code-snippet__number\">2<\/span> * min(unit.c(width, height)), <\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;gp = gpar(fill = col_fun(cor_mat[i, j]), col = NA))<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;} <span class=\"code-snippet__keyword\">else<\/span> {<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;grid.text(<span class=\"code-snippet__built_in\">sprintf<\/span>(<span class=\"code-snippet__string\">\"%.1f\"<\/span>, cor_mat[i, j]), x, y, gp = gpar(fontsize = <span class=\"code-snippet__number\">10<\/span>))<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp;}, cluster_rows = FALSE, cluster_columns = FALSE,<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp;show_row_names = FALSE, show_column_names = FALSE)<\/span><\/code><\/pre>\n<\/section>\n<section style=\"text-align: center;margin-top: 10px;margin-bottom: 10px;line-height: 0;\" powered-by=\"xiumi.us\">\n<section style=\"vertical-align: middle;display: inline-block;line-height: 0;\"><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"1.0091743119266054\" data-s=\"300,640\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/06\/9_B0UMStRZRofTVW8GCiap8nMZICgqgQ.png?w=640\" onerror=\"this.src='https:\/\/mmbiz.qpic.cn\/sz_mmbiz_png\/2wJ7bWfS0QsK3bt5BgR7soicwrXZEfsLPmS26qLf2WwCfuNKicJgNaqnnpIB0UMStRZRofTVW8GCiap8nMZICgqgQ\/640?wx_fmt=png'\" data-type=\"png\" data-w=\"654\" style=\"vertical-align: middle;width: 100%;height: auto !important;\" data-recalc-dims=\"1\"><\/section>\n<\/section>\n<section style=\"line-height: 1.8;letter-spacing: 1.5px;\" powered-by=\"xiumi.us\">\n<p style=\"white-space: normal;\">\u662f\u4e0d\u662f\u5f88\u795e\u5947\uff0c\u4e0d\u9700\u8981corrplot\u5305\u5c31\u7ed8\u5236\u51fa\u7c7b\u4f3c\u7684\u56fe<\/p>\n<p style=\"white-space: normal;\"><br  \/><\/p>\n<\/section>\n<section style=\"margin: 10px 0%;text-align: left;justify-content: flex-start;display: flex;flex-flow: row;\" powered-by=\"xiumi.us\">\n<section style=\"display: inline-block;width: auto;vertical-align: top;border-left: 5px solid rgb(242, 203, 203);border-bottom-left-radius: 0px;padding-left: 9px;min-width: 10%;flex: 0 0 auto;height: auto;align-self: flex-start;\">\n<section style=\"margin: 2px 0%;\" powered-by=\"xiumi.us\">\n<section style=\"color: rgb(110, 75, 36);line-height: 1.3;text-align: justify;letter-spacing: 1px;\">\n<p style=\"white-space: normal;\"><strong>\u6211\u4eec\u5728\u70ed\u56fe\u4e0a\u6dfb\u52a0\u56fe\u5c42<\/strong><\/p>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"c\"><code><span class=\"code-snippet_outer\">eatmap(small_mat, name = <span class=\"code-snippet__string\">\"mat\"<\/span>, col = col_fun,<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp;row_km = <span class=\"code-snippet__number\">2<\/span>, column_km = <span class=\"code-snippet__number\">2<\/span>,<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp;layer_fun = function(j, i, x, y, width, height, fill, slice_r, slice_c) {<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;v = pindex(small_mat, i, j)<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;grid.text(<span class=\"code-snippet__built_in\">sprintf<\/span>(<span class=\"code-snippet__string\">\"%.1f\"<\/span>, v), x, y, gp = gpar(fontsize = <span class=\"code-snippet__number\">10<\/span>))<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class=\"code-snippet__keyword\">if<\/span>(slice_r != slice_c) {<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;grid.rect(gp = gpar(lwd = <span class=\"code-snippet__number\">2<\/span>, fill = <span class=\"code-snippet__string\">\"transparent\"<\/span>))<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp;})<\/span><\/code><\/pre>\n<\/section>\n<section style=\"text-align: center;margin-top: 10px;margin-bottom: 10px;line-height: 0;\" powered-by=\"xiumi.us\">\n<section style=\"vertical-align: middle;display: inline-block;line-height: 0;\"><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"1.0384615384615385\" data-s=\"300,640\" src=\"\u56fe\u7247\/\u751f\u4fe1\u679c_2023-09-11_\u300c\u8f6c\u300d\u5c0f\u56fe\u6559\u4f60\u7ed8\u5236\u9ad8\u5927\u4e0a\u7684\u70ed\u56fe\uff01R\u5305ComplexHeatmap\u70ed\u56fe\u795e\u5668\u7684\u4f7f\u7528\uff01\uff01\uff01\/10_lR6PqDslZCTdF7AMZAnHR2ZUF2Sypw.png\" onerror=\"this.src='https:\/\/mmbiz.qpic.cn\/sz_mmbiz_png\/2wJ7bWfS0QsK3bt5BgR7soicwrXZEfsLPAVjPposFgm4J8o6BxiaMmAZKllR6PqDslZCTdF7AMZAnHR2ZUF2Sypw\/640?wx_fmt=png'\" data-type=\"png\" data-w=\"650\" style=\"vertical-align: middle;width: 100%;height: auto !important;\"><\/section>\n<\/section>\n<section style=\"line-height: 1.8;letter-spacing: 1.5px;\" powered-by=\"xiumi.us\">\n<p style=\"white-space: normal;\">\u8fd9\u4e2a\u5c31\u6709\u70b9\u7c7b\u4f3c\u5206\u7ec4\u3002<\/p>\n<p style=\"white-space: normal;\"><br  \/><\/p>\n<\/section>\n<section style=\"margin: 10px 0%;text-align: left;justify-content: flex-start;display: flex;flex-flow: row;\" powered-by=\"xiumi.us\">\n<section style=\"display: inline-block;width: auto;vertical-align: top;border-left: 5px solid rgb(242, 203, 203);border-bottom-left-radius: 0px;padding-left: 9px;min-width: 10%;flex: 0 0 auto;height: auto;align-self: flex-start;\">\n<section style=\"margin: 2px 0%;\" powered-by=\"xiumi.us\">\n<section style=\"color: rgb(110, 75, 36);line-height: 1.5;text-align: justify;letter-spacing: 1px;\">\n<p style=\"white-space: normal;\"><strong>\u4e0d\u8fc7\u8fd8\u6709\u4e00\u79cd\u65b9\u5f0f\u53bb\u81ea\u5b9a\u4e49\u53c2\u6570\u56fe\u5c42\uff0c\u5c31\u662flayer_fun\u51fd\u6570\u53ef\u4ee5\u81ea\u5b9a\u4e49\u56fe\u5c42\u51fd\u6570\uff0c\u6211\u4eec\u770b\u4e00\u4e0b\u6548\u679c\uff1a<\/strong><\/p>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<section class=\"code-snippet__fix code-snippet__js\">\n<ul class=\"code-snippet__line-index code-snippet__js\">\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<\/ul>\n<pre class=\"code-snippet__js\" data-lang=\"c\"><code><span class=\"code-snippet_outer\">Heatmap(small_mat, name = <span class=\"code-snippet__string\">\"mat\"<\/span>, col = col_fun,<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp;row_km = <span class=\"code-snippet__number\">2<\/span>, column_km = <span class=\"code-snippet__number\">2<\/span>,<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp;layer_fun = function(j, i, x, y, w, h, fill) {<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;# restore_matrix() is explained after <span class=\"code-snippet__keyword\">this<\/span> chunk of code<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ind_mat = restore_matrix(j, i, x, y)<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class=\"code-snippet__keyword\">for<\/span>(ir in seq_len(nrow(ind_mat))) {<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class=\"code-snippet__meta\"># start from the second column<\/span><\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class=\"code-snippet__keyword\">for<\/span>(ic in seq_len(ncol(ind_mat))[<span class=\"code-snippet__number\">-1<\/span>]) {<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ind1 = ind_mat[ir, ic<span class=\"code-snippet__number\">-1<\/span>] <span class=\"code-snippet__meta\"># previous column<\/span><\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ind2 = ind_mat[ir, ic] &nbsp; <span class=\"code-snippet__meta\"># current column<\/span><\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;v1 = small_mat[i[ind1], j[ind1]]<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;v2 = small_mat[i[ind2], j[ind2]]<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class=\"code-snippet__keyword\">if<\/span>(v1 * v2 &gt; <span class=\"code-snippet__number\">0<\/span>) { <span class=\"code-snippet__meta\"># <span class=\"code-snippet__meta-keyword\">if<\/span> they have the same sign<\/span><\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;col = ifelse(v1 &gt; <span class=\"code-snippet__number\">0<\/span>, <span class=\"code-snippet__string\">\"darkred\"<\/span>, <span class=\"code-snippet__string\">\"darkgreen\"<\/span>)<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;grid.segments(x[ind1], y[ind1], x[ind2], y[ind2],<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;gp = gpar(col = col, lwd = <span class=\"code-snippet__number\">2<\/span>))<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;grid.points(x[c(ind1, ind2)], y[c(ind1, ind2)], <\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pch = <span class=\"code-snippet__number\">16<\/span>, gp = gpar(col = col), size = unit(<span class=\"code-snippet__number\">4<\/span>, <span class=\"code-snippet__string\">\"mm\"<\/span>))<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<\/span><\/code><code><span class=\"code-snippet_outer\"> &nbsp; &nbsp; &nbsp; &nbsp;}<\/span><\/code><code><span class=\"code-snippet_outer\">)<\/span><\/code><\/pre>\n<\/section>\n<section style=\"text-align: center;margin-top: 10px;margin-bottom: 10px;line-height: 0;\" powered-by=\"xiumi.us\">\n<section style=\"vertical-align: middle;display: inline-block;line-height: 0;\"><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"1.0153846153846153\" data-s=\"300,640\" src=\"https:\/\/i0.wp.com\/www.biocloudservice.com\/wordpress\/wp-content\/uploads\/2024\/06\/11_DsQDJLSeLg8ACwBr6asoj7lfoqnwEg.png?w=640\" onerror=\"this.src='https:\/\/mmbiz.qpic.cn\/sz_mmbiz_png\/2wJ7bWfS0QsK3bt5BgR7soicwrXZEfsLP6Pl6ocNdob8GK80icib9sEYJKbDsQDJLSeLg8ACwBr6asoj7lfoqnwEg\/640?wx_fmt=png'\" data-type=\"png\" data-w=\"650\" style=\"vertical-align: middle;width: 100%;height: auto !important;\" data-recalc-dims=\"1\"><\/section>\n<\/section>\n<section style=\"line-height: 1.8;letter-spacing: 1.5px;\" powered-by=\"xiumi.us\">\n<p style=\"white-space: normal;\">\u8fd9\u4e2a\u5c31\u5f88\u795e\u5947\u4e86\uff0c\u8fd9\u4e2a\u5c31\u662f\u5728\u70ed\u56fe\u5207\u7247\u4e2d\u7684\u5355\u5143\u683c\u4e4b\u95f4\u8fdb\u884c\u4ea4\u4e92\u3002\u5728\u5bf9\u4e8e\u70ed\u56fe\u4e2d\u7684\u6bcf\u4e00\u884c\uff0c\u5982\u679c\u76f8\u90bb\u4e24\u5217\u4e2d\u7684\u503c\u5177\u6709\u76f8\u540c\u7684\u7b26\u53f7\uff0c\u6211\u4eec\u6839\u636e\u4e24\u4e2a\u503c\u7684\u7b26\u53f7\u6dfb\u52a0\u4e00\u6761\u7ea2\u7ebf\u6216\u4e00\u6761\u7eff\u7ebf\u3002\u7531\u4e8e\u73b0\u5728\u5355\u5143\u683c\u4e2d\u7684\u56fe\u5f62\u4f9d\u8d56\u4e8e\u5176\u4ed6\u5355\u5143\u683c\uff0c\u8fd9\u4e2a\u529f\u80fd\u503c\u80fd\u901a\u8fc7layer_fun\u51fd\u6570\u53bb\u5b9e\u73b0\u3002<\/p>\n<\/section>\n<p style=\"white-space: normal;\" powered-by=\"xiumi.us\"><br  \/><\/p>\n<section style=\"text-align: left;justify-content: flex-start;display: flex;flex-flow: row;margin-bottom: 10px;\" powered-by=\"xiumi.us\">\n<section style=\"display: inline-block;width: 100%;vertical-align: top;align-self: flex-start;flex: 0 0 auto;border-style: solid;border-width: 1px;border-color: rgb(176, 176, 176);padding: 7px;\">\n<section style=\"justify-content: flex-start;display: flex;flex-flow: row;\" powered-by=\"xiumi.us\">\n<section style=\"display: inline-block;width: 100%;vertical-align: top;align-self: flex-start;flex: 0 0 auto;background-color: rgba(249, 238, 237, 0.5);padding: 18px;\">\n<section style=\"\" powered-by=\"xiumi.us\">\n<section style=\"text-align: justify;font-size: 14px;letter-spacing: 2px;line-height: 1.8;\">\n<p style=\"white-space: normal;\">\u4e0a\u8ff0\u5c31\u662f\u70ed\u56fe\u7684\u7ed8\u5236\uff0c\u5c0f\u4f19\u4f34\u6709\u6ca1\u6709\u5b66\u4f1a\u5462\uff0c\u8fd9\u51e0\u79cd\u70ed\u56fe\u5f62\u5f0f\u54ea\u4e00\u79cd\u624d\u662f\u4f60\u7684\u559c\u6b22\uff0c\u5c0f\u4f19\u4f34\u8981\u6ce8\u610f\u591a\u591a\u7406\u89e3\u4ee3\u7801\u7684\u610f\u4e49\uff0c\u624d\u80fd\u7ed8\u5236\u51fa\u81ea\u5df1\u60f3\u8981\u7684\u56fe\u7247\u3002<\/p>\n<p style=\"white-space: normal;\"><br  \/><\/p>\n<\/section>\n<\/section>\n<section style=\"text-align: justify;font-size: 14px;\" powered-by=\"xiumi.us\">\n<p style=\"white-space: normal;\">\u6b22\u8fce\u4f7f\u7528\uff1a\u4e91\u751f\u4fe1\u5e73\u53f0 ( http:\/\/www.biocloudservice.com\/home.html)<\/p>\n<\/section>\n<section style=\"transform: scale(0.5);transform-origin: center center;margin-top: -65px;margin-bottom: -65px;\" powered-by=\"xiumi.us\">\n<section style=\"text-align: center;margin-top: 10px;margin-bottom: 10px;line-height: 0;\">\n<section style=\"vertical-align: middle;display: inline-block;line-height: 0;\"><img decoding=\"async\" class=\"rich_pages wxw-img\" data-ratio=\"1\" data-s=\"300,640\" src=\"\u56fe\u7247\/\u751f\u4fe1\u679c_2023-09-11_\u300c\u8f6c\u300d\u5c0f\u56fe\u6559\u4f60\u7ed8\u5236\u9ad8\u5927\u4e0a\u7684\u70ed\u56fe\uff01R\u5305ComplexHeatmap\u70ed\u56fe\u795e\u5668\u7684\u4f7f\u7528\uff01\uff01\uff01\/12_Bk8Hn3YR4fTn9nt5mVpJIe1diadCeg.jpg\" onerror=\"this.src='https:\/\/mmbiz.qpic.cn\/sz_mmbiz_jpg\/2wJ7bWfS0QsK3bt5BgR7soicwrXZEfsLPvsZ1NLJNWSg52AMibMuT2an6eXBk8Hn3YR4fTn9nt5mVpJIe1diadCeg\/640?wx_fmt=jpeg'\" data-type=\"jpeg\" data-w=\"258\" style=\"vertical-align: middle;width: 100%;height: auto !important;\"><\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<\/section>\n<section style=\"min-height: 40px;margin: 10px 0%;\" powered-by=\"xiumi.us\">\n<section style=\"width: 100%;margin-right: auto;margin-bottom: -10px;margin-left: auto;\">\n<table width=\"100%\">\n<tbody>\n<tr opera-tn-ra-comp=\"_$.pages:0.layers:0.comps:49.classicTable1:0\" powered-by=\"xiumi.us\">\n<td colspan=\"1\" rowspan=\"1\" opera-tn-ra-cell=\"_$.pages:0.layers:0.comps:49.classicTable1:0.td@@0\" style=\"border-color: rgb(62, 62, 62);border-style: none;background-color: rgb(249, 174, 165);padding: 10px 0px;\" width=\"96.3700%\">\n<section style=\"line-height: 1;text-align: center;font-size: 17px;color: rgb(255, 255, 255);letter-spacing: 5px;\" powered-by=\"xiumi.us\">\n<p><strong>\u5f80\u671f\u63a8\u8350<\/strong><\/p>\n<\/section>\n<\/td>\n<\/tr>\n<tr opera-tn-ra-comp=\"_$.pages:0.layers:0.comps:49.classicTable1:1\" powered-by=\"xiumi.us\">\n<td colspan=\"1\" rowspan=\"1\" opera-tn-ra-cell=\"_$.pages:0.layers:0.comps:49.classicTable1:1.td@@0\" style=\"border-top: 0px none rgb(62, 62, 62);border-right: 0px none rgb(62, 62, 62);border-left: 0px none rgb(62, 62, 62);border-bottom-color: rgb(202, 198, 198);border-bottom-style: dashed;background-color: rgb(247, 247, 247);padding-right: 5px;padding-left: 5px;\" width=\"96.3700%\">\n<section style=\"text-align: center;justify-content: center;display: flex;flex-flow: row;\" powered-by=\"xiumi.us\">\n<section style=\"display: inline-block;width: 100%;vertical-align: middle;border-width: 0px;align-self: center;flex: 0 0 auto;\">\n<section style=\"font-size: 14px;letter-spacing: 1px;\" powered-by=\"xiumi.us\">\n<p><a target=\"_blank\" href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzkxODUxNDgzNA==&amp;mid=2247484863&amp;idx=1&amp;sn=28a92146a8b2f04d0d5dc32bed20b527&amp;chksm=c1b17842f6c6f154ac96a34752f22788d3ea4bf52a009dc72bd61f23b56b74a89eb72355e4d8&amp;scene=21#wechat_redirect\" textvalue=\"\u5b5f\u5fb7\u5c14\u968f\u673a\u5316\u2014\u5982\u4f55\u4f7f\u7528GWAS summary\u6570\u636e\u5e93\" linktype=\"text\" imgurl=\"\" imgdata=\"null\" data-itemshowtype=\"0\" tab=\"innerlink\" data-linktype=\"2\" rel=\"noopener\">\u5b5f\u5fb7\u5c14\u968f\u673a\u5316\u2014\u5982\u4f55\u4f7f\u7528GWAS summary\u6570\u636e\u5e93<\/a><\/p>\n<\/section>\n<\/section>\n<\/section>\n<\/td>\n<\/tr>\n<tr opera-tn-ra-comp=\"_$.pages:0.layers:0.comps:49.classicTable1:2\" powered-by=\"xiumi.us\">\n<td colspan=\"1\" rowspan=\"1\" opera-tn-ra-cell=\"_$.pages:0.layers:0.comps:49.classicTable1:2.td@@0\" style=\"border-top: 0px none rgb(62, 62, 62);border-right: 0px none rgb(62, 62, 62);border-left: 0px none rgb(62, 62, 62);border-bottom-color: rgb(202, 198, 198);border-bottom-style: dashed;background-color: rgb(247, 247, 247);padding-right: 5px;padding-left: 5px;\" width=\"96.3700%\">\n<section style=\"text-align: center;justify-content: center;display: flex;flex-flow: row;\" powered-by=\"xiumi.us\">\n<section style=\"display: inline-block;width: 100%;vertical-align: middle;border-width: 0px;align-self: center;flex: 0 0 auto;\">\n<section style=\"font-size: 14px;letter-spacing: 1px;\" powered-by=\"xiumi.us\">\n<p><a target=\"_blank\" href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzkxODUxNDgzNA==&amp;mid=2247484862&amp;idx=1&amp;sn=1b340dcdd7b13099951666fd6be2e017&amp;chksm=c1b17843f6c6f155f7c2e8a64a4761a066e4e4deb7e9c39ebf938452f6d03ee21a6a4339f2c7&amp;scene=21#wechat_redirect\" textvalue=\"\u8d85\u8be6\u7ec6\uff0c\u5c0f\u56fe\u5e26\u4f60\u7528beeswarm\u753b\u4f18\u96c5\u7684\u6563\u70b9\u871c\u8702\u56fe\u5206\u6790\u57fa\u56e0\u4e0e\u4e34\u5e8a\u76f8\u5173\u6027\" linktype=\"text\" imgurl=\"\" imgdata=\"null\" data-itemshowtype=\"0\" tab=\"innerlink\" data-linktype=\"2\" rel=\"noopener\">\u8d85\u8be6\u7ec6\uff0c\u5c0f\u56fe\u5e26\u4f60\u7528beeswarm\u753b\u4f18\u96c5\u7684\u6563\u70b9\u871c\u8702\u56fe\u5206\u6790\u57fa\u56e0\u4e0e\u4e34\u5e8a\u76f8\u5173\u6027<\/a><\/p>\n<\/section>\n<\/section>\n<\/section>\n<\/td>\n<\/tr>\n<tr opera-tn-ra-comp=\"_$.pages:0.layers:0.comps:49.classicTable1:3\" powered-by=\"xiumi.us\">\n<td colspan=\"1\" rowspan=\"1\" opera-tn-ra-cell=\"_$.pages:0.layers:0.comps:49.classicTable1:3.td@@0\" style=\"border-top: 0px none rgb(62, 62, 62);border-right: 0px none rgb(62, 62, 62);border-left: 0px none rgb(62, 62, 62);border-bottom-color: rgb(202, 198, 198);border-bottom-style: dashed;background-color: rgb(247, 247, 247);padding-right: 5px;padding-left: 5px;\" width=\"96.3700%\">\n<section style=\"text-align: center;justify-content: center;display: flex;flex-flow: row;\" powered-by=\"xiumi.us\">\n<section style=\"display: inline-block;width: 100%;vertical-align: middle;border-width: 0px;align-self: center;flex: 0 0 auto;\">\n<section style=\"font-size: 14px;letter-spacing: 1px;\" powered-by=\"xiumi.us\">\n<p><a target=\"_blank\" href=\"http:\/\/mp.weixin.qq.com\/s?__biz=MzkxODUxNDgzNA==&amp;mid=2247484842&amp;idx=1&amp;sn=31983adde6a9dbeca752145768349898&amp;chksm=c1b17857f6c6f1411f96f6ba84709b47f8a015024df1bfa821da455ad202c672f60a3226cf1b&amp;scene=21#wechat_redirect\" textvalue=\"\u542c\u8bf4\u4f60\u8fd8\u5728\u56f0\u60d1SCI\u914d\u8272\u95ee\u9898\uff1f\u5c0f\u56fe\u4e00\u6587\u8ba9\u4f60\u5b66\u4f1aSCI\u9876\u520a\u7684\u914d\u8272\u65b9\u6848\uff01\uff01\uff01\" linktype=\"text\" imgurl=\"\" imgdata=\"null\" data-itemshowtype=\"0\" tab=\"innerlink\" data-linktype=\"2\" rel=\"noopener\">\u542c\u8bf4\u4f60\u8fd8\u5728\u56f0\u60d1SCI\u914d\u8272\u95ee\u9898\uff1f\u5c0f\u56fe\u4e00\u6587\u8ba9\u4f60\u5b66\u4f1aSCI\u9876\u520a\u7684\u914d\u8272\u65b9\u6848\uff01\uff01\uff01<\/a><\/p>\n<\/section>\n<\/section>\n<\/section>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/section>\n<\/section>\n<p style=\"white-space: normal;\" powered-by=\"xiumi.us\"><br  \/><\/p>\n<p style=\"white-space: normal;\" powered-by=\"xiumi.us\">\ud83d\udc47\u70b9\u51fb\u9605\u8bfb\u539f\u6587\u8fdb\u5165\u7f51\u5740<\/p>\n<\/section>\n<p style=\"display: none;margin-bottom: 24px;\"><mp-style-type data-value=\"3\"><\/mp-style-type><\/p>\n<div class=\"msg_source_url\"><a href=\"http:\/\/www.biocloudservice.com\/home.html\" target=\"_blank\" rel=\"noopener\">\u9605\u8bfb\u539f\u6587<\/a><\/div>\n<p><\/content><\/p>\n<div class=\"msg_source_url\"><a href=\"http:\/\/www.biocloudservice.com\/home.html\" target=\"_blank\" rel=\"noopener\">\u9605\u8bfb\u539f\u6587<\/a><\/div>\n<\/div>\n<p><\/body><br \/>\n<\/html><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5c0f\u56fe\u6559\u4f60\u7ed8\u5236\u9ad8\u5927\u4e0a\u7684\u70ed\u56fe\uff01R\u5305ComplexHeatmap\u70ed\u56fe\u795e\u5668\u7684\u4f7f\u7528\uff01\uff01\uff01 \u5c0f\u56fe&nbsp;&nbsp;\u751f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","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\/56354"}],"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=56354"}],"version-history":[{"count":1,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/56354\/revisions"}],"predecessor-version":[{"id":56368,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/56354\/revisions\/56368"}],"wp:attachment":[{"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=56354"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=56354"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.biocloudservice.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=56354"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}