Skip to content

Commit ed9af9d

Browse files
authored
Merge pull request #456 from nf-core/dev
Release PR for 2.1.0
2 parents 66e7a33 + ec744df commit ed9af9d

File tree

254 files changed

+12685
-6235
lines changed

Some content is hidden

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

254 files changed

+12685
-6235
lines changed

.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,7 @@ indent_size = unset
3131
# ignore python and markdown
3232
[*.{py,md}]
3333
indent_style = unset
34+
35+
# ignore ro-crate metadata files
36+
[**/ro-crate-metadata.json]
37+
insert_final_newline = unset

.github/CONTRIBUTING.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# nf-core/funcscan: Contributing Guidelines
1+
# `nf-core/funcscan`: Contributing Guidelines
22

33
Hi there!
44
Many thanks for taking an interest in improving nf-core/funcscan.
@@ -19,7 +19,7 @@ If you'd like to write some code for nf-core/funcscan, the standard workflow is
1919
1. Check that there isn't already an issue about your idea in the [nf-core/funcscan issues](https://github.com/nf-core/funcscan/issues) to avoid duplicating work. If there isn't one already, please create one so that others know you're working on this
2020
2. [Fork](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) the [nf-core/funcscan repository](https://github.com/nf-core/funcscan) to your GitHub account
2121
3. Make the necessary changes / additions within your forked repository following [Pipeline conventions](#pipeline-contribution-conventions)
22-
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).
22+
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).
2323
5. Submit a Pull Request against the `dev` branch and wait for the code to be reviewed and merged
2424

2525
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/).
@@ -40,7 +40,7 @@ There are typically two types of tests that run:
4040
### Lint tests
4141

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

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

@@ -55,27 +55,27 @@ These tests are run both with the latest available version of `Nextflow` and als
5555

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

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

6262
## Getting help
6363

6464
For further information/help, please consult the [nf-core/funcscan documentation](https://nf-co.re/funcscan/usage) and don't hesitate to get in touch on the nf-core Slack [#funcscan](https://nfcore.slack.com/channels/funcscan) channel ([join our Slack here](https://nf-co.re/join/slack)).
6565

6666
## Pipeline contribution conventions
6767

68-
To make the nf-core/funcscan 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.
68+
To make the `nf-core/funcscan` 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.
6969

7070
### Adding a new step
7171

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

74-
1. Define the corresponding input channel into your new process from the expected previous process channel
74+
1. Define the corresponding input channel into your new process from the expected previous process channel.
7575
2. Write the process block (see below).
7676
3. Define the output channel if needed (see below).
7777
4. Add any new parameters to `nextflow.config` with a default (see below).
78-
5. Add any new parameters to `nextflow_schema.json` with help text (via the `nf-core schema build` tool).
78+
5. Add any new parameters to `nextflow_schema.json` with help text (via the `nf-core pipelines schema build` tool).
7979
6. Add sanity checks and validation for all relevant parameters.
8080
7. Perform local tests to validate that the new code works as expected.
8181
8. If applicable, add a new test command in `.github/workflow/ci.yml`.
@@ -84,13 +84,13 @@ If you wish to contribute a new step, please use the following coding standards:
8484

8585
### Default values
8686

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

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

9191
### Default processes resource requirements
9292

93-
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.
93+
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.
9494

9595
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.
9696

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

104104
### Nextflow version bumping
105105

106-
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]`
106+
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]`
107107

