From 47583420aacf6267fa92bc2f1be4bcd329f6717f Mon Sep 17 00:00:00 2001 From: marcelcosta Date: Mon, 11 Jul 2022 14:23:36 +0200 Subject: [PATCH] =?UTF-8?q?Afegir=20butons=20per=20a=20definir=20m=C3=ADni?= =?UTF-8?q?m=20i=20m=C3=A0xim=20a=20la=20taula.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chromatoR/app.R | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) 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) } })