workflow-edit: Edit workflow targets and modules

moduleReplaceR Documentation

Edit workflow targets and modules

Description

Edit the targets of a workflow definition.

Usage

moduleReplace(x, module, replacement)

## S4 method for signature 'Workflow'
moduleReplace(x, module, replacement)

modulesRemove(x, modules)

## S4 method for signature 'Workflow'
modulesRemove(x, modules)

modulesKeep(x, modules)

## S4 method for signature 'Workflow'
modulesKeep(x, modules)

moduleAdd(x, module, addition)

## S4 method for signature 'Workflow'
moduleAdd(x, module, addition)

targetReplace(x, module, target, replacement)

## S4 method for signature 'Workflow'
targetReplace(x, module, target, replacement)

targetRemove(x, module, target)

## S4 method for signature 'Workflow'
targetRemove(x, module, target)

targetAdd(x, module, target, addition)

## S4 method for signature 'Workflow'
targetAdd(x, module, target, addition)

Arguments

x

S4 object of class Workflow

module

the workflow module name

replacement

the replacement workflow module or target

modules

character vector of module names

addition

the workflow module or target to add

target

the workflow target name

Value

S4 object of class Workflow with edited targets

Examples

## Define a workflow
file_paths <- metaboData::filePaths('FIE-HRMS','BdistachyonEcotypes')
sample_information <- metaboData::runinfo('FIE-HRMS','BdistachyonEcotypes')

workflow_input <- inputFilePath(file_paths,sample_information)

workflow_definition <- defineWorkflow(workflow_input,
                                     'FIE-HRMS fingerprinting',
                                     'Example project')
                                     
## Add a module
workflow_definition <- moduleAdd(workflow_definition,
                                 'additional_module',
                                 list(new_target = target('new_target','1 + 1')))
## Replace the additional module
workflow_definition <- moduleReplace(workflow_definition,
                                     'additional_module',
                                     list(replacement_target = target('replacement_target',
                                     '1 + 2')))
## Remove the additional module
workflow_definition <- modulesRemove(workflow_definition,
                                    'additional_module')

## Add a target to the input module
workflow_definition <- targetAdd(workflow_definition,
                                 'input',
                                 'new_target',
                                 target('new_target','1 + 1'))
## Replace the additional target
workflow_definition <- targetReplace(workflow_definition,
                                 'input',
                                 'new_target',
                                 target('new_target','1 + 2')) 
## Remove the additional target
workflow_definition <- targetRemove(workflow_definition,
                                 'input',
                                 'new_target')

jasenfinch/metaboWorkflows documentation built on May 24, 2023, 8:23 a.m.