Skip to content

Commit

Permalink
improve instant UI
Browse files Browse the repository at this point in the history
  • Loading branch information
Miachol committed Aug 16, 2018
1 parent 6904fea commit a45b094
Show file tree
Hide file tree
Showing 11 changed files with 151 additions and 38 deletions.
2 changes: 2 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
2018-08-16 Li Jianfeng <[email protected]>

* add pubmed search tool
* add geoquery instant plugin
* improve instant spack and code plugins

2018-08-15 Li Jianfeng <[email protected]>

Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: BioInstaller
Title: Integrator of Bioinformatics Resources
Version: 0.3.5.4000
Version: 0.3.5.5000
Authors@R: person("Jianfeng", "Li", email = "[email protected]", role = c("aut", "cre"), comment = c(ORCID = "0000-0003-2349-208X"))
Maintainer: Jianfeng Li <[email protected]>
Description:
Expand Down
6 changes: 3 additions & 3 deletions inst/extdata/config/shiny/shiny.bioinstaller.parameters.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ rcmd_last = """
"""
progressbar_message = "Running BioInstaller functions."
render_id = "bioinstaller_bioinstaller_input_box"
render_id = "bioinstaller_input_box"

#!!!!! input_ui_order required related section
input_ui_order = ["single_input", "start_analysis"]
Expand All @@ -37,7 +37,7 @@ label = "Run"
section_type = "output"
rcmd_last = "BioInstaller::install.bioinfo(show.all.names = TRUE)[1:10]"
render_type = "shiny::renderPrint"
render_id = "bioinstaller_bioinstaller_output_text"
render_id = "bioinstaller_output_text"
output_type = "shiny::verbatimTextOutput"
progressbar_message = "BioInstaller bioinstaller_output_text"

