From 0b04de1cb8a392d674ba7e1485cffcb40457b480 Mon Sep 17 00:00:00 2001 From: Robrecht Cannoodt Date: Fri, 18 Oct 2024 14:00:54 +0200 Subject: [PATCH] remove resources which were moved to common_resources --- src/common/comp_tests/check_get_info.py | 37 - src/common/comp_tests/check_method_config.py | 132 - src/common/comp_tests/check_metric_config.py | 139 - src/common/comp_tests/run_and_check_adata.py | 127 - .../helper_functions/read_and_merge_yaml.R | 144 -- .../helper_functions/read_and_merge_yaml.py | 52 - .../helper_functions/read_anndata_partial.py | 77 - src/common/helper_functions/read_api_files.R | 493 ---- src/common/helper_functions/setup_logger.py | 12 - src/common/helper_functions/strip_margin.R | 3 - src/common/helper_functions/strip_margin.py | 3 - src/common/helper_functions/subset_anndata.py | 83 - src/common/schemas/api_component.yaml | 67 - src/common/schemas/api_file.yaml | 26 - src/common/schemas/defs_common.yaml | 256 -- src/common/schemas/defs_viash.yaml | 2252 ----------------- src/common/schemas/task_control_method.yaml | 68 - src/common/schemas/task_info.yaml | 22 - src/common/schemas/task_method.yaml | 65 - src/common/schemas/task_metric.yaml | 86 - 20 files changed, 4144 deletions(-) delete mode 100644 src/common/comp_tests/check_get_info.py delete mode 100644 src/common/comp_tests/check_method_config.py delete mode 100644 src/common/comp_tests/check_metric_config.py delete mode 100644 src/common/comp_tests/run_and_check_adata.py delete mode 100644 src/common/helper_functions/read_and_merge_yaml.R delete mode 100644 src/common/helper_functions/read_and_merge_yaml.py delete mode 100644 src/common/helper_functions/read_anndata_partial.py delete mode 100644 src/common/helper_functions/read_api_files.R delete mode 100644 src/common/helper_functions/setup_logger.py delete mode 100644 src/common/helper_functions/strip_margin.R delete mode 100644 src/common/helper_functions/strip_margin.py delete mode 100644 src/common/helper_functions/subset_anndata.py delete mode 100644 src/common/schemas/api_component.yaml delete mode 100644 src/common/schemas/api_file.yaml delete mode 100644 src/common/schemas/defs_common.yaml delete mode 100644 src/common/schemas/defs_viash.yaml delete mode 100644 src/common/schemas/task_control_method.yaml delete mode 100644 src/common/schemas/task_info.yaml delete mode 100644 src/common/schemas/task_method.yaml delete mode 100644 src/common/schemas/task_metric.yaml diff --git a/src/common/comp_tests/check_get_info.py b/src/common/comp_tests/check_get_info.py deleted file mode 100644 index a00f1d702d..0000000000 --- a/src/common/comp_tests/check_get_info.py +++ /dev/null @@ -1,37 +0,0 @@ -import subprocess -from os import path -import json - -## VIASH START -## VIASH END - -input_path = meta["resources_dir"] + "/test_file.yaml" -task_id = "denoising" -output_path = "output.json" - -cmd = [ - meta['executable'], - "--input", input_path, - "--task_id", task_id, - "--output", output_path, -] - -print(">> Running script as test", flush=True) -out = subprocess.run(cmd, stderr=subprocess.STDOUT) - -if out.stdout: - print(out.stdout) - -if out.returncode: - print(f"script: '{cmd}' exited with an error.") - exit(out.returncode) - -print(">> Checking whether output file exists", flush=True) -assert path.exists(output_path), "Output does not exist" - -print(">> Reading json file", flush=True) -with open(output_path, 'r') as f: - out = json.load(f) - print(out) - -print("All checks succeeded!", flush=True) \ No newline at end of file diff --git a/src/common/comp_tests/check_method_config.py b/src/common/comp_tests/check_method_config.py deleted file mode 100644 index a30111d648..0000000000 --- a/src/common/comp_tests/check_method_config.py +++ /dev/null @@ -1,132 +0,0 @@ -import yaml - -## VIASH START -meta = { - "config" : "foo" -} -## VIASH END - - -NAME_MAXLEN = 50 - -SUMMARY_MAXLEN = 400 - -DESCRIPTION_MAXLEN = 5000 - -_MISSING_DOIS = ["vandermaaten2008visualizing", "hosmer2013applied"] - -TIME_LABELS = ["lowtime", "midtime", "hightime", "veryhightime"] -MEM_LABELS = ["lowmem", "midmem", "highmem"] -CPU_LABELS = ["lowcpu", "midcpu", "highcpu"] - -def _load_bib(): - with open(f"{meta['resources_dir']}/library.bib", "r") as file: - return file.read() - -def check_url(url): - import requests - from urllib3.util.retry import Retry - from requests.adapters import HTTPAdapter - - # configure retry strategy - session = requests.Session() - retry = Retry(connect=3, backoff_factor=0.5) - adapter = HTTPAdapter(max_retries=retry) - session.mount('http://', adapter) - session.mount('https://', adapter) - - get = session.head(url) - - if get.ok or get.status_code == 429: # 429 rejected, too many requests - return True - else: - return False - -def search_ref_bib(reference): - import re - bib = _load_bib() - - entry_pattern = r"(@\w+{[^}]*" + reference + r"[^}]*}(.|\n)*?)(?=@)" - - bib_entry = re.search(entry_pattern, bib) - - if bib_entry: - - type_pattern = r"@(.*){" + reference - doi_pattern = r"(?=[Dd][Oo][Ii]\s*=\s*{([^,}]+)})" - - entry_type = re.search(type_pattern, bib_entry.group(1)) - - if not (entry_type.group(1) == "misc" or reference in _MISSING_DOIS): - entry_doi = re.search(doi_pattern, bib_entry.group(1)) - assert entry_doi.group(1), "doi not found in bibtex reference" - url = f"https://doi.org/{entry_doi.group(1)}" - assert check_url(url), f"{url} is not reachable, ref= {reference}." - - return True - - else: - return False - -print("Load config data", flush=True) -with open(meta["config"], "r") as file: - config = yaml.safe_load(file) - -print("Check general fields", flush=True) -assert len(config["functionality"]["name"]) <= NAME_MAXLEN, f"Component id (.functionality.name) should not exceed {NAME_MAXLEN} characters." -assert "namespace" in config["functionality"] is not None, "namespace not a field or is empty" - -print("Check info fields", flush=True) -info = config['functionality']['info'] -assert "type" in info, "type not an info field" -info_types = ["method", "control_method"] -assert info["type"] in info_types , f"got {info['type']} expected one of {info_types}" -assert "label" in info is not None, "label not an info field or is empty" -assert "summary" in info is not None, "summary not an info field or is empty" -assert "FILL IN:" not in info["summary"], "Summary not filled in" -assert len(info["summary"]) <= SUMMARY_MAXLEN, f"Component id (.functionality.info.summary) should not exceed {SUMMARY_MAXLEN} characters." -assert "description" in info is not None, "description not an info field or is empty" -assert "FILL IN:" not in info["description"], "description not filled in" -assert len(info["description"]) <= DESCRIPTION_MAXLEN, f"Component id (.functionality.info.description) should not exceed {DESCRIPTION_MAXLEN} characters." -if info["type"] == "method": - assert "reference" in info, "reference not an info field" - bib = _load_bib() - if info["reference"]: - reference = info["reference"] - if not isinstance(reference, list): - reference = [reference] - for ref in reference: - assert search_ref_bib(ref), f"reference {ref} not added to library.bib" - assert "documentation_url" in info is not None, "documentation_url not an info field or is empty" - assert "repository_url" in info is not None, "repository_url not an info field or is empty" - assert check_url(info["documentation_url"]), f"{info['documentation_url']} is not reachable" - assert check_url(info["repository_url"]), f"{info['repository_url']} is not reachable" - -if "variants" in info: - arg_names = [arg["name"].replace("--", "") for arg in config["functionality"]["arguments"]] + ["preferred_normalization"] - - for paramset_id, paramset in info["variants"].items(): - if paramset: - for arg_id in paramset: - assert arg_id in arg_names, f"Argument '{arg_id}' in `.functionality.info.variants['{paramset_id}']` is not an argument in `.functionality.arguments`." - -assert "preferred_normalization" in info, "preferred_normalization not an info field" -norm_methods = ["log_cpm", "log_cp10k", "counts", "log_scran_pooling", "sqrt_cpm", "sqrt_cp10k", "l1_sqrt"] -assert info["preferred_normalization"] in norm_methods, "info['preferred_normalization'] not one of '" + "', '".join(norm_methods) + "'." - -print("Check platform fields", flush=True) -platforms = config['platforms'] -for platform in platforms: - if not platform["type"] == "nextflow": - continue - nextflow= platform - -assert nextflow, "nextflow not a platform" -assert nextflow["directives"], "directives not a field in nextflow platform" -assert nextflow["directives"]["label"], "label not a field in nextflow platform directives" - -assert [i for i in nextflow["directives"]["label"] if i in TIME_LABELS], "time label not filled in" -assert [i for i in nextflow["directives"]["label"] if i in MEM_LABELS], "mem label not filled in" -assert [i for i in nextflow["directives"]["label"] if i in CPU_LABELS], "cpu label not filled in" - -print("All checks succeeded!", flush=True) diff --git a/src/common/comp_tests/check_metric_config.py b/src/common/comp_tests/check_metric_config.py deleted file mode 100644 index 45fa1efc2b..0000000000 --- a/src/common/comp_tests/check_metric_config.py +++ /dev/null @@ -1,139 +0,0 @@ -import yaml -from typing import Dict - -## VIASH START - -meta = { - "config" : "foo" -} - -## VIASH END - -NAME_MAXLEN = 50 - -SUMMARY_MAXLEN = 400 - -DESCRIPTION_MAXLEN = 5000 - -_MISSING_DOIS = ["vandermaaten2008visualizing", "hosmer2013applied"] - -TIME_LABELS = ["lowtime", "midtime", "hightime"] -MEM_LABELS = ["lowmem", "midmem", "highmem"] -CPU_LABELS = ["lowcpu", "midcpu", "highcpu"] - - -def _load_bib(): - bib_path = meta["resources_dir"]+"/library.bib" - with open(bib_path, "r") as file: - return file.read() - -def check_url(url): - import requests - from urllib3.util.retry import Retry - from requests.adapters import HTTPAdapter - - # configure retry strategy - session = requests.Session() - retry = Retry(connect=3, backoff_factor=0.5) - adapter = HTTPAdapter(max_retries=retry) - session.mount('http://', adapter) - session.mount('https://', adapter) - - get = session.head(url) - - if get.ok or get.status_code == 429: # 429 rejected, too many requests - return True - else: - return False - -def search_ref_bib(reference): - import re - bib = _load_bib() - - entry_pattern = r"(@\w+{[^}]*" + reference + r"[^}]*}(.|\n)*?)(?=@)" - - bib_entry = re.search(entry_pattern, bib) - - if bib_entry: - - type_pattern = r"@(.*){" + reference - doi_pattern = r"(?=[Dd][Oo][Ii]\s*=\s*{([^,}]+)})" - - entry_type = re.search(type_pattern, bib_entry.group(1)) - - if not (entry_type.group(1) == "misc" or reference in _MISSING_DOIS): - entry_doi = re.search(doi_pattern, bib_entry.group(1)) - assert entry_doi.group(1), "doi not found in bibtex reference" - url = f"https://doi.org/{entry_doi.group(1)}" - assert check_url(url), f"{url} is not reachable, ref= {reference}." - - return True - - else: - return False - -def check_metric(metric: Dict[str, str]) -> str: - assert "name" in metric is not None, "name not a field or is empty" - assert len(metric["name"]) <= NAME_MAXLEN, f"Component id (.functionality.info.metrics.metric.name) should not exceed {NAME_MAXLEN} characters." - assert "label" in metric is not None, "label not a field in metric or is empty" - assert "summary" in metric is not None, "summary not a field in metric or is empty" - assert "FILL IN:" not in metric["summary"], "Summary not filled in" - assert len(metric["summary"]) <= SUMMARY_MAXLEN, f"Component id (.functionality.info.metrics.metric.summary) should not exceed {SUMMARY_MAXLEN} characters." - assert "description" in metric is not None, "description not a field in metric or is empty" - assert len(metric["description"]) <= DESCRIPTION_MAXLEN, f"Component id (.functionality.info.metrics.metric.description) should not exceed {DESCRIPTION_MAXLEN} characters." - assert "FILL IN:" not in metric["description"], "description not filled in" - # assert "reference" in metric, "reference not a field in metric" - if "reference" in metric: - reference = metric["reference"] - if not isinstance(reference, list): - reference = [reference] - for ref in reference: - assert search_ref_bib(ref), f"reference {ref} not added to library.bib" - # assert "documentation_url" in metric , "documentation_url not a field in metric" - # assert "repository_url" in metric , "repository_url not a metric field" - if "documentation_url" in metric: - assert check_url(metric["documentation_url"]), f"{metric['documentation_url']} is not reachable" - if "repository_url" in metric: - assert check_url(metric["repository_url"]), f"{metric['repository_url']} is not reachable" - assert "min" in metric is not None, f"min not a field in metric or is emtpy" - assert "max" in metric is not None, f"max not a field in metric or is empty" - assert "maximize" in metric is not None, f"maximize not a field in metric or is emtpy" - assert isinstance(metric['min'], (int, str)), "not an int or string (-.inf)" - assert isinstance(metric['max'], (int, str)), "not an int or string (+.inf)" - assert isinstance(metric['maximize'], bool) or metric["maximize"] not in ["-inf", "+inf"], "not a bool" - - -print("Load config data", flush=True) -with open(meta["config"], "r") as file: - config = yaml.safe_load(file) - -print("check general fields", flush=True) -assert "name" in config["functionality"] is not None, "Name not a field or is empty" -assert len(config["functionality"]["name"]) <= NAME_MAXLEN, f"Component id (.functionality.name) should not exceed {NAME_MAXLEN} characters." -assert "namespace" in config["functionality"] is not None, "namespace not a field or is empty" - - -print("Check info fields", flush=True) -info = config['functionality']['info'] -assert "type" in info, "type not an info field" -assert info["type"] == "metric" , f"got {info['type']} expected 'metric'" -assert "metrics" in info, "metrics not an info field" -for metric in info["metrics"]: - check_metric(metric) - -print("Check platform fields", flush=True) -platforms = config['platforms'] -for platform in platforms: - if not platform["type"] == "nextflow": - continue - nextflow= platform - -assert nextflow, "nextflow not a platform" -assert nextflow["directives"], "directives not a field in nextflow platform" -assert nextflow["directives"]["label"], "label not a field in nextflow platform directives" - -assert [i for i in nextflow["directives"]["label"] if i in TIME_LABELS], "time label not filled in" -assert [i for i in nextflow["directives"]["label"] if i in MEM_LABELS], "mem label not filled in" -assert [i for i in nextflow["directives"]["label"] if i in CPU_LABELS], "cpu label not filled in" - -print("All checks succeeded!", flush=True) diff --git a/src/common/comp_tests/run_and_check_adata.py b/src/common/comp_tests/run_and_check_adata.py deleted file mode 100644 index d2cda5af94..0000000000 --- a/src/common/comp_tests/run_and_check_adata.py +++ /dev/null @@ -1,127 +0,0 @@ -import anndata as ad -import subprocess -from os import path -import yaml -import re - -## VIASH START -meta = { - "executable": "target/docker/denoising/methods/dca/dca", - "config": "target/docker/denoising/methods/dca/.config.vsh.yaml", - "resources_dir": "resources_test/denoising" -} -## VIASH END - -# helper functions -def check_slots(adata, arg): - """Check whether an AnnData file contains all for the required - slots in the corresponding .info.slots field. - """ - for struc_name, slot_items in arg["info"].get("slots", {}).items(): - struc_x = getattr(adata, struc_name) - - if struc_name == "X": - if slot_items.get("required", True): - assert struc_x is not None,\ - f"File '{arg['value']}' is missing slot .{struc_name}" - - else: - for slot_item in slot_items: - if slot_item.get("required", True): - assert slot_item["name"] in struc_x,\ - f"File '{arg['value']}' is missing slot .{struc_name}['{slot_item['name']}']" - -def run_and_check(arguments, cmd): - print(">> Checking whether input files exist", flush=True) - for arg in arguments: - if arg["type"] == "file" and arg["direction"] == "input": - assert path.exists(arg["value"]), f"Input file '{arg['value']}' does not exist" - - print(f">> Running script as test", flush=True) - out = subprocess.run(cmd, stderr=subprocess.STDOUT) - - if out.stdout: - print(out.stdout) - - if out.returncode: - print(f"script: \'{' '.join(cmd)}\' exited with an error.") - exit(out.returncode) - - print(">> Checking whether output file exists", flush=True) - for arg in arguments: - if arg["type"] == "file" and arg["direction"] == "output": - assert path.exists(arg["value"]), f"Output file '{arg['value']}' does not exist" - - print(">> Reading h5ad files and checking formats", flush=True) - adatas = {} - for arg in arguments: - if arg["type"] == "file" and "slots" in arg["info"]: - print(f"Reading and checking {arg['clean_name']}", flush=True) - adata = ad.read_h5ad(arg["value"]) - - print(f" {adata}") - - check_slots(adata, arg) - - adatas[arg["clean_name"]] = adata - - print("All checks succeeded!", flush=True) - - -# read viash config -with open(meta["config"], "r") as file: - config = yaml.safe_load(file) - -# get resources -arguments = [] - -for arg in config["functionality"]["arguments"]: - new_arg = arg.copy() - arg_info = new_arg.get("info") or {} - - # set clean name - clean_name = re.sub("^--", "", arg["name"]) - new_arg["clean_name"] = clean_name - - # use example to find test resource file - if arg["type"] == "file": - if arg["direction"] == "input": - value = f"{meta['resources_dir']}/{arg['example'][0]}" - else: - value = f"{clean_name}.h5ad" - new_arg["value"] = value - elif "test_default" in arg_info: - new_arg["value"] = arg_info["test_default"] - - arguments.append(new_arg) - - -if "test_setup" not in config["functionality"]["info"]: - argument_sets = {"run": arguments} -else: - test_setup = config["functionality"]["info"]["test_setup"] - argument_sets = {} - for name, test_instance in test_setup.items(): - new_arguments = [] - for arg in arguments: - new_arg = arg.copy() - if arg["clean_name"] in test_instance: - val = test_instance[arg["clean_name"]] - if new_arg["type"] == "file" and new_arg["direction"] == "input": - val = f"{meta['resources_dir']}/{val}" - new_arg["value"] = val - new_arguments.append(new_arg) - argument_sets[name] = new_arguments - -for argset_name, argset_args in argument_sets.items(): - print(f">> Running test '{argset_name}'", flush=True) - # construct command - cmd = [ meta["executable"] ] - for arg in argset_args: - if "value" in arg: - value = arg["value"] - if arg["multiple"] and isinstance(value, list): - value = arg["multiple_sep"].join(value) - cmd.extend([arg["name"], str(value)]) - - run_and_check(argset_args, cmd) \ No newline at end of file diff --git a/src/common/helper_functions/read_and_merge_yaml.R b/src/common/helper_functions/read_and_merge_yaml.R deleted file mode 100644 index 932d3feb92..0000000000 --- a/src/common/helper_functions/read_and_merge_yaml.R +++ /dev/null @@ -1,144 +0,0 @@ -#' Read a Viash YAML -#' -#' If the YAML contains a "__merge__" key anywhere in the yaml, -#' the path specified in that YAML will be read and the two -#' lists will be merged. This is a recursive procedure. -#' -#' @param path Path to Viash YAML -read_and_merge_yaml <- function(path, project_path = .ram_find_project(path)) { - path <- normalizePath(path, mustWork = FALSE) - data <- tryCatch({ - suppressWarnings(yaml::read_yaml(path)) - }, error = function(e) { - stop("Could not read ", path, ". Error: ", e) - }) - .ram_process_merge(data, data, path, project_path) -} - -.ram_find_project <- function(path) { - path <- normalizePath(path, mustWork = FALSE) - check <- paste0(dirname(path), "/_viash.yaml") - if (file.exists(check)) { - dirname(check) - } else if (check == "//_viash.yaml") { - NULL - } else { - .ram_find_project(dirname(check)) - } -} - -.ram_is_named_list <- function(obj) { - is.null(obj) || (is.list(obj) && (length(obj) == 0 || !is.null(names(obj)))) -} - -.ram_process_merge <- function(data, root_data, path, project_path) { - if (.ram_is_named_list(data)) { - # check whether children have `__merge__` entries - processed_data <- lapply(data, function(dat) { - .ram_process_merge(dat, root_data, path, project_path) - }) - processed_data <- lapply(names(data), function(nm) { - dat <- data[[nm]] - .ram_process_merge(dat, root_data, path, project_path) - }) - names(processed_data) <- names(data) - - # if current element has __merge__, read list2 yaml and combine with data - new_data <- - if ("__merge__" %in% names(processed_data) && !.ram_is_named_list(processed_data$`__merge__`)) { - new_data_path <- .ram_resolve_path( - path = processed_data$`__merge__`, - project_path = project_path, - parent_path = dirname(path) - ) - read_and_merge_yaml(new_data_path, project_path) - } else if ("$ref" %in% names(processed_data) && !.ram_is_named_list(processed_data$`$ref`)) { - ref_parts <- strsplit(processed_data$`$ref`, "#")[[1]] - - # resolve the path in $ref - x <- - if (ref_parts[[1]] == "") { - root_data - } else { - new_data_path <- .ram_resolve_path( - path = ref_parts[[1]], - project_path = project_path, - parent_path = dirname(path) - ) - new_data_path <- normalizePath(new_data_path, mustWork = FALSE) - - # read in the new data - tryCatch({ - suppressWarnings(yaml::read_yaml(new_data_path)) - }, error = function(e) { - stop("Could not read ", new_data_path, ". Error: ", e) - }) - } - x_root <- x - - - # Navigate the path and retrieve the referenced data - ref_path_parts <- unlist(strsplit(ref_parts[[2]], "/")) - for (part in ref_path_parts) { - if (part == "") { - next - } else if (part %in% names(x)) { - x <- x[[part]] - } else { - stop("Could not find ", processed_data$`$ref`, " in ", path) - } - } - - # postprocess the new data - if (ref_parts[[1]] == "") { - x - } else { - .ram_process_merge(x, x_root, new_data_path, project_path) - } - } else { - list() - } - - .ram_deep_merge(new_data, processed_data) - } else if (is.list(data)) { - lapply(data, function(dat) { - .ram_process_merge(dat, root_data, path, project_path) - }) - } else { - data - } -} - -.ram_resolve_path <- function(path, project_path, parent_path) { - ifelse( - grepl("^/", path), - paste0(project_path, "/", path), - fs::path_abs(path, parent_path) - ) -} - -.ram_deep_merge <- function(list1, list2) { - if (.ram_is_named_list(list1) && .ram_is_named_list(list2)) { - # if list1 and list2 are objects, recursively merge - keys <- unique(c(names(list1), names(list2))) - out <- lapply(keys, function(key) { - if (key %in% names(list1)) { - if (key %in% names(list2)) { - .ram_deep_merge(list1[[key]], list2[[key]]) - } else { - list1[[key]] - } - } else { - list2[[key]] - } - }) - names(out) <- keys - out - } else if (is.list(list1) && is.list(list2)) { - # if list1 and list2 are both lists, append - c(list1, list2) - } else { - # else override list1 with list2 - list2 - } -} \ No newline at end of file diff --git a/src/common/helper_functions/read_and_merge_yaml.py b/src/common/helper_functions/read_and_merge_yaml.py deleted file mode 100644 index b74995aed1..0000000000 --- a/src/common/helper_functions/read_and_merge_yaml.py +++ /dev/null @@ -1,52 +0,0 @@ -def read_and_merge_yaml(path): - """Read a Viash YAML - - If the YAML contains a "__merge__" key anywhere in the yaml, - the path specified in that YAML will be read and the two - lists will be merged. This is a recursive procedure. - - Arguments: - path -- Path to the Viash YAML""" - from ruamel.yaml import YAML - - yaml = YAML(typ='safe', pure=True) - - with open(path, 'r') as stream: - data = yaml.load(stream) - return _ram_process_merge(data, path) - -def _ram_deep_merge(dict1, dict2): - if isinstance(dict1, dict) and isinstance(dict2, dict): - keys = set(list(dict1.keys()) + list(dict2.keys())) - out = {} - for key in keys: - if key in dict1: - if key in dict2: - out[key] = _ram_deep_merge(dict1[key], dict2[key]) - else: - out[key] = dict1[key] - else: - out[key] = dict2[key] - return out - elif isinstance(dict1, list) and isinstance(dict2, list): - return dict1 + dict2 - else: - return dict2 - -def _ram_process_merge(data, path): - import os - if isinstance(data, dict): - processed_data = {k: _ram_process_merge(v, path) for k, v in data.items()} - - if "__merge__" in processed_data: - new_data_path = os.path.join(os.path.dirname(path), processed_data["__merge__"]) - new_data = read_and_merge_yaml(new_data_path) - else: - new_data = {} - - return _ram_deep_merge(new_data, processed_data) - elif isinstance(data, list): - return [_ram_process_merge(dat, path) for dat in data] - else: - return data - diff --git a/src/common/helper_functions/read_anndata_partial.py b/src/common/helper_functions/read_anndata_partial.py deleted file mode 100644 index efbea0592d..0000000000 --- a/src/common/helper_functions/read_anndata_partial.py +++ /dev/null @@ -1,77 +0,0 @@ -import warnings -from pathlib import Path -import anndata as ad -import h5py -from scipy.sparse import csr_matrix -from anndata.experimental import read_elem, sparse_dataset - - -def read_anndata( - file: str, - backed: bool = False, - **kwargs -) -> ad.AnnData: - """ - Read anndata file - :param file: path to anndata file in h5ad format - :param kwargs: AnnData parameter to group mapping - """ - assert Path(file).exists(), f'File not found: {file}' - - f = h5py.File(file, 'r') - kwargs = {x: x for x in f} if not kwargs else kwargs - if len(f.keys()) == 0: - return ad.AnnData() - # check if keys are available - for name, slot in kwargs.items(): - if slot not in f: - warnings.warn( - f'Cannot find "{slot}" for AnnData parameter `{name}` from "{file}"' - ) - adata = read_partial(f, backed=backed, **kwargs) - if not backed: - f.close() - - return adata - - -def read_partial( - group: h5py.Group, - backed: bool = False, - force_sparse_types: [str, list] = None, - **kwargs -) -> ad.AnnData: - """ - Partially read h5py groups - :params group: file group - :params force_sparse_types: encoding types to convert to sparse_dataset via csr_matrix - :params backed: read sparse matrix as sparse_dataset - :params **kwargs: dict of slot_name: slot, by default use all available slot for the h5py file - :return: AnnData object - """ - if force_sparse_types is None: - force_sparse_types = [] - elif isinstance(force_sparse_types, str): - force_sparse_types = [force_sparse_types] - slots = {} - if backed: - print('Read as backed sparse matrix...') - - for slot_name, slot in kwargs.items(): - print(f'Read slot "{slot}", store as "{slot_name}"...') - if slot not in group: - warnings.warn(f'Slot "{slot}" not found, skip...') - slots[slot_name] = None - else: - elem = group[slot] - iospec = ad._io.specs.get_spec(elem) - if iospec.encoding_type in ("csr_matrix", "csc_matrix") and backed: - slots[slot_name] = sparse_dataset(elem) - elif iospec.encoding_type in force_sparse_types: - slots[slot_name] = csr_matrix(read_elem(elem)) - if backed: - slots[slot_name] = sparse_dataset(slots[slot_name]) - else: - slots[slot_name] = read_elem(elem) - return ad.AnnData(**slots) - diff --git a/src/common/helper_functions/read_api_files.R b/src/common/helper_functions/read_api_files.R deleted file mode 100644 index f2cf49b2f8..0000000000 --- a/src/common/helper_functions/read_api_files.R +++ /dev/null @@ -1,493 +0,0 @@ - -anndata_struct_names <- c("obs", "var", "obsm", "obsp", "varm", "varp", "layers", "uns") - -read_file_spec <- function(path) { - spec <- read_and_merge_yaml(path) - out <- list( - info = read_file_info(spec, path) - ) - if (out$info$file_type == "h5ad" || "slots" %in% names(spec$info)) { - out$info$file_type <- "h5ad" - out$slots <- read_anndata_slots(spec, path) - } - if (out$info$file_type == "csv" || out$info$file_type == "tsv" || out$info$file_type == "parquet") { - out$columns <- read_tabular_columns(spec, path) - } - out -} -read_file_info <- function(spec, path) { - # TEMP: make it readable - spec$info$slots <- NULL - df <- list_as_tibble(spec) - if (list_contains_tibble(spec$info)) { - df <- dplyr::bind_cols(df, list_as_tibble(spec$info)) - } - df$file_name <- basename(path) %>% gsub("\\.yaml", "", .) - df$description <- df$description %||% NA_character_ %>% as.character - df$summary <- df$summary %||% NA_character_ %>% as.character - as_tibble(df) -} -read_anndata_slots <- function(spec, path) { - map_df( - anndata_struct_names, - function(struct_name, slot) { - slot <- spec$info$slots[[struct_name]] - if (is.null(slot)) return(NULL) - df <- map_df(slot, as.data.frame) - df$struct <- struct_name - df$file_name <- basename(path) %>% gsub("\\.yaml", "", .) - df$required <- df$required %||% TRUE %|% TRUE - df$multiple <- df$multiple %||% FALSE %|% FALSE - as_tibble(df) - } - ) -} -read_tabular_columns <- function(spec, path) { - map_df( - spec$info$columns, - function(column) { - df <- list_as_tibble(column) - df$file_name <- basename(path) %>% gsub("\\.yaml", "", .) - df$required <- df$required %||% TRUE %|% TRUE - df$multiple <- df$multiple %||% FALSE %|% FALSE - as_tibble(df) - } - ) -} - -format_file_format <- function(spec) { - if (spec$info$file_type == "h5ad") { - example <- spec$slots %>% - group_by(struct) %>% - summarise( - str = paste0(unique(struct), ": ", paste0("'", name, "'", collapse = ", ")) - ) %>% - arrange(match(struct, anndata_struct_names)) - - c(" AnnData object", paste0(" ", example$str)) - } else if (spec$info$file_type == "csv" || spec$info$file_type == "tsv" || spec$info$file_type == "parquet") { - example <- spec$columns %>% - summarise( - str = paste0("'", name, "'", collapse = ", ") - ) - - c(" Tabular data", paste0(" ", example$str)) - } else { - "" - } -} - -format_file_format_as_kable <- function(spec) { - if (spec$info$file_type == "h5ad") { - spec$slots %>% - mutate( - tag_str = pmap_chr(lst(required), function(required) { - out <- c() - if (!required) { - out <- c(out, "Optional") - } - if (length(out) == 0) { - "" - } else { - paste0("(_", paste(out, collapse = ", "), "_) ") - } - }) - ) %>% - transmute( - Slot = paste0("`", struct, "[\"", name, "\"]`"), - Type = paste0("`", type, "`"), - Description = paste0( - tag_str, - description %>% gsub(" *\n *", " ", .) %>% gsub("\\. *$", "", .), - "." - ) - ) %>% - knitr::kable() - } else if (spec$info$file_type == "csv" || spec$info$file_type == "tsv" || spec$info$file_type == "parquet") { - spec$columns %>% - mutate( - tag_str = pmap_chr(lst(required), function(required) { - out <- c() - if (!required) { - out <- c(out, "Optional") - } - if (length(out) == 0) { - "" - } else { - paste0("(_", paste(out, collapse = ", "), "_) ") - } - }) - ) %>% - transmute( - Column = paste0("`", name, "`"), - Type = paste0("`", type, "`"), - Description = paste0( - tag_str, - description %>% gsub(" *\n *", " ", .) %>% gsub("\\. *$", "", .), - "." - ) - ) %>% - knitr::kable() - } else { - "" - } -} - -list_contains_tibble <- function(li) { - is.list(li) && any(sapply(li, is.atomic)) -} - -list_as_tibble <- function(li) { - as.data.frame(li[sapply(li, is.atomic)], check.names = FALSE) -} - -read_comp_spec <- function(path) { - spec_yaml <- read_and_merge_yaml(path) - list( - info = read_comp_info(spec_yaml, path), - args = read_comp_args(spec_yaml, path) - ) -} - -read_comp_info <- function(spec_yaml, path) { - # TEMP: make it readable - spec_yaml$functionality$arguments <- NULL - spec_yaml$functionality$argument_groups <- NULL - - df <- list_as_tibble(spec_yaml$functionality) - if (nrow(df) == 0) { - df <- data.frame(a = 1)[, integer(0)] - } - if (list_contains_tibble(spec_yaml$functionality$info)) { - df <- dplyr::bind_cols(df, list_as_tibble(spec_yaml$functionality$info)) - } - if (list_contains_tibble(spec_yaml$functionality$info$type_info)) { - df <- dplyr::bind_cols(df, list_as_tibble(spec_yaml$functionality$info$type_info)) - } - df$file_name <- basename(path) %>% gsub("\\.yaml", "", .) - as_tibble(df) -} - -read_comp_args <- function(spec_yaml, path) { - arguments <- spec_yaml$functionality$arguments - for (arg_group in spec_yaml$functionality$argument_groups) { - arguments <- c(arguments, arg_group$arguments) - } - map_df(arguments, function(arg) { - df <- list_as_tibble(arg) - if (list_contains_tibble(arg$info)) { - df <- dplyr::bind_cols(df, list_as_tibble(arg$info)) - } - df$file_name <- basename(path) %>% gsub("\\.yaml", "", .) - df$arg_name <- gsub("^-*", "", arg$name) - df$direction <- df$direction %||% "input" %|% "input" - df$parent <- df$`__merge__` %||% NA_character_ %>% basename() %>% gsub("\\.yaml", "", .) - df$required <- df$required %||% FALSE %|% FALSE - df$default <- df$default %||% NA_character_ %>% as.character - df$example <- df$example %||% NA_character_ %>% as.character - df$description <- df$description %||% NA_character_ %>% as.character - df$summary <- df$summary %||% NA_character_ %>% as.character - df - }) -} - -format_comp_args_as_tibble <- function(spec) { - if (nrow(spec$args) == 0) return("") - spec$args %>% - mutate( - tag_str = pmap_chr(lst(required, direction), function(required, direction) { - out <- c() - if (!required) { - out <- c(out, "Optional") - } - if (direction == "output") { - out <- c(out, "Output") - } - if (length(out) == 0) { - "" - } else { - paste0("(_", paste(out, collapse = ", "), "_) ") - } - }) - ) %>% - transmute( - Name = paste0("`--", arg_name, "`"), - Type = paste0("`", type, "`"), - Description = paste0( - tag_str, - (summary %|% description) %>% gsub(" *\n *", " ", .) %>% gsub("\\. *$", "", .), - ".", - ifelse(!is.na(default), paste0(" Default: `", default, "`."), "") - ) - ) %>% - knitr::kable() -} - -# path <- "src/datasets/api/comp_processor_knn.yaml" -render_component <- function(spec) { - if (is.character(spec)) { - spec <- read_comp_spec(spec) - } - - strip_margin(glue::glue(" - §## Component type: {spec$info$label} - § - §Path: [`src/{spec$info$namespace}`](https://github.com/openproblems-bio/openproblems/tree/main/src/{spec$info$namespace}) - § - §{spec$info$summary} - § - §Arguments: - § - §:::{{.small}} - §{paste(format_comp_args_as_tibble(spec), collapse = '\n')} - §::: - § - §"), symbol = "§") -} - -# path <- "src/datasets/api/file_pca.yaml" -render_file <- function(spec) { - if (is.character(spec)) { - spec <- read_file_spec(spec) - } - - if (!"label" %in% names(spec$info)) { - spec$info$label <- basename(spec$info$example) - } - - example <- - if (is.null(spec$info$example) || is.na(spec$info$example)) { - "" - } else { - paste0("Example file: `", spec$info$example, "`") - } - - description <- - if (is.null(spec$info$description) || is.na(spec$info$description)) { - "" - } else { - paste0("Description:\n\n", spec$info$description) - } - - strip_margin(glue::glue(" - §## File format: {spec$info$label} - § - §{spec$info$summary %||% ''} - § - §{example} - § - §{description} - § - §Format: - § - §:::{{.small}} - §{paste(format_file_format(spec), collapse = '\n')} - §::: - § - §Slot description: - § - §:::{{.small}} - §{paste(format_file_format_as_kable(spec), collapse = '\n')} - §::: - § - §"), symbol = "§") -} - -# path <- "src/tasks/denoising" -read_task_api <- function(path) { - cli::cli_inform("Looking for project root") - project_path <- .ram_find_project(path) - api_dir <- paste0(path, "/api") - - cli::cli_inform("Reading task info") - task_info_yaml <- list.files(api_dir, pattern = "task_info.ya?ml", full.names = TRUE) - assertthat::assert_that(length(task_info_yaml) == 1) - task_info <- read_and_merge_yaml(task_info_yaml, project_path) - - cli::cli_inform("Reading task authors") - authors <- map_df(task_info$authors, function(aut) { - aut$roles <- paste(aut$roles, collapse = ", ") - list_as_tibble(aut) - }) - - cli::cli_inform("Reading component yamls") - comp_yamls <- list.files(api_dir, pattern = "comp_.*\\.ya?ml", full.names = TRUE) - comps <- map(comp_yamls, read_comp_spec) - comp_info <- map_df(comps, "info") - comp_args <- map_df(comps, "args") - names(comps) <- basename(comp_yamls) %>% gsub("\\..*$", "", .) - - cli::cli_inform("Reading file yamls") - file_yamls <- .ram_resolve_path( - path = na.omit(unique(comp_args$`__merge__`)), - project_path = project_path, - parent_path = api_dir - ) - files <- map(file_yamls, read_file_spec) - names(files) <- basename(file_yamls) %>% gsub("\\..*$", "", .) - file_info <- map_df(files, "info") - file_slots <- map_df(files, "slots") - - cli::cli_inform("Generating task graph") - task_graph <- create_task_graph(file_info, comp_info, comp_args) - - list( - task_info = task_info, - file_specs = files, - file_info = file_info, - file_slots = file_slots, - comp_specs = comps, - comp_info = comp_info, - comp_args = comp_args, - task_graph = task_graph, - authors = authors - ) -} - - -create_task_graph <- function(file_info, comp_info, comp_args) { - clean_id <- function(id) { - gsub("graph", "graaf", id) - } - nodes <- - bind_rows( - file_info %>% - mutate(id = file_name, label = label, is_comp = FALSE), - comp_info %>% - mutate(id = file_name, label = label, is_comp = TRUE) - ) %>% - select(id, label, everything()) %>% - mutate(str = paste0( - " ", - clean_id(id), - ifelse(is_comp, "[/\"", "(\""), - label, - ifelse(is_comp, "\"/]", "\")") - )) - edges <- bind_rows( - comp_args %>% - filter(type == "file", direction == "input") %>% - mutate( - from = parent, - to = file_name, - arrow = "---" - ), - comp_args %>% - filter(type == "file", direction == "output") %>% - mutate( - from = file_name, - to = parent, - arrow = "-->" - ) - ) %>% - select(from, to, everything()) %>% - mutate(str = paste0(" ", clean_id(from), arrow, clean_id(to))) - - igraph::graph_from_data_frame( - edges, - vertices = nodes, - directed = TRUE - ) -} - -.task_graph_get_root <- function(task_api) { - root <- names(which(igraph::degree(task_api$task_graph, mode = "in") == 0)) - if (length(root) > 1) { - warning( - "There should probably only be one node with in-degree equal to 0.\n", - " Nodes with in-degree == 0: ", paste(root, collapse = ", ") - ) - } - root[[1]] -} - -render_task_graph <- function(task_api, root = .task_graph_get_root(task_api)) { - order <- names(igraph::bfs(task_api$task_graph, root)$order) - - vdf <- igraph::as_data_frame(task_api$task_graph, "vertices") %>% - arrange(match(name, order)) - edf <- igraph::as_data_frame(task_api$task_graph, "edges") %>% - arrange(match(from, order), match(to, order)) - - strip_margin(glue::glue(" - §```mermaid - §flowchart LR - §{paste(vdf$str, collapse = '\n')} - §{paste(edf$str, collapse = '\n')} - §``` - §"), symbol = "§") -} - - - -# Recursive function to process each property with indentation -.render_example_process_property <- function(prop, prop_name = NULL, indent_level = 0) { - if (is.null(prop_name)) { - prop_name <- "" - } - - out <- c() - - # define helper variables - indent_spaces <- strrep(" ", indent_level) - next_indent_spaces <- strrep(" ", indent_level + 2) - - # add comment if available - if ("description" %in% names(prop)) { - comment <- gsub("\n", paste0("\n", indent_spaces, "# "), stringr::str_trim(prop$description)) - out <- c(out, indent_spaces, "# ", comment, "\n") - } - - # add variable - out <- c(out, indent_spaces, prop_name, ": ") - - if (prop$type == "object" && "properties" %in% names(prop)) { - # Handle object with properties - prop_names <- setdiff(names(prop$properties), "additionalProperties") - sub_props <- unlist(lapply(prop_names, function(sub_prop_name) { - prop_out <- .render_example_process_property( - prop$properties[[sub_prop_name]], - sub_prop_name, - indent_level + 2 - ) - c(prop_out, "\n") - })) - c(out, "\n", sub_props[-length(sub_props)]) - } else if (prop$type == "array") { - if (is.list(prop$items) && "properties" %in% names(prop$items)) { - # Handle array of objects - array_items_yaml <- unlist(lapply(names(prop$items$properties), function(item_prop_name) { - prop_out <- .render_example_process_property( - prop$items$properties[[item_prop_name]], - item_prop_name, - indent_level + 4 - ) - c(prop_out, "\n") - })) - c(out, "\n", next_indent_spaces, "- ", array_items_yaml[-1]) - } else { - # Handle simple array - c(out, "[ ... ]") - } - } else { - c(out, "...") - } -} - -# Function for rendering an example yaml based on a JSON schema -render_example <- function(json_schema) { - if (!"properties" %in% names(json_schema)) { - return("") - } - text <- - unlist(lapply(names(json_schema$properties), function(prop_name) { - out <- .render_example_process_property( - json_schema$properties[[prop_name]], - prop_name, - 0 - ) - c(out, "\n") - })) - - paste(text, collapse = "") -} \ No newline at end of file diff --git a/src/common/helper_functions/setup_logger.py b/src/common/helper_functions/setup_logger.py deleted file mode 100644 index ae71eb9611..0000000000 --- a/src/common/helper_functions/setup_logger.py +++ /dev/null @@ -1,12 +0,0 @@ -def setup_logger(): - import logging - from sys import stdout - - logger = logging.getLogger() - logger.setLevel(logging.INFO) - console_handler = logging.StreamHandler(stdout) - logFormatter = logging.Formatter("%(asctime)s %(levelname)-8s %(message)s") - console_handler.setFormatter(logFormatter) - logger.addHandler(console_handler) - - return logger \ No newline at end of file diff --git a/src/common/helper_functions/strip_margin.R b/src/common/helper_functions/strip_margin.R deleted file mode 100644 index 3830d58d79..0000000000 --- a/src/common/helper_functions/strip_margin.R +++ /dev/null @@ -1,3 +0,0 @@ -strip_margin <- function(text, symbol = "\\|") { - gsub(paste0("(^|\n)[ \t]*", symbol), "\\1", text) -} \ No newline at end of file diff --git a/src/common/helper_functions/strip_margin.py b/src/common/helper_functions/strip_margin.py deleted file mode 100644 index fbfb39dec9..0000000000 --- a/src/common/helper_functions/strip_margin.py +++ /dev/null @@ -1,3 +0,0 @@ -def strip_margin(text: str) -> str: - import re - return re.sub("(^|\n)[ \t]*\|", "\\1", text) \ No newline at end of file diff --git a/src/common/helper_functions/subset_anndata.py b/src/common/helper_functions/subset_anndata.py deleted file mode 100644 index 80bd160872..0000000000 --- a/src/common/helper_functions/subset_anndata.py +++ /dev/null @@ -1,83 +0,0 @@ -"""Helper functions related to subsetting AnnData objects based on the file format -specifications in the .config.vsh.yaml and slot mapping overrides.""" - -def read_config_slots_info(config_file, slot_mapping = {}): - """Read the .config.vsh.yaml to find out which output slots need to be copied to which output file. - - Arguments: - config_file -- Path to the .config.vsh.yaml file (required). - slot_mapping -- Which slots to retain. Must be a dictionary whose keys are the names - of the AnnData structs, and values is another dictionary with destination value - names as keys and source value names as values. - Example of slot_mapping: - ``` - slot_mapping = { - "layers": { - "counts": par["layer_counts"], - }, - "obs": { - "cell_type": par["obs_cell_type"], - "batch": par["obs_batch"], - } - } - ``` - """ - import yaml - import re - - # read output spec from yaml - with open(config_file, "r") as object_name: - config = yaml.safe_load(object_name) - - output_struct_slots = {} - - # fetch info on which slots should be copied to which file - for arg in config["functionality"]["arguments"]: - # argument is an output file with a slot specification - if arg["direction"] == "output" and arg.get("info", {}).get("slots"): - object_name = re.sub("--", "", arg["name"]) - - struct_slots = arg['info']['slots'] - out = {} - for (struct, slots) in struct_slots.items(): - out_struct = {} - for slot in slots: - # if slot_mapping[struct][slot['name']] exists, use that as the source slot name - # otherwise use slot['name'] - source_slot = slot_mapping.get(struct, {}).get(slot["name"], slot["name"]) - out_struct[slot["name"]] = source_slot - out[struct] = out_struct - - output_struct_slots[object_name] = out - - return output_struct_slots - -# create new anndata objects according to api spec -def subset_anndata(adata, slot_info): - """Create new anndata object according to slot info specifications. - - Arguments: - adata -- An AnnData object to subset (required) - slot_info -- Which slots to retain, typically one of the items in the output of read_config_slots_info. - Must be a dictionary whose keys are the names of the AnnData structs, and values is another - dictionary with destination value names as keys and source value names as values. - """ - import pandas as pd - import anndata as ad - - structs = ["layers", "obs", "var", "uns", "obsp", "obsm", "varp", "varm"] - kwargs = {} - - for struct in structs: - slot_mapping = slot_info.get(struct, {}) - data = {dest : getattr(adata, struct)[src] for (dest, src) in slot_mapping.items()} - if len(data) > 0: - if struct in ['obs', 'var']: - data = pd.concat(data, axis=1) - kwargs[struct] = data - elif struct in ['obs', 'var']: - # if no columns need to be copied, we still need an 'obs' and a 'var' - # to help determine the shape of the adata - kwargs[struct] = getattr(adata, struct).iloc[:,[]] - - return ad.AnnData(**kwargs) \ No newline at end of file diff --git a/src/common/schemas/api_component.yaml b/src/common/schemas/api_component.yaml deleted file mode 100644 index b197e2e367..0000000000 --- a/src/common/schemas/api_component.yaml +++ /dev/null @@ -1,67 +0,0 @@ -title: Component API -description: | - A component type specification file. -type: object -required: [functionality] -properties: - functionality: - type: object - description: Information regarding the functionality of the component. - required: [namespace, info, arguments, test_resources] - additionalProperties: false - properties: - namespace: - "$ref": "defs_common.yaml#/definitions/Namespace" - info: - type: object - description: Metadata of the component. - additionalProperties: false - required: [type, type_info] - properties: - type: - "$ref": "defs_common.yaml#/definitions/ComponentType" - subtype: - "$ref": "defs_common.yaml#/definitions/ComponentSubtype" - type_info: - type: object - description: Metadata related to the component type. - required: [label, summary, description] - properties: - label: - $ref: "defs_common.yaml#/definitions/Label" - summary: - $ref: "defs_common.yaml#/definitions/Summary" - description: - $ref: "defs_common.yaml#/definitions/Description" - arguments: - type: array - description: Component-specific parameters. - items: - anyOf: - - $ref: 'defs_common.yaml#/definitions/ComponentAPIFile' - - $ref: 'defs_viash.yaml#/definitions/BooleanArgument' - - $ref: 'defs_viash.yaml#/definitions/BooleanArgument' - - $ref: 'defs_viash.yaml#/definitions/BooleanTrueArgument' - - $ref: 'defs_viash.yaml#/definitions/BooleanFalseArgument' - - $ref: 'defs_viash.yaml#/definitions/DoubleArgument' - - $ref: 'defs_viash.yaml#/definitions/IntegerArgument' - - $ref: 'defs_viash.yaml#/definitions/LongArgument' - - $ref: 'defs_viash.yaml#/definitions/StringArgument' - resources: - type: array - description: Resources required to run the component. - items: - "$ref": "defs_viash.yaml#/definitions/Resource" - test_resources: - type: array - description: One or more scripts and resources used to test the component. - items: - "$ref": "defs_viash.yaml#/definitions/Resource" - platforms: - type: array - description: A list of platforms which Viash generates target artifacts for. - items: - anyOf: - - "$ref": "defs_common.yaml#/definitions/PlatformDocker" - - "$ref": "defs_common.yaml#/definitions/PlatformNative" - - "$ref": "defs_common.yaml#/definitions/PlatformVdsl3" diff --git a/src/common/schemas/api_file.yaml b/src/common/schemas/api_file.yaml deleted file mode 100644 index 6294439eda..0000000000 --- a/src/common/schemas/api_file.yaml +++ /dev/null @@ -1,26 +0,0 @@ -title: File API -description: A file format specification file. -type: object -additionalProperties: false -required: [type, example, info] -properties: - type: - const: file - example: - description: A file in the `resources_test` folder which is an example of this file format. - type: string - __merge__: - $ref: "defs_common.yaml#/definitions/Merge" - info: - description: 'Structured information. Can be any shape: a string, vector, map or even nested map.' - type: object - required: [label, summary] - properties: - label: - $ref: "defs_common.yaml#/definitions/Label" - summary: - $ref: "defs_common.yaml#/definitions/Summary" - description: - $ref: "defs_common.yaml#/definitions/Description" - slots: - $ref: "defs_common.yaml#/definitions/AnnDataSlots" diff --git a/src/common/schemas/defs_common.yaml b/src/common/schemas/defs_common.yaml deleted file mode 100644 index 60b9946210..0000000000 --- a/src/common/schemas/defs_common.yaml +++ /dev/null @@ -1,256 +0,0 @@ -definitions: - PlatformVdsl3: - title: VDSL3 - description: Next-gen platform for generating NextFlow VDSL3 modules. - properties: - type: - const: nextflow - description: Next-gen platform for generating NextFlow VDSL3 modules. - directives: - $ref: 'defs_viash.yaml#/definitions/NextflowDirectives' - required: [ type ] - additionalProperties: false - PlatformDocker: - title: Docker platform - description: | - Run a Viash component on a Docker backend platform. - By specifying which dependencies your component needs, users are be able to build - a docker container from scratch using the setup flag, or pull it from a docker repository. - type: object - properties: - type: - const: docker - description: Run a Viash component on a Docker backend platform. - image: - type: string - description: The base container to start from. You can also add the tag here - if you wish. - run_args: - anyOf: - - type: string - description: Add docker run arguments. - - type: array - items: - type: string - description: Add docker run arguments. - target_image_source: - type: string - description: The source of the target image. This is used for defining labels - in the dockerfile. - setup: - type: array - items: - "$ref": "defs_viash.yaml#/definitions/Requirements" - test_setup: - type: array - items: - "$ref": "defs_viash.yaml#/definitions/Requirements" - required: [type, image] - additionalProperties: false - PlatformNative: - title: Native platform - type: object - properties: - type: - const: native - description: Specifies the type of the platform. Running a Viash component - on a native platform means that the script will be executed in your current - environment. - required: [ type ] - additionalProperties: false - PreferredNormalization: - enum: [l1_sqrt, log_cpm, log_cp10k, log_scran_pooling, sqrt_cpm, sqrt_cp10k, counts] - description: | - Which normalization method a component prefers. - - Each value corresponds to a normalization component in the directory `src/datasets/normalization`. - ComponentSubtype: - type: string - description: | - A component subtype, in case the task has multiple subtypes of methods and metrics. - ComponentType: - type: string - description: | - A component subtype, in case the task has multiple subtypes of methods and metrics. - Name: - type: string - description: | - A unique identifier. Can only contain lowercase letters, numbers or underscores. - pattern: "^[a-z_][a-z0-9_]*$" - maxLength: 50 - Namespace: - type: string - description: | - The namespace a component is part of. - pattern: "^[a-z_][a-z0-9_/]*$" - Label: - type: string - description: | - A unique, human-readable, short label. Used for creating summary tables and visualisations. - maxLength: 50 - Image: - type: string - description: | - The name of the image file to use for the component on the website. - Summary: - type: string - description: | - A one sentence summary of purpose and methodology. Used for creating an overview tables. - minLength: 15 - maxLength: 180 - Description: - type: string - description: | - A longer description (one or more paragraphs). Used for creating reference documentation and supplementary information. - minLength: 30 - BibtexReference: - type: string - description: | - A bibtex reference key to the paper where the component is described. - DocumentationURL: - type: string - format: uri - pattern: "^https://" - description: The url to the documentation of the used software library. - RepositoryURL: - type: string - format: uri - pattern: "^https://" - description: The url to the repository of the used software library. - MethodVariants: - type: object - description: Alternative parameter sets which should be evaluated in the benchmark. - properties: - preferred_normalization: - "$ref": "#/definitions/PreferredNormalization" - CompAPIMerge: - type: string - description: | - The API specifies which type of component this is. - It contains specifications for: - - - The input/output files - - Common parameters - - A unit test - Merge: - type: string - description: | - Another YAML to inherit values from. - ComponentAPIFile: - description: A `file` type argument has a string value that points to a file or folder path. - type: object - properties: - name: - description: "The name of the argument. Can be in the formats `--foo`, `-f` or `foo`. The number of dashes determines how values can be passed: \n\n - `--foo` is a long option, which can be passed with `executable_name --foo=value` or `executable_name --foo value`\n - `-f` is a short option, which can be passed with `executable_name -f value`\n - `foo` is an argument, which can be passed with `executable_name value` \n" - type: string - __merge__: - type: string - description: The file format specification file. - direction: - description: Makes this argument an `input` or an `output`, as in does the file/folder needs to be read or written. `input` by default. - $ref: 'defs_viash.yaml#/definitions/Direction' - info: - description: 'Structured information. Can be any shape: a string, vector, map or even nested map.' - type: object - required: - description: Make the value for this argument required. If set to `true`, an error will be produced if no value was provided. `false` by default. - type: boolean - required: [name, __merge__, direction, required] - additionalProperties: false - AnnDataSlots: - properties: - X: - $ref: "#/definitions/AnnDataSlot" - layers: - type: array - items: - $ref: "#/definitions/AnnDataSlot" - var: - type: array - items: - $ref: "#/definitions/AnnDataSlot" - varm: - type: array - items: - $ref: "#/definitions/AnnDataSlot" - varp: - type: array - items: - $ref: "#/definitions/AnnDataSlot" - obs: - type: array - items: - $ref: "#/definitions/AnnDataSlot" - obsm: - type: array - items: - $ref: "#/definitions/AnnDataSlot" - obsp: - type: array - items: - $ref: "#/definitions/AnnDataSlot" - uns: - type: array - items: - oneOf: - - $ref: "#/definitions/AnnDataSlot" - - $ref: "#/definitions/AnnDataSlotObject" - AnnDataSlot: - properties: - type: - enum: [integer, double, string, boolean] - name: - type: string - description: A unique identifier. - pattern: "^[a-zA-Z_][a-zA-Z0-9_]*$" - description: - type: string - required: - type: boolean - required: [type, name, description, required] - AnnDataSlotObject: - properties: - type: - enum: [object] - name: - type: string - description: A unique identifier. - pattern: "^[a-zA-Z_][a-zA-Z0-9_]*$" - description: - type: string - required: - type: boolean - required: [type, name, description, required] - Author: - description: Author metadata. - type: object - additionalProperties: false - properties: - name: - description: Full name of the author, usually in the name of FirstName MiddleName LastName. - type: string - info: - description: Additional information on the author - type: object - additionalProperties: false - properties: - github: - type: string - orcid: - type: string - email: - type: string - twitter: - type: string - linkedin: - type: string - roles: - description: | - Role of the author. Possible values: - - * `"author"`: Authors who have made substantial contributions to the component. - * `"maintainer"`: The maintainer of the component. - * `"contributor"`: Authors who have made smaller contributions (such as code patches etc.). - type: array - items: - enum: [maintainer, author, contributor] \ No newline at end of file diff --git a/src/common/schemas/defs_viash.yaml b/src/common/schemas/defs_viash.yaml deleted file mode 100644 index fff25ab382..0000000000 --- a/src/common/schemas/defs_viash.yaml +++ /dev/null @@ -1,2252 +0,0 @@ -$schema: "https://json-schema.org/draft-07/schema#" -title: Viash config schema definitions. -oneOf: - - $ref: "#/definitions/Config" -definitions: - Config: - description: "A Viash Config" - properties: - functionality: - description: "The functionality-part of the config file describes the behaviour\ - \ of the script in terms of arguments and resources.\nBy specifying a few restrictions\ - \ (e.g. mandatory arguments) and adding some descriptions, Viash will automatically\ - \ generate a stylish command-line interface for you.\n" - $ref: "#/definitions/Functionality" - platforms: - description: "Definition of the platforms" - type: "array" - items: - $ref: "#/definitions/Platforms" - info: - description: "Definition of meta data" - $ref: "#/definitions/Info" - required: - - "functionality" - additionalProperties: false - NativePlatform: - description: "Running a Viash component on a native platform means that the script\ - \ will be executed in your current environment.\nAny 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).\n" - type: "object" - properties: - id: - description: "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." - type: "string" - type: - description: "Running a Viash component on a native platform means that the\ - \ script will be executed in your current environment.\nAny 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).\n" - const: "native" - required: - - "type" - additionalProperties: false - DockerPlatform: - description: "Run a Viash component on a Docker backend platform.\nBy 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.\n" - type: "object" - properties: - organization: - description: "Name of a container's [organization](https://docs.docker.com/docker-hub/orgs/)." - type: "string" - registry: - description: "The URL to the a [custom Docker registry](https://docs.docker.com/registry/)" - type: "string" - image: - description: "The base container to start from. You can also add the tag here\ - \ if you wish." - type: "string" - tag: - description: "Specify a Docker image based on its tag." - type: "string" - target_tag: - description: "The tag the resulting image gets. Advanced usage only." - type: "string" - run_args: - anyOf: - - description: "Add [docker run](https://docs.docker.com/engine/reference/run/)\ - \ arguments." - type: "string" - - description: "Add [docker run](https://docs.docker.com/engine/reference/run/)\ - \ arguments." - type: "array" - items: - type: "string" - namespace_separator: - description: "The separator between the namespace and the name of the component,\ - \ used for determining the image name. Default: `\"/\"`." - type: "string" - resolve_volume: - description: "Enables or disables automatic volume mapping. Enabled when set\ - \ to `Automatic` or disabled when set to `Manual`. Default: `Automatic`." - $ref: "#/definitions/DockerResolveVolume" - port: - anyOf: - - description: "A list of enabled ports. This doesn't change the Dockerfile\ - \ but gets added as a command-line argument at runtime." - type: "string" - - description: "A list of enabled ports. This doesn't change the Dockerfile\ - \ but gets added as a command-line argument at runtime." - type: "array" - items: - type: "string" - setup: - description: "A list of requirements for installing the following types of\ - \ packages:\n\n - @[apt](apt_req)\n - @[apk](apk_req)\n - @[Docker setup\ - \ instructions](docker_req)\n - @[JavaScript](javascript_req)\n - @[Python](python_req)\n\ - \ - @[R](r_req)\n - @[Ruby](ruby_req)\n - @[yum](yum_req)\n\nThe order in\ - \ which these dependencies are specified determines the order in which they\ - \ will be installed.\n" - type: "array" - items: - $ref: "#/definitions/Requirements" - workdir: - description: "The working directory when starting the container. This doesn't\ - \ change the Dockerfile but gets added as a command-line argument at runtime." - type: "string" - target_image: - description: "If anything is specified in the setup section, running the `---setup`\ - \ will result in an image with the name of `:`. If\ - \ nothing is specified in the `setup` section, simply `image` will be used.\ - \ Advanced usage only." - type: "string" - cmd: - anyOf: - - description: "Set the default command being executed when running the Docker\ - \ container." - type: "string" - - description: "Set the default command being executed when running the Docker\ - \ container." - type: "array" - items: - type: "string" - target_image_source: - description: "The source of the target image. This is used for defining labels\ - \ in the dockerfile." - type: "string" - test_setup: - description: "Additional requirements specific for running unit tests." - type: "array" - items: - $ref: "#/definitions/Requirements" - entrypoint: - anyOf: - - description: "Override the entrypoint of the base container. Default set\ - \ `ENTRYPOINT []`." - type: "string" - - description: "Override the entrypoint of the base container. Default set\ - \ `ENTRYPOINT []`." - type: "array" - items: - type: "string" - id: - description: "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." - type: "string" - target_registry: - description: "The URL where the resulting image will be pushed to. Advanced\ - \ usage only." - type: "string" - setup_strategy: - description: "The Docker setup strategy to use when building a container.\n\ - \n| Strategy | Description |\n|-----|----------|\n| `alwaysbuild` / `build`\ - \ / `b` | Always build the image from the dockerfile. This is the default\ - \ setup strategy.\n| `alwayscachedbuild` / `cachedbuild` / `cb` | Always\ - \ build the image from the dockerfile, with caching enabled.\n| `ifneedbebuild`\ - \ | Build the image if it does not exist locally.\n| `ifneedbecachedbuild`\ - \ | Build the image with caching enabled if it does not exist locally, with\ - \ caching enabled.\n| `alwayspull` / `pull` / `p` | Try to pull the container\ - \ from [Docker Hub](https://hub.docker.com) or the @[specified docker registry](docker_registry).\n\ - | `alwayspullelsebuild` / `pullelsebuild` | Try to pull the image from\ - \ a registry and build it if it doesn't exist.\n| `alwayspullelsecachedbuild`\ - \ / `pullelsecachedbuild` | Try to pull the image from a registry and build\ - \ it with caching if it doesn't exist.\n| `ifneedbepull` | If the image\ - \ does not exist locally, pull the image.\n| `ifneedbepullelsebuild` | \ - \ If the image does not exist locally, pull the image. If the image does\ - \ exist, build it.\n| `ifneedbepullelsecachedbuild` | If the image does\ - \ not exist locally, pull the image. If the image does exist, build it with\ - \ caching enabled.\n| `push` | Push the container to [Docker Hub](https://hub.docker.com)\ - \ or the @[specified docker registry](docker_registry).\n| `pushifnotpresent`\ - \ | Push the container to [Docker Hub](https://hub.docker.com) or the @[specified\ - \ docker registry](docker_registry) if the @[tag](docker_tag) does not exist\ - \ yet.\n| `donothing` / `meh` | Do not build or pull anything.\n\n" - $ref: "#/definitions/DockerSetupStrategy" - type: - description: "Run a Viash component on a Docker backend platform.\nBy 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.\n" - const: "docker" - target_organization: - description: "The organization set in the resulting image. Advanced usage\ - \ only." - type: "string" - chown: - description: "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`." - type: "boolean" - required: - - "image" - - "type" - additionalProperties: false - NextflowVdsl3Platform: - description: "Next-gen platform for generating NextFlow VDSL3 modules." - type: "object" - properties: - auto: - description: "@[Automated processing flags](nextflow_auto) which can be toggled\ - \ on or off:\n\n| Flag | Description | Default |\n|---|---------|----|\n\ - | `simplifyInput` | 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\") ] ]`). | `true` |\n\ - | `simplifyOutput` | 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\")]`). | `true`\ - \ |\n| `transcript` | 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. | `false` |\n| `publish` | If `true`, the module's outputs are\ - \ automatically published to `params.publishDir`. Will throw an error if\ - \ `params.publishDir` is not defined. | `false` |\n\n" - $ref: "#/definitions/NextflowAuto" - directives: - description: "@[Directives](nextflow_directives) are optional settings that\ - \ affect the execution of the process. These mostly match up with the Nextflow\ - \ counterparts. \n" - $ref: "#/definitions/NextflowDirectives" - container: - description: "Specifies the Docker platform id to be used to run Nextflow." - type: "string" - debug: - description: "Whether or not to print debug messages." - type: "boolean" - id: - description: "Every platform can be given a specific id that can later be\ - \ referred to explicitly when running or building the Viash component." - type: "string" - type: - description: "Next-gen platform for generating NextFlow VDSL3 modules." - const: "nextflow" - config: - description: "Allows tweaking how the @[Nextflow Config](nextflow_config)\ - \ file is generated." - $ref: "#/definitions/NextflowConfig" - required: - - "type" - additionalProperties: false - Platforms: - anyOf: - - $ref: "#/definitions/NativePlatform" - - $ref: "#/definitions/DockerPlatform" - - $ref: "#/definitions/NextflowVdsl3Platform" - Info: - description: "Meta information fields filled in by Viash during build." - type: "object" - properties: - git_tag: - description: "Git tag." - type: "string" - git_remote: - description: "Git remote name." - type: "string" - viash_version: - description: "The Viash version that was used to build the component." - type: "string" - config: - description: "Path to the config used during build." - type: "string" - output: - description: "Folder path to the build artifacts." - type: "string" - platform: - description: "The platform id used during build." - type: "string" - git_commit: - description: "Git commit hash." - type: "string" - executable: - description: "Output folder with main executable path." - type: "string" - required: - - "config" - additionalProperties: false - Functionality: - description: "The functionality-part of the config file describes the behaviour\ - \ of the script in terms of arguments and resources.\nBy specifying a few restrictions\ - \ (e.g. mandatory arguments) and adding some descriptions, Viash will automatically\ - \ generate a stylish command-line interface for you.\n" - type: "object" - properties: - name: - description: "Name of the component and the filename of the executable when\ - \ built with `viash build`." - type: "string" - info: - description: "Structured information. Can be any shape: a string, vector,\ - \ map or even nested map." - type: "object" - version: - description: "Version of the component. This field will be used to version\ - \ the executable and the Docker container." - type: "string" - authors: - description: "A list of @[authors](author). 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.\n\nSuggested values for roles are:\n \n| Role |\ - \ Abbrev. | Description |\n|------|---------|-------------|\n| maintainer\ - \ | mnt | for the maintainer of the code. Ideally, exactly one maintainer\ - \ is specified. |\n| author | aut | for persons who have made substantial\ - \ contributions to the software. |\n| contributor | ctb| for persons who\ - \ have made smaller contributions (such as code patches).\n| datacontributor\ - \ | dtc | for persons or organisations that contributed data sets for the\ - \ software\n| copyrightholder | cph | for all copyright holders. This is\ - \ a legal concept so should use the legal name of an institution or corporate\ - \ body.\n| funder | fnd | for persons or organizations that furnished financial\ - \ support for the development of the software\n\nThe [full list of roles](https://www.loc.gov/marc/relators/relaterm.html)\ - \ is extremely comprehensive.\n" - type: "array" - items: - $ref: "#/definitions/Author" - status: - description: "Allows setting a component to active, deprecated or disabled." - $ref: "#/definitions/Status" - requirements: - description: "@[Computational requirements](computational_requirements) related\ - \ to running the component. \n`cpus` specifies the maximum number of (logical)\ - \ cpus a component is allowed to use., whereas\n`memory` specifies the maximum\ - \ amount of memory a component is allowed to allicate. Memory units must\ - \ be\nin B, KB, MB, GB, TB or PB." - $ref: "#/definitions/ComputationalRequirements" - resources: - description: "@[Resources](resources) are files that support the component.\ - \ The first resource should be @[a script](scripting_languages) that will\ - \ be executed when the functionality is run. Additional resources will be\ - \ copied to the same directory.\n\nCommon properties:\n\n * 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`.\n * 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.\n * 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`.\n * text: ...multiline text..., the content of\ - \ the resulting file specified as a string. Mutually exclusive with `path`.\n\ - \ * is_executable: `true` / `false`, whether the resulting resource file\ - \ should be made executable.\n" - type: "array" - items: - $ref: "#/definitions/Resource" - test_resources: - description: "One or more @[scripts](scripting_languages) 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](unit_testing) for more info." - type: "array" - items: - $ref: "#/definitions/Resource" - argument_groups: - description: "A grouping of the @[arguments](argument), used to display the\ - \ help message.\n\n - `name: foo`, the name of the argument group. \n -\ - \ `description: Description of foo`, a description of the argument group.\ - \ Multiline descriptions are supported.\n - `arguments: [arg1, arg2, ...]`,\ - \ list of the arguments names.\n\n" - type: "array" - items: - $ref: "#/definitions/ArgumentGroup" - description: - description: "A description of the component. This will be displayed with\ - \ `--help`." - type: "string" - usage: - description: "A description on how to use the component. This will be displayed\ - \ with `--help` under the 'Usage:' section." - type: "string" - namespace: - description: "Namespace this component is a part of. See the @[Namespaces\ - \ guide](namespace) for more information on namespaces." - type: "string" - arguments: - description: "A list of @[arguments](argument) 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: \n\n - @[string](arg_string)\n - @[file](arg_file)\n\ - \ - @[integer](arg_integer)\n - @[double](arg_double)\n - @[boolean](arg_boolean)\n\ - \ - @[boolean_true](arg_boolean_true)\n - @[boolean_false](arg_boolean_false)\n" - type: "array" - items: - $ref: "#/definitions/Argument" - required: - - "name" - additionalProperties: false - Author: - description: "Author metadata." - type: "object" - properties: - name: - description: "Full name of the author, usually in the name of FirstName MiddleName\ - \ LastName." - type: "string" - email: - description: "E-mail of the author." - type: "string" - info: - description: "Structured information. Can be any shape: a string, vector,\ - \ map or even nested map." - type: "object" - roles: - anyOf: - - description: "Role of the author. Suggested items:\n\n* `\"author\"`: Authors\ - \ who have made substantial contributions to the component.\n* `\"maintainer\"\ - `: The maintainer of the component.\n* `\"contributor\"`: Authors who\ - \ have made smaller contributions (such as code patches etc.).\n" - type: "string" - - description: "Role of the author. Suggested items:\n\n* `\"author\"`: Authors\ - \ who have made substantial contributions to the component.\n* `\"maintainer\"\ - `: The maintainer of the component.\n* `\"contributor\"`: Authors who\ - \ have made smaller contributions (such as code patches etc.).\n" - type: "array" - items: - type: "string" - props: - description: "Author properties. Must be a map of strings." - type: "object" - additionalProperties: - description: "Author properties. Must be a map of strings." - type: "string" - required: - - "name" - additionalProperties: false - ComputationalRequirements: - description: "Computational requirements related to running the component." - type: "object" - properties: - cpus: - description: "The maximum number of (logical) cpus a component is allowed\ - \ to use." - type: "integer" - commands: - description: "A list of commands which should be present on the system for\ - \ the script to function." - type: "array" - items: - type: "string" - memory: - description: "The maximum amount of memory a component is allowed to allocate.\ - \ Unit must be one of B, KB, MB, GB, TB or PB." - type: "string" - required: [] - additionalProperties: false - RubyRequirements: - description: "Specify which Ruby packages should be available in order to run\ - \ the component." - type: "object" - properties: - type: - description: "Specify which Ruby packages should be available in order to\ - \ run the component." - const: "ruby" - packages: - anyOf: - - description: "Specifies which packages to install." - type: "string" - - description: "Specifies which packages to install." - type: "array" - items: - type: "string" - required: - - "type" - additionalProperties: false - YumRequirements: - description: "Specify which yum packages should be available in order to run the\ - \ component." - type: "object" - properties: - type: - description: "Specify which yum packages should be available in order to run\ - \ the component." - const: "yum" - packages: - anyOf: - - description: "Specifies which packages to install." - type: "string" - - description: "Specifies which packages to install." - type: "array" - items: - type: "string" - required: - - "type" - additionalProperties: false - JavascriptRequirements: - description: "Specify which JavaScript packages should be available in order to\ - \ run the component." - type: "object" - properties: - github: - anyOf: - - description: "Specifies which packages to install from GitHub." - type: "string" - - description: "Specifies which packages to install from GitHub." - type: "array" - items: - type: "string" - url: - anyOf: - - description: "Specifies which packages to install using a generic URI." - type: "string" - - description: "Specifies which packages to install using a generic URI." - type: "array" - items: - type: "string" - git: - anyOf: - - description: "Specifies which packages to install using a Git URI." - type: "string" - - description: "Specifies which packages to install using a Git URI." - type: "array" - items: - type: "string" - npm: - anyOf: - - description: "Specifies which packages to install from npm." - type: "string" - - description: "Specifies which packages to install from npm." - type: "array" - items: - type: "string" - type: - description: "Specify which JavaScript packages should be available in order\ - \ to run the component." - const: "javascript" - packages: - anyOf: - - description: "Specifies which packages to install from npm." - type: "string" - - description: "Specifies which packages to install from npm." - type: "array" - items: - type: "string" - required: - - "type" - additionalProperties: false - DockerRequirements: - description: "Specify which Docker commands should be run during setup." - type: "object" - properties: - run: - anyOf: - - description: "Specifies which `RUN` entries to add to the Dockerfile while\ - \ building it." - type: "string" - - description: "Specifies which `RUN` entries to add to the Dockerfile while\ - \ building it." - type: "array" - items: - type: "string" - label: - anyOf: - - description: "Specifies which `LABEL` entries to add to the Dockerfile while\ - \ building it." - type: "string" - - description: "Specifies which `LABEL` entries to add to the Dockerfile while\ - \ building it." - type: "array" - items: - type: "string" - build_args: - anyOf: - - description: "Specifies which `ARG` entries to add to the Dockerfile while\ - \ building it." - type: "string" - - description: "Specifies which `ARG` entries to add to the Dockerfile while\ - \ building it." - type: "array" - items: - type: "string" - type: - description: "Specify which Docker commands should be run during setup." - const: "docker" - add: - anyOf: - - description: "Specifies which `ADD` entries to add to the Dockerfile while\ - \ building it." - type: "string" - - description: "Specifies which `ADD` entries to add to the Dockerfile while\ - \ building it." - type: "array" - items: - type: "string" - env: - anyOf: - - description: "Specifies which `ENV` entries to add to the Dockerfile while\ - \ building it. Unlike `ARG`, `ENV` entries are also accessible from inside\ - \ the container." - type: "string" - - description: "Specifies which `ENV` entries to add to the Dockerfile while\ - \ building it. Unlike `ARG`, `ENV` entries are also accessible from inside\ - \ the container." - type: "array" - items: - type: "string" - copy: - anyOf: - - description: "Specifies which `COPY` entries to add to the Dockerfile while\ - \ building it." - type: "string" - - description: "Specifies which `COPY` entries to add to the Dockerfile while\ - \ building it." - type: "array" - items: - type: "string" - required: - - "type" - additionalProperties: false - RRequirements: - description: "Specify which R packages should be available in order to run the\ - \ component." - type: "object" - properties: - bioc: - anyOf: - - description: "Specifies which packages to install from BioConductor." - type: "string" - - description: "Specifies which packages to install from BioConductor." - type: "array" - items: - type: "string" - github: - anyOf: - - description: "Specifies which packages to install from GitHub." - type: "string" - - description: "Specifies which packages to install from GitHub." - type: "array" - items: - type: "string" - gitlab: - anyOf: - - description: "Specifies which packages to install from GitLab." - type: "string" - - description: "Specifies which packages to install from GitLab." - type: "array" - items: - type: "string" - url: - anyOf: - - description: "Specifies which packages to install using a generic URI." - type: "string" - - description: "Specifies which packages to install using a generic URI." - type: "array" - items: - type: "string" - bioc_force_install: - description: "Forces packages specified in `bioc` to be reinstalled, even\ - \ if they are already present in the container. Default: false." - type: "boolean" - git: - anyOf: - - description: "Specifies which packages to install using a Git URI." - type: "string" - - description: "Specifies which packages to install using a Git URI." - type: "array" - items: - type: "string" - cran: - anyOf: - - description: "Specifies which packages to install from CRAN." - type: "string" - - description: "Specifies which packages to install from CRAN." - type: "array" - items: - type: "string" - bitbucket: - anyOf: - - description: "Specifies which packages to install from Bitbucket." - type: "string" - - description: "Specifies which packages to install from Bitbucket." - type: "array" - items: - type: "string" - svn: - anyOf: - - description: "Specifies which packages to install using an SVN URI." - type: "string" - - description: "Specifies which packages to install using an SVN URI." - type: "array" - items: - type: "string" - packages: - anyOf: - - description: "Specifies which packages to install from CRAN." - type: "string" - - description: "Specifies which packages to install from CRAN." - type: "array" - items: - type: "string" - script: - anyOf: - - description: "Specifies a code block to run as part of the build." - type: "string" - - description: "Specifies a code block to run as part of the build." - type: "array" - items: - type: "string" - type: - description: "Specify which R packages should be available in order to run\ - \ the component." - const: "r" - required: - - "type" - additionalProperties: false - ApkRequirements: - description: "Specify which apk packages should be available in order to run the\ - \ component." - type: "object" - properties: - type: - description: "Specify which apk packages should be available in order to run\ - \ the component." - const: "apk" - packages: - anyOf: - - description: "Specifies which packages to install." - type: "string" - - description: "Specifies which packages to install." - type: "array" - items: - type: "string" - required: - - "type" - additionalProperties: false - PythonRequirements: - description: "Specify which Python packages should be available in order to run\ - \ the component." - type: "object" - properties: - github: - anyOf: - - description: "Specifies which packages to install from GitHub." - type: "string" - - description: "Specifies which packages to install from GitHub." - type: "array" - items: - type: "string" - gitlab: - anyOf: - - description: "Specifies which packages to install from GitLab." - type: "string" - - description: "Specifies which packages to install from GitLab." - type: "array" - items: - type: "string" - pip: - anyOf: - - description: "Specifies which packages to install from pip." - type: "string" - - description: "Specifies which packages to install from pip." - type: "array" - items: - type: "string" - pypi: - anyOf: - - description: "Specifies which packages to install from PyPI using pip." - type: "string" - - description: "Specifies which packages to install from PyPI using pip." - type: "array" - items: - type: "string" - git: - anyOf: - - description: "Specifies which packages to install using a Git URI." - type: "string" - - description: "Specifies which packages to install using a Git URI." - type: "array" - items: - type: "string" - upgrade: - description: "Sets the `--upgrade` flag when set to true. Default: true." - type: "boolean" - packages: - anyOf: - - description: "Specifies which packages to install from pip." - type: "string" - - description: "Specifies which packages to install from pip." - type: "array" - items: - type: "string" - url: - anyOf: - - description: "Specifies which packages to install using a generic URI." - type: "string" - - description: "Specifies which packages to install using a generic URI." - type: "array" - items: - type: "string" - svn: - anyOf: - - description: "Specifies which packages to install using an SVN URI." - type: "string" - - description: "Specifies which packages to install using an SVN URI." - type: "array" - items: - type: "string" - bazaar: - anyOf: - - description: "Specifies which packages to install using a Bazaar URI." - type: "string" - - description: "Specifies which packages to install using a Bazaar URI." - type: "array" - items: - type: "string" - script: - anyOf: - - description: "Specifies a code block to run as part of the build." - type: "string" - - description: "Specifies a code block to run as part of the build." - type: "array" - items: - type: "string" - type: - description: "Specify which Python packages should be available in order to\ - \ run the component." - const: "python" - mercurial: - anyOf: - - description: "Specifies which packages to install using a Mercurial URI." - type: "string" - - description: "Specifies which packages to install using a Mercurial URI." - type: "array" - items: - type: "string" - user: - description: "Sets the `--user` flag when set to true. Default: false." - type: "boolean" - required: - - "type" - additionalProperties: false - AptRequirements: - description: "Specify which apt packages should be available in order to run the\ - \ component." - type: "object" - properties: - interactive: - description: "If `false`, the Debian frontend is set to non-interactive (recommended).\ - \ Default: false." - type: "boolean" - type: - description: "Specify which apt packages should be available in order to run\ - \ the component." - const: "apt" - packages: - anyOf: - - description: "Specifies which packages to install." - type: "string" - - description: "Specifies which packages to install." - type: "array" - items: - type: "string" - required: - - "type" - additionalProperties: false - Requirements: - anyOf: - - $ref: "#/definitions/RubyRequirements" - - $ref: "#/definitions/YumRequirements" - - $ref: "#/definitions/JavascriptRequirements" - - $ref: "#/definitions/DockerRequirements" - - $ref: "#/definitions/RRequirements" - - $ref: "#/definitions/ApkRequirements" - - $ref: "#/definitions/PythonRequirements" - - $ref: "#/definitions/AptRequirements" - StringArgument: - description: "A `string` type argument has a value made up of an ordered sequences\ - \ of characters, like \"Hello\" or \"I'm a string\"." - type: "object" - properties: - alternatives: - anyOf: - - description: "List of alternative format variations for this argument." - type: "string" - - description: "List of alternative format variations for this argument." - type: "array" - items: - type: "string" - name: - description: "The name of the argument. Can be in the formats `--foo`, `-f`\ - \ or `foo`. The number of dashes determines how values can be passed: \n\ - \n - `--foo` is a long option, which can be passed with `executable_name\ - \ --foo=value` or `executable_name --foo value`\n - `-f` is a short option,\ - \ which can be passed with `executable_name -f value`\n - `foo` is an argument,\ - \ which can be passed with `executable_name value` \n" - type: "string" - choices: - description: "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." - type: "array" - items: - type: "string" - info: - description: "Structured information. Can be any shape: a string, vector,\ - \ map or even nested map." - type: "object" - default: - anyOf: - - description: "The default value when no argument value is provided. This\ - \ will not work if the [`required`](#required) property is enabled." - type: "string" - - description: "The default value when no argument value is provided. This\ - \ will not work if the [`required`](#required) property is enabled." - type: "array" - items: - type: "string" - example: - anyOf: - - description: "An example value for this argument. If no [`default`](#default)\ - \ property was specified, this will be used for that purpose." - type: "string" - - description: "An example value for this argument. If no [`default`](#default)\ - \ property was specified, this will be used for that purpose." - type: "array" - items: - type: "string" - description: - description: "A description of the argument. This will be displayed with `--help`." - type: "string" - multiple_sep: - description: "The delimiter character for providing [`multiple`](#multiple)\ - \ values. `:` by default." - type: "string" - multiple: - description: "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`](#multiple_sep)\ - \ property. `false` by default." - type: "boolean" - type: - description: "A `string` type argument has a value made up of an ordered sequences\ - \ of characters, like \"Hello\" or \"I'm a string\"." - const: "string" - required: - description: "Make the value for this argument required. If set to `true`,\ - \ an error will be produced if no value was provided. `false` by default." - type: "boolean" - required: - - "name" - - "type" - additionalProperties: false - BooleanArgument: - description: "A `boolean` type argument has two possible values: `true` or `false`." - type: "object" - properties: - alternatives: - anyOf: - - description: "List of alternative format variations for this argument." - type: "string" - - description: "List of alternative format variations for this argument." - type: "array" - items: - type: "string" - name: - description: "The name of the argument. Can be in the formats `--trim`, `-t`\ - \ or `trim`. The number of dashes determines how values can be passed: \ - \ \n\n - `--trim` is a long option, which can be passed with `executable_name\ - \ --trim`\n - `-t` is a short option, which can be passed with `executable_name\ - \ -t`\n - `trim` is an argument, which can be passed with `executable_name\ - \ trim` \n" - type: "string" - info: - description: "Structured information. Can be any shape: a string, vector,\ - \ map or even nested map." - type: "object" - default: - anyOf: - - description: "The default value when no argument value is provided. This\ - \ will not work if the [`required`](#required) property is enabled." - type: "boolean" - - description: "The default value when no argument value is provided. This\ - \ will not work if the [`required`](#required) property is enabled." - type: "array" - items: - type: "boolean" - example: - anyOf: - - description: "An example value for this argument. If no [`default`](#default)\ - \ property was specified, this will be used for that purpose." - type: "boolean" - - description: "An example value for this argument. If no [`default`](#default)\ - \ property was specified, this will be used for that purpose." - type: "array" - items: - type: "boolean" - description: - description: "A description of the argument. This will be displayed with `--help`." - type: "string" - multiple_sep: - description: "The delimiter character for providing [`multiple`](#multiple)\ - \ values. `:` by default." - type: "string" - multiple: - description: "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`](#multiple_sep)\ - \ property. `false` by default." - type: "boolean" - type: - description: "A `boolean` type argument has two possible values: `true` or\ - \ `false`." - const: "boolean" - required: - description: "Make the value for this argument required. If set to `true`,\ - \ an error will be produced if no value was provided. `false` by default." - type: "boolean" - required: - - "name" - - "type" - additionalProperties: false - BooleanTrueArgument: - description: "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`." - type: "object" - properties: - alternatives: - anyOf: - - description: "List of alternative format variations for this argument." - type: "string" - - description: "List of alternative format variations for this argument." - type: "array" - items: - type: "string" - name: - description: "The name of the argument. Can be in the formats `--silent`,\ - \ `-s` or `silent`. The number of dashes determines how values can be passed:\ - \ \n\n - `--silent` is a long option, which can be passed with `executable_name\ - \ --silent`\n - `-s` is a short option, which can be passed with `executable_name\ - \ -s`\n - `silent` is an argument, which can be passed with `executable_name\ - \ silent` \n" - type: "string" - info: - description: "Structured information. Can be any shape: a string, vector,\ - \ map or even nested map." - type: "object" - description: - description: "A description of the argument. This will be displayed with `--help`." - type: "string" - type: - description: "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`." - const: "boolean_true" - required: - - "name" - - "type" - additionalProperties: false - IntegerArgument: - description: "An `integer` type argument has a numeric value without decimal points." - type: "object" - properties: - alternatives: - anyOf: - - description: "List of alternative format variations for this argument." - type: "string" - - description: "List of alternative format variations for this argument." - type: "array" - items: - type: "string" - name: - description: "The name of the argument. Can be in the formats `--foo`, `-f`\ - \ or `foo`. The number of dashes determines how values can be passed: \n\ - \n - `--foo` is a long option, which can be passed with `executable_name\ - \ --foo=value` or `executable_name --foo value`\n - `-f` is a short option,\ - \ which can be passed with `executable_name -f value`\n - `foo` is an argument,\ - \ which can be passed with `executable_name value` \n" - type: "string" - choices: - description: "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." - type: "array" - items: - type: "integer" - info: - description: "Structured information. Can be any shape: a string, vector,\ - \ map or even nested map." - type: "object" - max: - description: "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`](#min) to clamp values." - type: "integer" - default: - anyOf: - - description: "The default value when no argument value is provided. This\ - \ will not work if the [`required`](#required) property is enabled." - type: "integer" - - description: "The default value when no argument value is provided. This\ - \ will not work if the [`required`](#required) property is enabled." - type: "array" - items: - type: "integer" - example: - anyOf: - - description: "An example value for this argument. If no [`default`](#default)\ - \ property was specified, this will be used for that purpose." - type: "integer" - - description: "An example value for this argument. If no [`default`](#default)\ - \ property was specified, this will be used for that purpose." - type: "array" - items: - type: "integer" - description: - description: "A description of the argument. This will be displayed with `--help`." - type: "string" - multiple_sep: - description: "The delimiter character for providing [`multiple`](#multiple)\ - \ values. `:` by default." - type: "string" - min: - description: "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`](#max) to clamp values." - type: "integer" - multiple: - description: "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`](#multiple_sep)\ - \ property. `false` by default." - type: "boolean" - type: - description: "An `integer` type argument has a numeric value without decimal\ - \ points." - const: "integer" - required: - description: "Make the value for this argument required. If set to `true`,\ - \ an error will be produced if no value was provided. `false` by default." - type: "boolean" - required: - - "name" - - "type" - additionalProperties: false - LongArgument: - description: "An `long` type argument has a numeric value without decimal points." - type: "object" - properties: - alternatives: - anyOf: - - description: "List of alternative format variations for this argument." - type: "string" - - description: "List of alternative format variations for this argument." - type: "array" - items: - type: "string" - name: - description: "The name of the argument. Can be in the formats `--foo`, `-f`\ - \ or `foo`. The number of dashes determines how values can be passed: \n\ - \n - `--foo` is a long option, which can be passed with `executable_name\ - \ --foo=value` or `executable_name --foo value`\n - `-f` is a short option,\ - \ which can be passed with `executable_name -f value`\n - `foo` is an argument,\ - \ which can be passed with `executable_name value` \n" - type: "string" - choices: - description: "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." - type: "array" - items: - type: "integer" - info: - description: "Structured information. Can be any shape: a string, vector,\ - \ map or even nested map." - type: "object" - max: - description: "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`](#min) to clamp values." - type: "integer" - default: - anyOf: - - description: "The default value when no argument value is provided. This\ - \ will not work if the [`required`](#required) property is enabled." - type: "integer" - - description: "The default value when no argument value is provided. This\ - \ will not work if the [`required`](#required) property is enabled." - type: "array" - items: - type: "integer" - example: - anyOf: - - description: "An example value for this argument. If no [`default`](#default)\ - \ property was specified, this will be used for that purpose." - type: "integer" - - description: "An example value for this argument. If no [`default`](#default)\ - \ property was specified, this will be used for that purpose." - type: "array" - items: - type: "integer" - description: - description: "A description of the argument. This will be displayed with `--help`." - type: "string" - multiple_sep: - description: "The delimiter character for providing [`multiple`](#multiple)\ - \ values. `:` by default." - type: "string" - min: - description: "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`](#max) to clamp values." - type: "integer" - multiple: - description: "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`](#multiple_sep)\ - \ property. `false` by default." - type: "boolean" - type: - description: "An `long` type argument has a numeric value without decimal\ - \ points." - const: "long" - required: - description: "Make the value for this argument required. If set to `true`,\ - \ an error will be produced if no value was provided. `false` by default." - type: "boolean" - required: - - "name" - - "type" - additionalProperties: false - BooleanFalseArgument: - description: "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`." - type: "object" - properties: - alternatives: - anyOf: - - description: "List of alternative format variations for this argument." - type: "string" - - description: "List of alternative format variations for this argument." - type: "array" - items: - type: "string" - name: - description: "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:\ - \ \n\n - `--no-log` is a long option, which can be passed with `executable_name\ - \ --no-log`\n - `-n` is a short option, which can be passed with `executable_name\ - \ -n`\n - `no-log` is an argument, which can be passed with `executable_name\ - \ no-log` \n" - type: "string" - info: - description: "Structured information. Can be any shape: a string, vector,\ - \ map or even nested map." - type: "object" - description: - description: "A description of the argument. This will be displayed with `--help`." - type: "string" - type: - description: "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`." - const: "boolean_false" - required: - - "name" - - "type" - additionalProperties: false - DoubleArgument: - description: "A `double` type argument has a numeric value with decimal points" - type: "object" - properties: - alternatives: - anyOf: - - description: "List of alternative format variations for this argument." - type: "string" - - description: "List of alternative format variations for this argument." - type: "array" - items: - type: "string" - name: - description: "The name of the argument. Can be in the formats `--foo`, `-f`\ - \ or `foo`. The number of dashes determines how values can be passed: \n\ - \n - `--foo` is a long option, which can be passed with `executable_name\ - \ --foo=value` or `executable_name --foo value`\n - `-f` is a short option,\ - \ which can be passed with `executable_name -f value`\n - `foo` is an argument,\ - \ which can be passed with `executable_name value` \n" - type: "string" - info: - description: "Structured information. Can be any shape: a string, vector,\ - \ map or even nested map." - type: "object" - max: - description: "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`](#min) to clamp values." - type: "number" - default: - anyOf: - - description: "The default value when no argument value is provided. This\ - \ will not work if the [`required`](#required) property is enabled." - type: "number" - - description: "The default value when no argument value is provided. This\ - \ will not work if the [`required`](#required) property is enabled." - type: "array" - items: - type: "number" - example: - anyOf: - - description: "An example value for this argument. If no [`default`](#default)\ - \ property was specified, this will be used for that purpose." - type: "number" - - description: "An example value for this argument. If no [`default`](#default)\ - \ property was specified, this will be used for that purpose." - type: "array" - items: - type: "number" - description: - description: "A description of the argument. This will be displayed with `--help`." - type: "string" - multiple_sep: - description: "The delimiter character for providing [`multiple`](#multiple)\ - \ values. `:` by default." - type: "string" - min: - description: "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`](#max) to clamp values." - type: "number" - multiple: - description: "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`](#multiple_sep)\ - \ property. `false` by default." - type: "boolean" - type: - description: "A `double` type argument has a numeric value with decimal points" - const: "double" - required: - description: "Make the value for this argument required. If set to `true`,\ - \ an error will be produced if no value was provided. `false` by default." - type: "boolean" - required: - - "name" - - "type" - additionalProperties: false - FileArgument: - description: "A `file` type argument has a string value that points to a file\ - \ or folder path." - type: "object" - properties: - alternatives: - anyOf: - - description: "List of alternative format variations for this argument." - type: "string" - - description: "List of alternative format variations for this argument." - type: "array" - items: - type: "string" - name: - description: "The name of the argument. Can be in the formats `--foo`, `-f`\ - \ or `foo`. The number of dashes determines how values can be passed: \n\ - \n - `--foo` is a long option, which can be passed with `executable_name\ - \ --foo=value` or `executable_name --foo value`\n - `-f` is a short option,\ - \ which can be passed with `executable_name -f value`\n - `foo` is an argument,\ - \ which can be passed with `executable_name value` \n" - type: "string" - create_parent: - description: "If the output filename is a path and it does not exist, create\ - \ it before executing the script (only for `direction: output`)." - type: "boolean" - direction: - description: "Makes this argument an `input` or an `output`, as in does the\ - \ file/folder needs to be read or written. `input` by default." - $ref: "#/definitions/Direction" - info: - description: "Structured information. Can be any shape: a string, vector,\ - \ map or even nested map." - type: "object" - must_exist: - description: "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." - type: "boolean" - default: - anyOf: - - description: "The default value when no argument value is provided. This\ - \ will not work if the [`required`](#required) property is enabled." - type: "string" - - description: "The default value when no argument value is provided. This\ - \ will not work if the [`required`](#required) property is enabled." - type: "array" - items: - type: "string" - example: - anyOf: - - description: "An example value for this argument. If no [`default`](#default)\ - \ property was specified, this will be used for that purpose." - type: "string" - - description: "An example value for this argument. If no [`default`](#default)\ - \ property was specified, this will be used for that purpose." - type: "array" - items: - type: "string" - description: - description: "A description of the argument. This will be displayed with `--help`." - type: "string" - multiple_sep: - description: "The delimiter character for providing [`multiple`](#multiple)\ - \ values. `:` by default." - type: "string" - multiple: - description: "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`](#multiple_sep)\ - \ property. `false` by default." - type: "boolean" - type: - description: "A `file` type argument has a string value that points to a file\ - \ or folder path." - const: "file" - required: - description: "Make the value for this argument required. If set to `true`,\ - \ an error will be produced if no value was provided. `false` by default." - type: "boolean" - required: - - "name" - - "type" - additionalProperties: false - Argument: - anyOf: - - $ref: "#/definitions/StringArgument" - - $ref: "#/definitions/BooleanArgument" - - $ref: "#/definitions/BooleanTrueArgument" - - $ref: "#/definitions/IntegerArgument" - - $ref: "#/definitions/LongArgument" - - $ref: "#/definitions/BooleanFalseArgument" - - $ref: "#/definitions/DoubleArgument" - - $ref: "#/definitions/FileArgument" - ArgumentGroup: - type: "object" - properties: - name: - description: "The name of the argument group." - type: "string" - description: - description: "A description of the argument group. Multiline descriptions\ - \ are supported." - type: "string" - arguments: - description: "List of the arguments names." - type: "array" - items: - $ref: "#/definitions/Argument" - required: - - "name" - - "arguments" - additionalProperties: false - JavaScriptScript: - description: "An executable JavaScript script.\nWhen defined in functionality.resources,\ - \ only the first entry will be executed when running the built component or\ - \ when running `viash run`.\nWhen defined in functionality.test_resources, all\ - \ entries will be executed during `viash test`." - type: "object" - properties: - path: - description: "The path of the input file. Can be a relative or an absolute\ - \ path, or a URI. Mutually exclusive with `text`." - type: "string" - text: - description: "The content of the resulting file specified as a string. Mutually\ - \ exclusive with `path`." - type: "string" - is_executable: - description: "Whether the resulting resource file should be made executable." - type: "boolean" - type: - description: "An executable JavaScript script.\nWhen defined in functionality.resources,\ - \ only the first entry will be executed when running the built component\ - \ or when running `viash run`.\nWhen defined in functionality.test_resources,\ - \ all entries will be executed during `viash test`." - const: "javascript_script" - dest: - description: "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." - type: "string" - required: - - "type" - additionalProperties: false - CSharpScript: - description: "An executable C# script.\nWhen defined in functionality.resources,\ - \ only the first entry will be executed when running the built component or\ - \ when running `viash run`.\nWhen defined in functionality.test_resources, all\ - \ entries will be executed during `viash test`." - type: "object" - properties: - path: - description: "The path of the input file. Can be a relative or an absolute\ - \ path, or a URI. Mutually exclusive with `text`." - type: "string" - text: - description: "The content of the resulting file specified as a string. Mutually\ - \ exclusive with `path`." - type: "string" - is_executable: - description: "Whether the resulting resource file should be made executable." - type: "boolean" - type: - description: "An executable C# script.\nWhen defined in functionality.resources,\ - \ only the first entry will be executed when running the built component\ - \ or when running `viash run`.\nWhen defined in functionality.test_resources,\ - \ all entries will be executed during `viash test`." - const: "csharp_script" - dest: - description: "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." - type: "string" - required: - - "type" - additionalProperties: false - Executable: - description: "An executable file." - type: "object" - properties: - path: - description: "The path of the input file. Can be a relative or an absolute\ - \ path, or a URI. Mutually exclusive with `text`." - type: "string" - text: - description: "The content of the resulting file specified as a string. Mutually\ - \ exclusive with `path`." - type: "string" - is_executable: - description: "Whether the resulting resource file should be made executable." - type: "boolean" - type: - description: "An executable file." - const: "executable" - dest: - description: "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." - type: "string" - required: - - "type" - additionalProperties: false - ScalaScript: - description: "An executable Scala script.\nWhen defined in functionality.resources,\ - \ only the first entry will be executed when running the built component or\ - \ when running `viash run`.\nWhen defined in functionality.test_resources, all\ - \ entries will be executed during `viash test`." - type: "object" - properties: - path: - description: "The path of the input file. Can be a relative or an absolute\ - \ path, or a URI. Mutually exclusive with `text`." - type: "string" - text: - description: "The content of the resulting file specified as a string. Mutually\ - \ exclusive with `path`." - type: "string" - is_executable: - description: "Whether the resulting resource file should be made executable." - type: "boolean" - type: - description: "An executable Scala script.\nWhen defined in functionality.resources,\ - \ only the first entry will be executed when running the built component\ - \ or when running `viash run`.\nWhen defined in functionality.test_resources,\ - \ all entries will be executed during `viash test`." - const: "scala_script" - dest: - description: "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." - type: "string" - required: - - "type" - additionalProperties: false - NextflowScript: - description: "A Nextflow script. Work in progress; added mainly for annotation\ - \ at the moment." - type: "object" - properties: - path: - description: "The path of the input file. Can be a relative or an absolute\ - \ path, or a URI. Mutually exclusive with `text`." - type: "string" - text: - description: "The content of the resulting file specified as a string. Mutually\ - \ exclusive with `path`." - type: "string" - entrypoint: - description: "The name of the workflow to be executed." - type: "string" - is_executable: - description: "Whether the resulting resource file should be made executable." - type: "boolean" - type: - description: "A Nextflow script. Work in progress; added mainly for annotation\ - \ at the moment." - const: "nextflow_script" - dest: - description: "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." - type: "string" - required: - - "type" - additionalProperties: false - PlainFile: - description: "A plain file. This can only be used as a supporting resource for\ - \ the main script or unit tests." - type: "object" - properties: - path: - description: "The path of the input file. Can be a relative or an absolute\ - \ path, or a URI. Mutually exclusive with `text`." - type: "string" - text: - description: "The content of the resulting file specified as a string. Mutually\ - \ exclusive with `path`." - type: "string" - is_executable: - description: "Whether the resulting resource file should be made executable." - type: "boolean" - type: - description: "A plain file. This can only be used as a supporting resource\ - \ for the main script or unit tests." - const: "file" - dest: - description: "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." - type: "string" - required: - - "path" - additionalProperties: false - BashScript: - description: "An executable Bash script.\nWhen defined in functionality.resources,\ - \ only the first entry will be executed when running the built component or\ - \ when running `viash run`.\nWhen defined in functionality.test_resources, all\ - \ entries will be executed during `viash test`." - type: "object" - properties: - path: - description: "The path of the input file. Can be a relative or an absolute\ - \ path, or a URI. Mutually exclusive with `text`." - type: "string" - text: - description: "The content of the resulting file specified as a string. Mutually\ - \ exclusive with `path`." - type: "string" - is_executable: - description: "Whether the resulting resource file should be made executable." - type: "boolean" - type: - description: "An executable Bash script.\nWhen defined in functionality.resources,\ - \ only the first entry will be executed when running the built component\ - \ or when running `viash run`.\nWhen defined in functionality.test_resources,\ - \ all entries will be executed during `viash test`." - const: "bash_script" - dest: - description: "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." - type: "string" - required: - - "type" - additionalProperties: false - PythonScript: - description: "An executable Python script.\nWhen defined in functionality.resources,\ - \ only the first entry will be executed when running the built component or\ - \ when running `viash run`.\nWhen defined in functionality.test_resources, all\ - \ entries will be executed during `viash test`." - type: "object" - properties: - path: - description: "The path of the input file. Can be a relative or an absolute\ - \ path, or a URI. Mutually exclusive with `text`." - type: "string" - text: - description: "The content of the resulting file specified as a string. Mutually\ - \ exclusive with `path`." - type: "string" - is_executable: - description: "Whether the resulting resource file should be made executable." - type: "boolean" - type: - description: "An executable Python script.\nWhen defined in functionality.resources,\ - \ only the first entry will be executed when running the built component\ - \ or when running `viash run`.\nWhen defined in functionality.test_resources,\ - \ all entries will be executed during `viash test`." - const: "python_script" - dest: - description: "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." - type: "string" - required: - - "type" - additionalProperties: false - RScript: - description: "An executable R script.\nWhen defined in functionality.resources,\ - \ only the first entry will be executed when running the built component or\ - \ when running `viash run`.\nWhen defined in functionality.test_resources, all\ - \ entries will be executed during `viash test`." - type: "object" - properties: - path: - description: "The path of the input file. Can be a relative or an absolute\ - \ path, or a URI. Mutually exclusive with `text`." - type: "string" - text: - description: "The content of the resulting file specified as a string. Mutually\ - \ exclusive with `path`." - type: "string" - is_executable: - description: "Whether the resulting resource file should be made executable." - type: "boolean" - type: - description: "An executable R script.\nWhen defined in functionality.resources,\ - \ only the first entry will be executed when running the built component\ - \ or when running `viash run`.\nWhen defined in functionality.test_resources,\ - \ all entries will be executed during `viash test`." - const: "r_script" - dest: - description: "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." - type: "string" - required: - - "type" - additionalProperties: false - Resource: - anyOf: - - $ref: "#/definitions/JavaScriptScript" - - $ref: "#/definitions/CSharpScript" - - $ref: "#/definitions/Executable" - - $ref: "#/definitions/ScalaScript" - - $ref: "#/definitions/NextflowScript" - - $ref: "#/definitions/PlainFile" - - $ref: "#/definitions/BashScript" - - $ref: "#/definitions/PythonScript" - - $ref: "#/definitions/RScript" - NextflowDirectives: - description: "Directives are optional settings that affect the execution of the\ - \ process.\n" - type: "object" - properties: - beforeScript: - description: "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.\n\ - \nSee [`beforeScript`](https://www.nextflow.io/docs/latest/process.html#beforeScript).\n" - type: "string" - module: - anyOf: - - description: "Environment Modules is a package manager that allows you to\ - \ dynamically configure your execution environment and easily switch between\ - \ multiple versions of the same software tool.\n\nIf it is available in\ - \ your system you can use it with Nextflow in order to configure the processes\ - \ execution environment in your pipeline.\n\nIn a process definition you\ - \ can use the `module` directive to load a specific module version to\ - \ be used in the process execution environment.\n\nSee [`module`](https://www.nextflow.io/docs/latest/process.html#module).\n" - type: "string" - - description: "Environment Modules is a package manager that allows you to\ - \ dynamically configure your execution environment and easily switch between\ - \ multiple versions of the same software tool.\n\nIf it is available in\ - \ your system you can use it with Nextflow in order to configure the processes\ - \ execution environment in your pipeline.\n\nIn a process definition you\ - \ can use the `module` directive to load a specific module version to\ - \ be used in the process execution environment.\n\nSee [`module`](https://www.nextflow.io/docs/latest/process.html#module).\n" - type: "array" - items: - type: "string" - queue: - anyOf: - - description: "The `queue` directory allows you to set the queue where jobs\ - \ are scheduled when using a grid based executor in your pipeline.\n\n\ - See [`queue`](https://www.nextflow.io/docs/latest/process.html#queue).\n" - type: "string" - - description: "The `queue` directory allows you to set the queue where jobs\ - \ are scheduled when using a grid based executor in your pipeline.\n\n\ - See [`queue`](https://www.nextflow.io/docs/latest/process.html#queue).\n" - type: "array" - items: - type: "string" - label: - anyOf: - - description: "The `label` directive allows the annotation of processes with\ - \ mnemonic identifier of your choice.\n\nSee [`label`](https://www.nextflow.io/docs/latest/process.html#label).\n" - type: "string" - - description: "The `label` directive allows the annotation of processes with\ - \ mnemonic identifier of your choice.\n\nSee [`label`](https://www.nextflow.io/docs/latest/process.html#label).\n" - type: "array" - items: - type: "string" - container: - anyOf: - - description: "The `container` directive allows you to execute the process\ - \ script in a Docker container.\n\nIt requires the Docker daemon to be\ - \ running in machine where the pipeline is executed, i.e. the local machine\ - \ when using the local executor or the cluster nodes when the pipeline\ - \ is deployed through a grid executor.\n\nViash implements allows either\ - \ a string value or a map. In case a map is used, the allowed keys are:\ - \ `registry`, `image`, and `tag`. The `image` value must be specified.\n\ - \nSee [`container`](https://www.nextflow.io/docs/latest/process.html#container).\n" - type: "object" - additionalProperties: - description: "The `container` directive allows you to execute the process\ - \ script in a Docker container.\n\nIt requires the Docker daemon to\ - \ be running in machine where the pipeline is executed, i.e. the local\ - \ machine when using the local executor or the cluster nodes when the\ - \ pipeline is deployed through a grid executor.\n\nViash implements\ - \ allows either a string value or a map. In case a map is used, the\ - \ allowed keys are: `registry`, `image`, and `tag`. The `image` value\ - \ must be specified.\n\nSee [`container`](https://www.nextflow.io/docs/latest/process.html#container).\n" - type: "string" - - description: "The `container` directive allows you to execute the process\ - \ script in a Docker container.\n\nIt requires the Docker daemon to be\ - \ running in machine where the pipeline is executed, i.e. the local machine\ - \ when using the local executor or the cluster nodes when the pipeline\ - \ is deployed through a grid executor.\n\nViash implements allows either\ - \ a string value or a map. In case a map is used, the allowed keys are:\ - \ `registry`, `image`, and `tag`. The `image` value must be specified.\n\ - \nSee [`container`](https://www.nextflow.io/docs/latest/process.html#container).\n" - type: "string" - publishDir: - anyOf: - - anyOf: - - description: "The `publishDir` directive allows you to publish the process\ - \ output files to a specified folder.\n\nViash implements this directive\ - \ as a plain string or a map. The allowed keywords for the map are:\ - \ `path`, `mode`, `overwrite`, `pattern`, `saveAs`, `enabled`. The `path`\ - \ key and value are required.\nThe allowed values for `mode` are: `symlink`,\ - \ `rellink`, `link`, `copy`, `copyNoFollow`, `move`.\n\nSee [`publishDir`](https://www.nextflow.io/docs/latest/process.html#publishdir).\n" - type: "string" - - description: "The `publishDir` directive allows you to publish the process\ - \ output files to a specified folder.\n\nViash implements this directive\ - \ as a plain string or a map. The allowed keywords for the map are:\ - \ `path`, `mode`, `overwrite`, `pattern`, `saveAs`, `enabled`. The `path`\ - \ key and value are required.\nThe allowed values for `mode` are: `symlink`,\ - \ `rellink`, `link`, `copy`, `copyNoFollow`, `move`.\n\nSee [`publishDir`](https://www.nextflow.io/docs/latest/process.html#publishdir).\n" - type: "object" - additionalProperties: - description: "The `publishDir` directive allows you to publish the process\ - \ output files to a specified folder.\n\nViash implements this directive\ - \ as a plain string or a map. The allowed keywords for the map are:\ - \ `path`, `mode`, `overwrite`, `pattern`, `saveAs`, `enabled`. The\ - \ `path` key and value are required.\nThe allowed values for `mode`\ - \ are: `symlink`, `rellink`, `link`, `copy`, `copyNoFollow`, `move`.\n\ - \nSee [`publishDir`](https://www.nextflow.io/docs/latest/process.html#publishdir).\n" - type: "string" - - description: "The `publishDir` directive allows you to publish the process\ - \ output files to a specified folder.\n\nViash implements this directive\ - \ as a plain string or a map. The allowed keywords for the map are: `path`,\ - \ `mode`, `overwrite`, `pattern`, `saveAs`, `enabled`. The `path` key\ - \ and value are required.\nThe allowed values for `mode` are: `symlink`,\ - \ `rellink`, `link`, `copy`, `copyNoFollow`, `move`.\n\nSee [`publishDir`](https://www.nextflow.io/docs/latest/process.html#publishdir).\n" - type: "array" - items: - anyOf: - - description: "The `publishDir` directive allows you to publish the process\ - \ output files to a specified folder.\n\nViash implements this directive\ - \ as a plain string or a map. The allowed keywords for the map are:\ - \ `path`, `mode`, `overwrite`, `pattern`, `saveAs`, `enabled`. The\ - \ `path` key and value are required.\nThe allowed values for `mode`\ - \ are: `symlink`, `rellink`, `link`, `copy`, `copyNoFollow`, `move`.\n\ - \nSee [`publishDir`](https://www.nextflow.io/docs/latest/process.html#publishdir).\n" - type: "string" - - description: "The `publishDir` directive allows you to publish the process\ - \ output files to a specified folder.\n\nViash implements this directive\ - \ as a plain string or a map. The allowed keywords for the map are:\ - \ `path`, `mode`, `overwrite`, `pattern`, `saveAs`, `enabled`. The\ - \ `path` key and value are required.\nThe allowed values for `mode`\ - \ are: `symlink`, `rellink`, `link`, `copy`, `copyNoFollow`, `move`.\n\ - \nSee [`publishDir`](https://www.nextflow.io/docs/latest/process.html#publishdir).\n" - type: "object" - additionalProperties: - description: "The `publishDir` directive allows you to publish the\ - \ process output files to a specified folder.\n\nViash implements\ - \ this directive as a plain string or a map. The allowed keywords\ - \ for the map are: `path`, `mode`, `overwrite`, `pattern`, `saveAs`,\ - \ `enabled`. The `path` key and value are required.\nThe allowed\ - \ values for `mode` are: `symlink`, `rellink`, `link`, `copy`, `copyNoFollow`,\ - \ `move`.\n\nSee [`publishDir`](https://www.nextflow.io/docs/latest/process.html#publishdir).\n" - type: "string" - maxForks: - anyOf: - - description: "The `maxForks` directive allows you to define the maximum\ - \ number of process instances that can be executed in parallel. By default\ - \ this value is equals to the number of CPU cores available minus 1.\n\ - \nIf you want to execute a process in a sequential manner, set this directive\ - \ to one.\n\nSee [`maxForks`](https://www.nextflow.io/docs/latest/process.html#maxforks).\n" - type: "string" - - description: "The `maxForks` directive allows you to define the maximum\ - \ number of process instances that can be executed in parallel. By default\ - \ this value is equals to the number of CPU cores available minus 1.\n\ - \nIf you want to execute a process in a sequential manner, set this directive\ - \ to one.\n\nSee [`maxForks`](https://www.nextflow.io/docs/latest/process.html#maxforks).\n" - type: "integer" - maxErrors: - anyOf: - - description: "The `maxErrors` directive allows you to specify the maximum\ - \ number of times a process can fail when using the `retry` error strategy.\ - \ By default this directive is disabled.\n\nSee [`maxErrors`](https://www.nextflow.io/docs/latest/process.html#maxerrors).\n" - type: "string" - - description: "The `maxErrors` directive allows you to specify the maximum\ - \ number of times a process can fail when using the `retry` error strategy.\ - \ By default this directive is disabled.\n\nSee [`maxErrors`](https://www.nextflow.io/docs/latest/process.html#maxerrors).\n" - type: "integer" - cpus: - anyOf: - - description: "The `cpus` directive allows you to define the number of (logical)\ - \ CPU required by the process' task.\n\nSee [`cpus`](https://www.nextflow.io/docs/latest/process.html#cpus).\n" - type: "integer" - - description: "The `cpus` directive allows you to define the number of (logical)\ - \ CPU required by the process' task.\n\nSee [`cpus`](https://www.nextflow.io/docs/latest/process.html#cpus).\n" - type: "string" - accelerator: - description: "The `accelerator` directive allows you to specify the hardware\ - \ accelerator requirement for the task execution e.g. GPU processor.\n\n\ - Viash implements this directive as a map with accepted keywords: `type`,\ - \ `limit`, `request`, and `runtime`.\n\nSee [`accelerator`](https://www.nextflow.io/docs/latest/process.html#accelerator).\n" - type: "object" - additionalProperties: - description: "The `accelerator` directive allows you to specify the hardware\ - \ accelerator requirement for the task execution e.g. GPU processor.\n\ - \nViash implements this directive as a map with accepted keywords: `type`,\ - \ `limit`, `request`, and `runtime`.\n\nSee [`accelerator`](https://www.nextflow.io/docs/latest/process.html#accelerator).\n" - type: "string" - time: - description: "The `time` directive allows you to define how long a process\ - \ is allowed to run.\n\nSee [`time`](https://www.nextflow.io/docs/latest/process.html#time).\n" - type: "string" - afterScript: - description: "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.\n\nSee [`afterScript`](https://www.nextflow.io/docs/latest/process.html#afterscript).\n" - type: "string" - executor: - description: "The `executor` defines the underlying system where processes\ - \ are executed. By default a process uses the executor defined globally\ - \ in the nextflow.config file.\n\nThe `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:\n\n| Name | Executor\ - \ |\n|------|----------|\n| awsbatch | The process is executed using the\ - \ AWS Batch service. | \n| azurebatch | The process is executed using the\ - \ Azure Batch service. | \n| condor | The process is executed using the\ - \ HTCondor job scheduler. | \n| google-lifesciences | The process is executed\ - \ using the Google Genomics Pipelines service. | \n| ignite | The process\ - \ is executed using the Apache Ignite cluster. | \n| k8s | The process is\ - \ executed using the Kubernetes cluster. | \n| local | The process is executed\ - \ in the computer where Nextflow is launched. | \n| lsf | The process is\ - \ executed using the Platform LSF job scheduler. | \n| moab | The process\ - \ is executed using the Moab job scheduler. | \n| nqsii | The process is\ - \ executed using the NQSII job scheduler. | \n| oge | Alias for the sge\ - \ executor. | \n| pbs | The process is executed using the PBS/Torque job\ - \ scheduler. | \n| pbspro | The process is executed using the PBS Pro job\ - \ scheduler. | \n| sge | The process is executed using the Sun Grid Engine\ - \ / Open Grid Engine. | \n| slurm | The process is executed using the SLURM\ - \ job scheduler. | \n| tes | The process is executed using the GA4GH TES\ - \ service. | \n| uge | Alias for the sge executor. |\n\nSee [`executor`](https://www.nextflow.io/docs/latest/process.html#executor).\n" - type: "string" - containerOptions: - anyOf: - - description: "The `containerOptions` directive allows you to specify any\ - \ container execution option supported by the underlying container engine\ - \ (ie. Docker, Singularity, etc). This can be useful to provide container\ - \ settings only for a specific process e.g. mount a custom path.\n\nSee\ - \ [`containerOptions`](https://www.nextflow.io/docs/latest/process.html#containeroptions).\n" - type: "string" - - description: "The `containerOptions` directive allows you to specify any\ - \ container execution option supported by the underlying container engine\ - \ (ie. Docker, Singularity, etc). This can be useful to provide container\ - \ settings only for a specific process e.g. mount a custom path.\n\nSee\ - \ [`containerOptions`](https://www.nextflow.io/docs/latest/process.html#containeroptions).\n" - type: "array" - items: - type: "string" - disk: - description: "The `disk` directive allows you to define how much local disk\ - \ storage the process is allowed to use.\n\nSee [`disk`](https://www.nextflow.io/docs/latest/process.html#disk).\n" - type: "string" - tag: - description: "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.\n\nSee [`tag`](https://www.nextflow.io/docs/latest/process.html#tag).\n" - type: "string" - conda: - anyOf: - - description: "The `conda` directive allows for the definition of the process\ - \ dependencies using the Conda package manager.\n\nNextflow automatically\ - \ sets up an environment for the given package names listed by in the\ - \ `conda` directive.\n\nSee [`conda`](https://www.nextflow.io/docs/latest/process.html#conda).\n" - type: "string" - - description: "The `conda` directive allows for the definition of the process\ - \ dependencies using the Conda package manager.\n\nNextflow automatically\ - \ sets up an environment for the given package names listed by in the\ - \ `conda` directive.\n\nSee [`conda`](https://www.nextflow.io/docs/latest/process.html#conda).\n" - type: "array" - items: - type: "string" - machineType: - description: " The `machineType` can be used to specify a predefined Google\ - \ Compute Platform machine type when running using the Google Life Sciences\ - \ executor.\n\nSee [`machineType`](https://www.nextflow.io/docs/latest/process.html#machinetype).\n" - type: "string" - stageInMode: - description: "The `stageInMode` directive defines how input files are staged-in\ - \ to the process work directory. The following values are allowed:\n\n|\ - \ Value | Description |\n|-------|-------------| \n| copy | Input files\ - \ are staged in the process work directory by creating a copy. | \n| link\ - \ | Input files are staged in the process work directory by creating an\ - \ (hard) link for each of them. | \n| symlink | Input files are staged in\ - \ the process work directory by creating a symbolic link with an absolute\ - \ path for each of them (default). | \n| rellink | Input files are staged\ - \ in the process work directory by creating a symbolic link with a relative\ - \ path for each of them. | \n\nSee [`stageInMode`](https://www.nextflow.io/docs/latest/process.html#stageinmode).\n" - type: "string" - cache: - anyOf: - - description: "The `cache` directive allows you to store the process results\ - \ to a local cache. When the cache is enabled and the pipeline is launched\ - \ with the resume option, any following attempt to execute the process,\ - \ along with the same inputs, will cause the process execution to be skipped,\ - \ producing the stored data as the actual results.\n\nThe caching feature\ - \ generates a unique key by indexing the process script and inputs. This\ - \ key is used to identify univocally the outputs produced by the process\ - \ execution.\n\nThe `cache` is enabled by default, you can disable it\ - \ for a specific process by setting the cache directive to `false`.\n\n\ - Accepted values are: `true`, `false`, `\"deep\"`, and `\"lenient\"`.\n\ - \nSee [`cache`](https://www.nextflow.io/docs/latest/process.html#cache).\n" - type: "boolean" - - description: "The `cache` directive allows you to store the process results\ - \ to a local cache. When the cache is enabled and the pipeline is launched\ - \ with the resume option, any following attempt to execute the process,\ - \ along with the same inputs, will cause the process execution to be skipped,\ - \ producing the stored data as the actual results.\n\nThe caching feature\ - \ generates a unique key by indexing the process script and inputs. This\ - \ key is used to identify univocally the outputs produced by the process\ - \ execution.\n\nThe `cache` is enabled by default, you can disable it\ - \ for a specific process by setting the cache directive to `false`.\n\n\ - Accepted values are: `true`, `false`, `\"deep\"`, and `\"lenient\"`.\n\ - \nSee [`cache`](https://www.nextflow.io/docs/latest/process.html#cache).\n" - type: "string" - pod: - anyOf: - - description: "The `pod` directive allows the definition of pods specific\ - \ settings, such as environment variables, secrets and config maps when\ - \ using the Kubernetes executor.\n\nSee [`pod`](https://www.nextflow.io/docs/latest/process.html#pod).\n" - type: "object" - additionalProperties: - description: "The `pod` directive allows the definition of pods specific\ - \ settings, such as environment variables, secrets and config maps when\ - \ using the Kubernetes executor.\n\nSee [`pod`](https://www.nextflow.io/docs/latest/process.html#pod).\n" - type: "string" - - description: "The `pod` directive allows the definition of pods specific\ - \ settings, such as environment variables, secrets and config maps when\ - \ using the Kubernetes executor.\n\nSee [`pod`](https://www.nextflow.io/docs/latest/process.html#pod).\n" - type: "array" - items: - type: "object" - additionalProperties: - type: "string" - penv: - description: "The `penv` directive allows you to define the parallel environment\ - \ to be used when submitting a parallel task to the SGE resource manager.\n\ - \nSee [`penv`](https://www.nextflow.io/docs/latest/process.html#penv).\n" - type: "string" - scratch: - anyOf: - - description: "The `scratch` directive allows you to execute the process\ - \ in a temporary folder that is local to the execution node.\n\nSee [`scratch`](https://www.nextflow.io/docs/latest/process.html#scratch).\n" - type: "boolean" - - description: "The `scratch` directive allows you to execute the process\ - \ in a temporary folder that is local to the execution node.\n\nSee [`scratch`](https://www.nextflow.io/docs/latest/process.html#scratch).\n" - type: "string" - storeDir: - description: "The `storeDir` directive allows you to define a directory that\ - \ is used as a permanent cache for your process results.\n\nSee [`storeDir`](https://www.nextflow.io/docs/latest/process.html#storeDir).\n" - type: "string" - maxRetries: - anyOf: - - description: "The `maxRetries` directive allows you to define the maximum\ - \ number of times a process instance can be re-submitted in case of failure.\ - \ This value is applied only when using the retry error strategy. By default\ - \ only one retry is allowed.\n\nSee [`maxRetries`](https://www.nextflow.io/docs/latest/process.html#maxretries).\n" - type: "string" - - description: "The `maxRetries` directive allows you to define the maximum\ - \ number of times a process instance can be re-submitted in case of failure.\ - \ This value is applied only when using the retry error strategy. By default\ - \ only one retry is allowed.\n\nSee [`maxRetries`](https://www.nextflow.io/docs/latest/process.html#maxretries).\n" - type: "integer" - echo: - anyOf: - - description: "By default the stdout produced by the commands executed in\ - \ all processes is ignored. By setting the `echo` directive to true, you\ - \ can forward the process stdout to the current top running process stdout\ - \ file, showing it in the shell terminal.\n \nSee [`echo`](https://www.nextflow.io/docs/latest/process.html#echo).\n" - type: "boolean" - - description: "By default the stdout produced by the commands executed in\ - \ all processes is ignored. By setting the `echo` directive to true, you\ - \ can forward the process stdout to the current top running process stdout\ - \ file, showing it in the shell terminal.\n \nSee [`echo`](https://www.nextflow.io/docs/latest/process.html#echo).\n" - type: "string" - errorStrategy: - description: "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.\n\nTable of available error\ - \ strategies:\n| Name | Executor |\n|------|----------|\n| `terminate` |\ - \ Terminates the execution as soon as an error condition is reported. Pending\ - \ jobs are killed (default) |\n| `finish` | Initiates an orderly pipeline\ - \ shutdown when an error condition is raised, waiting the completion of\ - \ any submitted job. |\n| `ignore` | Ignores processes execution errors.\ - \ |\n| `retry` | Re-submit for execution a process returning an error condition.\ - \ |\n\nSee [`errorStrategy`](https://www.nextflow.io/docs/latest/process.html#errorstrategy).\n" - type: "string" - memory: - description: "The `memory` directive allows you to define how much memory\ - \ the process is allowed to use.\n\nSee [`memory`](https://www.nextflow.io/docs/latest/process.html#memory).\n" - type: "string" - stageOutMode: - description: "The `stageOutMode` directive defines how output files are staged-out\ - \ from the scratch directory to the process work directory. The following\ - \ values are allowed:\n\n| Value | Description |\n|-------|-------------|\ - \ \n| copy | Output files are copied from the scratch directory to the work\ - \ directory. | \n| move | Output files are moved from the scratch directory\ - \ to the work directory. | \n| rsync | Output files are copied from the\ - \ scratch directory to the work directory by using the rsync utility. |\n\ - \nSee [`stageOutMode`](https://www.nextflow.io/docs/latest/process.html#stageoutmode).\n" - type: "string" - required: [] - additionalProperties: false - NextflowAuto: - description: "Automated processing flags which can be toggled on or off." - type: "object" - properties: - simplifyInput: - description: "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\") ] ]`).\n\nDefault: `true`.\n" - type: "boolean" - simplifyOutput: - description: "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\")]`).\n\nDefault: `true`.\n" - type: "boolean" - publish: - description: "If `true`, the module's outputs are automatically published\ - \ to `params.publishDir`.\nWill throw an error if `params.publishDir` is\ - \ not defined.\n\nDefault: `false`.\n" - type: "boolean" - transcript: - description: "If `true`, the module's transcripts from `work/` are automatically\ - \ published to `params.transcriptDir`.\nIf not defined, `params.publishDir\ - \ + \"/_transcripts\"` will be used.\nWill throw an error if neither are\ - \ defined.\n\nDefault: `false`.\n" - type: "boolean" - required: [] - additionalProperties: false - NextflowConfig: - description: "Allows tweaking how the Nextflow Config file is generated." - type: "object" - properties: - labels: - description: "A series of default labels to specify memory and cpu constraints.\n\ - \nThe default memory labels are defined as \"mem1gb\", \"mem2gb\", \"mem4gb\"\ - , ... upto \"mem512tb\" and follows powers of 2.\nThe default cpu labels\ - \ are defined as \"cpu1\", \"cpu2\", \"cpu5\", \"cpu10\", ... upto \"cpu1000\"\ - \ and follows a semi logarithmic scale (1, 2, 5 per decade).\n\nConceptually\ - \ it is possible for a Viash Config to overwrite the full labels parameter,\ - \ however likely it is more efficient to add additional labels\nin the Viash\ - \ Project with a config mod.\n" - type: "object" - additionalProperties: - description: "A series of default labels to specify memory and cpu constraints.\n\ - \nThe default memory labels are defined as \"mem1gb\", \"mem2gb\", \"\ - mem4gb\", ... upto \"mem512tb\" and follows powers of 2.\nThe default\ - \ cpu labels are defined as \"cpu1\", \"cpu2\", \"cpu5\", \"cpu10\", ...\ - \ upto \"cpu1000\" and follows a semi logarithmic scale (1, 2, 5 per decade).\n\ - \nConceptually it is possible for a Viash Config to overwrite the full\ - \ labels parameter, however likely it is more efficient to add additional\ - \ labels\nin the Viash Project with a config mod.\n" - type: "string" - script: - anyOf: - - description: "Includes a single string or list of strings into the nextflow.config\ - \ file.\nThis can be used to add custom profiles or include an additional\ - \ config file.\n" - type: "string" - - description: "Includes a single string or list of strings into the nextflow.config\ - \ file.\nThis can be used to add custom profiles or include an additional\ - \ config file.\n" - type: "array" - items: - type: "string" - required: [] - additionalProperties: false - DockerSetupStrategy: - $comment: "TODO add descriptions to different strategies" - enum: - - "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" - description: "The Docker setup strategy to use when building a container." - Direction: - enum: - - "input" - - "output" - description: "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: - - "enabled" - - "disabled" - - "deprecated" - description: "Allows setting a component to active, deprecated or disabled." - DockerResolveVolume: - $comment: "TODO make fully case insensitive" - enum: - - "manual" - - "automatic" - - "auto" - - "Manual" - - "Automatic" - - "Auto" - description: "Enables or disables automatic volume mapping. Enabled when set to\ - \ `Automatic` or disabled when set to `Manual`. Default: `Automatic`" diff --git a/src/common/schemas/task_control_method.yaml b/src/common/schemas/task_control_method.yaml deleted file mode 100644 index 8d62f6be43..0000000000 --- a/src/common/schemas/task_control_method.yaml +++ /dev/null @@ -1,68 +0,0 @@ -title: Control Method -description: | - A control method is used to test the relative performance of all other methods, - and also as a quality control for the pipeline as a whole. A control method can - either be a positive control or a negative control. The positive control and - negative control methods set a maximum and minimum threshold for performance, - so any new method should perform better than the negative control methods and - worse than the positive control method. -type: object -required: [__merge__, functionality, platforms] -properties: - __merge__: - "$ref": "defs_common.yaml#/definitions/CompAPIMerge" - functionality: - type: object - description: Information regarding the functionality of the component. - required: [name, info, resources] - additionalProperties: false - properties: - name: - "$ref": "defs_common.yaml#/definitions/Name" - status: - "$ref": "defs_viash.yaml#/definitions/Status" - info: - type: object - description: Metadata of the component. - additionalProperties: false - required: [label, summary, description, preferred_normalization] - properties: - label: - "$ref": "defs_common.yaml#/definitions/Label" - summary: - "$ref": "defs_common.yaml#/definitions/Summary" - description: - "$ref": "defs_common.yaml#/definitions/Description" - preferred_normalization: - "$ref": "defs_common.yaml#/definitions/PreferredNormalization" - reference: - "$ref": "defs_common.yaml#/definitions/BibtexReference" - documentation_url: - "$ref": "defs_common.yaml#/definitions/DocumentationURL" - repository_url: - "$ref": "defs_common.yaml#/definitions/RepositoryURL" - variants: - "$ref": "defs_common.yaml#/definitions/MethodVariants" - arguments: - type: array - description: Component-specific parameters. - items: - "$ref": "defs_viash.yaml#/definitions/Argument" - resources: - type: array - description: Resources required to run the component. - items: - "$ref": "defs_viash.yaml#/definitions/Resource" - test_resources: - type: array - description: One or more scripts and resources used to test the component. - items: - "$ref": "defs_viash.yaml#/definitions/Resource" - platforms: - type: array - description: A list of platforms which Viash generates target artifacts for. - items: - anyOf: - - "$ref": "defs_common.yaml#/definitions/PlatformDocker" - - "$ref": "defs_common.yaml#/definitions/PlatformNative" - - "$ref": "defs_common.yaml#/definitions/PlatformVdsl3" diff --git a/src/common/schemas/task_info.yaml b/src/common/schemas/task_info.yaml deleted file mode 100644 index be6a1e3447..0000000000 --- a/src/common/schemas/task_info.yaml +++ /dev/null @@ -1,22 +0,0 @@ -title: Task info -description: A file format specification file. -type: object -additionalProperties: false -required: [name, label, summary, motivation, description] -properties: - name: - $ref: "defs_common.yaml#/definitions/Name" - label: - $ref: "defs_common.yaml#/definitions/Label" - summary: - $ref: "defs_common.yaml#/definitions/Summary" - image: - $ref: "defs_common.yaml#/definitions/Image" - motivation: - $ref: "defs_common.yaml#/definitions/Description" - description: - $ref: "defs_common.yaml#/definitions/Description" - authors: - type: array - items: - $ref: "defs_common.yaml#/definitions/Author" diff --git a/src/common/schemas/task_method.yaml b/src/common/schemas/task_method.yaml deleted file mode 100644 index 25c59c7a47..0000000000 --- a/src/common/schemas/task_method.yaml +++ /dev/null @@ -1,65 +0,0 @@ -title: Method -description: | - A method is a specific technique used to solve the task problem and is - compared to the control methods and other methods to determine the best - approach for the task depending on the type of dataset. -type: object -required: [__merge__, functionality, platforms] -properties: - __merge__: - "$ref": "defs_common.yaml#/definitions/CompAPIMerge" - functionality: - type: object - description: Information regarding the functionality of the component. - required: [name, info, resources] - additionalProperties: false - properties: - name: - "$ref": "defs_common.yaml#/definitions/Name" - status: - "$ref": "defs_viash.yaml#/definitions/Status" - info: - type: object - description: Metadata of the component. - additionalProperties: false - required: [label, summary, description, preferred_normalization, reference, documentation_url, repository_url] - properties: - label: - "$ref": "defs_common.yaml#/definitions/Label" - summary: - "$ref": "defs_common.yaml#/definitions/Summary" - description: - "$ref": "defs_common.yaml#/definitions/Description" - preferred_normalization: - "$ref": "defs_common.yaml#/definitions/PreferredNormalization" - reference: - "$ref": "defs_common.yaml#/definitions/BibtexReference" - documentation_url: - "$ref": "defs_common.yaml#/definitions/DocumentationURL" - repository_url: - "$ref": "defs_common.yaml#/definitions/RepositoryURL" - variants: - "$ref": "defs_common.yaml#/definitions/MethodVariants" - arguments: - type: array - description: Component-specific parameters. - items: - "$ref": "defs_viash.yaml#/definitions/Argument" - resources: - type: array - description: Resources required to run the component. - items: - "$ref": "defs_viash.yaml#/definitions/Resource" - test_resources: - type: array - description: One or more scripts and resources used to test the component. - items: - "$ref": "defs_viash.yaml#/definitions/Resource" - platforms: - type: array - description: A list of platforms which Viash generates target artifacts for. - items: - anyOf: - - "$ref": "defs_common.yaml#/definitions/PlatformDocker" - - "$ref": "defs_common.yaml#/definitions/PlatformNative" - - "$ref": "defs_common.yaml#/definitions/PlatformVdsl3" diff --git a/src/common/schemas/task_metric.yaml b/src/common/schemas/task_metric.yaml deleted file mode 100644 index 35932e9e7a..0000000000 --- a/src/common/schemas/task_metric.yaml +++ /dev/null @@ -1,86 +0,0 @@ -title: Metric -description: | - A metric is a quantitative measure used to evaluate the performance of the - different methods in solving the specific task problem. -type: object -required: [__merge__, functionality, platforms] -properties: - __merge__: - "$ref": "defs_common.yaml#/definitions/CompAPIMerge" - functionality: - type: object - description: Information regarding the functionality of the component. - required: [name, info, resources] - additionalProperties: false - properties: - name: - "$ref": "defs_common.yaml#/definitions/Name" - status: - "$ref": "defs_viash.yaml#/definitions/Status" - info: - type: object - description: Metadata of the component. - additionalProperties: false - required: [metrics] - properties: - metrics: - type: array - minItems: 1 - items: - type: object - description: Metadata of each metric. - additionalProperties: false - required: [label, summary, description, reference, min, max, maximize] - properties: - name: - "$ref": "defs_common.yaml#/definitions/Name" - label: - "$ref": "defs_common.yaml#/definitions/Label" - summary: - "$ref": "defs_common.yaml#/definitions/Summary" - description: - "$ref": "defs_common.yaml#/definitions/Description" - reference: - "$ref": "defs_common.yaml#/definitions/BibtexReference" - documentation_url: - "$ref": "defs_common.yaml#/definitions/DocumentationURL" - repository_url: - "$ref": "defs_common.yaml#/definitions/RepositoryURL" - variants: - "$ref": "defs_common.yaml#/definitions/MethodVariants" - min: - description: The lowest possible value of the metric. - oneOf: - - type: number - - const: "-.inf" - max: - description: The highest possible value of the metric. - oneOf: - - type: number - - const: "+.inf" - maximize: - type: boolean - description: Whether a higher metric value is better. - arguments: - type: array - description: Component-specific parameters. - items: - "$ref": "defs_viash.yaml#/definitions/Argument" - resources: - type: array - description: Resources required to run the component. - items: - "$ref": "defs_viash.yaml#/definitions/Resource" - test_resources: - type: array - description: One or more scripts and resources used to test the component. - items: - "$ref": "defs_viash.yaml#/definitions/Resource" - platforms: - type: array - description: A list of platforms which Viash generates target artifacts for. - items: - anyOf: - - "$ref": "defs_common.yaml#/definitions/PlatformDocker" - - "$ref": "defs_common.yaml#/definitions/PlatformNative" - - "$ref": "defs_common.yaml#/definitions/PlatformVdsl3"