From bfc51a8c822597967855f2645c2e29eae388f6b2 Mon Sep 17 00:00:00 2001 From: Rico Derks Date: Mon, 11 Oct 2021 09:56:28 +0200 Subject: [PATCH 1/4] Python version defined. --- omicser.Rproj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/omicser.Rproj b/omicser.Rproj index 270314b..2431d5e 100644 --- a/omicser.Rproj +++ b/omicser.Rproj @@ -19,3 +19,7 @@ BuildType: Package PackageUseDevtools: Yes PackageInstallArgs: --no-multiarch --with-keep.source PackageRoxygenize: rd,collate,namespace + +PythonType: conda +PythonVersion: 3.9.7 +PythonPath: ~/miniconda/envs/omxr/bin/python From 60651280ce54ae548087683ddbfa50283a7b4735 Mon Sep 17 00:00:00 2001 From: Rico Derks Date: Mon, 11 Oct 2021 11:59:42 +0200 Subject: [PATCH 2/4] Needed to run locally --- omicser_options.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 omicser_options.yml diff --git a/omicser_options.yml b/omicser_options.yml new file mode 100644 index 0000000..5f5fbd4 --- /dev/null +++ b/omicser_options.yml @@ -0,0 +1,6 @@ +database_names: + Domenico: domenico_stem_cell + Yassene: yassene_lipid + Schisto: schisto_lipids +db_root_path: /home/ricoderks/Documents/LUMC/Projects/omicser/inst/DB +conda_environment: omxr From ebaf857d911785cdbd135bacbb1f3cfbf5dff8f4 Mon Sep 17 00:00:00 2001 From: Rico Derks Date: Thu, 14 Oct 2021 14:34:59 +0200 Subject: [PATCH 3/4] checkbox for collapsing heatmap --- R/mod_pg_vis_raw.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/R/mod_pg_vis_raw.R b/R/mod_pg_vis_raw.R index 204d5dc..4b8ec2b 100644 --- a/R/mod_pg_vis_raw.R +++ b/R/mod_pg_vis_raw.R @@ -28,6 +28,8 @@ mod_pg_vis_raw_ui <- function(id){ ), hr(style = "border-top: 1px dashed grey;"), checkboxInput(ns("CB_scale"), "Scale values?", value = TRUE), + hr(style = "border-top: 1px dashed grey;"), + checkboxInput(ns("CB_collapse"), "Collapse heatmap?", value = FALSE), br() ), # End of column (6 space) From 787f5a9969306a466cbd55c858359386a4f143aa Mon Sep 17 00:00:00 2001 From: Rico Derks Date: Thu, 14 Oct 2021 14:42:47 +0200 Subject: [PATCH 4/4] Collapse the heatmap. --- R/mod_pg_vis_raw.R | 62 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 46 insertions(+), 16 deletions(-) diff --git a/R/mod_pg_vis_raw.R b/R/mod_pg_vis_raw.R index 4b8ec2b..7c03a91 100644 --- a/R/mod_pg_vis_raw.R +++ b/R/mod_pg_vis_raw.R @@ -267,22 +267,52 @@ mod_pg_vis_raw_server <- function(id, rv_data, rv_selections, heat_data){ #TODO: # -limit levels of clustering columns # - - ht <- ComplexHeatmap::Heatmap(in_mat, - cluster_rows = in_clust_row, - cluster_columns = in_clust_col, - column_split = grp_x, - #row_split = grp_y, - top_annotation = ha, - show_row_names = show_row_names, - right_annotation = ha2, - row_names_side = "right", - #row_names_side = "left", - row_names_gp = grid::gpar(fontsize = 7), - name = units_label, - column_title = x_title, - row_title = omics_title, - show_parent_dend_line = TRUE, - use_raster = FALSE) + if(input$CB_collapse) { + # collapse heatmap + # calculate the cluster for the rows + hc <- hclust(dist(in_mat, + method = "euclidian"), + method = "complete") + + # make heatmap with empty matrix + ht <- ComplexHeatmap::Heatmap(matrix(ncol = 0, + nrow = nrow(in_mat)), + cluster_rows = hc, + # cluster_columns = in_clust_col, + # column_split = grp_x, + #row_split = grp_y, + top_annotation = ha, + show_row_names = show_row_names, + right_annotation = ha2, + row_names_side = "right", + #row_names_side = "left", + row_names_gp = grid::gpar(fontsize = 7), + name = units_label, + column_title = x_title, + row_title = omics_title, + show_parent_dend_line = TRUE, + row_dend_reorder = FALSE, # Rico: this is needed to make sure ComplexHeatmap doesn't reorder the rows after clustering + use_raster = FALSE) + } else { + # show full heatmap + ht <- ComplexHeatmap::Heatmap(in_mat, + cluster_rows = in_clust_row, + cluster_columns = in_clust_col, + column_split = grp_x, + #row_split = grp_y, + top_annotation = ha, + show_row_names = show_row_names, + right_annotation = ha2, + row_names_side = "right", + #row_names_side = "left", + row_names_gp = grid::gpar(fontsize = 7), + name = units_label, + column_title = x_title, + row_title = omics_title, + show_parent_dend_line = TRUE, + row_dend_reorder = FALSE, # Rico: this is needed to make sure ComplexHeatmap doesn't reorder the rows after clustering + use_raster = FALSE) + } #top_annotation = HeatmapAnnotation(foo = anno_block(gp = gpar(fill = 2:4))), #