Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 48 additions & 16 deletions R/mod_pg_vis_raw.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -265,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))),
#
Expand Down
4 changes: 4 additions & 0 deletions omicser.Rproj
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 6 additions & 0 deletions omicser_options.yml
Original file line number Diff line number Diff line change
@@ -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