108108
### Images and figures
109109

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ body:
99
1010
- [nf-core website: troubleshooting](https://nf-co.re/usage/troubleshooting)
1111
- [nf-core/funcscan pipeline documentation](https://nf-co.re/funcscan/usage)
12-
1312
- type: textarea
1413
id: description
1514
attributes:

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Learn more about contributing: [CONTRIBUTING.md](https://github.com/nf-core/func
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/nf-core/funcscan/tree/master/.github/CONTRIBUTING.md)
1919
- [ ] If necessary, also make a PR on the nf-core/funcscan _branch_ on the [nf-core/test-datasets](https://github.com/nf-core/test-datasets) repository.
20-
- [ ] Make sure your code lints (`nf-core lint`).
20+
- [ ] Make sure your code lints (`nf-core pipelines lint`).
2121
- [ ] Ensure the test suite passes (`nextflow run . -profile test,docker --outdir <OUTDIR>`).
2222
- [ ] Check for unexpected warnings in debug mode (`nextflow run . -profile debug,test,docker --outdir <OUTDIR>`).
2323
- [ ] Usage Documentation in `docs/usage.md` is updated.

.github/workflows/awsfulltest.yml

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,48 @@
11
name: nf-core AWS full size tests
2-
# This workflow is triggered on published releases.
2+
# This workflow is triggered on PRs opened against the main/master branch.
33
# It can be additionally triggered manually with GitHub actions workflow dispatch button.
44
# It runs the -profile 'test_full' on AWS batch
55

66
on:
7-
release:
8-
types: [published]
7+
pull_request:
8+
branches:
9+
- main
10+
- master
911
workflow_dispatch:
12+
pull_request_review:
13+
types: [submitted]
14+
1015
jobs:
1116
run-platform:
1217
name: Run AWS full tests
13-
if: github.repository == 'nf-core/funcscan'
18+
# run only if the PR is approved by at least 2 reviewers and against the master branch or manually triggered
19+
if: github.repository == 'nf-core/funcscan' && github.event.review.state == 'approved' && github.event.pull_request.base.ref == 'master' || github.event_name == 'workflow_dispatch'
1420
runs-on: ubuntu-latest
1521
steps:
22+
- name: Get PR reviews
23+
uses: octokit/[email protected]
24+
if: github.event_name != 'workflow_dispatch'
25+
id: check_approvals
26+
continue-on-error: true
27+
with:
28+
route: GET /repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews?per_page=100
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
32+
- name: Check for approvals
33+
if: ${{ failure() && github.event_name != 'workflow_dispatch' }}
34+
run: |
35+
echo "No review approvals found. At least 2 approvals are required to run this action automatically."
36+
exit 1
37+
38+
- name: Check for enough approvals (>=2)
39+
id: test_variables
40+
if: github.event_name != 'workflow_dispatch'
41+
run: |
42+
JSON_RESPONSE='${{ steps.check_approvals.outputs.data }}'
43+
CURRENT_APPROVALS_COUNT=$(echo $JSON_RESPONSE | jq -c '[.[] | select(.state | contains("APPROVED")) ] | length')
44+
test $CURRENT_APPROVALS_COUNT -ge 2 || exit 1 # At least 2 approvals are required
45+
1646
- name: Launch workflow via Seqera Platform
1747
uses: seqeralabs/action-tower-launch@v2
1848
with:

.github/workflows/branch.yml

Lines changed: 10 additions & 8 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: [master]
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 == 'nf-core/funcscan'
1517
run: |
@@ -22,7 +24,7 @@ jobs:
2224
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: 60 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,20 @@ name: nf-core CI
33
on:
44
push:
55
branches:
6-
- "dev"
6+
- dev
77
pull_request:
88
branches:
99
- "dev"
1010
- "master"
1111
release:
12-
types:
13-
- "published"
12+
types: [published]
13+
workflow_dispatch:
1414

1515
env:
1616
NXF_ANSI_LOG: false
17-
NFTEST_VER: "0.8.4"
17+
NXF_SINGULARITY_CACHEDIR: ${{ github.workspace }}/.singularity
18+
NXF_SINGULARITY_LIBRARYDIR: ${{ github.workspace }}/.singularity
19+
NFTEST_VER: "0.9.2"
1820

1921
concurrency:
2022
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
@@ -36,16 +38,23 @@ jobs:
3638
fi
3739
3840
test:
39-
name: nf-test
40-
needs: define_nxf_versions
41+
name: "Run pipeline with test data (${{ matrix.NXF_VER }} | ${{ matrix.test_name }} | ${{ matrix.profile }})"
42+
# Only run on push if this is the nf-core dev branch (merged PRs)
43+
if: "${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/funcscan') }}"
4144
runs-on: ubuntu-latest
4245
strategy:
4346
fail-fast: false
4447
matrix:
45-
NXF_VER: ${{ fromJson(needs.define_nxf_versions.outputs.matrix) }}
46-
tags:
48+
NXF_VER:
49+
- "24.10.4"
50+
- "latest-everything"
51+
profile:
52+
- "conda"
53+
- "docker"
54+
- "singularity"
55+
test_name:
4756
- "test"
48-
- "test_nothing"
57+
- "test_minimal"
4958
- "test_bakta"
5059
- "test_prokka"
5160
- "test_bgc_pyrodigal"
@@ -56,12 +65,24 @@ jobs:
5665
- "test_taxonomy_prokka"
5766
- "test_preannotated"
5867
- "test_preannotated_bgc"
59-
profile:
60-
- "docker"
61-
68+
isMaster:
69+
- ${{ github.base_ref == 'master' }}
70+
# Exclude conda and singularity on dev
71+
exclude:
72+
- isMaster: false
73+
profile: "conda"
74+
- isMaster: false
75+
profile: "singularity"
6276
steps:
6377
- name: Check out pipeline code
64-
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
78+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
79+
with:
80+
fetch-depth: 0
81+
82+
- name: Set up Nextflow
83+
uses: nf-core/setup-nextflow@v2
84+
with:
85+
version: "${{ matrix.NXF_VER }}"
6586

6687
- name: Check out test data
6788
uses: actions/checkout@v3
@@ -71,22 +92,42 @@ jobs:
7192
path: test-datasets/
7293
fetch-depth: 1
7394

74-
- name: Install Nextflow
75-
uses: nf-core/setup-nextflow@v1
95+
- name: Set up Apptainer
96+
if: matrix.profile == 'singularity'
97+
uses: eWaterCycle/setup-apptainer@main
98+
99+
- name: Set up Singularity
100+
if: matrix.profile == 'singularity'
101+
run: |
102+
mkdir -p $NXF_SINGULARITY_CACHEDIR
103+
mkdir -p $NXF_SINGULARITY_LIBRARYDIR
104+
105+
- name: Set up Miniconda
106+
if: matrix.profile == 'conda'
107+
uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3
76108
with:
77-
version: "${{ matrix.NXF_VER }}"
109+
miniconda-version: "latest"
110+
auto-update-conda: true
111+
conda-solver: libmamba
112+
channels: conda-forge,bioconda
113+
114+
- name: Set up Conda
115+
if: matrix.profile == 'conda'
116+
run: |
117+
echo $(realpath $CONDA)/condabin >> $GITHUB_PATH
118+
echo $(realpath python) >> $GITHUB_PATH
78119
79-
- name: Disk space cleanup
120+
- name: Clean up Disk space
80121
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
81122

82123
- name: Install nf-test
83124
run: |
84125
wget -qO- https://code.askimed.com/install/nf-test | bash -s $NFTEST_VER
85126
sudo mv nf-test /usr/local/bin/
86127
87-
- name: Run nf-test
128+
- name: "Run pipeline with test data ${{ matrix.NXF_VER }} | ${{ matrix.test_name }} | ${{ matrix.profile }}"
88129
run: |
89-
nf-test test --tag ${{ matrix.tags }} --profile ${{ matrix.tags }},${{ matrix.profile }} --junitxml=test.xml
130+
nf-test test --tag ${{ matrix.test_name }} --profile ${{ matrix.test_name }},${{ matrix.profile }} --junitxml=test.xml
90131
91132
- name: Output log on failure
92133
if: failure()

0 commit comments

Comments
 (0)