@@ -28,8 +28,8 @@ DEsummaryPanelUI <- function(id, metadata){
2828 onStatus = FALSE
2929 ),
3030 checkboxInput(ns(" pca.show.labels" ), label = " Show sample labels" , value = FALSE ),
31- checkboxInput(ns(' pca.show.ellipses' ),label = " Show ellipses around groups" ,value = TRUE ),
32- textInput(ns(' plotPCAFileName' ), ' File name for PCA plot download' , value = ' PCAPlotDE.png' ),
31+ checkboxInput(ns(' pca.show.ellipses' ), label = " Show ellipses around groups" , value = TRUE ),
32+ textInput(ns(' plotPCAFileName' ), ' File name for PCA plot download' , value = ' PCAPlotDE.png' ),
3333 downloadButton(ns(' downloadPCAPlot' ), ' Download PCA Plot' ),
3434
3535 status = " info" ,
@@ -42,8 +42,7 @@ DEsummaryPanelUI <- function(id, metadata){
4242 radioButtons(ns(' heatmap.processing' ), label = " Heatmap values" ,
4343 choices = c(' Expression' ,' Log2 Expression' ,' Z-score' ),
4444 selected = ' Z-score' ),
45- shinyjqui :: orderInput(ns(' heatmap.annotations' ), label = " Show annotations" ,
46- items = colnames(metadata )[c(ncol(metadata ), seq_len(ncol(metadata ) - 1 ))][- 2 ]),
45+ shinyjqui :: orderInput(ns(' heatmap.annotations' ), label = " Show annotations" , items = colnames(metadata )),
4746 selectInput(ns(" geneName" ), " Additional genes to include:" , multiple = TRUE , choices = character (0 )),
4847 div(" \n If no genes are selected in the DE panel or here then the top 50 DE genes are chosen.\n " ),
4948 div(style = " margin-bottom:10px" ),
@@ -99,6 +98,16 @@ DEsummaryPanelServer <- function(id, expression.matrix, metadata, DEresults, ann
9998 })
10099 output [[' pca' ]] <- renderPlot(pca.plot())
101100
101+ observe({
102+ items <- colnames(metadata())
103+ include.exclude <- apply(metadata(), 2 , function (x ){
104+ l <- length(unique(x ))
105+ (l > 1 ) & (l < length(x ))
106+ })
107+ items <- colnames(metadata())[include.exclude ]
108+ items <- items [c(length(items ), seq_len(length(items ) - 1 ))]
109+ shinyjqui :: updateOrderInput(session , " heatmap.annotations" , items = items )
110+ })
102111 heatmap.plot <- reactive({
103112 selectedGenes = DEresults()$ selectedGenes()
104113 if (length(selectedGenes )){
@@ -122,7 +131,8 @@ DEsummaryPanelServer <- function(id, expression.matrix, metadata, DEresults, ann
122131 expression.matrix = subsetExpression [, meta [, 1 ]],
123132 top.annotation.ids = match(input [[' heatmap.annotations' ]], colnames(meta )),
124133 metadata = meta ,
125- type = input [[" heatmap.processing" ]]
134+ type = input [[" heatmap.processing" ]],
135+ show.column.names = (nrow(meta ) < = 20 )
126136 )
127137 return (myplot )
128138 }) %> %
0 commit comments