Skip to contents

A Workflow is composed of multiple Tools.

Public fields

name

(character(1))
Name of workflow.

path

(character(n))
Path(s) to workflow results.

tools

(list(n))
List of Tools that compose a Workflow.

files_tbl

(tibble(n))
Tibble of files from list_files_dir().

Methods


Method new()

Create a new Workflow object.

Usage

Workflow$new(name = NULL, path = NULL, tools = NULL)

Arguments

name

(character(1))
Name of workflow.

path

(character(n))
Path(s) to workflow results.

tools

(list(n))
List of Tools that compose a Workflow.


Method print()

Print details about the File.

Usage

Workflow$print(...)

Arguments

...

(ignored).


Method filter_files()

Filter files in given workflow directory.

Usage

Workflow$filter_files(include = NULL, exclude = NULL)

Arguments

include

(character(n))
Files to include.

exclude

(character(n))
Files to exclude.


Method list_files()

List files in given workflow directory.

Usage

Workflow$list_files(type = c("file", "symlink"))

Arguments

type

(character(1))
File types(s) to return (e.g. any, file, directory, symlink). See fs::dir_info.

Returns

A tibble with all files found for each Tool.


Method tidy()

Tidy Workflow files.

Usage

Workflow$tidy(tidy = TRUE, keep_raw = FALSE)

Arguments

tidy

(logical(1))
Should the raw parsed tibbles get tidied?

keep_raw

(logical(1))
Should the raw parsed tibbles be kept in the final output?

Returns

self invisibly.


Method write()

Write tidy tibbles.

Usage

Workflow$write(odir = ".", format = "tsv", id = NULL, dbconn = NULL)

Arguments

odir

(character(1))
Directory path to output tidy files.

format

(character(1))
Format of output files.

id

(character(1))
ID to use for the dataset (e.g. wfrid.123, prid.456).

dbconn

(DBIConnection)
Database connection object (see DBI::dbConnect).

Returns

A tibble with the tidy data and their output location prefix.


Method nemofy()

Parse, filter, tidy and write files.

Usage

Workflow$nemofy(
  odir = ".",
  format = "tsv",
  id = NULL,
  dbconn = NULL,
  include = NULL,
  exclude = NULL
)

Arguments

odir

(character(1))
Directory path to output tidy files.

format

(character(1))
Format of output files.

id

(character(1))
ID to use for the dataset (e.g. wfrid.123, prid.456).

dbconn

(DBIConnection)
Database connection object (see DBI::dbConnect).

include

(character(n))
Files to include.

exclude

(character(n))
Files to exclude.

Returns

A tibble with the tidy data and their output location prefix.


Method get_raw_schemas_all()

Get raw schemas for all Tools.

Usage

Workflow$get_raw_schemas_all()

Returns

Tibble with names of tool and file, schema and its version.


Method get_tidy_schemas_all()

Get tidy schemas for all Tools.

Usage

Workflow$get_tidy_schemas_all()

Returns

Tibble with names of tool and tbl, schema and its version.


Method get_tbls()

Get tidy tbls for all Tools.

Usage

Workflow$get_tbls()

Returns

Tibble with tidy tbls of all Tools.


Method clone()

The objects of this class are cloneable with this method.

Usage

Workflow$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

path <- system.file("extdata/tool1", package = "nemo")
tools <- list(tool1 = Tool1)
wf1 <- Workflow$new(name = "foo", path = path, tools = tools)
odir <- tempdir()
wf1$list_files()
#> # A tibble: 4 × 10
#>   tool_parser  parser bname        size lastmodified        path  pattern prefix
#>   <glue>       <chr>  <chr>       <fs:> <dttm>              <chr> <chr>   <glue>
#> 1 tool1_table1 table1 sampleA.to…   113 2025-09-07 13:03:45 /hom… "\\.to… sampl…
#> 2 tool1_table1 table1 sampleA.to…   153 2025-09-07 13:03:45 /hom… "\\.to… sampl…
#> 3 tool1_table2 table2 sampleA.to…    70 2025-09-07 13:03:45 /hom… "\\.to… sampl…
#> 4 tool1_table3 table3 sampleA.to…    83 2025-09-07 13:03:45 /hom… "\\.to… sampl…
#> # ℹ 2 more variables: schema <list>, group <glue>
wf1$nemofy(odir = odir, format = "parquet", id = "run1")
#> # A tibble: 4 × 9
#>   tool_parser  parser prefix  tidy_name tidy_data tbl_name fpfix dbtab  out     
#>   <glue>       <chr>  <glue>  <chr>     <list>    <glue>   <glu> <list> <list>  
#> 1 tool1_table1 table1 sampleA table1    <tibble>  tool1_t… /tmp… <NULL> <tibble>
#> 2 tool1_table1 table1 sample… table1    <tibble>  tool1_t… /tmp… <NULL> <tibble>
#> 3 tool1_table2 table2 sampleA table2    <tibble>  tool1_t… /tmp… <NULL> <tibble>
#> 4 tool1_table3 table3 sampleA table3    <tibble>  tool1_t… /tmp… <NULL> <tibble>
(lf <- list.files(odir, pattern = "tool1.*parquet", full.names = FALSE))
#> [1] "sampleA_2_tool1_table1.parquet" "sampleA_tool1_table1.parquet"  
#> [3] "sampleA_tool1_table2.parquet"   "sampleA_tool1_table3.parquet"  
#dbconn <- DBI::dbConnect(drv = RPostgres::Postgres(), dbname = "nemo", user = "orcabus")
#wf1$nemofy(format = "db", id = "runABC", dbconn = dbconn)