...Hi, I coded a shiny App for analysis of two protein or DNA sequences similarities using DotPlot function in seqinr library. The app is opening perfectly but when i upload the fasta files for the analysis than rather than using file content for analysis, the app is using filepath name for similarities analysis. Please find the code below

Any kind of help will be greatly appreciated.

library(seqinr)
library(shiny)
library(Biostrings)
# User interface
ui <- fluidPage(
  titlePanel("Welcome to DotMatcher Plot App"),
  sidebarLayout(
    sidebarPanel (
      fileInput("protein1",
                label = "Choose a file",
                multiple = FALSE,
                accept =c( ".fasta")),
      fileInput( "protein2",
                 label = NULL,
                 multiple=FALSE,
                 accept =c("fasta"))
    ),
    # Outputs
    mainPanel(
      plotOutput(outputId = "plot")
    )
  )
)

# Server Function
server <- function(input, output) {
  seq1 <- reactive({
    req(s2c(paste(input$protein1, collapse = "")))})
  seq2 <- reactive({
    req(s2c(paste(input$protein2, collapse = "")))
  })

  output$plot <- renderPlot({

    print(seq1())
    print(seq2())


    dotPlot(seq1(), seq2())

  })

}
# App 
shinyApp(ui = ui, server = server)

0 Answers