Compare commits

...

5 Commits

Author SHA1 Message Date
marcelcosta 4e30176b88 Error, siempre la misma secuencia. 2022-07-20 12:08:31 +02:00
marcelcosta e86ada3330 Typo. 2022-07-13 15:28:48 +02:00
marcelcosta 2359d6911d Etiquetes en anglès. 2022-07-13 15:27:25 +02:00
marcelcosta e705417d75 Soporte para input file de csv i xlsx, además de fasta. 2022-07-13 13:01:27 +02:00
marcelcosta c868dc934d Update 'README.md' 2022-07-12 16:04:47 +02:00
2 changed files with 19 additions and 6 deletions
+3
View File
@@ -0,0 +1,3 @@
# Revtrans
Paquet per a la traducció reversa de pèptid a DNA tenint en compte l'ús de codons específics.
+16 -6
View File
@@ -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)
} }
}) })