CCICB / CRUX

Other
2 stars 1 forks source link

ShinyApps Surivival analysis breaking #21

Open selkamand opened 1 year ago

selkamand commented 1 year ago

Test with edge and multiple users

selkamand commented 1 year ago

Survival analysis timing out when using edge. Not replicable on MAC. Reported to also happen on local version of CRUX

selkamand commented 1 year ago

It happens on some macs too. Both in offline version and online version.

My guess it requires some sort of obscure system dependency to render the results (e.g. a particular font installed)

I can't reproduce it on any system I own (windows/mac/linux), which has made it really painful to debug. Will have to try dropping visualization and seeing if the bug dissapears

selkamand commented 10 months ago

Testing further, I'm suspecting the cause is the trycatch. When the error happens we see the message 1 but not message two. I'm wondering if the validate is not appropriate here. Maybe we should try forcing an error here and see if we can replicate the issue

     message('[1] Running maftools::survGroup')
      result = tryCatch(
        expr = { 
          maftools::survGroup(
            maf = maf(), 
            top = input$in_num_genes_to_include, 
            geneSetSize = input$in_num_geneset_size, 
            minSamples = input$in_num_minsamples, 
            time = column_time_to_event(), 
            Status = column_event_status()
          ) 
        },
        error = function(err){
          # I think this is throwing a problem on some devices
          validate(paste0("Couldn't run survival analysis. This usually means either the wrong `event` or `time` columns were selected, or these columns are formatted incorrectly. Please see the manual for examples. \nFull Error Message: ",as.character(err)))
        }
      )

      message('[2] Finished running maftools::survGroup')
selkamand commented 10 months ago

Note plots use col = "gray70" for abline, which is NOT web safe (see maftools::run_surv())

selkamand commented 10 months ago

Could reproduce on the following setup using browserling

image