satijalab / seurat

R toolkit for single cell genomics
http://www.satijalab.org/seurat
Other
2.29k stars 916 forks source link

Deploying Shiny apps using Seurat library to shinyapps.io #2716

Closed dataMaster-Kris closed 4 years ago

dataMaster-Kris commented 4 years ago

Hi,

Given the recent trend of providing interactive web applications to explore scRNA-seq data with manuscripts, we made an app using R Shiny package. The app works fine locally but when I tried to deploy it on RStudio's shinyapps.io, it gave me the following error:

Error: Unhandled Exception: Child Task 702752924 failed: Error parsing manifest: Unable to determine package source for Bioconductor package Seurat: Repository must be specified

I have specified the Bioconductor repository using the method mentioned here. As I understand and also indicated in the linked StackOverflow question, Seurat is not on Bioconductor. I tried several ways to specify the repository for Seurat but failed.

Can you please advise?

Here is a minimal script to reproduce the error.

     library(shiny)
     library(Seurat)

        ui <- fluidPage(

       titlePanel("Old Faithful Geyser Data"),

      sidebarLayout(
         sidebarPanel(
               sliderInput("bins",
                 "Number of bins:",
                 min = 1,
                 max = 50,
                 value = 30)
            ),

             mainPanel(
             plotOutput("distPlot")
              )
            )
           )

        server <- function(input, output) {

         output$distPlot <- renderPlot({

         x    <- faithful[, 2] 
          bins <- seq(min(x), max(x), length.out = input$bins + 1)

          hist(x, breaks = bins, col = 'darkgray', border = 'white')
           })
        }

       shinyApp(ui = ui, server = server)

You can reproduce the error by trying to deploy it on shinyapps.io with a free account. It is caused by the requirement of Seurat library and goes away when Seurat is not required.

mojaveazure commented 4 years ago

Hi,

This is likely because we've added a biocViews tag to Seurat in an attempt to force R to install dependencies from Bioconductor in addition to CRAN. However, this seems to have caused more problems without actually solving the issue of depending on Bioconductor packages while being on CRAN.

As such, we've removed the Bioconductor dependencies and the biocViews tag on the latest development version of Seurat. Try using that version, if shinyapps.io allows you to use GitHub packages rather than CRAN ones, and let me know if that works. We don't yet have a timeline for when the next CRAN release will happen, fully removing biocViews from Seurat.

dataMaster-Kris commented 4 years ago

Thanks, it worked.

mzhibo commented 4 years ago

Hi, I recently started to have this issue again after updating R to 4 and Seurat. Although this time it is due to a different package: sctransform: Error: Unhandled Exception: Child Task 815775800 failed: Error parsing manifest: Unable to determine package source for Bioconductor package sctransform: Repository must be specified rsconnect::appDependencies() The output shows 145 sctransform 0.3.1 Bioconductor It looks like the appdependency has bioconductor for sctransfrom package but it is actually only on CRAN. This issue happens in this new version of Seurat. It worked fine before I updated R and seurat. packageVersion("Seurat") [1] ‘3.2.2.9008’ It worked fine when I switched back to the R3.6 and the old library. packageVersion("Seurat", lib.loc = "c:/Rpackages/3.6/") [1] ‘3.2.1’ Is it possible to change the sctransform source to CRAN?

ChristophH commented 4 years ago

This is a known issue in the current version of sctransform. See sctransform issue #72 for a discussion of the problem and a link to a solution.