| Title: | Configurable Shiny data-analysis workflows |
|---|---|
| Description: | MagellanNTK (Magellan Navigation ToolKit) is a collection of Shiny modules which provide the basis for a generic workflow manager for data processing tools with several steps. It works in combination with any package which implements data processing pipelines compliant with MagellanNTK such as Prostar2. |
| Authors: | Samuel Wieczorek [aut] (ORCID: <https://orcid.org/0000-0002-5016-1203>), Thomas Burger [aut], Manon Gaudin [cre, aut] |
| Maintainer: | Manon Gaudin <[email protected]> |
| License: | Artistic-2.0 |
| Version: | 0.99.34 |
| Built: | 2026-10-07 12:23:11 UTC |
| Source: | https://github.com/BiocStaging/MagellanNTK |
This function returns the indice of the last validated step before the current step.
Add2History(history, step, substep, param.name, value)Add2History(history, step, substep, param.name, value)
history |
A 'data.frame()' |
step |
A 'character()' |
substep |
A 'character()' |
param.name |
A 'character()' |
value |
The value corresponding to the param.name |
A 'data.frame()'
history <- InitializeHistory() Add2History(history, "Example step", "First sub-step", "my param", "THE value")history <- InitializeHistory() Add2History(history, "Example step", "First sub-step", "my param", "THE value")
The names of the slots in dataIn are a subset of the names of the steps (names(stepsNames)). Each item is the result of a process and when a process has been validated, it creates a new slot with its own name
BuildData2Send(session, dataIn, stepsNames)BuildData2Send(session, dataIn, stepsNames)
session |
internal parameter |
dataIn |
An instance of an object of type 'list()'. |
stepsNames |
A vector in which items is the name of a step in the pipeline. |
A vector of the same length of the vector 'stepsNames' in which each item is an object (the type of object used by the pipeline). This object must have the same behavior of a 'list()'.
data(lldata) stepsNames <- c("data1", "data2", "data3") BuildData2Send(NULL, lldata, stepsNames) stepsNames <- c("data1", "data2", "data3", "data4", "data5") BuildData2Send(NULL, lldata, stepsNames)data(lldata) stepsNames <- c("data1", "data2", "data3") BuildData2Send(NULL, lldata, stepsNames) stepsNames <- c("data1", "data2", "data3", "data4", "data5") BuildData2Send(NULL, lldata, stepsNames)
Wrapper to the function 'do.call'
call_func(fname, args)call_func(fname, args)
fname |
The name of the function to execute |
args |
The 'list()' of its arguments |
The result of the function called
[do.call()]
call_func("stats::rnorm", list(n = 10, mean = 3))call_func("stats::rnorm", list(n = 10, mean = 3))
This code is heavily based on the following repository: https://github.com/wleepang/shiny-directory-input Display an OS-native folder selection dialog under Mac OS X, Linux GTK+ or Windows.
Given x and y, return y only if both x and y are set
x %AND% y file_sep(sysinfo = Sys.info()) choose_dir(default = NA, caption = NA, useNew = TRUE, sysinfo = Sys.info()) choose_dir.darwin(default = NA, caption = NA) choose_dir.linux(default = NA, caption = NA) choose_dir.windows(default = NA, caption = NA, useNew = TRUE)x %AND% y file_sep(sysinfo = Sys.info()) choose_dir(default = NA, caption = NA, useNew = TRUE, sysinfo = Sys.info()) choose_dir.darwin(default = NA, caption = NA) choose_dir.linux(default = NA, caption = NA) choose_dir.windows(default = NA, caption = NA, useNew = TRUE)
x |
left operand |
y |
right operand |
sysinfo |
System inforamtions |
default |
which folder to show initially |
caption |
the caption on the selection dialog |
useNew |
boolean, selects the type of dialog shown in windows |
Uses an Apple Script, Zenity or Windows Batch script to display an OS-native folder selection dialog.
For Apple Script, with default = NA, the initial folder selection
is determined by default behavior of the "choose folder" script. Otherwise,
paths are expanded with path.expand.
For Linux, with default = NA, the initial folder selection is
determined by defaul behavior of the zenity script.
The new windows batch script allows both initial folder and caption to be set. In the old batch script for Windows the initial folder is always ignored.
A length one character vector, character NA if 'Cancel' was selected.
A length one character vector, character NA if 'Cancel' was selected.
A length one character vector, character NA if 'Cancel' was selected.
A length one character vector, character NA if 'Cancel' was selected.
NULLNULL
This class is used to store the configuration of any process used with MagellanNTK It contains the following slots:
Wrapper function to the constructor of the class
Config( fullname = "", mode = "", steps = NULL, mandatory = NULL, steps.source.file = NULL ) ## S4 method for signature 'Config' initialize(.Object, fullname, mode, steps, mandatory, steps.source.file) Config( fullname = "", mode = "", steps = NULL, mandatory = NULL, steps.source.file = NULL )Config( fullname = "", mode = "", steps = NULL, mandatory = NULL, steps.source.file = NULL ) ## S4 method for signature 'Config' initialize(.Object, fullname, mode, steps, mandatory, steps.source.file) Config( fullname = "", mode = "", steps = NULL, mandatory = NULL, steps.source.file = NULL )
fullname |
The complete name of the pipeline or the process (in this case, it is the concatenation of the name of the pipeline and the name of the process itself, separated by '_') |
mode |
A 'character()' which indicates whether the current module is used as a 'process' nor a 'pipeline.' Default value is NULL |
steps |
A vector containing the names of steps in a process or a pipeline. |
mandatory |
A vector of boolean where each element indicates whether the corresponding steps is mandatory or not. It has the same length of the vector steps. |
steps.source.file |
A 'vector' of which each item is the source code of the corresponding step. |
.Object |
The object |
An instance of the class 'Config'
fullnameThe name of the process which is the concatenation of the name of the pipeline and the name of the process itself, separated by '_'.
nameThe name of the process nor pipeline.
parentThe name of the pipeline/process which owns this instance
modeA 'character()' which indicates if the configuration is about a whole process nor a process of a pipeline.
stepsA 'vector' of 'character()' which contains the primary steps of the pipeline. Two steps will be automatically inserted in this vector: 'Description 'in the first position and 'Save' at the end.
mandatoryA 'vector' of 'boolean()' in which each item is the necessary code for the GUI of a step. The size of this vector is the number of steps
ll.UIA 'vector' of Shiny source code. Each item is the necessary code for the GUI of a step. The size of this vector is the number of steps
steps.source.fileA 'vector' of which each item is the source code of the corresponding step.
stepsA 'vector' of 'character()' which contains the primary steps of the pipeline. Two steps will be automatically inserted in this vector: 'Description 'in the first position and 'Save' at the end.
mandatoryA 'vector' of 'boolean()' in which each item is the necessary code for the GUI of a step. The size of this vector is the number of steps
# Example of a single process with one step proc1step <- Config( fullname = "PipelineDemo_DataGeneration", mode = "process", steps = c("DataGeneration"), mandatory = c(TRUE) ) # Example of a single process with two steps proc2steps <- Config( fullname = "PipelineDemo_PreProcessing", mode = "process", steps = c("Filtering", "Normalization"), mandatory = c(TRUE, FALSE) ) # Example of pipeline with three process pipe3proc <- Config( mode = "pipeline", fullname = "PipelineDemo", steps = c("DataGeneration", "Preprocessing", "Clustering"), mandatory = c(TRUE, FALSE, FALSE) ) # Example of a particular description module (A process with no step) description.process <- Config( fullname = "PipelineDemo_Description", mode = "process", steps = "", mandatory = "" )# Example of a single process with one step proc1step <- Config( fullname = "PipelineDemo_DataGeneration", mode = "process", steps = c("DataGeneration"), mandatory = c(TRUE) ) # Example of a single process with two steps proc2steps <- Config( fullname = "PipelineDemo_PreProcessing", mode = "process", steps = c("Filtering", "Normalization"), mandatory = c(TRUE, FALSE) ) # Example of pipeline with three process pipe3proc <- Config( mode = "pipeline", fullname = "PipelineDemo", steps = c("DataGeneration", "Preprocessing", "Clustering"), mandatory = c(TRUE, FALSE, FALSE) ) # Example of a particular description module (A process with no step) description.process <- Config( fullname = "PipelineDemo_Description", mode = "process", steps = "", mandatory = "" )
The following functions are currently available:
- 'keepDatasets(object, range)' keep datasets in object which are in range
- ‘addDatasets(object, dataset, name)' add the ’dataset' to the object (of type list)
This manual page describes manipulation methods using [list] objects. In index or name 'i' can be specified to define the array (by name of index) on which to operate.
The following functions are currently available:
- 'keepDatasets(object, range)' keep datasets in object which are in range
- ‘addDatasets(object, dataset, name)' add the ’dataset' to the object (of type list)
- 'Save(object, file)' stores the object to a .RData file
addDatasets(object, dataset, name) keepDatasets(object = NULL, range = seq_along(object))addDatasets(object, dataset, name) keepDatasets(object = NULL, range = seq_along(object))
object |
An object of class 'list'. |
dataset |
'character()' providing the base with respect to which logarithms are computed. Default is log2. |
name |
A 'character()' naming the new array name. |
range |
A interval of integers |
The object must be of type list. Thetwo functions are implemented here for of the package which uses MagellanNTK
The object must be of type list. Thetwo functions are implemented here for of the package which uses MagellanNTK
An instance of class 'MultiAssayExperiment'.
An processed object of the same class as 'object'.
data(lldata) obj.se <- lldata[[1]] new.obj <- addDatasets(lldata, obj.se, "mynewobj") data(lldata123) keepDatasets(lldata123, c(1, 3)) NULLdata(lldata) obj.se <- lldata[[1]] new.obj <- addDatasets(lldata, obj.se, "mynewobj") data(lldata123) keepDatasets(lldata123, c(1, 3)) NULL
left_panel = left_sidebar + width_sidebar top_sidebar = top_panel width_sidebar = width_process_btns
default_funcs() default_base_URL() default_workflow() default_layout default_theme(mode)default_funcs() default_base_URL() default_workflow() default_layout default_theme(mode)
mode |
A 'character()' to specifies the running mode of MagellanNTK: 'user' (default) or 'dev'. |
NA
NULLNULL
Directory Selection Control
directoryInput(inputId, label, value = NULL)directoryInput(inputId, label, value = NULL)
inputId |
The |
label |
Display label for the control, or NULL for no label |
value |
Initial value. Paths are expanded via |
This widget relies on choose_dir to present an interactive
dialog to users for selecting a directory on the local filesystem. Therefore,
this widget is intended for shiny apps that are run locally - i.e. on the
same system that files/directories are to be accessed - and not from hosted
applications (e.g. from shinyapps.io).
A directory input control that can be added to a UI definition.
updateDirectoryInput,
readDirectoryInput,
choose_dir
NULLNULL
Discover Skipped Steps
Discover_Skipped_Steps(steps.status)Discover_Skipped_Steps(steps.status)
steps.status |
A vector of 'character()' which reflects the status of the steps in the pipeline. Thus, the length of this vector is equal to the number of steps |
A vector of integers of the same length as steps.status and where skipped steps are identified with '-1'
steps <- c(1, 1, 0, 1) Discover_Skipped_Steps(steps)steps <- c(1, 1, 0, 1) Discover_Skipped_Steps(steps)
A shiny Module.
download_dataset_ui(id) download_dataset_server( id, dataIn = reactive({ NULL }), filename = "myDataset", remoteReset = reactive({ 0 }), is.enabled = reactive({ TRUE }) ) download_dataset(dataIn = NULL, filename = "myDataset")download_dataset_ui(id) download_dataset_server( id, dataIn = reactive({ NULL }), filename = "myDataset", remoteReset = reactive({ 0 }), is.enabled = reactive({ TRUE }) ) download_dataset(dataIn = NULL, filename = "myDataset")
id |
A 'character()' as the id of the Shiny module |
dataIn |
An instance of the class 'MultiAssayExperiment' |
filename |
internal |
remoteReset |
A 'logical(1)' which acts as a remote command to reset the module to its default values. Default is FALSE. |
is.enabled |
A 'boolean'. This variable is used as a remote command to specify if the corresponding module is enabled (TRUE) or disabled (FALSE). |
NA
if (interactive()) { data(lldata, package = "MagellanNTK") download_dataset(lldata) }if (interactive()) { data(lldata, package = "MagellanNTK") download_dataset(lldata) }
A shiny Module.
format_DT_ui(id) format_DT_server( id, dataIn = reactive({ NULL }), hidden = reactive({ NULL }), withDLBtns = FALSE, showRownames = FALSE, dom = "Bt", max.rows = 20, hc_style = reactive({ NULL }), remoteReset = reactive({ 0 }), is.enabled = reactive({ TRUE }) ) format_DT( dataIn, hidden = NULL, withDLBtns = FALSE, showRownames = FALSE, dom = "Bt", hc_style = NULL, remoteReset = NULL, is.enabled = TRUE )format_DT_ui(id) format_DT_server( id, dataIn = reactive({ NULL }), hidden = reactive({ NULL }), withDLBtns = FALSE, showRownames = FALSE, dom = "Bt", max.rows = 20, hc_style = reactive({ NULL }), remoteReset = reactive({ 0 }), is.enabled = reactive({ TRUE }) ) format_DT( dataIn, hidden = NULL, withDLBtns = FALSE, showRownames = FALSE, dom = "Bt", hc_style = NULL, remoteReset = NULL, is.enabled = TRUE )
id |
A 'character()' as the id of the Shiny module |
dataIn |
A 'data.frame()' |
|
Default is NULL, |
|
withDLBtns |
Default is FALSE, |
showRownames |
Default is FALSE, |
dom |
Default is 'Bt', |
max.rows |
Default is 20, |
hc_style |
Default is NULL, |
remoteReset |
An 'integer' which acts as a remote command to reset the module. Its value is incremented on a external event and it is used to trigger an event in this module |
is.enabled |
Default is TRUE |
A shiny App
if (interactive()) { data(lldata) obj <- SummarizedExperiment::assay(lldata[[1]]) obj <- as.data.frame(obj) format_DT(obj) # Compute style from within third party tab obj <- as.data.frame(matrix(seq_len(30), byrow = TRUE, nrow = 6)) colnames(obj) <- paste0("col", seq_len(5)) mask <- as.data.frame(matrix(rep(LETTERS[seq_len(5)], 6), byrow = TRUE, nrow = 6 )) style <- list( cols = colnames(obj), vals = colnames(mask), unique = unique(mask), pal = RColorBrewer::brewer.pal(5, "Dark2")[seq_len(5)] ) format_DT(obj, hidden = mask, hc_style = style ) }if (interactive()) { data(lldata) obj <- SummarizedExperiment::assay(lldata[[1]]) obj <- as.data.frame(obj) format_DT(obj) # Compute style from within third party tab obj <- as.data.frame(matrix(seq_len(30), byrow = TRUE, nrow = 6)) colnames(obj) <- paste0("col", seq_len(5)) mask <- as.data.frame(matrix(rep(LETTERS[seq_len(5)], 6), byrow = TRUE, nrow = 6 )) style <- list( cols = colnames(obj), vals = colnames(mask), unique = unique(mask), pal = RColorBrewer::brewer.pal(5, "Dark2")[seq_len(5)] ) format_DT(obj, hidden = mask, hc_style = style ) }
This module allows to change
open_dataset_ui(id) open_dataset_server( id, class = NULL, extension = NULL, remoteReset = reactive({ NULL }), is.enabled = reactive({ TRUE }) ) open_dataset(extension = NULL)open_dataset_ui(id) open_dataset_server( id, class = NULL, extension = NULL, remoteReset = reactive({ NULL }), is.enabled = reactive({ TRUE }) ) open_dataset(extension = NULL)
id |
A 'character()' as the id of the Shiny module |
class |
The type of file to allow for other packages dataset |
extension |
The extension file allowed |
remoteReset |
An 'integer' which acts as a remote command to reset the module. Its value is incremented on a external event and it is used to trigger an event in this module |
is.enabled |
A 'boolean'. This variable is used as a remote command to specify if the corresponding module is enabled/disabled in the calling module of upper level. For example, if this module is disabled, then this variable is set to TRUE. Then, all the widgets will be disabled. If not, the enabling/disabling of widgets is deciding by this module. |
A Shiny app
if (interactive()) { open_dataset(extension = "rdata") }if (interactive()) { open_dataset(extension = "rdata") }
Get file extension
GetExtension(name)GetExtension(name)
name |
A complete filename |
The extension of the given filename
GetExtension("foo.xlsx")GetExtension("foo.xlsx")
Get the first mandatory step not validated
GetFirstMandatoryNotValidated(range, rv)GetFirstMandatoryNotValidated(range, rv)
range |
A 'vector' of integers. The min of this vector must be greater of equal to 0 and the max must be less or equal to the size of the object |
rv |
A 'list' with at least two slots : * mandatory: A vector of 'booelan' which indicates whther the steps are mandatory or not * steps.status: A vector of 'interger()' which indicates the status of the steps |
An integer which is the indice of the identified step in the vector rv$steps.status
NULLNULL
Get the history of an assay
GetHistory(dataIn, name)GetHistory(dataIn, name)
dataIn |
An instance of 'MultiAssayExperiment' class |
name |
The name of a slot in the object |
A 'data.frame()'
data(lldata123) GetHistory(lldata123, "Clustering")data(lldata123) GetHistory(lldata123, "Clustering")
Get datasets from packages which owns datasets of a given class
GetListDatasets(class = NULL, demo_package = NULL)GetListDatasets(class = NULL, demo_package = NULL)
class |
A 'character()' which is the class of the datasets one looking for |
demo_package |
A 'character()' which specifies a particular package to search |
A 'vector' in which items are the name of datasets which inherits the class given in parameter
foo1 <- GetListDatasets()foo1 <- GetListDatasets()
This function returns the indice of the last validated step among all the steps
GetMaxValidated_AllSteps(steps.status)GetMaxValidated_AllSteps(steps.status)
steps.status |
A vector of strings where each item is the status of a step. The length of this vector is the same of the number of steps. |
A 'integer(1)' which is the indice of the value
GetMaxValidated_AllSteps(c(1, 1, 0, 1, 0, 0))GetMaxValidated_AllSteps(c(1, 1, 0, 1, 0, 0))
This function returns the indice of the last validated step before the current step.
GetMaxValidated_BeforePos(pos = NULL, rv)GetMaxValidated_BeforePos(pos = NULL, rv)
pos |
A 'integer()' which is the indice of the active position. |
rv |
A 'list()' which stores reactiveValues() |
A 'integer()'
pos <- 3 rv <- list(steps.status = c(1, 1, 0, 1, 0, 0), current.pos = 3) GetMaxValidated_BeforePos(pos, rv)pos <- 3 rv <- list(steps.status = c(1, 1, 0, 1, 0, 0), current.pos = 3) GetMaxValidated_BeforePos(pos, rv)
Get the version of a package installed in the local R distribution
GetPackageVersion(pkg)GetPackageVersion(pkg)
pkg |
The name of a package |
A 'character()'
GetPackageVersion("MagellanNTK")GetPackageVersion("MagellanNTK")
Global constants and configuration variables used throughout the package.
tl_v_next_icon stepStatus default_pos listBrewerPalettestl_v_next_icon stepStatus default_pos listBrewerPalettes
A collection of exported constants, lists and UI configuration objects.
NULLNULL
Initialisation function for DT
initComplete()initComplete()
literal JavaScript code
initComplete()initComplete()
This function returns the indice of the last validated step before the current step.
InitializeHistory()InitializeHistory()
A ‘data.frame()' with four columns: ’Process', 'Step', 'Parameter' and 'Value'
InitializeHistory()InitializeHistory()
Insert source code for config()
Insert_Call_to_Config(name)Insert_Call_to_Config(name)
name |
The name of a pipeline nor a process |
A 'character()' containing R source code
Insert_Call_to_Config("PipelineDemo")Insert_Call_to_Config("PipelineDemo")
This function generates the necessary code to modify the variable 'config' (slots steps and mandatory). It adds a 'Description' step and a TRUE value at the beginning of the 'steps' and 'mandatory' list, erases all white spaces for the names of the steps.
This function generates the necessary code to modify the variable 'config' (slots steps and mandatory). It adds a 'Description' step and a TRUE value at the beginning of the 'steps' and 'mandatory' list, erases all white spaces for the names of the steps.
This function create the source code needed inside a module to declare the reactive variable called 'widgets.default.values'. # Declaration of the variables that will contain the values of the widgets To avoid confusion, the first string is the name of the step while the second is the name of the widget
This function create the source code needed inside a module to declare the reactive variable called 'rv.custom.default.values'. # Declaration of the variables that will contain the values of the user variables. To avoid confusion, the first string is the name of the step while the second is the name of the widget
Returned value of the process
This function generates dynamically the observeEvent function for each widget
Get_Code_Update_Config_Variable() Get_Code_Declare_widgets(widgets.names = NULL) Get_Code_Declare_rv_custom(rv.custom.names = NULL) Get_Code_for_ObserveEvent_widgets(widgets.names = NULL) Get_Code_for_rv_reactiveValues() Get_Code_for_dataOut() Get_Code_for_General_observeEvents() Get_Code_for_remoteReset( widgets = TRUE, custom = TRUE, dataIn = "dataIn()", addon = "" ) Get_Code_for_resetting_widgets() Get_Code_for_resetting_custom() Module_Return_Func() AdditionnalCodeForExternalModules(w.names = NULL, rv.custom.names = NULL) Get_Workflow_Core_Code( mode = NULL, name = NULL, w.names = NULL, rv.custom.names = NULL ) Get_AdditionalModule_Core_Code(w.names = NULL, rv.custom.names = NULL)Get_Code_Update_Config_Variable() Get_Code_Declare_widgets(widgets.names = NULL) Get_Code_Declare_rv_custom(rv.custom.names = NULL) Get_Code_for_ObserveEvent_widgets(widgets.names = NULL) Get_Code_for_rv_reactiveValues() Get_Code_for_dataOut() Get_Code_for_General_observeEvents() Get_Code_for_remoteReset( widgets = TRUE, custom = TRUE, dataIn = "dataIn()", addon = "" ) Get_Code_for_resetting_widgets() Get_Code_for_resetting_custom() Module_Return_Func() AdditionnalCodeForExternalModules(w.names = NULL, rv.custom.names = NULL) Get_Workflow_Core_Code( mode = NULL, name = NULL, w.names = NULL, rv.custom.names = NULL ) Get_AdditionalModule_Core_Code(w.names = NULL, rv.custom.names = NULL)
widgets.names |
A 'vector' containing the names of the widgets in all steps of the module. |
rv.custom.names |
A 'vector' containing the names of the custom variables in all steps of the module. |
widgets |
A 'list' containing the names of the widgets in all steps of the module with their default values |
custom |
A 'list' of the custom variables used in the process. Each custom variable is accompanied with its default value |
dataIn |
An instance of the 'MultiAssayExperiment' or 'SummarizedExperiment' classes |
addon |
Additional code for the 'observeEvent()' function which catches the 'remoteReset()' action. |
w.names |
Same as widgets.names |
mode |
A 'character()' which indicates whether the current module is used as a 'process' nor a 'pipeline.' Default value is NULL |
name |
The Shiny id of the process or pipeline |
A 'string' containing some R code
A 'character()' containing R source code
A 'character()' containing R source code
A 'character()' containing R source code
A 'string' containing some R code
A 'character()' containing R source code
A 'character()' containing R source code
A 'character()' containing R source code
A 'character()' containing R source code
A 'character()' containing R source code
A 'character()' containing R source code
A 'character()' containing R source code
A 'character()' containing R source code
A 'character()' containing R source code
Samuel Wieczorek
MagellanNTK::Get_AdditionalModule_Core_Code("PipelineDemo", "")MagellanNTK::Get_AdditionalModule_Core_Code("PipelineDemo", "")
Substring test
isSubstr(pattern, target)isSubstr(pattern, target)
pattern |
A 'character()' |
target |
The 'character()' to look for into the pattern |
A boolean
isSubstr("cde", "abcdefghi")isSubstr("cde", "abcdefghi")
An instance of the class 'MultiAssayExperiment' which contains one assay (instance of class 'SummarizedExperiment'): 'Convert': Contains a data.frame with 6 columns and 100 rows fullfilled with '0'. It also contains a slot 'history' in the metadata(). This dataset is the most bacis one to run the example pipeline and learn how to work with MagellanNTK
data(lldata)data(lldata)
An object of class 'MultiAssayExperiment'
An instance of the class 'MultiAssayExperiment' which contains two assays (instance of class 'SummarizedExperiment'): 'Convert': Contains a data.frame with 6 columns and 100 rows fullfilled with '0'. 'DataGeneration' which stores the result of the 'DataGeneration' step of the demo pipeline Each assay contains a slot 'history' in the metadata().
data(lldata1)data(lldata1)
An object of class 'MultiAssayExperiment'
An instance of the class 'MultiAssayExperiment' which contains two assays (instance of class 'SummarizedExperiment'): 'Convert': Contains a data.frame with 6 columns and 100 rows fullfilled with '0'. 'DataGeneration' which stores the result of the 'DataGeneration' step of the demo pipeline 'Preprocessing' which stores the result of the 'DataGeneration' and 'Preprocessing' steps of the demo pipeline Each assay contains a slot 'history' in the metadata().
data(lldata12)data(lldata12)
An object of class 'MultiAssayExperiment'
An instance of the class 'MultiAssayExperiment' which contains two assays (instance of class 'SummarizedExperiment'): 'Convert': Contains a data.frame with 6 columns and 100 rows fullfilled with '0'. 'DataGeneration' which stores the result of the 'DataGeneration' step of the demo pipeline 'Preprocessing' which stores the result of the 'DataGeneration' and 'Preprocessing' steps of the demo pipeline 'Clustering' which stores the result of all the three steps of the demo pipeline Each assay contains a slot 'history' in the metadata().
data(lldata123)data(lldata123)
An object of class 'MultiAssayExperiment'
Main Shiny application
MagellanNTK_ui(id, sidebarSize = "medium") MagellanNTK_server( id, workflow.path = reactive({ NULL }), workflow.name = reactive({ NULL }), verbose = FALSE, usermod = "user" ) MagellanNTK( workflow.path = NULL, workflow.name = NULL, verbose = FALSE, usermod = "user", sidebarSize = "medium", ... )MagellanNTK_ui(id, sidebarSize = "medium") MagellanNTK_server( id, workflow.path = reactive({ NULL }), workflow.name = reactive({ NULL }), verbose = FALSE, usermod = "user" ) MagellanNTK( workflow.path = NULL, workflow.name = NULL, verbose = FALSE, usermod = "user", sidebarSize = "medium", ... )
id |
A 'character()' as the id of the Shiny module |
sidebarSize |
The width of the sidebar. Available values are 'small', 'medium', 'large' |
workflow.path |
A 'character()' which is the path to the directory which contains the files and directories of the pipeline. |
workflow.name |
A 'character()' which is the name of the pipeline to launch and run whithin the framework of MagellanNTK. It designs the name of a directory which contains the files and directories of the pipeline. |
verbose |
A 'boolean' to indicate whether to turn off (FALSE) or ON (TRUE) the verbose mode for logs. |
usermod |
A 'character()' to specifies the running mode of MagellanNTK: 'user' (default) or 'dev'. |
... |
Additional parameters |
A shiny app
if (interactive()) { wf.path <- system.file('workflow/PipelineDemo', package = 'MagellanNTK') MagellanNTK(wf.path, 'PipelineDemo') }if (interactive()) { wf.path <- system.file('workflow/PipelineDemo', package = 'MagellanNTK') MagellanNTK(wf.path, 'PipelineDemo') }
This module is not directly used by MagellanNTK core functions. It is rather a useful tool for third part pipelines and processes.
mod_errorModal_ui(id) mod_errorModal_server( id, title = NULL, text = NULL, footer = modalButton("Close") ) mod_errorModal(title = NULL, text = NULL)mod_errorModal_ui(id) mod_errorModal_server( id, title = NULL, text = NULL, footer = modalButton("Close") ) mod_errorModal(title = NULL, text = NULL)
id |
A 'character()' as the id of the Shiny module |
title |
A 'character()' as the title of the modal |
text |
A 'character()' as the content of the modal |
footer |
The content of the footer . May be UI content |
A shiny App
if (interactive()) { mod_errorModal("myTitle", "myContent") }if (interactive()) { mod_errorModal("myTitle", "myContent") }
A shiny Module.
mod_homepage_ui(id) mod_homepage_server( id, mdfile = file.path(system.file("www/md", package = "MagellanNTK"), "Presentation.Rmd"), dataset = reactive({ NULL }) ) mod_homepage()mod_homepage_ui(id) mod_homepage_server( id, mdfile = file.path(system.file("www/md", package = "MagellanNTK"), "Presentation.Rmd"), dataset = reactive({ NULL }) ) mod_homepage()
id |
A 'character()' as the id of the Shiny module |
mdfile |
The path to the Rmd file which describes the pipeline |
dataset |
An instance of the class 'MultiAssayExperiment' |
A shiny App
if (interactive()) { mod_homepage() }if (interactive()) { mod_homepage() }
A shiny Module.
insert_md_ui(id) insert_md_server(id, url) insert_md(url)insert_md_ui(id) insert_md_server(id, url) insert_md(url)
id |
A 'character()' as the id of the Shiny module |
url |
The path to the Rmd file to display. It can be a path to a file on the computer or a link to a file over internet. |
A shiny App
if (interactive()) { base <- system.file("www/md", package = "MagellanNTK") url <- file.path(base, "Presentation.Rmd") insert_md(url) }if (interactive()) { base <- system.file("www/md", package = "MagellanNTK") url <- file.path(base, "Presentation.Rmd") insert_md(url) }
A shiny Module.
mainapp_ui(id, session, size = "300px") mainapp_server( id, workflow.name = reactive({ NULL }), workflow.path = reactive({ NULL }), verbose = FALSE, usermod = "user" ) mainapp(usermod = "user")mainapp_ui(id, session, size = "300px") mainapp_server( id, workflow.name = reactive({ NULL }), workflow.path = reactive({ NULL }), verbose = FALSE, usermod = "user" ) mainapp(usermod = "user")
id |
A 'character()' as the id of the Shiny module |
session |
shiny internal |
size |
The width of the sidebar.in pixels |
workflow.name |
A 'character()' which is the name of the pipeline to launch and run whithin the framework of MagellanNTK. It designs the name of a directory which contains the files and directories of the pipeline. |
workflow.path |
A 'character()' which is the path to the directory which contains the files and directories of the pipeline. |
verbose |
A 'boolean' to indicate whether to turn off (FALSE) or ON (TRUE) the verbose mode for logs. |
usermod |
A 'character()' to specifies the running mode of MagellanNTK: 'user' (default) or 'dev'. |
A shiny App
if (interactive()) { mainapp() }if (interactive()) { mainapp() }
Displays of formatted modal-dialog with 'Cancel' and 'Ok' buttons. This modal (a shiny module itself) can embed a shiny module and it is able to return the return value of the embeded shiny module.
mod_modalDialog_ui(id) mod_modalDialog_server( id, title = NULL, typeWidget = "button", width = NULL, uiContent = NULL, external_mod = NULL, external_mod_args = list() ) mod_modalDialog( title, typeWidget = "button", uiContent = NULL, external_mod = NULL, external_mod_args = list() )mod_modalDialog_ui(id) mod_modalDialog_server( id, title = NULL, typeWidget = "button", width = NULL, uiContent = NULL, external_mod = NULL, external_mod_args = list() ) mod_modalDialog( title, typeWidget = "button", uiContent = NULL, external_mod = NULL, external_mod_args = list() )
id |
A 'character(1)' which is the id of the instance of the module |
title |
A 'character(1)' |
typeWidget |
The type of command widget to show to open the modal. Available values are 'button' (default) and 'link'. |
width |
A 'character(1)' indicating the size of the modal window. Can be "s" for small (the default), "m" for medium, or "l" for large. |
uiContent |
The content of the modal dialog. By default, its value is NULL which means that the user wants to embed a shiny module. In this case, the module rather take into account the two next parameters. |
external_mod |
The name of a shiny module which is already loaded in the R session. This name corresponds to the name of the functions '_ui' and '_server' without these suffixes. For example, if the user wants to add a module defined by the functions 'myModule_ui()' and 'myModule_server()', then the parameter 'external_mod' should be set to 'myModule'. |
external_mod_args |
A 'list()' which contains the parameters sent to the function 'myModule_server()'. |
A Shiny modal-dialog
if (interactive()) { mod_modalDialog( title = "test modalDialog", uiContent = p("test") ) }if (interactive()) { mod_modalDialog( title = "test modalDialog", uiContent = p("test") ) }
A shiny Module.
open_workflow_ui(id) open_workflow_server(id) open_workflow()open_workflow_ui(id) open_workflow_server(id) open_workflow()
id |
A 'character()' as the id of the Shiny module |
A shiny App
if (interactive()) { open_workflow() }if (interactive()) { open_workflow() }
Actually, this module does not work because we do not allow the use of the package 'shinyBS' package (conflicts with BS versions). In the future, one will fix this module with native functions in the package 'bs4Dash' (https://bs4dash.rinterface.com/reference/tooltip).
mod_popover_for_help_ui(id) mod_popover_for_help_server(id, title, content) mod_popover_for_help(title, content)mod_popover_for_help_ui(id) mod_popover_for_help_server(id, title, content) mod_popover_for_help(title, content)
id |
A 'character()' as the id of the Shiny module |
title |
The title of the tooltip window |
content |
The main text of the tooltip window |
A shiny App
if (interactive()) { mod_popover_for_help("myTitle", "myContent") }if (interactive()) { mod_popover_for_help("myTitle", "myContent") }
A shiny Module.
mod_release_notes_ui(id) mod_release_notes_server(id, URL_releaseNotes) mod_release_notes(URL_releaseNotes)mod_release_notes_ui(id) mod_release_notes_server(id, URL_releaseNotes) mod_release_notes(URL_releaseNotes)
id |
A 'character()' as the id of the Shiny module |
URL_releaseNotes |
The path to the Rmd file to display. It can be a path to a file on the computer or a link to a file over internet. |
A shiny App
if (interactive()) { url <- "http://www.prostar-proteomics.org/md/versionNotes.md" mod_release_notes(url) local.url <- system.file("/workflow/PipelineDemo/md/links.Rmd", package = "MagellanNTK" ) mod_release_notes(local.url) }if (interactive()) { url <- "http://www.prostar-proteomics.org/md/versionNotes.md" mod_release_notes(url) local.url <- system.file("/workflow/PipelineDemo/md/links.Rmd", package = "MagellanNTK" ) mod_release_notes(local.url) }
This module is not directly used by MagellanNTK core functions. It is rather a useful tool for third part pipelines and processes.
mod_SweetAlert_ui(id) mod_SweetAlert_server( id, title = NULL, text = NULL, showClipBtn = TRUE, type = "error" ) mod_SweetAlert(title, text, type = "warning")mod_SweetAlert_ui(id) mod_SweetAlert_server( id, title = NULL, text = NULL, showClipBtn = TRUE, type = "error" ) mod_SweetAlert(title, text, type = "warning")
id |
A 'character()' as the id of the Shiny module |
title |
The title to be displayed in the window |
text |
The titmessage to be displayed in the window |
showClipBtn |
A 'boolean' to indicates if the copy to clipboard button is shown or not. |
type |
A ‘character()' for the type of message: ’error', 'warning', etc. |
A shiny App
if (interactive()) { mod_SweetAlert("my title", "my message") }if (interactive()) { mod_SweetAlert("my title", "my message") }
This function checks if the ui() and server() parts of a Shiny module are available in the global environment.
module_exists(base_name)module_exists(base_name)
base_name |
The name of the module (without '_ui' nor '_server' suffixes) |
A boolean
path <- system.file("workflow/PipelineDemo", package = "MagellanNTK") source_wf_files(path) module_exists("PipelineDemo_Preprocessing")path <- system.file("workflow/PipelineDemo", package = "MagellanNTK") source_wf_files(path) module_exists("PipelineDemo_Preprocessing")
Checks if a package is available to load it
Checks if a package is available to load it
pkgsRequire(ll.deps) pkgsRequire(ll.deps)pkgsRequire(ll.deps) pkgsRequire(ll.deps)
ll.deps |
A vector of 'character()' which contains packages names |
NA
Samuel Wieczorek
NULL pkgsRequire(c("stats"))NULL pkgsRequire(c("stats"))
Creates a layout to place the sidebar and the main screen for pipelines and processes.
process_layout(session, ns, sidebar, content) process_layout_process(session, ns, sidebar, content) process_layout_pipeline(session, ns, sidebar, content)process_layout(session, ns, sidebar, content) process_layout_process(session, ns, sidebar, content) process_layout_pipeline(session, ns, sidebar, content)
session |
The R session parameter |
ns |
Namespaced IDs for inputs/outputs |
sidebar |
Shiny components |
content |
Shiny components |
A 'div()' containing shiny components
NULLNULL
Read the configuration file of a pipeline and extract formatted (as a list) information
readConfigFile(path, usermod = "user")readConfigFile(path, usermod = "user")
path |
A 'character()' which is the path to the directory which contains the files and directories of the pipeline. |
usermod |
A 'character()' to specifies the running mode of MagellanNTK: 'user' (default) or 'dev'. |
A list containing the following items: value <- list( * funcs = tmp, * verbose = get_data(lines, "verbose") == "enabled", * UI_view_debugger: a 'boolean' to show (TRUE) of hide (FALSE) the debugger interface * UI_view_open_pipeline: a 'boolean' to show (TRUE) of hide (FALSE) the UI to open a pipeline * UI_view_convert_dataset a 'boolean' to show (TRUE) of hide (FALSE) the UI for convert/import a dataset * UI_view_change_Look_Feel a 'boolean' to show (TRUE) of hide (FALSE) the UI to change the L&F * UI_view_change_core_funcs a 'boolean' to show (TRUE) of hide (FALSE) the UI to change the generic functions * extension A 'character()' which specifies the extension file allowed to be processed in the pipeline, * class A 'character()' which specifies the class of the dataset to be processed in the pipeline, * package A 'character()' which specifies the package which owns the pipeline * demo_package A 'character()' which specifies a particular package to search * URL_manual The path to the Rmd file containing the user manual of the pipeline. It can be a path to a file on the computer or a link to a file over internet. * URL_ReleaseNotes The path to the Rmd file containing release notes about the pipeline. It can be a path to a file on the computer or a link to a file over internet.
path <- system.file("workflow/PipelineDemo", package = "MagellanNTK") readConfigFile(path)path <- system.file("workflow/PipelineDemo", package = "MagellanNTK") readConfigFile(path)
Read the value of a directoryInput
readDirectoryInput(session, inputId)readDirectoryInput(session, inputId)
session |
The |
inputId |
The id of the input object |
Reads the value of the text field associated with a directoryInput
object that stores the user selected directory path.
NA
NULLNULL
Runs a demo app with the code
runDirinputExample()runDirinputExample()
Runs a demo app with the code. See the code in the example_application folder for how this is accomplished.
NA
if (interactive()) { shiny::runApp(runDirinputExample()) }if (interactive()) { shiny::runApp(runDirinputExample()) }
Get the position of the last validated item
SetCurrentPosition(stepsstatus)SetCurrentPosition(stepsstatus)
stepsstatus |
A vector of integers which reflects the status of the steps in the pipeline. Thus, the length of this vector is equal to the number of steps |
An integer
status <- c(1, 1, 1, 0, 0) SetCurrentPosition(status) status <- c(1, 1, 0, 1, 0) SetCurrentPosition(status)status <- c(1, 1, 1, 0, 0) SetCurrentPosition(status) status <- c(1, 1, 0, 1, 0) SetCurrentPosition(status)
Standardize names
SetHistory(obj.se, history)SetHistory(obj.se, history)
obj.se |
An instance of the class 'SummarizedExperiment' |
history |
A 'data.frame()' |
An instance of the class 'SummarizedExperiment'
Samuel Wieczorek
data(lldata) history <- GetHistory(lldata, "Convert") history <- Add2History(history, "Step example", "Substep example", "ex_param", "Ex") lldata[[1]] <- SetHistory(lldata[[1]], history)data(lldata) history <- GetHistory(lldata, "Convert") history <- Add2History(history, "Step example", "Substep example", "ex_param", "Ex") lldata[[1]] <- SetHistory(lldata[[1]], history)
Prints the content of a 'Config' class
## S4 method for signature 'Config' show(object)## S4 method for signature 'Config' show(object)
object |
An instance of the class 'Config' |
NA
These functions content the UI code for the main sidebar in the interface of MagellanNTK
Insert_User_Sidebar()Insert_User_Sidebar()
Shiny UI component
Insert_User_Sidebar()Insert_User_Sidebar()
Loads the source code of basic Shiny app files
source_shinyApp_files()source_shinyApp_files()
NA
if (interactive()) { source_shinyApp_files() }if (interactive()) { source_shinyApp_files() }
This function goes into the 'R' directory of the file structure of a pipeline and load into memory the source code of the R scripts (which contains the interfaces of the process)
source_wf_files(dirpath, verbose = FALSE)source_wf_files(dirpath, verbose = FALSE)
dirpath |
A 'character()' which is the path to the directory which contains the files and directories of the pipeline. |
verbose |
A 'boolean' to indicate whether to turn off (FALSE) or ON (TRUE) the verbose mode for logs. |
NA
path <- system.file("workflow/PipelineDemo", package = "MagellanNTK") source_wf_files(path)path <- system.file("workflow/PipelineDemo", package = "MagellanNTK") source_wf_files(path)
Define the appearance of the pipeline timeline.
Define the appearance of the pipeline timeline.
timeline_process_ui(id) timeline_process_server( id, config, status = reactive({ NULL }), position = reactive({ 1 }), enabled = reactive({ NULL }) ) timeline_process(config, status, position, enabled) timeline_pipeline_ui(id) timeline_pipeline_server(id, config, status, position, enabled) timeline_pipeline(config, status, position, enabled)timeline_process_ui(id) timeline_process_server( id, config, status = reactive({ NULL }), position = reactive({ 1 }), enabled = reactive({ NULL }) ) timeline_process(config, status, position, enabled) timeline_pipeline_ui(id) timeline_pipeline_server(id, config, status, position, enabled) timeline_pipeline(config, status, position, enabled)
id |
A 'character()' as the id of the Shiny module |
config |
An instance of the class 'Config' |
status |
A boolean which indicates whether the current status of the pipeline |
position |
An integer which reflects the current position of the cursor within the steps. |
enabled |
A vector of booleans with the same length as the number of steps (See the slot steps in the config object). Each element indicates if the corresponding step is enabled (TRUE) or (DISABLED) |
A shiny app
A shiny App
if (interactive()) { config <- Config( mode = "process", fullname = "PipelineDemo_Preprocessing", steps = c("Filtering", "Normalization"), mandatory = c(FALSE, TRUE) ) status <- reactive({ c(1, 1, 0, 0) }) pos <- reactive({ 2 }) enabled <- reactive({ c(0, 0, 1, 1) }) shiny::runApp(timeline_process(config, status, pos, enabled)) } if (interactive()) { config <- Config( mode = "pipeline", fullname = "PipelineDemo", steps = c("DataGeneration", "Preprocessing", "Clustering"), mandatory = c(TRUE, FALSE, FALSE) ) status <- reactive({ c(1, 1, -1, 1, 0) }) pos <- reactive({ 4 }) enabled <- reactive({ c(0, 0, 0, 0, 1) }) timeline_pipeline(config, status, pos, enabled) }if (interactive()) { config <- Config( mode = "process", fullname = "PipelineDemo_Preprocessing", steps = c("Filtering", "Normalization"), mandatory = c(FALSE, TRUE) ) status <- reactive({ c(1, 1, 0, 0) }) pos <- reactive({ 2 }) enabled <- reactive({ c(0, 0, 1, 1) }) shiny::runApp(timeline_process(config, status, pos, enabled)) } if (interactive()) { config <- Config( mode = "pipeline", fullname = "PipelineDemo", steps = c("DataGeneration", "Preprocessing", "Clustering"), mandatory = c(TRUE, FALSE, FALSE) ) status <- reactive({ c(1, 1, -1, 1, 0) }) pos <- reactive({ 4 }) enabled <- reactive({ c(0, 0, 0, 0, 1) }) timeline_pipeline(config, status, pos, enabled) }
Returns the date and time in timestamp UNIX format.
Timestamp()Timestamp()
A 'integer()'.
NULLNULL
Updates the status of steps in a given range
ToggleState_Screens(cond, range, is.enabled, rv)ToggleState_Screens(cond, range, is.enabled, rv)
cond |
A 'boolean' |
range |
A 'vector' of integers. The min of this vector must be greater of equal to 0 and the max must be less or equal to the size of the vector rv$steps.enabled |
is.enabled |
A 'boolean' |
rv |
A ‘list' containing at least a slot named ’steps.enabled' which is a vector of integers |
An updated version of the vector rv$steps.enabled
NULLNULL
Wrapper for the 'toggleWidget()' function of the package 'shinyjs'
toggleWidget(widget, condition)toggleWidget(widget, condition)
widget |
The id of a 'Shiny' widget |
condition |
A 'logical()' to hide/show the widget. |
NA
Samuel Wieczorek
NULLNULL
Update the status enabled/disabled of the steps of a pipeline/process
Update_State_Screens(is.skipped, is.enabled, rv)Update_State_Screens(is.skipped, is.enabled, rv)
is.skipped |
A 'boolean' indicating whether the current step of a process or process of a pipeline has the status SKIPPED |
is.enabled |
A 'boolean' indicating whether the current step of a process or process of a pipeline is enabled (TRUE) or not (FALSE) |
rv |
A ‘list()' containing at least an item named ’steps.status' which is a vector of of names for the steps of a pipeline nor a process. |
A 'vector' of boolean which gives the status enabled (TRUE) or disabled (FALSE) of the steps from a pipeline nor a process.
NULLNULL
Change the value of a directoryInput on the client
updateDirectoryInput(session, inputId, value = NULL, ...)updateDirectoryInput(session, inputId, value = NULL, ...)
session |
The |
inputId |
The id of the input object. |
value |
A directory path to set |
... |
Additional arguments passed to |
Sends a message to the client, telling it to change the value of the input
object. For directoryInput objects, this changes the value displayed
in the text-field and triggers a client-side change event. A directory
selection dialog is not displayed.
NA
NULLNULL
Update the status of steps in a pipeline nor process.
UpdateStepsStatus(dataIn, config)UpdateStepsStatus(dataIn, config)
dataIn |
An instance of the 'SummarizedExperiment' class |
config |
An instance of the 'Config' class |
A vector of boolean in which each item indicates the status (VALIDATED, UNDONE, SKIPPED) of the corresponding step.
NULLNULL
A shiny Module.
view_dataset_ui(id) view_dataset_server(id, dataIn = NULL, ...) view_dataset(dataIn)view_dataset_ui(id) view_dataset_server(id, dataIn = NULL, ...) view_dataset(dataIn)
id |
A 'character()' as the id of the Shiny module |
dataIn |
An instance of the class 'MultiAssayExperiment' |
... |
Additional parameters |
A shiny App
if (interactive()) { data(lldata123) view_dataset(lldata123) }if (interactive()) { data(lldata123) view_dataset(lldata123) }