Skip to content
Snippets Groups Projects
Unverified Commit 6e12b289 authored by Todor Kondic's avatar Todor Kondic
Browse files

app, shiny-ui-base, resources: Add controls for compound and set lists

* app (comp_list,set_list): New widgets.

* shiny-ui-base(comp_list_b,set_list_b): New observers.

(setid_b): Removed observer.
parent 020890b0
No related branches found
No related tags found
No related merge requests found
......@@ -276,3 +276,7 @@ SIGNF_RT <- 4
## Symbols to display T, or F
SYM_YES="\U002713"
SYM_NO="\U00274C"
CMPD_LIST_PATT <- "((*.csv)|(*.csv.gz))$"
SET_LIST_PATT <- CMPD_LIST_PATT
......@@ -1022,7 +1022,13 @@ mk_shinyscreen_server <- function(projects,init) {
updateSelectInput(session = session,
inputId = "comp_list",
choices = list.files(path=indir,
pattern = "*.csv$"))
pattern = CMPD_LIST_PATT))
updateSelectInput(session = session,
inputId = "set_list",
choices = list.files(path=indir,
pattern = SET_LIST_PATT))
updateSelectInput(session = session,
inputId = "indir_list",
selected = basename(indir),
......@@ -1043,12 +1049,21 @@ mk_shinyscreen_server <- function(projects,init) {
## })
observeEvent(input$comp_list_b, {
filters <- matrix(c("CSV files", ".csv",
"All files", "*"),
2, 2, byrow = TRUE)
compfiles <- tcltk::tk_choose.files(filters=filters)
message("(config) Selected compound lists: ", paste(compfiles,collapse = ","))
sels <- input$comp_list
req(isTruthy(sels))
compfiles <- file.path(rvs$m$conf$indir,sels)
message("(config) Selected compound lists: ", paste(sels,collapse = ","))
rvs$m$conf$compounds$lists <- if (length(compfiles)>0 && nchar(compfiles[[1]])>0) compfiles else "Nothing selected."
})
observeEvent(input$set_list_b, {
sels <- input$set_list
req(isTruthy(sels))
setfiles <- file.path(rvs$m$conf$indir,sels)
message("(config) Selected set lists: ", paste(sels,collapse = ","))
rvs$m$conf$compounds$sets <- if (length(setfiles)>0 && nchar(setfiles[[1]])>0) setfiles else "Nothing selected."
})
observeEvent(input$datafiles_b,{
......@@ -1071,15 +1086,6 @@ mk_shinyscreen_server <- function(projects,init) {
}
})
observeEvent(input$setid_b, {
filters <- matrix(c("CSV files", ".csv",
"All files", "*"),
2, 2, byrow = TRUE)
setids <- tcltk::tk_choose.files(filters=filters)
message("(config) Selected compound sets (setid): ", paste(setids,collapse = ","))
rvs$m$conf$compounds$sets <- if (length(setids)>0 && nchar(setids[[1]])>0) setids else "Nothing selected."
})
observe({
df_tab <- rf_get_inp_datafiles()
state <- rf_compound_input_state()
......@@ -1562,6 +1568,7 @@ mk_shinyscreen_server <- function(projects,init) {
allowInvalid=F)
})
output$comp_table <- DT::renderDataTable({
state <- rf_compound_input_state()
......@@ -1576,6 +1583,7 @@ mk_shinyscreen_server <- function(projects,init) {
scroller = T))
})
output$setid_table <- DT::renderDataTable({
state <- rf_compound_input_state()
......
......@@ -115,13 +115,18 @@ actionButton(inputId = "load_proj_b",
```
### Save project state
### Save project
```{r, echo=F}
actionButton(inputId = "save_proj_b",
label= "Save project")
```
### Select input directory
<details>
<summary>More on input directories</summary>
Blah.
</details>
```{r, echo=F}
selectInput('indir_list',
label = "Input directories",
......@@ -130,10 +135,29 @@ actionButton(inputId = "sel_indir_b",
label= "Select")
```
<details>
<summary>More on input directories</summary>
### Select compound lists
</details>
```{r, echo=FALSE}
selectInput('comp_list',
label = "Select compound lists",
multiple = T,
choices = "")
actionButton(inputId = "comp_list_b",
label= "Select")
```
### Select set lists
```{r, echo=FALSE}
selectInput('set_list',
label = "Select set lists",
multiple = T,
choices = "")
actionButton(inputId = "set_list_b",
label= "Select")
```
## Inputs
......@@ -173,17 +197,8 @@ scanning for completely unknown compounds is also supported by the
It is strongly recommended to quote SMILES, names and formulas in the
CSV file used with Shinyscreen.
</details>
```{r, echo=FALSE}
selectInput('comp_list',
label = "Select compound lists",
multiple = T,
choices = inputdirs)
actionButton(inputId = "comp_list_b",
label= "Compound list(s)")
```
`r htmlOutput("comp_lists")`
<!-- needs inv comma ... r htmlOutput("comp_lists")` -->
<details><summary>Load compound set list (_setid_ table)</summary>
The compound lists can contain more entries than is necessary. Using
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment