Skip to content

Commit 0e749b4

Browse files
authored
Merge pull request #390 from sanger-tol/schema_update
Schema/Template update
2 parents f7f4402 + 6fd0b0f commit 0e749b4

File tree

146 files changed

+3938
-4002
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+3938
-4002
lines changed

.devcontainer/devcontainer.json

Lines changed: 0 additions & 27 deletions
This file was deleted.

.editorconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,20 @@ insert_final_newline = unset
1919
trim_trailing_whitespace = unset
2020
indent_style = unset
2121
indent_size = unset
22+
[/subworkflows/nf-core/**]
23+
charset = unset
24+
end_of_line = unset
25+
insert_final_newline = unset
26+
trim_trailing_whitespace = unset
27+
indent_style = unset
2228

2329
[/assets/email*]
2430
indent_size = unset
31+
32+
# ignore python and markdown
33+
[*.{py,md}]
34+
indent_style = unset
35+
36+
# ignore ro-crate metadata files
37+
[**/ro-crate-metadata.json]
38+
insert_final_newline = unset

.github/CONTRIBUTING.md

Lines changed: 13 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# sanger-tol/treeval: Contributing Guidelines
1+
# `sanger-tol/treeval`: Contributing Guidelines
22

33
Hi there!
44
Many thanks for taking an interest in improving sanger-tol/treeval.
@@ -16,7 +16,7 @@ If you'd like to write some code for sanger-tol/treeval, the standard workflow i
1616
1. Check that there isn't already an issue about your idea in the [sanger-tol/treeval issues](https://github.com/sanger-tol/treeval/issues) to avoid duplicating work. If there isn't one already, please create one so that others know you're working on this
1717
2. [Fork](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) the [sanger-tol/treeval repository](https://github.com/sanger-tol/treeval) to your GitHub account
1818
3. Make the necessary changes / additions within your forked repository following [Pipeline conventions](#pipeline-contribution-conventions)
19-
4. Use `nf-core schema build` and add any new parameters to the pipeline JSON schema (requires [nf-core tools](https://github.com/nf-core/tools) >= 1.10).
19+
4. Use `nf-core pipelines schema build` and add any new parameters to the pipeline JSON schema (requires [nf-core tools](https://github.com/nf-core/tools) >= 1.10).
2020
5. Submit a Pull Request against the `dev` branch and wait for the code to be reviewed and merged
2121

2222
If you're not used to this workflow with git, you can start with some [docs from GitHub](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests) or even their [excellent `git` resources](https://try.github.io/).
@@ -31,7 +31,7 @@ There are typically two types of tests that run:
3131
### Lint tests
3232

3333
`nf-core` has a [set of guidelines](https://nf-co.re/developers/guidelines) which all pipelines must adhere to.
34-
To enforce these and ensure that all pipelines stay in sync, we have developed a helper tool which runs checks on the pipeline code. This is in the [nf-core/tools repository](https://github.com/nf-core/tools) and once installed can be run locally with the `nf-core lint <pipeline-directory>` command.
34+
To enforce these and ensure that all pipelines stay in sync, we have developed a helper tool which runs checks on the pipeline code. This is in the [nf-core/tools repository](https://github.com/nf-core/tools) and once installed can be run locally with the `nf-core pipelines lint <pipeline-directory>` command.
3535

3636
If any failures or warnings are encountered, please follow the listed URL for more documentation.
3737

@@ -46,40 +46,38 @@ These tests are run both with the latest available version of `Nextflow` and als
4646

4747
:warning: Only in the unlikely and regretful event of a release happening with a bug.
4848

49-
- On your own fork, make a new branch `patch` based on `upstream/master`.
49+
- On your own fork, make a new branch `patch` based on `upstream/main` or `upstream/master`.
5050
- Fix the bug, and bump version (X.Y.Z+1).
51-
- A PR should be made on `master` from patch to directly this particular bug.
51+
- Open a pull-request from `patch` to `main`/`master` with the changes.
5252

5353
## Pipeline contribution conventions
5454

55-
To make the sanger-tol/treeval code and processing logic more understandable for new contributors and to ensure quality, we semi-standardise the way the code and other contributions are written.
55+
To make the `sanger-tol/treeval` code and processing logic more understandable for new contributors and to ensure quality, we semi-standardise the way the code and other contributions are written.
5656

5757
### Adding a new step
5858

5959
If you wish to contribute a new step, please use the following coding standards:
6060

61-
1. Define the corresponding input channel into your new process from the expected previous process channel
61+
1. Define the corresponding input channel into your new process from the expected previous process channel.
6262
2. Write the process block (see below).
6363
3. Define the output channel if needed (see below).
6464
4. Add any new parameters to `nextflow.config` with a default (see below).
65-
5. Add any new parameters to `nextflow_schema.json` with help text (via the `nf-core schema build` tool).
65+
5. Add any new parameters to `nextflow_schema.json` with help text (via the `nf-core pipelines schema build` tool).
6666
6. Add sanity checks and validation for all relevant parameters.
6767
7. Perform local tests to validate that the new code works as expected.
6868
8. If applicable, add a new test command in `.github/workflow/ci.yml`.
69-
9. Update MultiQC config `assets/multiqc_config.yml` so relevant suffixes, file name clean up and module plots are in the appropriate order. If applicable, add a [MultiQC](https://https://multiqc.info/) module.
70-
10. Add a description of the output files and if relevant any appropriate images from the MultiQC report to `docs/output.md`.
7169

7270
### Default values
7371

74-
Parameters should be initialised / defined with default values in `nextflow.config` under the `params` scope.
72+
Parameters should be initialised / defined with default values within the `params` scope in `nextflow.config`.
7573

76-
Once there, use `nf-core schema build` to add to `nextflow_schema.json`.
74+
Once there, use `nf-core pipelines schema build` to add to `nextflow_schema.json`.
7775

7876
### Default processes resource requirements
7977

80-
Sensible defaults for process resource requirements (CPUs / memory / time) for a process should be defined in `conf/base.config`. These should generally be specified generic with `withLabel:` selectors so they can be shared across multiple processes/steps of the pipeline. A nf-core standard set of labels that should be followed where possible can be seen in the [nf-core pipeline template](https://github.com/nf-core/tools/blob/master/nf_core/pipeline-template/conf/base.config), which has the default process as a single core-process, and then different levels of multi-core configurations for increasingly large memory requirements defined with standardised labels.
78+
Sensible defaults for process resource requirements (CPUs / memory / time) for a process should be defined in `conf/base.config`. These should generally be specified generic with `withLabel:` selectors so they can be shared across multiple processes/steps of the pipeline. A nf-core standard set of labels that should be followed where possible can be seen in the [nf-core pipeline template](https://github.com/nf-core/tools/blob/main/nf_core/pipeline-template/conf/base.config), which has the default process as a single core-process, and then different levels of multi-core configurations for increasingly large memory requirements defined with standardised labels.
8179

82-
The process resources can be passed on to the tool dynamically within the process with the `${task.cpu}` and `${task.memory}` variables in the `script:` block.
80+
The process resources can be passed on to the tool dynamically within the process with the `${task.cpus}` and `${task.memory}` variables in the `script:` block.
8381

8482
### Naming schemes
8583

@@ -90,24 +88,8 @@ Please use the following naming schemes, to make it easy to understand what is g
9088

9189
### Nextflow version bumping
9290

93-
If you are using a new feature from core Nextflow, you may bump the minimum required version of nextflow in the pipeline with: `nf-core bump-version --nextflow . [min-nf-version]`
91+
If you are using a new feature from core Nextflow, you may bump the minimum required version of nextflow in the pipeline with: `nf-core pipelines bump-version --nextflow . [min-nf-version]`
9492

9593
### Images and figures
9694

9795
For overview images and other documents we follow the nf-core [style guidelines and examples](https://nf-co.re/developers/design_guidelines).
98-
99-
## GitHub Codespaces
100-
101-
This repo includes a devcontainer configuration which will create a GitHub Codespaces for Nextflow development! This is an online developer environment that runs in your browser, complete with VSCode and a terminal.
102-
103-
To get started:
104-
105-
- Open the repo in [Codespaces](https://github.com/sanger-tol/treeval/codespaces)
106-
- Tools installed
107-
- nf-core
108-
- Nextflow
109-
110-
Devcontainer specs:
111-
112-
- [DevContainer config](.devcontainer/devcontainer.json)
113-
- [Dockerfile](.devcontainer/Dockerfile)

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,46 +9,34 @@ body:
99
description: A clear and concise description of what the bug is.
1010
validations:
1111
required: true
12+
1213
- type: textarea
1314
id: command_used
1415
attributes:
1516
label: Command used and terminal output
16-
description: Steps to reproduce the behaviour. Please paste the command you used
17-
to launch the pipeline and the output from your terminal.
17+
description: Steps to reproduce the behaviour. Please paste the command you used to launch the pipeline and the output from your terminal.
1818
render: console
19-
placeholder: "$ nextflow run ...
20-
19+
placeholder: |
20+
$ nextflow run ...
2121
2222
Some output where something broke
2323
24-
"
2524
- type: textarea
2625
id: files
2726
attributes:
2827
label: Relevant files
29-
description: "Please drag and drop the relevant files here. Create a `.zip` archive
30-
if the extension is not allowed.
31-
32-
Your verbose log file `.nextflow.log` is often useful _(this is a hidden file
33-
in the directory where you launched the pipeline)_ as well as custom Nextflow
34-
configuration files.
28+
description: |
29+
Please drag and drop the relevant files here. Create a `.zip` archive if the extension is not allowed.
30+
Your verbose log file `.nextflow.log` is often useful _(this is a hidden file in the directory where you launched the pipeline)_ as well as custom Nextflow configuration files.
3531
36-
"
3732
- type: textarea
3833
id: system
3934
attributes:
4035
label: System information
41-
description: "* Nextflow version _(eg. 22.10.1)_
42-
36+
description: |
37+
* Nextflow version _(eg. 23.04.0)_
4338
* Hardware _(eg. HPC, Desktop, Cloud)_
44-
4539
* Executor _(eg. slurm, local, awsbatch)_
46-
47-
* Container engine: _(e.g. Docker, Singularity, Conda, Podman, Shifter, Charliecloud,
48-
or Apptainer)_
49-
40+
* Container engine: _(e.g. Docker, Singularity, Conda, Podman, Shifter, Charliecloud, or Apptainer)_
5041
* OS _(eg. CentOS Linux, macOS, Linux Mint)_
51-
5242
* Version of sanger-tol/treeval _(eg. 1.1, 1.5, 1.8.2)_
53-
54-
"

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ Learn more about contributing: [CONTRIBUTING.md](https://github.com/sanger-tol/t
1616
- [ ] This comment contains a description of changes (with reason).
1717
- [ ] If you've fixed a bug or added code that should be tested, add tests!
1818
- [ ] If you've added a new tool - have you followed the pipeline conventions in the [contribution docs](https://github.com/sanger-tol/treeval/tree/master/.github/CONTRIBUTING.md)
19-
- [ ] Make sure your code lints (`nf-core lint`).
19+
- [ ] Make sure your code lints (`nf-core pipelines lint`).
2020
- [ ] Ensure the test suite passes (`nextflow run . -profile test,docker --outdir <OUTDIR>`).
21+
- [ ] Check for unexpected warnings in debug mode (`nextflow run . -profile debug,test,docker --outdir <OUTDIR>`).
2122
- [ ] Usage Documentation in `docs/usage.md` is updated.
2223
- [ ] Output Documentation in `docs/output.md` is updated.
2324
- [ ] `CHANGELOG.md` is updated.

.github/workflows/branch.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
name: nf-core branch protection
2-
# This workflow is triggered on PRs to master branch on the repository
3-
# It fails when someone tries to make a PR against the nf-core `master` branch instead of `dev`
2+
# This workflow is triggered on PRs to `main`/`master` branch on the repository
3+
# It fails when someone tries to make a PR against the nf-core `main`/`master` branch instead of `dev`
44
on:
55
pull_request_target:
6-
branches: [main]
6+
branches:
7+
- main
8+
- master
79

810
jobs:
911
test:
1012
runs-on: ubuntu-latest
1113
steps:
12-
# PRs to the nf-core repo master branch are only ok if coming from the nf-core repo `dev` or any `patch` branches
14+
# PRs to the nf-core repo main/master branch are only ok if coming from the nf-core repo `dev` or any `patch` branches
1315
- name: Check PRs
1416
if: github.repository == 'sanger-tol/treeval'
1517
run: |
@@ -19,10 +21,10 @@ jobs:
1921
# NOTE - this doesn't currently work if the PR is coming from a fork, due to limitations in GitHub actions secrets
2022
- name: Post PR comment
2123
if: failure()
22-
uses: mshick/add-pr-comment@v1
24+
uses: mshick/add-pr-comment@b8f338c590a895d50bcbfa6c5859251edc8952fc # v2
2325
with:
2426
message: |
25-
## This PR is against the `master` branch :x:
27+
## This PR is against the `${{github.event.pull_request.base.ref}}` branch :x:
2628
2729
* Do not close this PR
2830
* Click _Edit_ and change the `base` to `dev`
@@ -32,9 +34,9 @@ jobs:
3234
3335
Hi @${{ github.event.pull_request.user.login }},
3436
35-
It looks like this pull-request is has been made against the [${{github.event.pull_request.head.repo.full_name }}](https://github.com/${{github.event.pull_request.head.repo.full_name }}) `master` branch.
36-
The `master` branch on nf-core repositories should always contain code from the latest release.
37-
Because of this, PRs to `master` are only allowed if they come from the [${{github.event.pull_request.head.repo.full_name }}](https://github.com/${{github.event.pull_request.head.repo.full_name }}) `dev` branch.
37+
It looks like this pull-request is has been made against the [${{github.event.pull_request.head.repo.full_name }}](https://github.com/${{github.event.pull_request.head.repo.full_name }}) ${{github.event.pull_request.base.ref}} branch.
38+
The ${{github.event.pull_request.base.ref}} branch on nf-core repositories should always contain code from the latest release.
39+
Because of this, PRs to ${{github.event.pull_request.base.ref}} are only allowed if they come from the [${{github.event.pull_request.head.repo.full_name }}](https://github.com/${{github.event.pull_request.head.repo.full_name }}) `dev` branch.
3840
3941
You do not need to close this PR, you can change the target branch to `dev` by clicking the _"Edit"_ button at the top of this page.
4042
Note that even after this, the test will continue to show as failing until you push a new commit.

.github/workflows/ci.yml

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
pull_request:
88
release:
99
types: [published]
10+
workflow_dispatch:
1011

1112
env:
1213
NXF_ANSI_LOG: false
@@ -19,20 +20,33 @@ concurrency:
1920

2021
jobs:
2122
test:
22-
name: Run pipeline with test data
23+
name: "Run pipeline with test data (${{ matrix.NXF_VER }} | ${{ matrix.test_name }} | ${{ matrix.profile }})"
2324
# Only run on push if this is the nf-core dev branch (merged PRs)
2425
if: "${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'sanger-tol/treeval') }}"
2526
runs-on: [ubuntu-latest]
2627
strategy:
2728
matrix:
2829
NXF_VER:
29-
- "22.10.1"
30+
- "24.04.2"
3031
- "latest-everything"
32+
profile:
33+
- "docker"
34+
- "singularity"
35+
test_name:
36+
- "test_github"
37+
isMaster:
38+
- ${{ github.base_ref == 'master' }}
39+
# Exclude conda and singularity on dev
40+
exclude:
41+
- isMaster: false
42+
profile: "singularity"
3143
steps:
3244
- name: Check out pipeline code
33-
uses: actions/checkout@v4
45+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
46+
with:
47+
fetch-depth: 0
3448

35-
- name: Install Nextflow
49+
- name: Set up Nextflow
3650
uses: nf-core/setup-nextflow@v2
3751
with:
3852
version: "${{ matrix.NXF_VER }}"
@@ -42,11 +56,19 @@ jobs:
4256
run: |
4357
curl https://tolit.cog.sanger.ac.uk/test-data/resources/treeval/TreeValTinyData.tar.gz | tar xzf -
4458
45-
- name: Run FULL pipeline with test data
46-
# Remember that you can parallelise this by using strategy.matrix
59+
- name: Set up Apptainer
60+
if: matrix.profile == 'singularity'
61+
uses: eWaterCycle/setup-apptainer@main
62+
63+
- name: Set up Singularity
64+
if: matrix.profile == 'singularity'
4765
run: |
48-
nextflow run ${GITHUB_WORKSPACE} -profile test_github,docker --outdir ./Sing-Full
66+
mkdir -p $NXF_SINGULARITY_CACHEDIR
67+
mkdir -p $NXF_SINGULARITY_LIBRARYDIR
68+
69+
- name: Clean up Disk space
70+
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
4971

50-
- name: Print list of output
72+
- name: "Run pipeline with test data ${{ matrix.NXF_VER }} | ${{ matrix.test_name }} | ${{ matrix.profile }}"
5173
run: |
52-
echo "The contents of dir1 are: $(find ./Sing-Full)"
74+
nextflow run ${GITHUB_WORKSPACE} -profile ${{ matrix.test_name }},${{ matrix.profile }} --outdir ./results

.github/workflows/clean-up.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
issues: write
1111
pull-requests: write
1212
steps:
13-
- uses: actions/stale@v7
13+
- uses: actions/stale@28ca1036281a5e5922ead5184a1bbf96e5fc984e # v9
1414
with:
1515
stale-issue-message: "This issue has been tagged as awaiting-changes or awaiting-feedback by an nf-core contributor. Remove stale label or add a comment otherwise this issue will be closed in 20 days."
1616
stale-pr-message: "This PR has been tagged as awaiting-changes or awaiting-feedback by an nf-core contributor. Remove stale label or add a comment if it is still useful."

0 commit comments

Comments
 (0)