Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update nf-core/tools API docs for dev #2975

Merged
merged 2 commits into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions sites/docs/src/content/api_reference/dev/api/utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,18 @@ Bases: `BaseModel`
"default": null,
"title": "Pipeline Todos"
},
"pipeline_if_empty_null": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Pipeline If Empty Null"
},
"plugin_includes": {
"anyOf": [
{
Expand Down Expand Up @@ -862,6 +874,18 @@ Bases: `BaseModel`
],
"default": null,
"title": "Included Configs"
},
"local_component_structure": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Local Component Structure"
}
},
"title": "NFCoreYamlLintConfig",
Expand Down Expand Up @@ -1168,6 +1192,18 @@ schema for linting config in .nf-core.yml should cover:
"default": null,
"title": "Pipeline Todos"
},
"pipeline_if_empty_null": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Pipeline If Empty Null"
},
"plugin_includes": {
"anyOf": [
{
Expand Down Expand Up @@ -1323,6 +1359,18 @@ schema for linting config in .nf-core.yml should cover:
],
"default": null,
"title": "Included Configs"
},
"local_component_structure": {
"anyOf": [
{
"type": "boolean"
},
{
"type": "null"
}
],
"default": null,
"title": "Local Component Structure"
}
}
}
Expand All @@ -1338,6 +1386,7 @@ schema for linting config in .nf-core.yml should cover:
- [`files_exist (bool | List[str] | None)`](#nf_core.utils.NFCoreYamlLintConfig.files_exist)
- [`files_unchanged (bool | List[str] | None)`](#nf_core.utils.NFCoreYamlLintConfig.files_unchanged)
- [`included_configs (bool | None)`](#nf_core.utils.NFCoreYamlLintConfig.included_configs)
- [`local_component_structure (bool | None)`](#nf_core.utils.NFCoreYamlLintConfig.local_component_structure)
- [`merge_markers (bool | List[str] | None)`](#nf_core.utils.NFCoreYamlLintConfig.merge_markers)
- [`modules_config (bool | List[str] | None)`](#nf_core.utils.NFCoreYamlLintConfig.modules_config)
- [`modules_json (bool | None)`](#nf_core.utils.NFCoreYamlLintConfig.modules_json)
Expand All @@ -1346,6 +1395,7 @@ schema for linting config in .nf-core.yml should cover:
- [`nextflow_config (bool | List[str | Dict[str, List[str]]] | None)`](#nf_core.utils.NFCoreYamlLintConfig.nextflow_config)
- [`nfcore_components (bool | None)`](#nf_core.utils.NFCoreYamlLintConfig.nfcore_components)
- [`nfcore_yml (bool | None)`](#nf_core.utils.NFCoreYamlLintConfig.nfcore_yml)
- [`pipeline_if_empty_null (bool | None)`](#nf_core.utils.NFCoreYamlLintConfig.pipeline_if_empty_null)
- [`pipeline_name_conventions (bool | None)`](#nf_core.utils.NFCoreYamlLintConfig.pipeline_name_conventions)
- [`pipeline_todos (bool | None)`](#nf_core.utils.NFCoreYamlLintConfig.pipeline_todos)
- [`plugin_includes (bool | None)`](#nf_core.utils.NFCoreYamlLintConfig.plugin_includes)
Expand Down Expand Up @@ -1389,6 +1439,10 @@ List of files that should not be changed

Lint for included configs

#### _`field{:python}`_`local_component_structure{:python}`_: bool | None_`{:python}`_= None_

Lint local components use correct structure mirroring remote

#### _`field{:python}`_`merge_markers{:python}`_: bool | List\[str] | None_`{:python}`_= None_

List of files that should not contain merge markers
Expand Down Expand Up @@ -1421,6 +1475,10 @@ Lint all required files to use nf-core modules and subworkflows

Lint nf-core.yml

#### _`field{:python}`_`pipeline_if_empty_null{:python}`_: bool | None_`{:python}`_= None_

Lint for ifEmpty(null) statements

#### _`field{:python}`_`pipeline_name_conventions{:python}`_: bool | None_`{:python}`_= None_

Lint for pipeline name conventions
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# environment_yml

#### `ModuleLint.environment_yml(module: NFCoreComponent) → None{:python}`
#### `ModuleLint.environment_yml(module: NFCoreComponent, allow_missing: bool = False) → None{:python}`

Lint an `environment.yml` file.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# meta_yml

#### `ModuleLint.meta_yml(module: NFCoreComponent) → None{:python}`
#### `ModuleLint.meta_yml(module: NFCoreComponent, allow_missing: bool = False) → None{:python}`

Lint a `meta.yml` file

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# module_tests

#### `ModuleLint.module_tests(module: NFCoreComponent){:python}`
#### `ModuleLint.module_tests(module: NFCoreComponent, allow_missing: bool = False){:python}`

Lint the tests of a module in `nf-core/modules`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
- [nfcore_yml](./nfcore_yml/)
- [pipeline_name_conventions](./pipeline_name_conventions/)
- [pipeline_todos](./pipeline_todos/)
- [pipeline_if_empty_null](./pipeline_if_empty_null/)
- [plugin_includes](./plugin_includes/)
- [readme](./readme/)
- [schema_description](./schema_description/)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# modules_structure

#### `PipelineLint.local_component_structure(){:python}`

Check that the local modules and subworkflows directories in a pipeline have the correct format:

```bash
modules/local/TOOL/SUBTOOL
```

Prior to nf-core/tools release 3.1.0 the directory structure allowed top-level \*.nf files:

```bash
modules/local/modules/TOOL_SUBTOOL.nf
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# pipeline_if_empty_null

#### `PipelineLint.pipeline_if_empty_null(root_dir=None){:python}`

Check for ifEmpty(null)

There are two general cases for workflows to use the channel operator ifEmpty:
: 1. ifEmpty( \[ ] ) to ensure a process executes, for example when an input file is optional (although this can be replaced by toList()).
2\. When a channel should not be empty and throws an error ifEmpty { error … }, e.g. reading from an empty samplesheet.

There are multiple examples of workflows that inject null objects into channels using ifEmpty(null), which can cause unhandled null pointer exceptions.
This lint test throws warnings for those instances.
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
- [subworkflow_changes](./subworkflow_changes/)
- [subworkflow_tests](./subworkflow_tests/)
- [subworkflow_todos](./subworkflow_todos/)
- [subworkflow_if_empty_null](./subworkflow_if_empty_null/)
- [subworkflow_version](./subworkflow_version/)
```
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# meta_yml

#### `SubworkflowLint.meta_yml(subworkflow){:python}`
#### `SubworkflowLint.meta_yml(subworkflow, allow_missing: bool = False){:python}`

Lint a `meta.yml` file

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# subworkflow_if_empty_null

#### `SubworkflowLint.subworkflow_if_empty_null(subworkflow){:python}`

Check for ifEmpty(null)

There are two general cases for workflows to use the channel operator ifEmpty:
: 1. ifEmpty( \[ ] ) to ensure a process executes, for example when an input file is optional (although this can be replaced by toList()).
2\. When a channel should not be empty and throws an error ifEmpty { error … }, e.g. reading from an empty samplesheet.

There are multiple examples of workflows that inject null objects into channels using ifEmpty(null), which can cause unhandled null pointer exceptions.
This lint test throws warnings for those instances.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# subworkflow_tests

#### `SubworkflowLint.subworkflow_tests(subworkflow: NFCoreComponent){:python}`
#### `SubworkflowLint.subworkflow_tests(subworkflow: NFCoreComponent, allow_missing: bool = False){:python}`

Lint the tests of a subworkflow in `nf-core/modules`

Expand Down
Loading