Code to deal with pipeline JSON Schema


Bases: object

Class to generate a schema object with functions to handle pipeline JSON Schema


Add anything that’s found in the Nextflow params that’s missing in the pipeline schema Update defaults if they have changed

build_schema(pipeline_dir, no_prompts, web_only, url)

Interactively build a new pipeline schema for a pipeline


Build a pipeline schema dictionary for an param interactively


Check that the input parameter has a mimetype

Common mime types:

  • Returns: The mimetype of the input parameter
  • Return type: mimetype (str)
  • Raises: LookupError – If the input parameter is not found or defined in the correct place


Generate set of default input parameters from schema.

Saves defaults to self.schema_defaults Returns count of how many parameters were found (with or without a default value)

get_schema_path(path: str | Path, local_only: bool = False, revision: str | None = None)

Given a pipeline name, directory, or path, set self.schema_filename


Get a list of all parameter types in the schema


Given a URL for a Schema build response, recursively query it until results are ready. Once ready, validate Schema and write to disk.


Load the pipeline parameter defaults using nextflow config Strip out only the params. values and ignore anything that is not a flat variable


Send pipeline schema to web builder and wait for response


Load a given a path to a parameters file (JSON/YAML)

These should be input parameters used to run a pipeline with the Nextflow -params-file option.


Load and lint a given schema to see if it looks valid


Load a pipeline schema from a file


Make a new pipeline schema from the template

markdown_param_table(properties, required, columns)

Creates a markdown table for params from jsonschema properties section

  • Parameters:
    • properties (dict) – A jsonschema properties dictionary
    • required (list) – A list of the required fields. Should come from the same level of the jsonschema as properties
    • columns (list) – A list of columns to write
  • Returns: A string with the markdown table
  • Return type: str


Convert markdown to html

Prints documentation for the schema.


Check if a given key is found in the nextflow config params and prompt to remove it if note

Returns True if it should be removed, False if not.


Go through top-level schema remove definitions that don’t have any property attributes


Go through top-level schema and all definitions sub-schemas to remove anything that’s not in the nextflow config.


Go through a single schema / set of properties and strip out anything that’s not in the nextflow config.

Takes: Schema or sub-schema with properties key Returns: Cleaned schema / sub-schema


Given a param, ensure that the default value is the correct variable type


Save a pipeline schema to a file


Creates documentation for the schema in Markdown format.

validate_config_default_parameter(param, schema_param, config_default)

Assure that default parameters in the nextflow.config are correctly set by comparing them to their type in the schema


Check that all default parameters in the schema are valid Ignores ‘required’ flag, as required parameters might have no defaults

Additional check that all parameters have defaults in nextflow.config and that these are valid and adhere to guidelines


Check given parameters against a schema and validate


Check that the Schema is valid

Returns: Number of parameters found


Extra validation command for linting. Checks that the schema “$id”, “title” and “description” attributes match the piipeline config.