diff --git a/chromatoR/app.R b/chromatoR/app.R index 5a79ba7..dea8a66 100644 --- a/chromatoR/app.R +++ b/chromatoR/app.R @@ -34,7 +34,9 @@ ui <- fluidPage( sidebarPanel( numericInput("visStart", label="Inicio", value=0), numericInput("visWidth", label="Bases a mostrar", value=50), - actionButton("butvis", "Mostrar") + actionButton("butvis", "Mostrar"), + uiOutput('tabmin'), + uiOutput('tabmax') ), mainPanel( plotOutput("visor",width=1000), @@ -242,10 +244,22 @@ server <- function(input, output) { } }) + output$tabmin<-renderUI({ + if (!is.null(obj$seq) & input$old != ""){ + numericInput("tabmin_num", label = "Mínimo en tabla", value = 0) + } + }) + output$tabmax<-renderUI({ + if (!is.null(obj$seq) & input$old != ""){ + alignament<-msaClustalW(c("Reference"=toupper(input$old),"Predicted"=obj_ab@primarySeq %>% as.character), type="dna") + numericInput("tabmax_num", label = "Máximo en tabla", value = length((alignament@unmasked[2] %>% as.character() %>% strsplit(""))[[1]])) + } + }) + output$visTab <- renderTable({ observeEvent(obj$seq, {}) - if (!is.null(obj$seq) & input$old != ""){ + if (!is.null(obj$seq) & input$old != "" & !is.null(input$tabmin_num)){ print(3) alignament<-msaClustalW(c("Reference"=toupper(input$old),"Predicted"=obj_ab@primarySeq %>% as.character), type="dna") @@ -258,9 +272,10 @@ server <- function(input, output) { cons == T~"", TRUE~"?" )) - aln %>% filter(pred != "-") %>% add_column("PosChrom"=1:nrow(.)) %>% - merge(aln, all=T) %>% filter(cons == "?") %>% arrange(PosAln) + merge(aln, all=T) %>% arrange(PosAln) %>% add_column("PosChromAnterior"=c(NA,.$PosChrom[1:(nrow(.)-1)])) %>% + filter(cons == "?") %>% + filter(PosAln >= input$tabmin_num & PosAln <= input$tabmax_num) } })