Hi everyone,
I'm developing my first shiny app and it's working fine on my computer, but when I publish it on shinyapps.io it disconnects from server and stops working.
There isn't anything in the log and looking at the developper console on my browser, I could only find a code":4702, message.
After digging a little bit I managed to isolate the line inside my code with the problem.
It seems to be linked to the following call
BSgenome::getSeq()
Trying to figure out what was the problem with this function, I did this :
library(shiny)
library(BSgenome.Hsapiens.NCBI.GRCh38)
# Define UI for application that draws a histogram
ui <- fluidPage(
titlePanel("Bsgenome test"),
verbatimTextOutput("bs_text")
)
# Define server logic required to draw a histogram
server <- function(input, output) {
output$bs_text <- renderPrint(Biostrings::getSeq(BSgenome.Hsapiens.NCBI.GRCh38, names = "5"))
}
# Run the application
shinyApp(ui = ui, server = server)
I was a little bit suprised by the difference between the locale and online version of this code
On your local computer, if you just print Biostrings::getSeq(BSgenome.Hsapiens.NCBI.GRCh38, names = "5") not in a Shiny app, do you get a better result? I think the [48;5;249... is the ANSI to try and print with colors. That would happen if your terminal does not support {crayon}, or in other words, not a problem you need to worry about for now.
So I suspect the fact that you get an error on shinapps.io is unrelated to this difference in output. Is there a more explicit error message after the "code 4702"? Is it possible your Shiny app is running out of memory? Could you try a smaller genome?
You could try adding a few cat() to follow the App execution in the logs, and get a better idea of where exactly it fails (before getSeq() or when executing renderPrint()).