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

if (FALSE) { # \dontrun{
path <- here::here("nogit/oa_v2")
tools <- list(align = Alignments, sigs = Sigs)
wf1 <- Workflow$new(name = "foo", path = path, tools = tools)
wf1$list_files()
wf1$nemofy(
    odir = "nogit/test_data",
    format = "parquet",
    id = "run1"
)

dbconn <- DBI::dbConnect(
  drv = RPostgres::Postgres(),
  dbname = "nemo",
  user = "orcabus"
)
wf1$nemofy(
    format = "db",
    id = "runABC",
    dbconn = dbconn
)

} # }