Skip to content

Commit 4af8554

Browse files
committed
Removed button to create expression heatmap. Fixed typo in parameter name for expression_heatmap function
1 parent 894546d commit 4af8554

2 files changed

Lines changed: 10 additions & 15 deletions

File tree

R/DEsummaryFuns.R

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ expression_heatmap <- function(
2323
top.annotation.ids = NULL,
2424
metadata,
2525
type = c('Z-score', 'Log2 Expression', 'Expression'),
26-
show.columns.names = TRUE
26+
show.column.names = TRUE
2727
){
2828
heatmat <- as.matrix(expression.matrix.subset)
2929

3030
type <- type[1]
3131
heatmat <- rescale_matrix(heatmat, type)
32-
if(!show.columns.names){colnames(heatmat <- NULL)}
32+
if(!show.column.names){colnames(heatmat <- NULL)}
3333

3434
if(!is.null(top.annotation.ids)){
3535
qual.col.pals = dplyr::filter(RColorBrewer::brewer.pal.info, .data$category == 'qual')
@@ -57,16 +57,13 @@ expression_heatmap <- function(
5757
top.annotation <- NULL
5858
}
5959
if (type != 'Z-score'){
60-
breaks <- seq(min(heatmat),
61-
max(heatmat),
62-
(max(heatmat) - min(heatmat))/9)
63-
colours = c("#FFFFFF",RColorBrewer::brewer.pal(n = 9, name = "YlOrRd"))
64-
}
65-
else {
66-
breaks <- seq(-3,3,6/9)
60+
breaks <- seq(min(heatmat), max(heatmat), (max(heatmat) - min(heatmat)) / 9)
61+
colours = c("#FFFFFF", RColorBrewer::brewer.pal(n = 9, name = "YlOrRd"))
62+
}else{
63+
breaks <- seq(-3, 3, 6 / 9)
6764
colours = rev(RColorBrewer::brewer.pal(n = 10, name = "RdBu"))
68-
heatmat[heatmat>3]<-3
69-
heatmat[heatmat<(-3)]<- (-3)
65+
heatmat[heatmat > 3] <- 3
66+
heatmat[heatmat < (-3)] <- (-3)
7067
}
7168
ComplexHeatmap::Heatmap(
7269
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 = subsetExpression[, meta[, 1]],
130+
expression.matrix = 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)