Schema URL

Type: Config

One of

1. Config object

Definitions

Config object

A Viash configuration is a YAML file which contains metadata to describe the behaviour and build target(s) of a component.
We commonly name this file config.vsh.yaml in our examples, but you can name it however you choose.

functionality object required

The functionality-part of the config file describes the behaviour of the script in terms of arguments and resources. By specifying a few restrictions (e.g. mandatory arguments) and adding some descriptions, Viash will automatically generate a stylish command-line interface for you.

13 nested properties
name string required

Name of the component and the filename of the executable when built with viash build.

info object

Structured information. Can be any shape: a string, vector, map or even nested map.

version string

Version of the component. This field will be used to version the executable and the Docker container.

authors Author[]

A list of authors. An author must at least have a name, but can also have a list of roles, an e-mail address, and a map of custom properties.

Suggested values for roles are:

RoleAbbrev.Description
maintainermntfor the maintainer of the code. Ideally, exactly one maintainer is specified.
authorautfor persons who have made substantial contributions to the software.
contributorctbfor persons who have made smaller contributions (such as code patches).
datacontributordtcfor persons or organisations that contributed data sets for the software
copyrightholdercphfor all copyright holders. This is a legal concept so should use the legal name of an institution or corporate body.
funderfndfor persons or organizations that furnished financial support for the development of the software

The full list of roles is extremely comprehensive.

status enum

Allows setting a component to active, deprecated or disabled.

Values: "enabled" "disabled" "deprecated"
requirements object

Computational requirements related to running the component.

3 nested properties
cpus integer

The maximum number of (logical) cpus a component is allowed to use.

commands string[]

A list of commands which should be present on the system for the script to function.

memory string

The maximum amount of memory a component is allowed to allocate. Unit must be one of B, KB, MB, GB, TB or PB.

resources Resource[]

Resources are files that support the component. The first resource should be a script that will be executed when the functionality is run. Additional resources will be copied to the same directory.

Common properties:

  • type: file / r_script / python_script / bash_script / javascript_script / scala_script / csharp_script, specifies the type of the resource. The first resource cannot be of type file. When the type is not specified, the default type is simply file.
  • dest: filename, the resulting name of the resource. From within a script, the file can be accessed at meta["resources_dir"] + "/" + dest. If unspecified, dest will be set to the basename of the path parameter.
  • path: path/to/file, the path of the input file. Can be a relative or an absolute path, or a URI. Mutually exclusive with text.
  • text: ...multiline text..., the content of the resulting file specified as a string. Mutually exclusive with path.
  • is_executable: true / false, whether the resulting resource file should be made executable.
test_resources Resource[]

One or more scripts to be used to test the component behaviour when viash test is invoked. Additional files of type file will be made available only during testing. Each test script should expect no command-line inputs, be platform-independent, and return an exit code >0 when unexpected behaviour occurs during testing. See Unit Testing for more info.

argument_groups ArgumentGroup[]

A grouping of the arguments, used to display the help message.

  • name: foo, the name of the argument group.
  • description: Description of foo, a description of the argument group. Multiline descriptions are supported.
  • arguments: [arg1, arg2, ...], list of the arguments.
description string

A description of the component. This will be displayed with --help.

usage string

A description on how to use the component. This will be displayed with --help under the 'Usage:' section.

namespace string

Namespace this component is a part of. See the Namespaces guide for more information on namespaces.

arguments Argument[]

A list of arguments for this component. For each argument, a type and a name must be specified. Depending on the type of argument, different properties can be set. See these reference pages per type for more information:

  • string
  • file
  • integer
  • double
  • boolean
  • boolean_true
  • boolean_false
platforms Platform[] required

A list of platforms to generate target artifacts for.

  • Native
  • Docker
  • Nextflow
Project object

A Viash project configuration file. It's name should be _viash.yaml.

source string

Which source directory to use for the viash ns commands.

viash_version string

Which version of Viash to use.

config_mods string | string[]
target string

Which target directory to use for viash ns build.

Info object

Meta information fields filled in by Viash during build.

config string required

Path to the config used during build.

git_tag string

Git tag.

git_remote string

Git remote name.

viash_version string

The Viash version that was used to build the component.

output string

Folder path to the build artifacts.

platform string

The platform id used during build.

git_commit string

Git commit hash.

executable string

Output folder with main executable path.

EnvironmentVariables object

Viash checks several environment variables during operation.

VIASH_HOME string required

If VIASH_HOME is not defined, the fallback HOME/.viash is used.

Location where specific downloaded versions of Viash will be cached and run from.

VIASH_VERSION string

A specific Viash version can be set to run the commands with. If so required, the specific Viash version will be downloaded. This is useful when replicating older results or building Viash components that use outdated code.

Functionality object

The functionality-part of the config file describes the behaviour of the script in terms of arguments and resources. By specifying a few restrictions (e.g. mandatory arguments) and adding some descriptions, Viash will automatically generate a stylish command-line interface for you.

name string required

Name of the component and the filename of the executable when built with viash build.

info object

Structured information. Can be any shape: a string, vector, map or even nested map.

version string

Version of the component. This field will be used to version the executable and the Docker container.

authors Author[]

A list of authors. An author must at least have a name, but can also have a list of roles, an e-mail address, and a map of custom properties.

Suggested values for roles are:

