Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
shinyscreen
Manage
Activity
Members
Labels
Plan
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Environmental Cheminformatics
shinyscreen
Commits
ec102c7a
Commit
ec102c7a
authored
2 years ago
by
Todor Kondic
Browse files
Options
Downloads
Patches
Plain Diff
...
parent
b49b5845
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
R/shiny-state.R
+17
-4
17 additions, 4 deletions
R/shiny-state.R
R/shiny-ui-base.R
+31
-18
31 additions, 18 deletions
R/shiny-ui-base.R
with
48 additions
and
22 deletions
R/shiny-state.R
+
17
−
4
View file @
ec102c7a
...
@@ -33,7 +33,7 @@ create_stub_gui <- function() {
...
@@ -33,7 +33,7 @@ create_stub_gui <- function() {
gui
<-
list
()
gui
<-
list
()
shiny
::
isolate
({
shiny
::
isolate
({
gui
$
compounds
<-
shiny
::
reactiveValues
(
lists
=
character
(),
gui
$
compounds
<-
shiny
::
reactiveValues
(
lists
=
character
(),
set
=
character
())
set
s
=
character
())
gui
$
datatab
<-
shiny
::
reactiveValues
(
file
=
character
(),
gui
$
datatab
<-
shiny
::
reactiveValues
(
file
=
character
(),
tag
=
character
(),
tag
=
character
(),
adduct
=
character
(),
adduct
=
character
(),
...
@@ -83,10 +83,10 @@ r2taadse <- function(tablist,sets) {
...
@@ -83,10 +83,10 @@ r2taadse <- function(tablist,sets) {
r2compounds
<-
function
(
rcompounds
)
{
r2compounds
<-
function
(
rcompounds
)
{
shiny
::
isolate
({
shiny
::
isolate
({
cmpd_lists
<-
rcompounds
$
lists
cmpd_lists
<-
rcompounds
$
lists
cmpd_set
<-
rcompounds
$
set
cmpd_set
<-
rcompounds
$
set
s
})
})
list
(
lists
=
cmpd_lists
,
set
=
cmpd_set
)
list
(
lists
=
cmpd_lists
,
set
s
=
cmpd_set
)
}
}
...
@@ -211,9 +211,22 @@ app_state2state <- function(input,gui) {
...
@@ -211,9 +211,22 @@ app_state2state <- function(input,gui) {
m
<-
new_project
(
gui
$
paths
$
project
)
m
<-
new_project
(
gui
$
paths
$
project
)
m
$
run
$
paths
<-
shiny
::
reactiveValuesToList
(
gui
$
paths
)
m
$
run
$
paths
<-
shiny
::
reactiveValuesToList
(
gui
$
paths
)
m
$
conf
<-
input2conf
(
input
)
m
$
conf
<-
input2conf
(
input
)
m
$
input
$
tab
$
mzml
<-
data.table
(
tag
=
gui
$
datatab
$
tag
,
adduct
=
gui
$
datatab
$
adduct
,
set
=
gui
$
datatab
$
set
,
file
=
gui
$
datatab
$
file
)
m
m
}
}
gen_comp_state
<-
function
(
input
,
gui
)
{
m
<-
app_state2state
(
input
,
gui
)
run
(
m
=
m
,
phases
=
c
(
"setup"
,
"mk_comp_tab"
))
}
get_sets
<-
function
(
gui
)
{
fn_set
<-
file.path
(
gui
$
paths
$
project
,
gui
$
compounds
$
sets
)
df
<-
fread
(
file
=
fn_sets
)
df
[,
unique
(
set
)]
}
This diff is collapsed.
Click to expand it.
R/shiny-ui-base.R
+
31
−
18
View file @
ec102c7a
...
@@ -439,7 +439,7 @@ mk_shinyscreen_server <- function(projects,init) {
...
@@ -439,7 +439,7 @@ mk_shinyscreen_server <- function(projects,init) {
## Update with data-files.
## Update with data-files.
rv_dfile
<-
reactiveVal
(
def_datafiles
)
rv_dfile
<-
reactiveVal
(
def_datafiles
)
## TODO: think about the connection of rv_dfile to the rest.
## Data-file table when loading.
## Data-file table when loading.
rv_datatab
<-
reactiveVal
(
def_datatab
)
rv_datatab
<-
reactiveVal
(
def_datatab
)
rv_flag_datatab
<-
reactiveVal
(
-
.Machine
$
integer.max
)
rv_flag_datatab
<-
reactiveVal
(
-
.Machine
$
integer.max
)
...
@@ -654,24 +654,37 @@ mk_shinyscreen_server <- function(projects,init) {
...
@@ -654,24 +654,37 @@ mk_shinyscreen_server <- function(projects,init) {
## REACTIVE FUNCTIONS
## REACTIVE FUNCTIONS
rf_compound_input_state
<-
reactive
({
## rf_compound_input_state <- reactive({
sets
<-
rvs
$
m
$
run
$
paths
$
compounds
$
sets
## sets <- rvs$m$run$paths$compounds$sets
lst
<-
as.list
(
rvs
$
m
$
run
$
paths
$
compounds
$
lists
)
## lst <- as.list(rvs$m$run$paths$compounds$lists)
## TODO XXX
## ## TODO XXX
validate
(
need
(
length
(
lst
)
>
0
,
## validate(need(length(lst)>0,
message
=
"Load the compound lists(s) first."
))
## message = "Load the compound lists(s) first."))
validate
(
need
(
length
(
sets
)
>
0
&&
nchar
(
sets
)
>
0
,
## validate(need(length(sets)>0 && nchar(sets)>0,
message
=
"Load the setid table first."
))
## message = "Load the setid table first."))
isolate
({
## isolate({
state
<-
rev2list
(
rvs
$
m
)
## state <- rev2list(rvs$m)
m
<-
load_compound_input
(
state
)
## m <- load_compound_input(state)
## Side effect! This is because my pipeline logic does not
## ## Side effect! This is because my pipeline logic does not
## work nicely with reactive stuff.
## ## work nicely with reactive stuff.
rvs
$
m
$
input
$
tab
$
cmpds
<-
list2rev
(
m
$
input
$
tab
$
cmpds
)
## rvs$m$input$tab$cmpds <- list2rev(m$input$tab$cmpds)
rvs
$
m
$
input
$
tab
$
setid
<-
m
$
input
$
tab
$
setid
## rvs$m$input$tab$setid <- m$input$tab$setid
m
## m
## })
## })
rf_comp_state
<-
reactive
({
app_state2state
(
input
=
input
,
gui
=
rvs
$
gui
)
})
})
rf_get_sets
<-
reactive
({
req
(
rvs
$
gui
$
paths
$
project
)
req
(
rvs
$
gui
$
paths
$
sets
)
get_sets
(
gui
)
})
})
rf_conf_proj
<-
reactive
({
rf_conf_proj
<-
reactive
({
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment