Создание блестящего приложения для данных Seurat scRNAseq - PullRequest
0 голосов
/ 18 марта 2020

Так что я пытаюсь загрузить несколько больших наборов данных с будущими / обещаниями, как я видел в https://community.rstudio.com/t/how-to-use-future-promises-to-read-rds-files-in-background-to-decrease-initial-loading-latency-in-ie11/12880, но я почти уверен, что делаю это неправильно. В настоящее время у меня очень медленная загрузка страницы, а затем появляются ошибки «подписи за пределами» для каждого из моих графиков. Почему? Понятия не имею Помощь оценена!

library(shiny)
library(Seurat)
library(shinyWidgets)
library(promises)
library(future)

plan(multisession)

promise_1 <- future(readRDS("data/sample1.rds"))

promise_2 <- future(readRDS("data/sample2.rds"))

promise_3 <- future(readRDS("data/sample3.rds"))

promise_4 <- future(readRDS("data/sample4.rds"))

promise_5 <- future(readRDS("data/sample5.rds"))

promise_6 <- future(readRDS("data/sample6.rds"))

promise_7 <- future(readRDS("data/sample7.rds"))

# Define UI for application
ui <- fluidPage(

    # Application title
    titlePanel("scRNAseq data browser"),

    fluidRow(
        column(4,

               sidebarPanel(
                   radioButtons("dataset", label = h3("Dataset"),
                                choices = list("sample1" = "promise_1", "sample3" = "promise_3", "sample2" = "promise_2", "sample4" = "promise_4", "sample6" = "promise_6", "sample5" = "promise_5", "sample7" = "promise_7"),
                                selected = "promise_1"),
                   helpText("Enter gene names in CAPS.  Gene names must be exact."),
                   textInput("gene2", label = "Gene Name", value = "GAPDH"),
                   textInput("gene3", label = "Gene Name", value = "GAPDH"),
                   textInput("gene4", label = "Gene Name", value = "GAPDH")

               )
        ),
        column(8,
               column(6, 
                      mainPanel(
                          plotOutput("dimPlot1", width = "150%"),
                          plotOutput("genePlot2", width = "150%")
                      )
               ),
               column(6,
                      mainPanel(
                          plotOutput("genePlot3", width = "150%"),
                          plotOutput("genePlot4", width = "150%")
                      )
               )
        )
    )
)


server <- function(input, output, session) {

    updateRadioButtons(session = session, inputId = "dataset", selected = "promise_1")

    output$dimPlot1 <- renderPlot({
        DimPlot(input$dataset, reduction = "umap", group.by = "ShortID", label = T, label.size = 4)
    })

    output$genePlot2 <- renderPlot({
        FeaturePlot(input$dataset, features = (input$gene2), reduction = "umap")
    })

    output$genePlot3 <- renderPlot({
        FeaturePlot(input$dataset, features = (input$gene3), reduction = "umap")
    })

    output$genePlot4 <- renderPlot({
        FeaturePlot(input$dataset, features = (input$gene4), reduction = "umap")
    })

#    output$res <- renderPrint({
#        input$search
#    })

}



# Run the application 
shinyApp(ui = ui, server = server)
...