Skip to content

Commit ee702d7

Browse files
authored
Merge pull request #112 from Plant-Food-Research-Open/dev
Candidate for 0.5.0
2 parents 24a8f50 + 02e7669 commit ee702d7

File tree

184 files changed

+7911
-1888
lines changed

Some content is hidden

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

184 files changed

+7911
-1888
lines changed

.editorconfig

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ trim_trailing_whitespace = true
88
indent_size = 4
99
indent_style = space
1010

11-
[*.{md,yml,yaml,html,css,scss,js}]
11+
[*.{md,yml,yaml,html,css,scss,js,cff}]
1212
indent_size = 2
1313

1414
# These files are edited and tested upstream in nf-core/modules
@@ -58,3 +58,7 @@ indent_size = unset
5858
# ignore LICENSE
5959
[LICENSE]
6060
indent_size = unset
61+
62+
# ignore bin/genepal_report
63+
[bin/genepal_report*]
64+
indent_size = unset

.github/CONTRIBUTING.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ If you'd like to write some code for plant-food-research-open/genepal, the stand
1616
1. Check that there isn't already an issue about your idea in the [plant-food-research-open/genepal issues](https://github.com/plant-food-research-open/genepal/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 [plant-food-research-open/genepal repository](https://github.com/plant-food-research-open/genepal) 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/).
@@ -37,7 +37,7 @@ There are typically two types of tests that run:
3737
### Lint tests
3838

3939
`nf-core` has a [set of guidelines](https://nf-co.re/developers/guidelines) which all pipelines must adhere to.
40-
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.
40+
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.
4141

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

@@ -68,7 +68,7 @@ If you wish to contribute a new step, please use the following coding standards:
6868
2. Write the process block (see below).
6969
3. Define the output channel if needed (see below).
7070
4. Add any new parameters to `nextflow.config` with a default (see below).
71-
5. Add any new parameters to `nextflow_schema.json` with help text (via the `nf-core schema build` tool).
71+
5. Add any new parameters to `nextflow_schema.json` with help text (via the `nf-core pipelines schema build` tool).
7272
6. Add sanity checks and validation for all relevant parameters.
7373
7. Perform local tests to validate that the new code works as expected.
7474
8. If applicable, add a new test command in `.github/workflow/ci.yml`.
@@ -79,11 +79,11 @@ If you wish to contribute a new step, please use the following coding standards:
7979

8080
Parameters should be initialised / defined with default values in `nextflow.config` under the `params` scope.
8181

82-
Once there, use `nf-core schema build` to add to `nextflow_schema.json`.
82+
Once there, use `nf-core pipelines schema build` to add to `nextflow_schema.json`.
8383

8484
### Default processes resource requirements
8585

86-
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.
86+
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.
8787

8888
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.
8989

@@ -96,7 +96,7 @@ Please use the following naming schemes, to make it easy to understand what is g
9696

9797
### Nextflow version bumping
9898

99-
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]`
99+
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]`
100100

101101
### Images and figures
102102

.github/ISSUE_TEMPLATE/bug_report.yml

+10-22
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. 23.04.0)_
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 plant-food-research-open/genepal _(eg. 1.1, 1.5, 1.8.2)_
53-
54-
"