RoleAbbrev.Description
maintainermntfor the maintainer of the code. Ideally, exactly one maintainer is specified.
authorautfor persons who have made substantial contributions to the software.
contributorctbfor persons who have made smaller contributions (such as code patches).
datacontributordtcfor persons or organisations that contributed data sets for the software
copyrightholdercphfor all copyright holders. This is a legal concept so should use the legal name of an institution or corporate body.
funderfndfor persons or organizations that furnished financial support for the development of the software

The full list of roles is extremely comprehensive.

status enum

Allows setting a component to active, deprecated or disabled.

Values: "enabled" "disabled" "deprecated"
requirements object

Computational requirements related to running the component.

3 nested properties
cpus integer

The maximum number of (logical) cpus a component is allowed to use.

commands string[]

A list of commands which should be present on the system for the script to function.

memory string

The maximum amount of memory a component is allowed to allocate. Unit must be one of B, KB, MB, GB, TB or PB.

resources Resource[]

Resources are files that support the component. The first resource should be a script that will be executed when the functionality is run. Additional resources will be copied to the same directory.

Common properties:

  • type: file / r_script / python_script / bash_script / javascript_script / scala_script / csharp_script, specifies the type of the resource. The first resource cannot be of type file. When the type is not specified, the default type is simply file.
  • dest: filename, the resulting name of the resource. From within a script, the file can be accessed at meta["resources_dir"] + "/" + dest. If unspecified, dest will be set to the basename of the path parameter.
  • path: path/to/file, the path of the input file. Can be a relative or an absolute path, or a URI. Mutually exclusive with text.
  • text: ...multiline text..., the content of the resulting file specified as a string. Mutually exclusive with path.
  • is_executable: true / false, whether the resulting resource file should be made executable.
test_resources Resource[]

One or more scripts to be used to test the component behaviour when viash test is invoked. Additional files of type file will be made available only during testing. Each test script should expect no command-line inputs, be platform-independent, and return an exit code >0 when unexpected behaviour occurs during testing. See Unit Testing for more info.

argument_groups ArgumentGroup[]

A grouping of the arguments, used to display the help message.

  • name: foo, the name of the argument group.
  • description: Description of foo, a description of the argument group. Multiline descriptions are supported.
  • arguments: [arg1, arg2, ...], list of the arguments.
description string

A description of the component. This will be displayed with --help.

usage string

A description on how to use the component. This will be displayed with --help under the 'Usage:' section.

namespace string

Namespace this component is a part of. See the Namespaces guide for more information on namespaces.

arguments Argument[]

A list of arguments for this component. For each argument, a type and a name must be specified. Depending on the type of argument, different properties can be set. See these reference pages per type for more information:

  • string
  • file
  • integer
  • double
  • boolean
  • boolean_true
  • boolean_false
Author object

Author metadata.

name string required

Full name of the author, usually in the name of FirstName MiddleName LastName.

email string

E-mail of the author.

info object

Structured information. Can be any shape: a string, vector, map or even nested map.

roles string | string[]
props Record<string, string>

Author properties. Must be a map of strings.

ComputationalRequirements object

Computational requirements related to running the component.

cpus integer

The maximum number of (logical) cpus a component is allowed to use.

commands string[]

A list of commands which should be present on the system for the script to function.

memory string

The maximum amount of memory a component is allowed to allocate. Unit must be one of B, KB, MB, GB, TB or PB.

ArgumentGroup object

A grouping of the arguments, used to display the help message.

name string required

The name of the argument group.

arguments Argument[] required

List of arguments.

description string

