Skip to content

Commit

Permalink
catch if only one matrix is uplaoded; closes #421
Browse files Browse the repository at this point in the history
  • Loading branch information
LeaSeep committed Dec 19, 2024
1 parent 7ad0b54 commit 2cae00d
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion program/shinyApp/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,6 @@ server <- function(input,output,session){
)
},
error = function(e) {
browser()
# Handle errors specifically
output$DataMatrix_VI <- DT::renderDataTable({
DT::datatable(data = data.frame(Error = "Invalid data for display"))
Expand Down Expand Up @@ -950,6 +949,7 @@ server <- function(input,output,session){
fun_LogIt(
message = paste0("**DataInput** - Uploaded Omic Type: ", par_tmp[[session$token]]['omic_type'])
)

if(!(
# Is Precompiled data used?
(isTruthy(input$data_preDone) & uploaded_from() == "precompiled") |
Expand Down Expand Up @@ -1025,6 +1025,19 @@ server <- function(input,output,session){
par_tmp[[session$token]]['omic_type'] <<- input[[paste0("omic_type_", uploaded_from())]]
omic_type(input[[paste0("omic_type_", uploaded_from())]])
}
# catch if only one file is uploaded
if(uploaded_from() == "file_input"){
if(isTruthy(input$data_matrix1) & !isTruthy(input$data_sample_anno1) & !isTruthy(input$data_row_anno1)){
output$debug <- renderText({
"<font color=\"#FF0000\"><b>Upload failed, please check your input.</b></font>"
})
reset('data_matrix1')
reset('data_sample_anno1')
reset('data_row_anno1')

return(NULL)
}
}

req(
(isTruthy(input$data_preDone) & uploaded_from() == "precompiled") |
Expand Down

0 comments on commit 2cae00d

Please sign in to comment.