Skip to content

Commit f985626

Browse files
author
Baohong Zhang
committed
Set font sizes in Gene Set Heatmap
1 parent 895eb4a commit f985626

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

geneset.R

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,17 @@ genesetheatmap_out <- reactive({withProgress(message = 'Making heatmap...', valu
239239
subdatwide=subdatwide[row_SD!=0, ]
240240
#p <- pheatmap::pheatmap(as.matrix(subdatwide), scale = "row", color = colorpanel (64, low = "blue",mid = "white", high = "red"),filename=NA)
241241
scaled_data=t(scale(t(subdatwide))); scaled_data=pmin(scaled_data, 3); scaled_data=pmax(scaled_data, -3)
242-
p <- ComplexHeatmap::Heatmap(scaled_data, column_title = ID, cluster_columns =F, heatmap_legend_param = list(title = "Z Score", color_bar = "continuous") )
242+
p <- ComplexHeatmap::Heatmap(scaled_data,
243+
column_names_gp = gpar(fontsize = as.numeric(as.character(input$hxfontsize_gsh))),
244+
row_names_gp = gpar(fontsize = as.numeric(as.character(input$hyfontsize_gsh))),
245+
column_title_gp = gpar(fontsize = as.numeric(as.character(input$htfontsize_gsh))),
246+
heatmap_legend_param = list(
247+
title = "Z Score",
248+
color_bar = "continuous",
249+
title_gp = gpar(fontsize = as.numeric(as.character(input$hlfontsize_gsh))),
250+
labels_gp = gpar(fontsize = as.numeric(as.character(input$hlfontsize_gsh))-1)
251+
),
252+
column_title = ID, cluster_columns =F)
243253
return(p)
244254
})
245255
})

ui.R

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,11 @@ tabPanel("Gene Set Enrichment",
377377
selectInput("geneset_test5", label="5th Comparison", choices=NULL))
378378
),
379379
conditionalPanel("input.geneset_tabset=='Gene Set Heatmap'",
380-
radioButtons("gs_heatmap_label",label="Gene Label",inline = TRUE, choices=c("UniqueID", "Gene.Name"), selected="Gene.Name")),
380+
column(width=6,sliderInput("hxfontsize_gsh", "Column Font Size:", min = 2, max = 24, step = 1, value = 12)),
381+
column(width=6,sliderInput("hyfontsize_gsh", "Row Font Size:", min = 2, max = 24, step = 1, value = 12)),
382+
column(width=6,sliderInput("htfontsize_gsh", "Title Font Size:", min = 10, max = 32, step = 1, value = 14)),
383+
column(width=6,sliderInput("hlfontsize_gsh", "Legend Font Size:", min = 2, max = 20, step = 1, value = 10)),
384+
radioButtons("gs_heatmap_label",label="Gene Label",inline = TRUE, choices=c("UniqueID", "Gene.Name"), selected="Gene.Name")),
381385
conditionalPanel("input.geneset_tabset=='Gene Set Enrichment'",
382386
radioButtons("MSigDB", label= "MSigDB Collections",
383387
choices= c("KEGG Pathway" = "KEGG",
@@ -403,7 +407,7 @@ tabPanel("Gene Set Enrichment",
403407
tabsetPanel(id="geneset_tabset",
404408
tabPanel(title="Gene Set Enrichment", DT::dataTableOutput("MSigDB")),
405409
tabPanel(title="Gene Expression",textInput('x1', 'Row ID'), DT::dataTableOutput("Expression")),
406-
tabPanel(title="Gene Set Heat Map", textInput('x2', 'Row ID'), actionButton("genesetheatmap", "Save to output"), plotOutput('SetHeatMap', height="auto", width = 900)),
410+
tabPanel(title="Gene Set Heatmap", textInput('x2', 'Row ID'), actionButton("genesetheatmap", "Save to output"), plotOutput('SetHeatMap', height="auto", width = 900)),
407411
tabPanel(title="KEGG Pathway View", textInput('x3', 'Row ID'), actionButton("keggSave", "Save to output"),plotOutput('keggView')),
408412
tabPanel(title="Help", htmlOutput('help_geneset'))
409413
)

0 commit comments

Comments
 (0)