Description of foo`, a description of the argument group. Multiline descriptions are supported.

Platform NativePlatform | DockerPlatform | NextflowPlatform
NativePlatform object

Running a Viash component on a native platform means that the script will be executed in your current environment. Any dependencies are assumed to have been installed by the user, so the native platform is meant for developers (who know what they're doing) or for simple bash scripts (which have no extra dependencies).

type const: "native" required

Running a Viash component on a native platform means that the script will be executed in your current environment. Any dependencies are assumed to have been installed by the user, so the native platform is meant for developers (who know what they're doing) or for simple bash scripts (which have no extra dependencies).

Constant: "native"
id string

As with all platforms, you can give a platform a different name. By specifying id: foo, you can target this platform (only) by specifying -p foo in any of the Viash commands.

DockerPlatform object

Run a Viash component on a Docker backend platform. By specifying which dependencies your component needs, users will be able to build a docker container from scratch using the setup flag, or pull it from a docker repository.

image string required

The base container to start from. You can also add the tag here if you wish.

type const: "docker" required

Run a Viash component on a Docker backend platform. By specifying which dependencies your component needs, users will be able to build a docker container from scratch using the setup flag, or pull it from a docker repository.

Constant: "docker"
organization string

Name of a container's organization.

registry string

The URL to the a custom Docker registry

tag string

Specify a Docker image based on its tag.

target_tag string

The tag the resulting image gets. Advanced usage only.

run_args string | string[]
namespace_separator string

The separator between the namespace and the name of the component, used for determining the image name. Default: "/".

resolve_volume enum

Enables or disables automatic volume mapping. Enabled when set to Automatic or disabled when set to Manual. Default: Automatic

Values: "manual" "automatic" "auto" "Manual" "Automatic" "Auto"
id string

As with all platforms, you can give a platform a different name. By specifying id: foo, you can target this platform (only) by specifying -p foo in any of the Viash commands.

port string | integer | string[] | integer[]

A list of requirements for installing the following types of packages:

  • apt
  • apk
  • Docker setup instructions
  • JavaScript
  • Python
  • R
  • Ruby
  • yum

The order in which these dependencies are specified determines the order in which they will be installed.

workdir string

The working directory when starting the container. This doesn't change the Dockerfile but gets added as a command-line argument at runtime.

target_image string

If anything is specified in the setup section, running the ---setup will result in an image with the name of <target_image>:<version>. If nothing is specified in the setup section, simply image will be used. Advanced usage only.

cmd string | string[]
target_image_source string

The source of the target image. This is used for defining labels in the dockerfile.

test_setup Requirements[]

Additional requirements specific for running unit tests.

entrypoint string | string[]
target_registry string

The URL where the resulting image will be pushed to. Advanced usage only.

setup_strategy enum

The Docker setup strategy to use when building a container.

Values: "cb" "ifneedbepullelsecachedbuild" "donothing" "gentlepush" "alwayspullelsebuild" "build" "alwayspull" "alwaysbuild" "ifneedbebuild" "pullelsebuild" "p" "alwayspullelsecachedbuild" "pull" "maybepush" "ifneedbepullelsebuild" "cachedbuild" "pullelsecachedbuild" "push" "forcepush" "alwayspush" "b" "pushifnotpresent" "alwayscachedbuild" "meh" "ifneedbepull" "ifneedbecachedbuild"
target_organization string

The organization set in the resulting image. Advanced usage only.

chown boolean

In Linux, files created by a Docker container will be owned by root. With chown: true, Viash will automatically change the ownership of output files (arguments with type: file and direction: output) to the user running the Viash command after execution of the component. Default value: true.

NextflowPlatform object

Platform for generating Nextflow VDSL3 modules.

type const: "nextflow" required

Platform for generating Nextflow VDSL3 modules.

Constant: "nextflow"
auto object

Automated processing flags which can be toggled on or off.

4 nested properties
simplifyInput boolean

If true, an input tuple only containing only a single File (e.g. ["foo", file("in.h5ad")]) is automatically transformed to a map (i.e. ["foo", [ input: file("in.h5ad") ] ]).

Default: true.

simplifyOutput boolean

If true, an output tuple containing a map with a File (e.g. ["foo", [ output: file("out.h5ad") ] ]) is automatically transformed to a map (i.e. ["foo", file("out.h5ad")]).

Default: true.

publish boolean

If true, the module's outputs are automatically published to params.publishDir. Will throw an error if params.publishDir is not defined.

Default: false.

transcript boolean

If true, the module's transcripts from work/ are automatically published to params.transcriptDir. If not defined, params.publishDir + "/_transcripts" will be used. Will throw an error if neither are defined.

Default: false.

directives object

Directives are optional settings that affect the execution of the process.

29 nested properties
beforeScript string

The beforeScript directive allows you to execute a custom (Bash) snippet before the main process script is run. This may be useful to initialise the underlying cluster environment or for other custom initialisation.

See beforeScript.

module string | string[]
queue string | string[]
label string | string[]
container object | string
publishDir string | object | string | object[]
maxForks string | integer
maxErrors string | integer
cpus integer | string
accelerator Record<string, string>

The accelerator directive allows you to specify the hardware accelerator requirement for the task execution e.g. GPU processor.

Viash implements this directive as a map with accepted keywords: type, limit, request, and runtime.

See accelerator.

time string

The time directive allows you to define how long a process is allowed to run.

See time.

afterScript string

The afterScript directive allows you to execute a custom (Bash) snippet immediately after the main process has run. This may be useful to clean up your staging area.

See afterScript.

executor string

The executor defines the underlying system where processes are executed. By default a process uses the executor defined globally in the nextflow.config file.

The executor directive allows you to configure what executor has to be used by the process, overriding the default configuration. The following values can be used:

NameExecutor
awsbatchThe process is executed using the AWS Batch service.
azurebatchThe process is executed using the Azure Batch service.
condorThe process is executed using the HTCondor job scheduler.
google-lifesciencesThe process is executed using the Google Genomics Pipelines service.
igniteThe process is executed using the Apache Ignite cluster.
k8sThe process is executed using the Kubernetes cluster.
localThe process is executed in the computer where Nextflow is launched.
lsfThe process is executed using the Platform LSF job scheduler.
moabThe process is executed using the Moab job scheduler.
nqsiiThe process is executed using the NQSII job scheduler.
ogeAlias for the sge executor.
pbsThe process is executed using the PBS/Torque job scheduler.
pbsproThe process is executed using the PBS Pro job scheduler.
sgeThe process is executed using the Sun Grid Engine / Open Grid Engine.
slurmThe process is executed using the SLURM job scheduler.
tesThe process is executed using the GA4GH TES service.
ugeAlias for the sge executor.

See executor.

containerOptions string | string[]
disk string

The disk directive allows you to define how much local disk storage the process is allowed to use.

See disk.

tag string

The tag directive allows you to associate each process execution with a custom label, so that it will be easier to identify them in the log file or in the trace execution report.

See tag.

conda string | string[]
machineType string

The machineType can be used to specify a predefined Google Compute Platform machine type when running using the Google Life Sciences executor.

See machineType.

stageInMode string

The stageInMode directive defines how input files are staged-in to the process work directory. The following values are allowed:

ValueDescription
copyInput files are staged in the process work directory by creating a copy.
linkInput files are staged in the process work directory by creating an (hard) link for each of them.
symlinkInput files are staged in the process work directory by creating a symbolic link with an absolute path for each of them (default).
rellinkInput files are staged in the process work directory by creating a symbolic link with a relative path for each of them.

See stageInMode.

cache boolean | string
pod object | object[]
penv string

The penv directive allows you to define the parallel environment to be used when submitting a parallel task to the SGE resource manager.

See penv.

scratch boolean | string
storeDir string

The storeDir directive allows you to define a directory that is used as a permanent cache for your process results.

See storeDir.

maxRetries string | integer
echo boolean | string
errorStrategy string

The errorStrategy directive allows you to define how an error condition is managed by the process. By default when an error status is returned by the executed script, the process stops immediately. This in turn forces the entire pipeline to terminate.

Table of available error strategies:

NameExecutor
terminateTerminates the execution as soon as an error condition is reported. Pending jobs are killed (default)
finishInitiates an orderly pipeline shutdown when an error condition is raised, waiting the completion of any submitted job.
ignoreIgnores processes execution errors.
retryRe-submit for execution a process returning an error condition.

See errorStrategy.

memory string

The memory directive allows you to define how much memory the process is allowed to use.

See memory.

stageOutMode string

The stageOutMode directive defines how output files are staged-out from the scratch directory to the process work directory. The following values are allowed:

ValueDescription
copyOutput files are copied from the scratch directory to the work directory.
moveOutput files are moved from the scratch directory to the work directory.
rsyncOutput files are copied from the scratch directory to the work directory by using the rsync utility.

See stageOutMode.

container string

Specifies the Docker platform id to be used to run Nextflow.

config object

Allows tweaking how the Nextflow Config file is generated.

2 nested properties
labels Record<string, string>

A series of default labels to specify memory and cpu constraints.

The default memory labels are defined as "mem1gb", "mem2gb", "mem4gb", ... upto "mem512tb" and follows powers of 2. The default cpu labels are defined as "cpu1", "cpu2", "cpu5", "cpu10", ... upto "cpu1000" and follows a semi logarithmic scale (1, 2, 5 per decade).

Conceptually it is possible for a Viash Config to overwrite the full labels parameter, however likely it is more efficient to add additional labels in the Viash Project with a config mod.

script string | string[]
debug boolean

Whether or not to print debug messages.

id string

Every platform can be given a specific id that can later be referred to explicitly when running or building the Viash component.

Requirements ApkRequirements | AptRequirements | DockerRequirements | JavaScriptRequirements | PythonRequirements | RRequirements | RubyRequirements | YumRequirements
ApkRequirements object

Specify which apk packages should be available in order to run the component.

type const: "apk" required

Specify which apk packages should be available in order to run the component.

Constant: "apk"
packages string | string[]
AptRequirements object

Specify which apt packages should be available in order to run the component.

type const: "apt" required

Specify which apt packages should be available in order to run the component.

Constant: "apt"
interactive boolean

If false, the Debian frontend is set to non-interactive (recommended). Default: false.

packages string | string[]
DockerRequirements object

Specify which Docker commands should be run during setup.

type const: "docker" required

Specify which Docker commands should be run during setup.

Constant: "docker"
run string | string[]
label string | string[]
build_args string | string[]
copy string | string[]
add string | string[]
env string | string[]
JavaScriptRequirements object

Specify which JavaScript packages should be available in order to run the component.

type const: "javascript" required

Specify which JavaScript packages should be available in order to run the component.

Constant: "javascript"
github string | string[]
url string | string[]
git string | string[]
npm string | string[]
packages string | string[]
PythonRequirements object

Specify which Python packages should be available in order to run the component.

type const: "python" required

Specify which Python packages should be available in order to run the component.

Constant: "python"
github string | string[]
gitlab string | string[]
pip string | string[]
pypi string | string[]
git string | string[]
upgrade boolean

Sets the --upgrade flag when set to true. Default: true.

packages string | string[]
url string | string[]
svn string | string[]
bazaar string | string[]
script string | string[]
mercurial string | string[]
user boolean

Sets the --user flag when set to true. Default: false.

RRequirements object

Specify which R packages should be available in order to run the component.

type const: "r" required

Specify which R packages should be available in order to run the component.

Constant: "r"
bioc string | string[]
github string | string[]
gitlab string | string[]
url string | string[]
bioc_force_install boolean

Forces packages specified in bioc to be reinstalled, even if they are already present in the container. Default: false.

git string | string[]
cran string | string[]
bitbucket string | string[]
svn string | string[]
packages string | string[]
script string | string[]
RubyRequirements object

Specify which Ruby packages should be available in order to run the component.

type const: "ruby" required

Specify which Ruby packages should be available in order to run the component.

Constant: "ruby"
packages string | string[]
YumRequirements object

Specify which yum packages should be available in order to run the component.

type const: "yum" required

Specify which yum packages should be available in order to run the component.

Constant: "yum"
packages string | string[]
Argument BooleanArgument | BooleanTrueArgument | BooleanFalseArgument | DoubleArgument | FileArgument | IntegerArgument | LongArgument | StringArgument
BooleanArgument object

A boolean type argument has two possible values: true or false.

name string required

The name of the argument. Can be in the formats --trim, -t or trim. The number of dashes determines how values can be passed:

  • --trim is a long option, which can be passed with executable_name --trim
  • -t is a short option, which can be passed with executable_name -t
  • trim is an argument, which can be passed with executable_name trim
type const: "boolean" required

A boolean type argument has two possible values: true or false.

Constant: "boolean"
alternatives string | string[]
info object

Structured information. Can be any shape: a string, vector, map or even nested map.

default boolean | boolean[]
example boolean | boolean[]
description string

A description of the argument. This will be displayed with --help.

multiple_sep string

The delimiter character for providing multiple values. : by default.

multiple boolean

Treat the argument value as an array. Arrays can be passed using the delimiter --foo=1:2:3 or by providing the same argument multiple times --foo 1 --foo 2. You can use a custom delimiter by using the multiple_sep property. false by default.

required boolean

Make the value for this argument required. If set to true, an error will be produced if no value was provided. false by default.

BooleanTrueArgument object

An argument of the boolean_true type acts like a boolean flag with a default value of false. When called as an argument it sets the boolean to true.

name string required

The name of the argument. Can be in the formats --silent, -s or silent. The number of dashes determines how values can be passed:

  • --silent is a long option, which can be passed with executable_name --silent
  • -s is a short option, which can be passed with executable_name -s
  • silent is an argument, which can be passed with executable_name silent
type const: "boolean_true" required

An argument of the boolean_true type acts like a boolean flag with a default value of false. When called as an argument it sets the boolean to true.

Constant: "boolean_true"
alternatives string | string[]
info object

Structured information. Can be any shape: a string, vector, map or even nested map.

description string

A description of the argument. This will be displayed with --help.

BooleanFalseArgument object

An argument of the boolean_false type acts like an inverted boolean flag with a default value of true. When called as an argument it sets the boolean to false.

name string required

The name of the argument. Can be in the formats --no-log, -n or no-log. The number of dashes determines how values can be passed:

  • --no-log is a long option, which can be passed with executable_name --no-log
  • -n is a short option, which can be passed with executable_name -n
  • no-log is an argument, which can be passed with executable_name no-log
type const: "boolean_false" required

An argument of the boolean_false type acts like an inverted boolean flag with a default value of true. When called as an argument it sets the boolean to false.

Constant: "boolean_false"
alternatives string | string[]
info object

Structured information. Can be any shape: a string, vector, map or even nested map.

description string

A description of the argument. This will be displayed with --help.

DoubleArgument object

A double type argument has a numeric value with decimal points

name string required

The name of the argument. Can be in the formats --foo, -f or foo. The number of dashes determines how values can be passed:

  • --foo is a long option, which can be passed with executable_name --foo=value or executable_name --foo value
  • -f is a short option, which can be passed with executable_name -f value
  • foo is an argument, which can be passed with executable_name value
type const: "double" required

A double type argument has a numeric value with decimal points

Constant: "double"
alternatives string | string[]
info object

Structured information. Can be any shape: a string, vector, map or even nested map.

max number | DoubleStrings
description string

A description of the argument. This will be displayed with --help.

multiple_sep string

The delimiter character for providing multiple values. : by default.

min number | DoubleStrings
multiple boolean

Treat the argument value as an array. Arrays can be passed using the delimiter --foo=1:2:3 or by providing the same argument multiple times --foo 1 --foo 2. You can use a custom delimiter by using the multiple_sep property. false by default.

required boolean

Make the value for this argument required. If set to true, an error will be produced if no value was provided. false by default.

FileArgument object

A file type argument has a string value that points to a file or folder path.

name string required

The name of the argument. Can be in the formats --foo, -f or foo. The number of dashes determines how values can be passed:

  • --foo is a long option, which can be passed with executable_name --foo=value or executable_name --foo value
  • -f is a short option, which can be passed with executable_name -f value
  • foo is an argument, which can be passed with executable_name value
type const: "file" required

A file type argument has a string value that points to a file or folder path.

Constant: "file"
alternatives string | string[]
create_parent boolean

If the output filename is a path and it does not exist, create it before executing the script (only for direction: output).

direction enum

Makes this argument an input or an output, as in does the file/folder needs to be read or written. input by default.

Values: "input" "output"
info object

Structured information. Can be any shape: a string, vector, map or even nested map.

must_exist boolean

Checks whether the file or folder exists. For input files, this check will happen before the execution of the script, while for output files the check will happen afterwards.

default string | string[]
example string | string[]
description string

A description of the argument. This will be displayed with --help.

multiple_sep string

The delimiter character for providing multiple values. : by default.

multiple boolean

Treat the argument value as an array. Arrays can be passed using the delimiter --foo=1:2:3 or by providing the same argument multiple times --foo 1 --foo 2. You can use a custom delimiter by using the multiple_sep property. false by default.

required boolean

Make the value for this argument required. If set to true, an error will be produced if no value was provided. false by default.

IntegerArgument object

An integer type argument has a numeric value without decimal points.

name string required

The name of the argument. Can be in the formats --foo, -f or foo. The number of dashes determines how values can be passed:

  • --foo is a long option, which can be passed with executable_name --foo=value or executable_name --foo value
  • -f is a short option, which can be passed with executable_name -f value
  • foo is an argument, which can be passed with executable_name value
type const: "integer" required

An integer type argument has a numeric value without decimal points.

Constant: "integer"
alternatives string | string[]
choices integer[]

Limit the amount of valid values for this argument to those set in this list. When set and a value not present in the list is provided, an error will be produced.

info object

Structured information. Can be any shape: a string, vector, map or even nested map.

max integer

Maximum allowed value for this argument. If set and the provided value is higher than the maximum, an error will be produced. Can be combined with min to clamp values.

default integer | integer[]
example integer | integer[]
description string

A description of the argument. This will be displayed with --help.

multiple_sep string

The delimiter character for providing multiple values. : by default.

min integer

Minimum allowed value for this argument. If set and the provided value is lower than the minimum, an error will be produced. Can be combined with max to clamp values.

multiple boolean

Treat the argument value as an array. Arrays can be passed using the delimiter --foo=1:2:3 or by providing the same argument multiple times --foo 1 --foo 2. You can use a custom delimiter by using the multiple_sep property. false by default.

required boolean

Make the value for this argument required. If set to true, an error will be produced if no value was provided. false by default.

LongArgument object

An long type argument has a numeric value without decimal points.

name string required

The name of the argument. Can be in the formats --foo, -f or foo. The number of dashes determines how values can be passed:

  • --foo is a long option, which can be passed with executable_name --foo=value or executable_name --foo value
  • -f is a short option, which can be passed with executable_name -f value
  • foo is an argument, which can be passed with executable_name value
type const: "long" required

An long type argument has a numeric value without decimal points.

Constant: "long"
alternatives string | string[]
choices integer[]

Limit the amount of valid values for this argument to those set in this list. When set and a value not present in the list is provided, an error will be produced.

info object

Structured information. Can be any shape: a string, vector, map or even nested map.

max integer

Maximum allowed value for this argument. If set and the provided value is higher than the maximum, an error will be produced. Can be combined with min to clamp values.

default integer | integer[]
example integer | integer[]
description string

A description of the argument. This will be displayed with --help.

multiple_sep string

The delimiter character for providing multiple values. : by default.

min integer

Minimum allowed value for this argument. If set and the provided value is lower than the minimum, an error will be produced. Can be combined with max to clamp values.

multiple boolean

Treat the argument value as an array. Arrays can be passed using the delimiter --foo=1:2:3 or by providing the same argument multiple times --foo 1 --foo 2. You can use a custom delimiter by using the multiple_sep property. false by default.

required boolean

Make the value for this argument required. If set to true, an error will be produced if no value was provided. false by default.

StringArgument object

A string type argument has a value made up of an ordered sequences of characters, like "Hello" or "I'm a string".

name string required

The name of the argument. Can be in the formats --foo, -f or foo. The number of dashes determines how values can be passed:

  • --foo is a long option, which can be passed with executable_name --foo=value or executable_name --foo value
  • -f is a short option, which can be passed with executable_name -f value
  • foo is an argument, which can be passed with executable_name value
type const: "string" required

A string type argument has a value made up of an ordered sequences of characters, like "Hello" or "I'm a string".

Constant: "string"
alternatives string | string[]
choices string[]

Limit the amount of valid values for this argument to those set in this list. When set and a value not present in the list is provided, an error will be produced.

info object

Structured information. Can be any shape: a string, vector, map or even nested map.

default string | string[]
example string | string[]
description string

A description of the argument. This will be displayed with --help.

multiple_sep string

The delimiter character for providing multiple values. : by default.

multiple boolean

Treat the argument value as an array. Arrays can be passed using the delimiter --foo=1:2:3 or by providing the same argument multiple times --foo 1 --foo 2. You can use a custom delimiter by using the multiple_sep property. false by default.

required boolean

Make the value for this argument required. If set to true, an error will be produced if no value was provided. false by default.

Resource BashScript | CSharpScript | Executable | JavaScriptScript | NextflowScript | PlainFile | PythonScript | RScript | ScalaScript
BashScript object

An executable Bash script. When defined in functionality.resources, only the first entry will be executed when running the built component or when running viash run. When defined in functionality.test_resources, all entries will be executed during viash test.

type const: "bash_script" required

An executable Bash script. When defined in functionality.resources, only the first entry will be executed when running the built component or when running viash run. When defined in functionality.test_resources, all entries will be executed during viash test.

Constant: "bash_script"
path string

The path of the input file. Can be a relative or an absolute path, or a URI. Mutually exclusive with text.

text string

The content of the resulting file specified as a string. Mutually exclusive with path.

is_executable boolean

Whether the resulting resource file should be made executable.

dest string

Resulting filename of the resource. From within a script, the file can be accessed at meta["resources_dir"] + "/" + dest. If unspecified, dest will be set to the basename of the path parameter.

CSharpScript object

An executable C# script. When defined in functionality.resources, only the first entry will be executed when running the built component or when running viash run. When defined in functionality.test_resources, all entries will be executed during viash test.

type const: "csharp_script" required

An executable C# script. When defined in functionality.resources, only the first entry will be executed when running the built component or when running viash run. When defined in functionality.test_resources, all entries will be executed during viash test.

Constant: "csharp_script"
path string

The path of the input file. Can be a relative or an absolute path, or a URI. Mutually exclusive with text.

text string

The content of the resulting file specified as a string. Mutually exclusive with path.

is_executable boolean

Whether the resulting resource file should be made executable.

dest string

Resulting filename of the resource. From within a script, the file can be accessed at meta["resources_dir"] + "/" + dest. If unspecified, dest will be set to the basename of the path parameter.

Executable object

An executable file.

type const: "executable" required

An executable file.

Constant: "executable"
path string

The path of the input file. Can be a relative or an absolute path, or a URI. Mutually exclusive with text.

text string

The content of the resulting file specified as a string. Mutually exclusive with path.

is_executable boolean

Whether the resulting resource file should be made executable.

dest string

Resulting filename of the resource. From within a script, the file can be accessed at meta["resources_dir"] + "/" + dest. If unspecified, dest will be set to the basename of the path parameter.

JavaScriptScript object

An executable JavaScript script. When defined in functionality.resources, only the first entry will be executed when running the built component or when running viash run. When defined in functionality.test_resources, all entries will be executed during viash test.

type const: "javascript_script" required

An executable JavaScript script. When defined in functionality.resources, only the first entry will be executed when running the built component or when running viash run. When defined in functionality.test_resources, all entries will be executed during viash test.

Constant: "javascript_script"
path string

The path of the input file. Can be a relative or an absolute path, or a URI. Mutually exclusive with text.

text string

The content of the resulting file specified as a string. Mutually exclusive with path.

is_executable boolean

Whether the resulting resource file should be made executable.

dest string

Resulting filename of the resource. From within a script, the file can be accessed at meta["resources_dir"] + "/" + dest. If unspecified, dest will be set to the basename of the path parameter.

NextflowScript object

A Nextflow script. Work in progress; added mainly for annotation at the moment.

type const: "nextflow_script" required

A Nextflow script. Work in progress; added mainly for annotation at the moment.

Constant: "nextflow_script"
path string

The path of the input file. Can be a relative or an absolute path, or a URI. Mutually exclusive with text.

text string

The content of the resulting file specified as a string. Mutually exclusive with path.

entrypoint string

The name of the workflow to be executed.

is_executable boolean

Whether the resulting resource file should be made executable.

dest string

Resulting filename of the resource. From within a script, the file can be accessed at meta["resources_dir"] + "/" + dest. If unspecified, dest will be set to the basename of the path parameter.

PlainFile object

A plain file. This can only be used as a supporting resource for the main script or unit tests.

path string

The path of the input file. Can be a relative or an absolute path, or a URI. Mutually exclusive with text.

text string

The content of the resulting file specified as a string. Mutually exclusive with path.

is_executable boolean

Whether the resulting resource file should be made executable.

type const: "file"

A plain file. This can only be used as a supporting resource for the main script or unit tests.

Constant: "file"
dest string

Resulting filename of the resource. From within a script, the file can be accessed at meta["resources_dir"] + "/" + dest. If unspecified, dest will be set to the basename of the path parameter.

PythonScript object

An executable Python script. When defined in functionality.resources, only the first entry will be executed when running the built component or when running viash run. When defined in functionality.test_resources, all entries will be executed during viash test.

type const: "python_script" required

An executable Python script. When defined in functionality.resources, only the first entry will be executed when running the built component or when running viash run. When defined in functionality.test_resources, all entries will be executed during viash test.

Constant: "python_script"
path string

The path of the input file. Can be a relative or an absolute path, or a URI. Mutually exclusive with text.

text string

The content of the resulting file specified as a string. Mutually exclusive with path.

is_executable boolean

Whether the resulting resource file should be made executable.

dest string

Resulting filename of the resource. From within a script, the file can be accessed at meta["resources_dir"] + "/" + dest. If unspecified, dest will be set to the basename of the path parameter.

RScript object

An executable R script. When defined in functionality.resources, only the first entry will be executed when running the built component or when running viash run. When defined in functionality.test_resources, all entries will be executed during viash test.

type const: "r_script" required

An executable R script. When defined in functionality.resources, only the first entry will be executed when running the built component or when running viash run. When defined in functionality.test_resources, all entries will be executed during viash test.

Constant: "r_script"
path string

The path of the input file. Can be a relative or an absolute path, or a URI. Mutually exclusive with text.

text string

The content of the resulting file specified as a string. Mutually exclusive with path.

is_executable boolean

Whether the resulting resource file should be made executable.

dest string

Resulting filename of the resource. From within a script, the file can be accessed at meta["resources_dir"] + "/" + dest. If unspecified, dest will be set to the basename of the path parameter.

ScalaScript object

An executable Scala script. When defined in functionality.resources, only the first entry will be executed when running the built component or when running viash run. When defined in functionality.test_resources, all entries will be executed during viash test.

type const: "scala_script" required

An executable Scala script. When defined in functionality.resources, only the first entry will be executed when running the built component or when running viash run. When defined in functionality.test_resources, all entries will be executed during viash test.

Constant: "scala_script"
path string

The path of the input file. Can be a relative or an absolute path, or a URI. Mutually exclusive with text.

text string

The content of the resulting file specified as a string. Mutually exclusive with path.

is_executable boolean

Whether the resulting resource file should be made executable.

dest string

Resulting filename of the resource. From within a script, the file can be accessed at meta["resources_dir"] + "/" + dest. If unspecified, dest will be set to the basename of the path parameter.

NextflowDirectives object

Directives are optional settings that affect the execution of the process.

beforeScript string

The beforeScript directive allows you to execute a custom (Bash) snippet before the main process script is run. This may be useful to initialise the underlying cluster environment or for other custom initialisation.

See beforeScript.

module string | string[]
queue string | string[]
label string | string[]
container object | string
publishDir string | object | string | object[]
maxForks string | integer
maxErrors string | integer
cpus integer | string
accelerator Record<string, string>

The accelerator directive allows you to specify the hardware accelerator requirement for the task execution e.g. GPU processor.

Viash implements this directive as a map with accepted keywords: type, limit, request, and runtime.

See accelerator.

time string

The time directive allows you to define how long a process is allowed to run.

See time.

afterScript string

The afterScript directive allows you to execute a custom (Bash) snippet immediately after the main process has run. This may be useful to clean up your staging area.

See afterScript.

executor string

The executor defines the underlying system where processes are executed. By default a process uses the executor defined globally in the nextflow.config file.

The executor directive allows you to configure what executor has to be used by the process, overriding the default configuration. The following values can be used:

NameExecutor
awsbatchThe process is executed using the AWS Batch service.
azurebatchThe process is executed using the Azure Batch service.
condorThe process is executed using the HTCondor job scheduler.
google-lifesciencesThe process is executed using the Google Genomics Pipelines service.
igniteThe process is executed using the Apache Ignite cluster.
k8sThe process is executed using the Kubernetes cluster.
localThe process is executed in the computer where Nextflow is launched.
lsfThe process is executed using the Platform LSF job scheduler.
moabThe process is executed using the Moab job scheduler.
nqsiiThe process is executed using the NQSII job scheduler.
ogeAlias for the sge executor.
pbsThe process is executed using the PBS/Torque job scheduler.
pbsproThe process is executed using the PBS Pro job scheduler.
sgeThe process is executed using the Sun Grid Engine / Open Grid Engine.
slurmThe process is executed using the SLURM job scheduler.
tesThe process is executed using the GA4GH TES service.
ugeAlias for the sge executor.

See executor.

containerOptions string | string[]
disk string

The disk directive allows you to define how much local disk storage the process is allowed to use.

See disk.

tag string

The tag directive allows you to associate each process execution with a custom label, so that it will be easier to identify them in the log file or in the trace execution report.

See tag.

conda string | string[]
machineType string

The machineType can be used to specify a predefined Google Compute Platform machine type when running using the Google Life Sciences executor.

See machineType.

stageInMode string

The stageInMode directive defines how input files are staged-in to the process work directory. The following values are allowed:

ValueDescription
copyInput files are staged in the process work directory by creating a copy.
linkInput files are staged in the process work directory by creating an (hard) link for each of them.
symlinkInput files are staged in the process work directory by creating a symbolic link with an absolute path for each of them (default).
rellinkInput files are staged in the process work directory by creating a symbolic link with a relative path for each of them.

See stageInMode.

cache boolean | string
pod object | object[]
penv string

The penv directive allows you to define the parallel environment to be used when submitting a parallel task to the SGE resource manager.

See penv.

scratch boolean | string
storeDir string

The storeDir directive allows you to define a directory that is used as a permanent cache for your process results.

See storeDir.

maxRetries string | integer
echo boolean | string
errorStrategy string

The errorStrategy directive allows you to define how an error condition is managed by the process. By default when an error status is returned by the executed script, the process stops immediately. This in turn forces the entire pipeline to terminate.

Table of available error strategies:

NameExecutor
terminateTerminates the execution as soon as an error condition is reported. Pending jobs are killed (default)
finishInitiates an orderly pipeline shutdown when an error condition is raised, waiting the completion of any submitted job.
ignoreIgnores processes execution errors.
retryRe-submit for execution a process returning an error condition.

See errorStrategy.

memory string

The memory directive allows you to define how much memory the process is allowed to use.

See memory.

stageOutMode string

The stageOutMode directive defines how output files are staged-out from the scratch directory to the process work directory. The following values are allowed:

ValueDescription
copyOutput files are copied from the scratch directory to the work directory.
moveOutput files are moved from the scratch directory to the work directory.
rsyncOutput files are copied from the scratch directory to the work directory by using the rsync utility.

See stageOutMode.

NextflowAuto object

Automated processing flags which can be toggled on or off.

simplifyInput boolean

If true, an input tuple only containing only a single File (e.g. ["foo", file("in.h5ad")]) is automatically transformed to a map (i.e. ["foo", [ input: file("in.h5ad") ] ]).

Default: true.

simplifyOutput boolean

If true, an output tuple containing a map with a File (e.g. ["foo", [ output: file("out.h5ad") ] ]) is automatically transformed to a map (i.e. ["foo", file("out.h5ad")]).

Default: true.

publish boolean

If true, the module's outputs are automatically published to params.publishDir. Will throw an error if params.publishDir is not defined.

Default: false.

transcript boolean

If true, the module's transcripts from work/ are automatically published to params.transcriptDir. If not defined, params.publishDir + "/_transcripts" will be used. Will throw an error if neither are defined.

Default: false.

NextflowConfig object

Allows tweaking how the Nextflow Config file is generated.

labels Record<string, string>

A series of default labels to specify memory and cpu constraints.

The default memory labels are defined as "mem1gb", "mem2gb", "mem4gb", ... upto "mem512tb" and follows powers of 2. The default cpu labels are defined as "cpu1", "cpu2", "cpu5", "cpu10", ... upto "cpu1000" and follows a semi logarithmic scale (1, 2, 5 per decade).

Conceptually it is possible for a Viash Config to overwrite the full labels parameter, however likely it is more efficient to add additional labels in the Viash Project with a config mod.

script string | string[]
DockerSetupStrategy enum

The Docker setup strategy to use when building a container.

Direction enum

Makes this argument an input or an output, as in does the file/folder needs to be read or written. input by default.

Status enum

Allows setting a component to active, deprecated or disabled.

DockerResolveVolume enum

Enables or disables automatic volume mapping. Enabled when set to Automatic or disabled when set to Manual. Default: Automatic

DoubleStrings enum
DoubleWithInf number | DoubleStrings