<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ## correlation heatmap ### 應用場景 可以同時展示多個變量之間的相關關系,比如,同時展示10個基因直接的相關系數 ### correlation plot ```R library(ggcorrplot) # 準備數據 # 構建相關表達矩陣 get_lower_tri<-function(cormat){ cormat[upper.tri(cormat)] <- NA return(cormat) } # Get upper triangle of the correlation matrix get_upper_tri <- function(cormat){ cormat[lower.tri(cormat)]<- NA return(cormat) } # Reorder the correlation matrix reorder_cormat <- function(cormat){ # Use correlation between variables as distance dd <- as.dist((1-cormat)/2) hc <- hclust(dd) cormat <-cormat[hc$order, hc$order] } # 利用前面兩節中差異表達數據,選取10個基因的數據做展示 rt_cor <- t(rt_ht[20:30, ]) cormat <- round(cor(rt_cor), 2) ``` > cormat數據結構如下 ![cor_data_format](http://kancloud.nordata.cn/2018-12-30-074434.png) ```R svg(file = 'heatmap9.svg', width = 10, height = 6) ggcorrplot(cormat) dev.off() # 可以改變下顏色 svg(file = 'heatmap10.svg', width = 10, height = 6) ggcorrplot(cormat, hc.order = TRUE, outline.col = "white", colors = c("#6D9EC1", "white", "#E46726")) dev.off() # 可以按照相關系數排個序 svg(file = 'heatmap11.svg', width = 10, height = 6) ggcorrplot(cormat, hc.order = TRUE, outline.col = "white") dev.off() # 可以展示upper或者lower # 設置type參數 svg(file = 'heatmap12.svg', width = 10, height = 6) ggcorrplot(cormat, hc.order = TRUE, outline.col = "white", type = "lower") dev.off() # 可以加上相關系數的值 # lab = TRUE svg(file = 'heatmap12.svg', width = 10, height = 6) ggcorrplot(cormat, hc.order = TRUE, type = "lower", lab = TRUE) dev.off() # 也可以換種展示方式 # method = "circle" svg(file = 'heatmap14.svg', width = 10, height = 6) ggcorrplot(cormat, hc.order = TRUE, type = "lower", method = "circle") dev.off() ``` ![cor_heatmap](http://kancloud.nordata.cn/2018-12-30-074435.png)![cor_heatmap](http://kancloud.nordata.cn/2018-12-30-074436.png) ![cor_heatmap](http://kancloud.nordata.cn/2018-12-30-074437.png)![cor_heatmap](http://kancloud.nordata.cn/2018-12-30-074438.png) ![cor_heatmap](http://kancloud.nordata.cn/2018-12-30-074440.png)![cor_heatmap](http://kancloud.nordata.cn/2018-12-30-074441.png)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看