Skip to content

Commit 459e685

Browse files
committed
Restored previous commit removing button from expression heatmap
1 parent b24ab80 commit 459e685

2 files changed

Lines changed: 8 additions & 13 deletions

File tree

R/DEsummaryFuns.R

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,13 @@ expression_heatmap <- function(
6060
top.annotation <- NULL
6161
}
6262
if (type != 'Z-score'){
63-
breaks <- seq(min(heatmat),
64-
max(heatmat),
65-
(max(heatmat) - min(heatmat))/9)
66-
colours = c("#FFFFFF",RColorBrewer::brewer.pal(n = 9, name = "YlOrRd"))
67-
}
68-
else {
69-
breaks <- seq(-3,3,6/9)
63+
breaks <- seq(min(heatmat), max(heatmat), (max(heatmat) - min(heatmat)) / 9)
64+
colours = c("#FFFFFF", RColorBrewer::brewer.pal(n = 9, name = "YlOrRd"))
65+
}else{
66+
breaks <- seq(-3, 3, 6 / 9)
7067
colours = rev(RColorBrewer::brewer.pal(n = 10, name = "RdBu"))
71-
heatmat[heatmat>3]<-3
72-
heatmat[heatmat<(-3)]<- (-3)
68+
heatmat[heatmat > 3] <- 3
69+
heatmat[heatmat < (-3)] <- (-3)
7370
}
7471
ComplexHeatmap::Heatmap(
7572
matrix = heatmat,

R/DEsummaryPanel.R

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ DEsummaryPanelUI <- function(id, metadata){
4646
selectInput(ns("geneName"), "Additional genes to include:", multiple = TRUE, choices = character(0)),
4747
div("\nIf no genes are selected in the DE panel or here then the top 50 DE genes are chosen.\n"),
4848
div(style="margin-bottom:10px"),
49-
actionButton(ns('goHeatmap'), label = 'Create heatmap'),
5049
textInput(ns('plotHeatmapFileName'), 'File name for heatmap plot download', value ='HeatmapPlot.png'),
5150
downloadButton(ns('downloadHeatmapPlot'), 'Download Heatmap Plot'),
5251

@@ -128,15 +127,14 @@ DEsummaryPanelServer <- function(id, expression.matrix, metadata, DEresults, ann
128127
dplyr::arrange(dplyr::across(input[['heatmap.annotations']]))
129128

130129
myplot <- expression_heatmap(
131-
expression.matrix.subset = subsetExpression[, meta[, 1]],
130+
expression.matrix.subset = subsetExpression[, meta[, 1], drop = FALSE],
132131
top.annotation.ids = match(input[['heatmap.annotations']], colnames(meta)),
133132
metadata = meta,
134133
type = input[["heatmap.processing"]],
135134
show.column.names = (nrow(meta) <= 20)
136135
)
137136
return(myplot)
138-
}) %>%
139-
bindEvent(DEresults(), input[['goHeatmap']])
137+
})
140138
output[['heatmap']] <- renderPlot(heatmap.plot(), height = 800)
141139

142140
output[['downloadHeatmapPlot']] <- downloadHandler(

0 commit comments

Comments
 (0)