Skip to content

Commit 0af416a

Browse files
Merge pull request #554 from nf-core/dev
v1.2.1 - Bouncy Basenji Patch PR
2 parents 6893894 + acd85cc commit 0af416a

Some content is hidden

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

70 files changed

+6870
-1177
lines changed

.github/CONTRIBUTING.md

+6-6
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ If you'd like to write some code for nf-core/taxprofiler, the standard workflow
1919
1. Check that there isn't already an issue about your idea in the [nf-core/taxprofiler issues](https://github.com/nf-core/taxprofiler/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/taxprofiler repository](https://github.com/nf-core/taxprofiler) 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

@@ -75,7 +75,7 @@ If you wish to contribute a new step, please use the following coding standards:
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`.
@@ -86,11 +86,11 @@ If you wish to contribute a new step, please use the following coding standards:
8686

8787
Parameters should be initialised / defined with default values in `nextflow.config` under the `params` scope.
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/PULL_REQUEST_TEMPLATE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Learn more about contributing: [CONTRIBUTING.md](https://github.com/nf-core/taxp
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/taxprofiler/tree/master/.github/CONTRIBUTING.md)
1919
- [ ] If necessary, also make a PR on the nf-core/taxprofiler _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

+21-4
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,35 @@
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 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+
- master
910
workflow_dispatch:
11+
pull_request_review:
12+
types: [submitted]
13+
1014
jobs:
1115
run-platform:
1216
name: Run AWS full tests
13-
if: github.repository == 'nf-core/taxprofiler'
17+
# run only if the PR is approved by at least 2 reviewers and against the master branch or manually triggered
18+
if: github.repository == 'nf-core/taxprofiler' && github.event.review.state == 'approved' && github.event.pull_request.base.ref == 'master' || github.event_name == 'workflow_dispatch'
1419
runs-on: ubuntu-latest
1520
steps:
21+
- uses: octokit/[email protected]
22+
id: check_approvals
23+
with:
24+
route: GET /repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/reviews
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
- id: test_variables
28+
if: github.event_name != 'workflow_dispatch'
29+
run: |
30+
JSON_RESPONSE='${{ steps.check_approvals.outputs.data }}'
31+
CURRENT_APPROVALS_COUNT=$(echo $JSON_RESPONSE | jq -c '[.[] | select(.state | contains("APPROVED")) ] | length')
32+
test $CURRENT_APPROVALS_COUNT -ge 2 || exit 1 # At least 2 approvals are required
1633
- name: Launch workflow via Seqera Platform
1734
uses: seqeralabs/action-tower-launch@v2
1835
with:

.github/workflows/ci.yml

+47-16
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,34 @@ on:
77
pull_request:
88
release:
99
types: [published]
10+
workflow_dispatch:
1011

1112
env:
1213
NXF_ANSI_LOG: false
14+
NXF_SINGULARITY_CACHEDIR: ${{ github.workspace }}/.singularity
15+
NXF_SINGULARITY_LIBRARYDIR: ${{ github.workspace }}/.singularity
1316

1417
concurrency:
1518
group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}"
1619
cancel-in-progress: true
1720

1821
jobs:
1922
test:
20-
name: Run pipeline with test data
23+
name: "Run pipeline with test data (${{ matrix.NXF_VER }} | ${{ matrix.test_name }} | ${{ matrix.profile }})"
2124
# Only run on push if this is the nf-core dev branch (merged PRs)
2225
if: "${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/taxprofiler') }}"
2326
runs-on: ubuntu-latest
2427
strategy:
2528
fail-fast: false
2629
matrix:
2730
NXF_VER:
28-
- "23.04.0"
31+
- "24.04.2"
2932
- "latest-everything"
30-
tags:
33+
profile:
34+
- "conda"
35+
- "docker"
36+
- "singularity"
37+
test_name:
3138
- "test"
3239
- "test_nopreprocessing"
3340
- "test_noprofiling"
@@ -39,37 +46,61 @@ jobs:
3946
- "test_alternativepreprocessing"
4047
- "test_bbduk"
4148
- "test_prinseqplusplus"
42-
49+
isMaster:
50+
- ${{ github.base_ref == 'master' }}
51+
# Exclude conda and singularity on dev
52+
exclude:
53+
- isMaster: false
54+
profile: "conda"
55+
- isMaster: false
56+
profile: "singularity"
4357
steps:
4458
- name: Check out pipeline code
4559
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
4660

47-
- name: Install Nextflow
61+
- name: Set up Nextflow
4862
uses: nf-core/setup-nextflow@v2
4963
with:
5064
version: "${{ matrix.NXF_VER }}"
5165

52-
- name: Disk space cleanup
53-
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
66+
- name: Set up Apptainer
67+
if: matrix.profile == 'singularity'
68+
uses: eWaterCycle/setup-apptainer@main
5469

55-
- name: Run pipeline with test data
56-
# TODO nf-core: You can customise CI pipeline run tests as required
57-
# For example: adding multiple test runs with different parameters
58-
# Remember that you can parallelise this by using strategy.matrix
70+
- name: Set up Singularity
71+
if: matrix.profile == 'singularity'
5972
run: |
60-
sudo locale-gen en_US.UTF-8
61-
sudo update-locale LANG=en_US.UTF-8
73+
mkdir -p $NXF_SINGULARITY_CACHEDIR
74+
mkdir -p $NXF_SINGULARITY_LIBRARYDIR
75+
76+
- name: Set up Miniconda
77+
if: matrix.profile == 'conda'
78+
uses: conda-incubator/setup-miniconda@a4260408e20b96e80095f42ff7f1a15b27dd94ca # v3
79+
with:
80+
miniconda-version: "latest"
81+
auto-update-conda: true
82+
conda-solver: libmamba
83+
channels: conda-forge,bioconda
84+
85+
- name: Set up Conda
86+
if: matrix.profile == 'conda'
87+
run: |
88+
echo $(realpath $CONDA)/condabin >> $GITHUB_PATH
89+
echo $(realpath python) >> $GITHUB_PATH
90+
91+
- name: Clean up Disk space
92+
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
6293

6394
- name: Run pipeline with test data
6495
run: |
65-
if [[ "${{ matrix.tags }}" == "test_motus" ]]; then
96+
if [[ "${{ matrix.test_name }}" == "test_motus" ]]; then
6697
wget https://raw.githubusercontent.com/motu-tool/mOTUs/master/motus/downloadDB.py
6798
python downloadDB.py --no-download-progress
6899
echo 'tool,db_name,db_params,db_type,db_path' > 'database_motus.csv'
69100
echo "motus,db1_mOTU,,short,db_mOTU" >> 'database_motus.csv'
70101
echo "motus,db2_mOTU,,long,db_mOTU" >> 'database_motus.csv'
71102
echo "motus,db3_mOTU,,short;long,db_mOTU" >> 'database_motus.csv'
72-
nextflow run ${GITHUB_WORKSPACE} -profile docker,${{ matrix.tags }} --databases ./database_motus.csv --outdir ./results_${{ matrix.tags }};
103+
nextflow run ${GITHUB_WORKSPACE} -profile docker,${{ matrix.test_name }} --databases ./database_motus.csv --outdir ./results_${{ matrix.test_name }};
73104
else
74-
nextflow run ${GITHUB_WORKSPACE} -profile docker,${{ matrix.tags }} --outdir ./results_${{ matrix.tags }};
105+
nextflow run ${GITHUB_WORKSPACE} -profile docker,${{ matrix.test_name }} --outdir ./results_${{ matrix.test_name }};
75106
fi

.github/workflows/download_pipeline.yml

+43-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Test successful pipeline download with 'nf-core download'
1+
name: Test successful pipeline download with 'nf-core pipelines download'
22

33
# Run the workflow when:
44
# - dispatched manually
@@ -8,7 +8,7 @@ on:
88
workflow_dispatch:
99
inputs:
1010
testbranch:
11-
description: "The specific branch you wish to utilize for the test execution of nf-core download."
11+
description: "The specific branch you wish to utilize for the test execution of nf-core pipelines download."
1212
required: true
1313
default: "dev"
1414
pull_request:
@@ -39,9 +39,11 @@ jobs:
3939
with:
4040
python-version: "3.12"
4141
architecture: "x64"
42-
- uses: eWaterCycle/setup-singularity@931d4e31109e875b13309ae1d07c70ca8fbc8537 # v7
42+
43+
- name: Setup Apptainer
44+
uses: eWaterCycle/setup-apptainer@4bb22c52d4f63406c49e94c804632975787312b3 # v2.0.0
4345
with:
44-
singularity-version: 3.8.3
46+
apptainer-version: 1.3.4
4547

4648
- name: Install dependencies
4749
run: |
@@ -54,33 +56,64 @@ jobs:
5456
echo "REPOTITLE_LOWERCASE=$(basename ${GITHUB_REPOSITORY,,})" >> ${GITHUB_ENV}
5557
echo "REPO_BRANCH=${{ github.event.inputs.testbranch || 'dev' }}" >> ${GITHUB_ENV}
5658
59+
- name: Make a cache directory for the container images
60+
run: |
61+
mkdir -p ./singularity_container_images
62+
5763
- name: Download the pipeline
5864
env:
59-
NXF_SINGULARITY_CACHEDIR: ./
65+
NXF_SINGULARITY_CACHEDIR: ./singularity_container_images
6066
run: |
61-
nf-core download ${{ env.REPO_LOWERCASE }} \
67+
nf-core pipelines download ${{ env.REPO_LOWERCASE }} \
6268
--revision ${{ env.REPO_BRANCH }} \
6369
--outdir ./${{ env.REPOTITLE_LOWERCASE }} \
6470
--compress "none" \
6571
--container-system 'singularity' \
66-
--container-library "quay.io" -l "docker.io" -l "ghcr.io" \
72+
--container-library "quay.io" -l "docker.io" -l "community.wave.seqera.io" \
6773
--container-cache-utilisation 'amend' \
68-
--download-configuration
74+
--download-configuration 'yes'
6975
7076
- name: Inspect download
7177
run: tree ./${{ env.REPOTITLE_LOWERCASE }}
7278

79+
- name: Count the downloaded number of container images
80+
id: count_initial
81+
run: |
82+
image_count=$(ls -1 ./singularity_container_images | wc -l | xargs)
83+
echo "Initial container image count: $image_count"
84+
echo "IMAGE_COUNT_INITIAL=$image_count" >> ${GITHUB_ENV}
85+
7386
- name: Run the downloaded pipeline (stub)
7487
id: stub_run_pipeline
7588
continue-on-error: true
7689
env:
77-
NXF_SINGULARITY_CACHEDIR: ./
90+
NXF_SINGULARITY_CACHEDIR: ./singularity_container_images
7891
NXF_SINGULARITY_HOME_MOUNT: true
7992
run: nextflow run ./${{ env.REPOTITLE_LOWERCASE }}/$( sed 's/\W/_/g' <<< ${{ env.REPO_BRANCH }}) -stub -profile test,singularity --outdir ./results
8093
- name: Run the downloaded pipeline (stub run not supported)
8194
id: run_pipeline
8295
if: ${{ job.steps.stub_run_pipeline.status == failure() }}
8396
env:
84-
NXF_SINGULARITY_CACHEDIR: ./
97+
NXF_SINGULARITY_CACHEDIR: ./singularity_container_images
8598
NXF_SINGULARITY_HOME_MOUNT: true
8699
run: nextflow run ./${{ env.REPOTITLE_LOWERCASE }}/$( sed 's/\W/_/g' <<< ${{ env.REPO_BRANCH }}) -profile test,singularity --outdir ./results
100+
101+
- name: Count the downloaded number of container images
102+
id: count_afterwards
103+
run: |
104+
image_count=$(ls -1 ./singularity_container_images | wc -l | xargs)
105+
echo "Post-pipeline run container image count: $image_count"
106+
echo "IMAGE_COUNT_AFTER=$image_count" >> ${GITHUB_ENV}
107+
108+
- name: Compare container image counts
109+
run: |
110+
if [ "${{ env.IMAGE_COUNT_INITIAL }}" -ne "${{ env.IMAGE_COUNT_AFTER }}" ]; then
111+
initial_count=${{ env.IMAGE_COUNT_INITIAL }}
112+
final_count=${{ env.IMAGE_COUNT_AFTER }}
113+
difference=$((final_count - initial_count))
114+
echo "$difference additional container images were \n downloaded at runtime . The pipeline has no support for offline runs!"
115+
tree ./singularity_container_images
116+
exit 1
117+
else
118+
echo "The pipeline can be downloaded successfully!"
119+
fi

.github/workflows/linting.yml

+19-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: nf-core linting
22
# This workflow is triggered on pushes and PRs to the repository.
3-
# It runs the `nf-core lint` and markdown lint tests to ensure
3+
# It runs the `nf-core pipelines lint` and markdown lint tests to ensure
44
# that the code meets the nf-core guidelines.
55
on:
66
push:
@@ -41,17 +41,32 @@ jobs:
4141
python-version: "3.12"
4242
architecture: "x64"
4343

44+
- name: read .nf-core.yml
45+
uses: pietrobolcato/[email protected]
46+
id: read_yml
47+
with:
48+
config: ${{ github.workspace }}/.nf-core.yml
49+
4450
- name: Install dependencies
4551
run: |
4652
python -m pip install --upgrade pip
47-
pip install nf-core
53+
pip install nf-core==${{ steps.read_yml.outputs['nf_core_version'] }}
54+
55+
- name: Run nf-core pipelines lint
56+
if: ${{ github.base_ref != 'master' }}
57+
env:
58+
GITHUB_COMMENTS_URL: ${{ github.event.pull_request.comments_url }}
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60+
GITHUB_PR_COMMIT: ${{ github.event.pull_request.head.sha }}
61+
run: nf-core -l lint_log.txt pipelines lint --dir ${GITHUB_WORKSPACE} --markdown lint_results.md
4862

49-
- name: Run nf-core lint
63+
- name: Run nf-core pipelines lint --release
64+
if: ${{ github.base_ref == 'master' }}
5065
env:
5166
GITHUB_COMMENTS_URL: ${{ github.event.pull_request.comments_url }}
5267
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5368
GITHUB_PR_COMMIT: ${{ github.event.pull_request.head.sha }}
54-
run: nf-core -l lint_log.txt lint --dir ${GITHUB_WORKSPACE} --markdown lint_results.md
69+
run: nf-core -l lint_log.txt pipelines lint --release --dir ${GITHUB_WORKSPACE} --markdown lint_results.md
5570

5671
- name: Save PR number
5772
if: ${{ always() }}

.github/workflows/linting_comment.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Download lint results
14-
uses: dawidd6/action-download-artifact@09f2f74827fd3a8607589e5ad7f9398816f540fe # v3
14+
uses: dawidd6/action-download-artifact@bf251b5aa9c2f7eeb574a96ee720e24f801b7c11 # v6
1515
with:
1616
workflow: linting.yml
1717
workflow_conclusion: completed

.github/workflows/release-announcements.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- name: get topics and convert to hashtags
1313
id: get_topics
1414
run: |
15-
echo "topics=$(curl -s https://nf-co.re/pipelines.json | jq -r '.remote_workflows[] | select(.full_name == "${{ github.repository }}") | .topics[]' | awk '{print "#"$0}' | tr '\n' ' ')" >> $GITHUB_OUTPUT
15+
echo "topics=$(curl -s https://nf-co.re/pipelines.json | jq -r '.remote_workflows[] | select(.full_name == "${{ github.repository }}") | .topics[]' | awk '{print "#"$0}' | tr '\n' ' ')" | sed 's/-//g' >> $GITHUB_OUTPUT
1616
1717
- uses: rzr/fediverse-action@master
1818
with:

0 commit comments

Comments
 (0)