Author: Alan O’Callaghan (alan.b.ocallaghan@gmail.com)

Introduction

Due to the size of the objects, this file is seperated to three fils. You can view this series in the following links:

This is file 3 in the series.

# Let's load the packages
library(heatmaply)
#> Loading required package: plotly
#> Loading required package: ggplot2
#> 
#> Attaching package: 'plotly'
#> The following object is masked from 'package:ggplot2':
#> 
#>     last_plot
#> The following object is masked from 'package:stats':
#> 
#>     filter
#> The following object is masked from 'package:graphics':
#> 
#>     layout
#> Loading required package: viridis
#> Loading required package: viridisLite
#> 
#> ---------------------
#> Welcome to heatmaply version 0.11.1
#> Type ?heatmaply for the main documentation.
#> The github page is: https://github.com/talgalili/heatmaply/
#> 
#> Suggestions and bug-reports can be submitted at: https://github.com/talgalili/heatmaply/issues
#> Or contact: <tal.galili@gmail.com>
#> 
#>  To suppress this message use:  suppressPackageStartupMessages(library(heatmaply))
#> ---------------------
library(heatmaplyExamples)

Visualization of voom-transformed data (median-centered data, PAM50 genes only)

Following normalization, gene expression patterns appear roughly similar. This indicates that relative expression levels have not been altered unduly. Furthermore, slightly increased concordance with the pre-assigned cluster labels is observed in normalized data. Samples appear to cluster based Sample-sample correlation appears to show less concordance with row annotations than clustering based on gene expression. However, the use of different linkage criteria or distance measures may alter the observed clusters.

pam50_genes <- intersect(pam50_genes, rownames(voomed_expression))

center_voom_mat <- voomed_expression[pam50_genes, ] - 
    apply(voomed_expression[pam50_genes, ], 1, median)

voom_max <- max(abs(center_voom_mat))
voom_limits <- c(-voom_max, voom_max)


heatmaply(t(center_voom_mat), 
    row_side_colors=tcga_brca_clinical,
    fontsize_col = 7.5,
    showticklabels = c(TRUE, FALSE),
    col = cool_warm(50),
    limits = voom_limits,
    main = 'Normalised, centred log2 CPM, PAM50 genes',
    plot_method = 'plotly')
heatmaply_cor(cor(center_voom_mat), 
    row_side_colors = tcga_brca_clinical,
    showticklabels = c(FALSE, FALSE),
    main = 'Sample-sample correlation based on centred, normalised PAM50 gene expression',
    plot_method = 'plotly')

Discussion

It may be useful when examining expression heatmaps to identify particularly high or low measures for a single gene in a group of patients, or a gene which shows unusually high or low variance. The mouse-over text available in the heatmaply package allows visual assessment of measures of interest and quick identification of samples or genes with unusual gene expression patterns. Similarly, visualizing correlation heatmaps with heatmaply allows the user to rapidly identify samples with unusually high or low pairwise correlation.

sessionInfo

sessionInfo()
#> R version 3.4.2 (2017-09-28)
#> Platform: x86_64-pc-linux-gnu (64-bit)
#> Running under: Ubuntu 16.04.3 LTS
#> 
#> Matrix products: default
#> BLAS: /usr/lib/openblas-base/libblas.so.3
#> LAPACK: /usr/lib/libopenblasp-r0.2.18.so
#> 
#> locale:
#>  [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C              
#>  [3] LC_TIME=en_GB.UTF-8        LC_COLLATE=en_GB.UTF-8    
#>  [5] LC_MONETARY=en_GB.UTF-8    LC_MESSAGES=en_GB.UTF-8   
#>  [7] LC_PAPER=en_GB.UTF-8       LC_NAME=C                 
#>  [9] LC_ADDRESS=C               LC_TELEPHONE=C            
#> [11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C       
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> other attached packages:
#> [1] heatmaplyExamples_0.2.0 heatmaply_0.11.1        viridis_0.4.0          
#> [4] viridisLite_0.2.0       plotly_4.7.1            ggplot2_2.2.1.9000     
#> [7] knitr_1.16             
#> 
#> loaded via a namespace (and not attached):
#>  [1] httr_1.3.1         tidyr_0.6.3        jsonlite_1.5      
#>  [4] foreach_1.4.3      gtools_3.5.0       shiny_1.0.5       
#>  [7] assertthat_0.2.0   stats4_3.4.2       yaml_2.1.14       
#> [10] robustbase_0.92-7  backports_1.1.0    lattice_0.20-35   
#> [13] glue_1.1.1         digest_0.6.12      RColorBrewer_1.1-2
#> [16] colorspace_1.3-2   htmltools_0.3.6    httpuv_1.3.5      
#> [19] plyr_1.8.4         pkgconfig_2.0.1    xtable_1.8-2      
#> [22] purrr_0.2.3        mvtnorm_1.0-6      scales_0.5.0.9000 
#> [25] gdata_2.18.0       whisker_0.3-2      tibble_1.3.4      
#> [28] nnet_7.3-12        lazyeval_0.2.0     mime_0.5          
#> [31] magrittr_1.5       mclust_5.3         evaluate_0.10.1   
#> [34] MASS_7.3-47        gplots_3.0.1       class_7.3-14      
#> [37] tools_3.4.2        registry_0.3       data.table_1.10.4 
#> [40] trimcluster_0.1-2  stringr_1.2.0      kernlab_0.9-25    
#> [43] munsell_0.4.3      cluster_2.0.6      fpc_2.1-10        
#> [46] bindrcpp_0.2       compiler_3.4.2     caTools_1.17.1    
#> [49] rlang_0.1.2.9000   grid_3.4.2         iterators_1.0.8   
#> [52] htmlwidgets_0.9    crosstalk_1.0.0    bitops_1.0-6      
#> [55] rmarkdown_1.6      gtable_0.2.0       codetools_0.2-15  
#> [58] flexmix_2.3-14     TSP_1.1-5          R6_2.2.2          
#> [61] seriation_1.2-2    gridExtra_2.2.1    prabclus_2.2-6    
#> [64] dplyr_0.7.2        bindr_0.1          rprojroot_1.2     
#> [67] KernSmooth_2.23-15 dendextend_1.5.2   modeltools_0.2-21 
#> [70] stringi_1.1.5      Rcpp_0.12.12       gclus_1.3.1       
#> [73] DEoptimR_1.0-8     diptest_0.75-7