Skip to contents

Get and set methods for the Workflow S4 class.

Usage

# S4 method for Workflow
type(x)

# S4 method for Workflow
type(x) <- value

input(x)

# S4 method for Workflow
input(x)

input(x) <- value

# S4 method for Workflow
input(x) <- value

targets(x)

# S4 method for Workflow
targets(x)

targets(x) <- value

# S4 method for Workflow
targets(x) <- value

modules(x)

# S4 method for Workflow
modules(x)

# S4 method for Workflow
filePaths(x)

# S4 method for Workflow
filePaths(x) <- value

# S4 method for Workflow
sampleInformation(x)

# S4 method for Workflow
sampleInformation(x) <- value

# S4 method for Workflow
instrument(x)

# S4 method for Workflow
instrument(x) <- value

# S4 method for Workflow
directory(x)

# S4 method for Workflow
directory(x) <- value

# S4 method for Workflow
host(x)

# S4 method for Workflow
host(x) <- value

# S4 method for Workflow
port(x)

# S4 method for Workflow
port(x) <- value

# S4 method for Workflow
auth(x)

# S4 method for Workflow
auth(x) <- value

Arguments

x

S4 object of class Workflow

value

value to set

Examples

## Define a workflow with file path input
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')

## Return the workflow type
type(workflow_definition)
#> [1] "FIE-HRMS fingerprinting"

## Set the workflow type
type(workflow_definition) <- "RP-LC-HRMS profiling" 

## Return the workflow input
input(workflow_definition)
#> File path workflow input
#> # files: 68

## Set the workflow input
if (FALSE) {
input(workflow_definition) <- inputGrover(instrument = 'An_instrument',
                                          directory = 'Experiment_directory',
                                          host = 'a.grover.host',
                                          port = 80,
                                          auth = '1234')
}

## Return the workflow targets for the input module
targets(workflow_definition)$input
#> $file_paths_list
#> ## Retrieve data file paths
#> tarchetypes::tar_file(
#>   file_paths_list,
#>   "data/file_paths.txt"
#> )
#> 
#> $mzML
#> ## Track individual data files
#> hrmtargets::tar_export(
#>   mzML,
#>   readLines(file_paths_list)
#> )
#> 
#> $sample_information_file
#> ## Sample information file path
#> tarchetypes::tar_file(
#>   sample_information_file,
#>   "data/runinfo.csv"
#> )
#> 
#> $sample_information
#> ## Parse sample information
#> tar_target(
#>   sample_information,
#>   readr::read_csv(sample_information_file)
#> )
#> 

## Set the workflow targets
targets(workflow_definition) <- list(
                                     a_module = list(
                                     a_target =  target('a_target',
                                                        1 + 1,
                                                        args = list(memory = 'persistent'), 
                                                        comment = 'A target')
                                               )
                                     )

## Return the workflow modules
modules(workflow_definition)
#> [1] "a_module"

## Return the workflow file paths
if (FALSE) {
filePaths(workflow_definition)
}

## Set the workflow file paths
filePaths(workflow_definition) <- 'a_file.mzML'

## Return the workflow sample information
sampleInformation(workflow_definition)
#> # A tibble: 68 × 7
#>    fileOrder injOrder fileName   batch block name    class
#>        <dbl>    <dbl> <chr>      <dbl> <dbl> <chr>   <chr>
#>  1         1       64 1.mzML.gz      1     5 ABR1_1  ABR1 
#>  2         2       40 10.mzML.gz     1     3 ABR1_10 ABR1 
#>  3         3       52 11.mzML.gz     1     4 ABR1_11 ABR1 
#>  4         4       67 12.mzML.gz     1     5 ABR1_12 ABR1 
#>  5         5       32 13.mzML.gz     1     3 ABR1_13 ABR1 
#>  6         6       53 14.mzML.gz     1     4 ABR1_14 ABR1 
#>  7         7        4 15.mzML.gz     1     1 ABR1_15 ABR1 
#>  8         8       34 16.mzML.gz     1     3 ABR5_1  ABR5 
#>  9         9       38 17.mzML.gz     1     3 ABR5_2  ABR5 
#> 10        10       59 18.mzML.gz     1     5 ABR5_3  ABR5 
#> # ℹ 58 more rows

## Set the workflow sample information
sampleInformation(workflow_definition) <- tibble::tibble(fileName = 'a_file.mzML')

## Define a workflow with grover input
workflow_input <- inputGrover(instrument = 'An_instrument',
                              directory = 'Experiment_directory',
                              host = 'a.grover.host',
                              port = 80,
                              auth = '1234')

workflow_definition <- defineWorkflow(workflow_input,
                                      'FIE-HRMS fingerprinting',
                                      'Example project')

## Return the workflow instrument
instrument(workflow_definition)
#> [1] "An_instrument"

## Set the workflow Instrument
instrument(workflow_definition) <- 'A_different_instrument'

## Return the workflow directory
directory(workflow_definition)
#> [1] "Experiment_directory"

## Set the workflow directory
directory(workflow_definition) <- 'Another_experiment'

## Return the workflow host
host(workflow_definition)
#> [1] "a.grover.host"

## Set the workflow_host
host(workflow_definition) <- 'a.new.host'

## Return the workflow port
port(workflow_definition)
#> [1] 80

## Set the workflow port
port(workflow_definition) <- 81

## Return the workflow auth
auth(workflow_definition)
#> [1] "1234"

## Set the workflow auth
auth(workflow_definition) <- 'abcd'