Expand Down Expand Up @@ -77,6 +77,6 @@ if (object_type != "all") {
obj <- cbind(obj, resources_db)
"""
render_type = "DT::renderDataTable"
render_id = "bioinstaller_bioinstaller_output_table"
render_id = "bioinstaller_output_table"
output_type = "DT::dataTableOutput"
progressbar_message = "BioInstaller bioinstaller_output_table"
53 changes: 43 additions & 10 deletions inst/extdata/config/shiny/shiny.conda.parameters.toml
Original file line number Diff line number Diff line change
@@ -1,30 +1,63 @@
[conda.ui.sections]
order = ["readfiles", "outputFields"]
order = ["conda_input_box", "conda_output_box_text", "conda_output_box_table"]
[conda.ui.sections.ui_basic]
readfiles = "title = 'Input', status = 'primary', width = 12, collapsed = FALSE, collapsible = TRUE"
outputFields = "title = 'Output of conda', status = 'primary', width = 12, collapsed = FALSE, collapsible = TRUE"
conda_input_box = "title = 'Input', status = 'primary', width = 12, collapsed = FALSE, collapsible = TRUE"
conda_output_box_text = "title = 'Output of conda (Text)', status = 'primary', width = 12, collapsed = FALSE, collapsible = TRUE"
conda_output_box_table = "title = 'Output of conda (Table)', status = 'primary', width = 12, collapsed = FALSE, collapsible = TRUE"

[conda.paramters.readfiles]
[conda.paramters.conda_input_box]
# For reading annovarR shiny APP conda tool input files
section_type = "input"
rcmd_last = """
"""
progressbar_message = "Running conda functions."
render_id = "conda_readfiles"
render_id = "conda_input_box"

#!!!!! input_ui_order required related section
input_ui_order = ["start_analysis"]
input_ui_order = ["single_input", "start_analysis"]

[conda.paramters.readfiles.input.start_analysis]
[conda.paramters.conda_input_box.input.single_input]
title = "Parameters:"
title_control = "class = 'input-section-p'"
varname = ["conda_sub_cmd", "conda_env_name", "conda_params"]
input_id = ["input_conda_1", "input_conda_2", "input_conda_3"]
type = ["shiny::selectInput", "shiny::selectInput", "shiny::textInput"]
label = ["Conda subcommands", "Conda environment", "Conda parameters"]

[conda.paramters.conda_input_box.input.single_input.choices]
conda_sub_cmd = ["clean", "config", "create", "info", "install",
"list", "package", "remove", "uninstall",
"search", "update", "upgrade"]
conda_env_name = "!!glue {BioInstaller::conda.env.list()[,1]}"
[conda.paramters.conda_input_box.input.single_input.selected]
conda_sub_cmd = "list"
conda_env_name = "base"

[conda.paramters.conda_input_box.input.start_analysis]
input_id = "start_conda_analysis"
type = "shiny::actionButton"
label = "Run"

[conda.paramters.outputFields]
[conda.paramters.conda_output_box_text]
section_type = "output"
rcmd_last = "BioInstaller::conda.list()"
rcmd_last = """
conda_env_cmd <- sprintf("source activate %s;", conda_env_name)
conda_params <- sprintf("%s %s", conda_sub_cmd, conda_params)
cat(conda(conda_params, conda_env_cmd))
"""
render_type = "shiny::renderPrint"
render_id = "conda_output"
output_type = "shiny::verbatimTextOutput"
progressbar_message = "conda ouput"
progressbar_message = "conda ouput_box_text"

[conda.paramters.conda_output_box_table]
section_type = "output"
rcmd_last = """
if (conda_sub_cmd == 'list')
conda.list(conda_env_name)
"""
render_type = "DT::renderDataTable"
render_id = "conda_output_table"
output_type = "DT::dataTableOutput"
progressbar_message = "conda ouput_box_table"
4 changes: 3 additions & 1 deletion inst/extdata/config/shiny/shiny.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,11 @@ shiny_tools:
pipeline: easy_project
instant:
- bioinstaller
- conda
- spack
- conda
- datasets2tools
- pubmed
- geoquery
- maftools
shiny_tools_params:
require:
Expand All @@ -62,6 +63,7 @@ shiny_tools_params:
pubmed:
- rentrez
- XML
geoquery: GEOquery
maftools: maftools
shiny_upload:
upload_dir: ~/.BioInstaller/upload
Expand Down
12 changes: 7 additions & 5 deletions inst/extdata/config/shiny/shiny.datasets2tools.parameters.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ for (i in input_params) {
json_dat <- getForm(url, .params=datasets2tools_params)
json_dat <- jsonlite::fromJSON(json_dat)
json_dat <- as.data.frame(json_dat)
for(i in 1:ncol(json_dat)) {
if (typeof(json_dat[,i]) == "list") {
json_dat[,i] <- unlist(lapply(json_dat[,i], function(x) {paste0(x, collapse = ", ")}))
if (length(json_dat) > 0) {
for(i in 1:ncol(json_dat)) {
if (typeof(json_dat[,i]) == "list") {
json_dat[,i] <- unlist(lapply(json_dat[,i], function(x) {paste0(x, collapse = ", ")}))
}
}
}
"""
Expand All @@ -42,7 +44,7 @@ input_id = ["input_datasets2tools_1", "input_datasets2tools_2",
type = ["shiny::selectInput", "shiny::textInput", "shiny::textInput", "shiny::textInput", "shiny::textInput",
"shiny::textInput", "shiny::textInput", "shiny::numericInput"]
label = ["Query type", "Key Words", "Dataset Accession (e.g. GSE775)", "Tool name", "Disease name",
"Canned nalysis Cccession", "Geneset", "Page size"]
"Canned nalysis Cccession", "Geneset", "Counts"]

[datasets2tools.paramters.dataset2tools_input_box.input.single_input.choices]
object_type = ["canned_analysis", "dataset", "tool"]
Expand All @@ -53,7 +55,7 @@ page_size = 100
[datasets2tools.paramters.dataset2tools_input_box.input.start_analysis]
input_id = "start_datasets2tools_analysis"
type = "shiny::actionButton"
label = "Submit"
label = "Run"

[datasets2tools.paramters.dataset2tools_out_box]
section_type = "output"
Expand Down
59 changes: 59 additions & 0 deletions inst/extdata/config/shiny/shiny.geoquery.parameters.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
[geoquery.ui.sections]
order = ["geoquery_input_box", "geoquery_output_text_1", "geoquery_output_table_1"]
[geoquery.ui.sections.ui_basic]
geoquery_input_box = "title = 'Input', status = 'primary', width = 12, collapsed = FALSE, collapsible = TRUE"
geoquery_output_text_1 = "title = 'Output of geoquery', status = 'primary', width = 12, collapsed = FALSE, collapsible = TRUE"
geoquery_output_table_1 = "title = 'Output of geoquery (Table)', status = 'primary', width = 12, collapsed = FALSE, collapsible = TRUE"

[geoquery.paramters.geoquery_input_box]
# For reading annovarR shiny APP geoquery tool input files
section_type = "input"
rcmd_last = """
gds <- ""
gsm <- ""
if (gds_file != "") gds <- getGEO(filename=gds_file)
if (gsm_file != "") gsm <- getGEO(filename=gsm_file)
"""
progressbar_message = "Running geoquery functions."
render_id = "geoquery_input_box"

#!!!!! input_ui_order required related section
input_ui_order = ["single_input", "start_analysis"]

[geoquery.paramters.geoquery_input_box.input.single_input]
title = "Parameters:"
title_control = "class = 'input-section-p'"
varname = ["gds_file", "gsm_file"]
input_id = ["input_geoquery_1", "input_geoquery_2"]
type = ["shiny::selectInput", "shiny::selectInput"]
label = ["GDS File", "GSE File"]

[geoquery.paramters.geoquery_input_box.input.single_input.choices]
gds_file = "!!glue {c(system.file('extdata', 'GDS507.soft.gz', package = 'GEOquery'), featch_files()$file_path, '')}"
gsm_file = "!!glue {c(system.file('extdata', 'GSM11805.txt.gz', package = 'GEOquery'), featch_files()$file_path, '')}"
[geoquery.paramters.geoquery_input_box.input.single_input.selected]
gds_file = ""
gsm_file = ""

[geoquery.paramters.geoquery_input_box.input.start_analysis]
input_id = "start_geoquery_analysis"
type = "shiny::actionButton"
label = "Run"

[geoquery.paramters.geoquery_output_text_1]
section_type = "output"
rcmd_last = "head(Meta(gsm))"
render_type = "shiny::renderPrint"
render_id = "geoquery_output_text_1"
output_type = "shiny::verbatimTextOutput"
progressbar_message = "GEOquery geoquery_output_text_1"

[geoquery.paramters.geoquery_output_table_1]
section_type = "output"
rcmd_last = """
Table(gsm)
"""
render_type = "DT::renderDataTable"
render_id = "geoquery_output_table_1"
output_type = "DT::dataTableOutput"
progressbar_message = "GEOquery geoquery_output_table_1"
2 changes: 1 addition & 1 deletion inst/extdata/config/shiny/shiny.pubmed.parameters.toml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ if (!is.null(objs) && (max_n_items >= 500)){
colnames(result) <- c("PMID", "DOI", "Title", "Abstract", "PublishDate", "JournalName", "BookName")
"""
progressbar_message = "Running pubmed functions."
render_id = "pubmed_pubmed_input_box"
render_id = "pubmed_input_box"

#!!!!! input_ui_order required related section
input_ui_order = ["single_input", "start_analysis"]
Expand Down
39 changes: 27 additions & 12 deletions inst/extdata/config/shiny/shiny.spack.parameters.toml
Original file line number Diff line number Diff line change
@@ -1,29 +1,44 @@
[spack.ui.sections]
order = ["readfiles", "outputFields"]
order = ["spack_input_box", "spack_output_box_text"]
[spack.ui.sections.ui_basic]
readfiles = "title = 'Input', status = 'primary', width = 12, collapsed = FALSE, collapsible = TRUE"
outputFields = "title = 'Output of spack', status = 'primary', width = 12, collapsed = FALSE, collapsible = TRUE"
spack_input_box = "title = 'Input', status = 'primary', width = 12, collapsed = FALSE, collapsible = TRUE"
spack_output_box_text = "title = 'Output of spack', status = 'primary', width = 12, collapsed = FALSE, collapsible = TRUE"

[spack.paramters.readfiles]
[spack.paramters.spack_input_box]
# For reading annovarR shiny APP spack tool input files
section_type = "input"
rcmd_last = """
"""
rcmd_last = ""
progressbar_message = "Running spack functions."
render_id = "spack_readfiles"
render_id = "spack_input_box"

#!!!!! input_ui_order required related section
input_ui_order = ["start_analysis"]
input_ui_order = ["single_input", "start_analysis"]

[spack.paramters.spack_input_box.input.single_input]
title = "Parameters:"
title_control = "class = 'input-section-p'"
varname = ["spack_sub_cmd", "spack_params"]
input_id = ["input_spack_1", "input_spack_2"]
type = ["shiny::selectInput", "shiny::textInput"]
label = ["spack subcommands", "spack parameters"]

[spack.paramters.spack_input_box.input.single_input.choices]
spack_sub_cmd = ["list", "info", "find", "install", "uninstall",
"spec", "load",
"module", "unload",
"view", "create", "edit",
"arch", "compilers"]
[spack.paramters.spack_input_box.input.single_input.selected]
spack_sub_cmd = "find"

[spack.paramters.readfiles.input.start_analysis]
[spack.paramters.spack_input_box.input.start_analysis]
input_id = "start_spack_analysis"
type = "shiny::actionButton"
label = "Run"

[spack.paramters.outputFields]
[spack.paramters.spack_output_box_text]
section_type = "output"
rcmd_last = "cat(BioInstaller::spack('find'))"
rcmd_last = "cat(BioInstaller::spack(sprintf('%s %s', spack_sub_cmd, spack_params)))"
render_type = "shiny::renderPrint"
render_id = "spack_output"
output_type = "shiny::verbatimTextOutput"
Expand Down
8 changes: 4 additions & 4 deletions inst/extdata/shiny/server_download.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ download_section_server <- function(input, output) {
output$conda_installer_ui <- renderUI({
conda_envs <- BioInstaller::conda.env.list()[,1]
HTML(
paste0(shiny::selectInput("installer_conda_sub_command", "Sub command of conda",
paste0(shiny::selectInput("installer_conda_sub_command", "Conda subcommands",
c("clean", "config", "create",
"info", "install",
"list", "package",
Expand All @@ -80,8 +80,8 @@ download_section_server <- function(input, output) {
shiny::selectInput("installer_conda_env_name", label = "Conda environment",
choices = conda_envs,
selected = "base"),
shiny::textAreaInput("installer_conda_parameters", label = "Parameters"),
actionButton("installer_conda_run", label = "Run")
shiny::textAreaInput("installer_conda_parameters", label = "Conda parameters"),
actionButton("installer_conda_run", label = "Submit")
), collapse = "\n")
})

Expand All @@ -97,7 +97,7 @@ download_section_server <- function(input, output) {
"arch", "compilers"),
selected = "find"),
shiny::textAreaInput("installer_spack_parameters", label = "Parameters"),
actionButton("installer_spack_run", label = "Run")
actionButton("installer_spack_run", label = "Submit")
), collapse = "\n")
})

Expand Down
2 changes: 1 addition & 1 deletion inst/extdata/shiny/ui_body_download.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ get_download_tabItem_ui <- function(){
"save.to.db", "overwrite")
),
shiny::textInput("extra.paramters", "Extra parameters", "list()"),
actionButton("install_run", "Run")
actionButton("install_run", "Submit")
),
box(
title = "Conda",
Expand Down

0 comments on commit a45b094

Please sign in to comment.