.github/PULL_REQUEST_TEMPLATE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Learn more about contributing: [CONTRIBUTING.md](https://github.com/plant-food-r
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/plant-food-research-open/genepal/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>`).
2121
- [ ] Check for unexpected warnings in debug mode (`nextflow run . -profile debug,test,docker --outdir <OUTDIR>`).
2222
- [ ] Usage Documentation in `docs/usage.md` is updated.

.github/include.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
".":
2+
- ./.github/workflows/**
3+
- ./nf-test.config
4+
tests:
5+
- ./assets/*
6+
- ./bin/*
7+
- ./conf/*
8+
- ./main.nf
9+
- ./nextflow_schema.json
10+
- ./nextflow.config

.github/version_checks.sh

+19-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,24 @@
11
#!/usr/bin/env bash
22

3-
config_version=$(sed -n "s/.*version.*= '\(.*\)'.*/\1/p" nextflow.config)
3+
set -euo pipefail
44

5-
# Check CHANGELOG version
5+
config_version=$(sed -n "/^\s*version\s*=\s*'/s/version//p" nextflow.config | tr -d "=[:space:]'")
6+
cff_version=$(sed -n '/^version: /s/version: //p' CITATION.cff | tr -d '[:space:]')
7+
8+
if [[ $config_version != $cff_version ]]; then
9+
echo 'config_version != cff_version'
10+
exit 1
11+
fi
612

7-
head -n 10 CHANGELOG.md | grep "## $config_version - " >/dev/null \
13+
# Check CHANGELOG version
14+
head -10 CHANGELOG.md | grep "## v$config_version - " >/dev/null \
815
|| (echo 'Failed to match CHANGELOG version'; exit 1)
16+
17+
# Check .nf-core.yml version
18+
tail -5 .nf-core.yml | grep "version: $config_version" >/dev/null \
19+
|| (echo 'Failed to match .nf-core.yml version'; exit 1)
20+
21+
# Check multiqc_config.yml version
22+
config_version_plain=$(echo $config_version | sed 's/.*\dev$/dev/; t; s/\+.*//')
23+
head -n 5 assets/multiqc_config.yml | grep "https://github.com/plant-food-research-open/genepal/blob/$config_version_plain/docs/usage.md" >/dev/null \
24+
|| (echo 'Failed to match multiqc_config.yml version'; exit 1)

.github/workflows/ci.yml

+71-29
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,100 @@
11
name: nf-core CI
22
# This workflow runs the pipeline with the minimal test dataset to check that it completes without any syntax errors
33
on:
4-
push:
5-
branches:
6-
- dev
74
pull_request:
8-
release:
9-
types: [published]
105

116
env:
127
NXF_ANSI_LOG: false
8+
NFT_WORKDIR: "nf-test-work"
9+
NFT_DIFF: "pdiff"
10+
NFT_DIFF_ARGS: "--line-numbers --expand-tabs=2"
1311

1412
concurrency:
1513
group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}"
1614
cancel-in-progress: true
17-
1815
jobs:
16+
nf-test-changes:
17+
name: Check for changes
18+
runs-on: ubuntu-latest
19+
outputs:
20+
nf_test_files: ${{ steps.list.outputs.components }}
21+
steps:
22+
- uses: actions/checkout@v4.2.1
23+
with:
24+
fetch-depth: 0
25+
26+
- name: List nf-test files
27+
id: list
28+
uses: adamrtalbot/detect-nf-test-changes@v0.0.4
29+
with:
30+
head: ${{ github.sha }}
31+
base: origin/${{ github.base_ref }}
32+
include: .github/include.yaml
33+
34+
- name: print list of nf-test files
35+
run: |
36+
echo ${{ steps.list.outputs.components }}
37+
1938
test:
20-
name: Run pipeline with test data
21-
if: "${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'Plant-Food-Research-Open/genepal') }}"
39+
name: ${{ matrix.nf_test_files }} ${{ matrix.profile }} NF-${{ matrix.NXF_VER }}
40+
needs: [nf-test-changes]
41+
if: needs.nf-test-changes.outputs.nf_test_files != '[]'
2242
runs-on: ubuntu-latest
2343
strategy:
44+
fail-fast: false
2445
matrix:
2546
NXF_VER:
26-
- "23.04.0"
27-
TEST_PARAMS:
28-
- minimal
29-
- short
30-
- nonmasked
31-
- stub
32-
OPTION_STUB:
33-
- "-stub"
47+
- "24.04.2"
48+
49+
nf_test_files: ["${{ fromJson(needs.nf-test-changes.outputs.nf_test_files) }}"]
50+
profile:
51+
- "docker"
3452

3553
steps:
3654
- name: Check out pipeline code
37-
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
55+
uses: actions/checkout@v4.2.1
3856

3957
- name: Install Nextflow
4058
uses: nf-core/setup-nextflow@v2
4159
with:
4260
version: "${{ matrix.NXF_VER }}"
4361

62+
- uses: actions/setup-python@v5.2.0
63+
with:
64+
python-version: "3.11"
65+
architecture: "x64"
66+
67+
- name: Install pdiff to see diff between nf-test snapshots
68+
run: |
69+
python -m pip install --upgrade pip
70+
pip install pdiff
71+
72+
- uses: nf-core/setup-nf-test@v1.1.2
73+
with:
74+
version: 0.9.0
75+
4476
- name: Disk space cleanup
45-
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
77+
if: matrix.nf_test_files == 'tests/stub/main.nf.test'
78+
uses: jlumbroso/free-disk-space@v1.3.1
79+
80+
- name: Run nf-test
81+
run: |
82+
nf-test test --verbose ${{ matrix.nf_test_files }} --profile "+${{ matrix.profile }}"
83+
84+
confirm-pass:
85+
runs-on: ubuntu-latest
86+
needs: [test]
87+
if: always()
88+
steps:
89+
- name: All tests ok
90+
if: ${{ !contains(needs.*.result, 'failure') }}
91+
run: exit 0
92+
- name: One or more tests failed
93+
if: ${{ contains(needs.*.result, 'failure') }}
94+
run: exit 1
4695

47-
- name: Run pipeline with test data
96+
- name: debug-print
97+
if: always()
4898
run: |
49-
nextflow run \
50-
${GITHUB_WORKSPACE} \
51-
-profile docker \
52-
-params-file \
53-
./tests/${{ matrix.TEST_PARAMS }}/params.json \
54-
${{ matrix.OPTION_STUB }} \
55-
--outdir ./results \
56-
--max_cpus 2 \
57-
--max_memory '6.GB' \
58-
--max_time '2.h'
99+
echo "toJSON(needs) = ${{ toJSON(needs) }}"
100+
echo "toJSON(needs.*.result) = ${{ toJSON(needs.*.result) }}"

0 commit comments

Comments
 (0)