Question: shiny giving spurious data-analysis output in comparison to non-shiny environment
gravatar for chrisclarkson100
3.0 years ago by
European Union
chrisclarkson10070 wrote:

I am trying to implement analysis on cell types in a shiny app via a package-defined command that outputs a plot. This package defined command requires preliminary input from a separate command (one that specifies which specific columns in a given data matrix are to be assessed- these columns contain information about cell types).


uiactual <- dashboardPage( dashboardHeader(title="Project"),
[dashboard sidebar....] dashboardBody(tabItems( box(sliderInput(inputId="maximum_genes", label="Choose number genes per cell-type", value=15, min=5, max=15)), column(7, checkboxGroupInput("cell_choices", "choose cell types", colnames(IRIS), selected=c("Bcell-naïve", "CD4Tcell-N0","Monocyte-Day0", "NKcell-control", "Neutrophil-Resting"))), actionButton(inputId="choices", label="Update heatmap"), column(12,plotOutput("graph")) ) ) ) )


serveractual <- function(input, output) { dataInput<-eventReactive(input$choices, { tagData(IRIS[, input$cell_choices], max=input$maximum_genes) }) output$graph<-renderPlot({ package_defined_plot( data=data, dataTag=dataInput() ) }) }

See in the above code for server.R, the tagData command is the preliminary process that is required for output from package_defined_plot.

The point of this analysis is to check visually and numerically for a significant difference between the column specified cell types.

While the mechanism of analysis seems in no way impaired, for some reason the input (stored in function dataInput) is perturbed such that the output is completely different from what would be expected in a non-shiny environment. See below the significance values that accompany the heat maps that are output:

When I set the output of tagData equal to a variable "irisTag" as normal when not using shiny and impute irisTag as the dataTag argument in package_defined_plot- the output is normal.

But when the dataInput function is implemented it perturbs the data-handling somehow and gives incorrect significance results.

To see if this was due to the checkboxgroupInput that goes into dataInput(), gave the dataInput()normal arguments- but the same incorrect output still resulted.

Overall there is something wrong with the way that I am storing column-specific information within the shiny implemented dataInput(). While the output in shiny is consistent after multiple testing (i.e. it doesn't just randomly change), it is wrong.

UPDATE: The following gives the same incorrect output:

package_defined_plot( data=data, dataTag=tagData(IRIS[, c("Bcell-naïve", "CD4Tcell-N0","Monocyte-Day0", "NKcell-control", "Neutrophil-Resting")], max=input$maximum_genes)

However when I assign the tagData command to a variable outside of the shiny environment and then set that data tag argument equal to that variable the output is correct.

Can anyone tell me how I might rectify this?

significance cellcode shiny • 841 views
ADD COMMENTlink written 3.0 years ago by chrisclarkson10070
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 917 users visited in the last hour