Soporte para input file de csv i xlsx, además de fasta.

This commit is contained in:
2022-07-13 13:01:27 +02:00
parent c868dc934d
commit e705417d75
+11 -1
View File
@@ -11,7 +11,7 @@ ui <- fluidPage(
navbarPage("Apps",
tabPanel("Translation",
sidebarPanel(
fileInput("file1", "Sube fichero mfasta", multiple = FALSE),
fileInput("file1", "Sube fichero (fasta, csv o xlsx)", multiple = FALSE),
selectInput("spec", label = h3("Specie"),
choices = list("Human" = 1, "E. Coli" = 2),
selected = 1),
@@ -43,8 +43,18 @@ server <- function(input, output) {
observe({
if (!is.null(input$file1)){ # This ensures that the reading is only tried when File selected
if (grepl(".xlsx", input$file1$datapath)){
file<-openxlsx::read.xlsx(input$file1$datapath)
obj$fasta<-dataframe2fas(file)
}else{
if (grepl(".csv", input$file1$datapath)){
file<-read.csv(input$file1$datapath)
obj$fasta<-dataframe2fas(file)
}else{
obj$fasta<-read.fasta(input$file1$datapath)
}
}
}
})
revtrans<-eventReactive(input$but_an, {