|
|
@@ -11,12 +11,12 @@ ui <- fluidPage(
|
|
|
|
navbarPage("Apps",
|
|
|
|
navbarPage("Apps",
|
|
|
|
tabPanel("Translation",
|
|
|
|
tabPanel("Translation",
|
|
|
|
sidebarPanel(
|
|
|
|
sidebarPanel(
|
|
|
|
fileInput("file1", "Sube fichero mfasta", multiple = FALSE),
|
|
|
|
fileInput("file1", "Upload file (fasta, csv or xlsx)", multiple = FALSE),
|
|
|
|
selectInput("spec", label = h3("Specie"),
|
|
|
|
selectInput("spec", label = h3("Specie"),
|
|
|
|
choices = list("Human" = 1, "E. Coli" = 2),
|
|
|
|
choices = list("Human" = 1, "E. Coli" = 2),
|
|
|
|
selected = 1),
|
|
|
|
selected = 1),
|
|
|
|
actionButton("but_an", "Analizar"),
|
|
|
|
actionButton("but_an", "Analize"),
|
|
|
|
selectInput("for_output", label = h3("Formato Output"),
|
|
|
|
selectInput("for_output", label = h3("Output Format"),
|
|
|
|
choices = list("fasta" = 1, "tabla" = 2),
|
|
|
|
choices = list("fasta" = 1, "tabla" = 2),
|
|
|
|
selected = 1),
|
|
|
|
selected = 1),
|
|
|
|
),
|
|
|
|
),
|
|
|
@@ -43,7 +43,17 @@ server <- function(input, output) {
|
|
|
|
|
|
|
|
|
|
|
|
observe({
|
|
|
|
observe({
|
|
|
|
if (!is.null(input$file1)){ # This ensures that the reading is only tried when File selected
|
|
|
|
if (!is.null(input$file1)){ # This ensures that the reading is only tried when File selected
|
|
|
|
obj$fasta<-read.fasta(input$file1$datapath)
|
|
|
|
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)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
@@ -65,7 +75,7 @@ server <- function(input, output) {
|
|
|
|
progress <- shiny::Progress$new(min=0, max=length(seqs))
|
|
|
|
progress <- shiny::Progress$new(min=0, max=length(seqs))
|
|
|
|
for (i in 1:length(seqs)){
|
|
|
|
for (i in 1:length(seqs)){
|
|
|
|
set.seed(123)
|
|
|
|
set.seed(123)
|
|
|
|
seqs_DNA<-c(seqsDNA<-reverse_translate(seqs[i],spec))
|
|
|
|
seqs_DNA<-c(seqs_DNA, reverse_translate(seqs[i],spec))
|
|
|
|
progress$set(message = "Reverse Translating", value = i)
|
|
|
|
progress$set(message = "Reverse Translating", value = i)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
progress$close()
|
|
|
|
progress$close()
|
|
|
@@ -86,7 +96,7 @@ server <- function(input, output) {
|
|
|
|
print(2)
|
|
|
|
print(2)
|
|
|
|
observeEvent(input$but_an, {revtrans()})
|
|
|
|
observeEvent(input$but_an, {revtrans()})
|
|
|
|
if (!is.null(obj$seqs)){
|
|
|
|
if (!is.null(obj$seqs)){
|
|
|
|
data.frame("Nombre"=obj$names, "Seqs"=obj$seqs)
|
|
|
|
data.frame("Name"=obj$names, "Seqs"=obj$seqs)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|