Skip to content

Commit 72c4c4c

Browse files
authored
Merge pull request #446 from nf-core/dev
PR for Release 2.4.0
2 parents 5901bea + 3876a7a commit 72c4c4c

File tree

320 files changed

+19101
-4457
lines changed

Some content is hidden

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

320 files changed

+19101
-4457
lines changed

.editorconfig

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ indent_style = space
1111
[*.{md,yml,yaml,html,css,scss,js}]
1212
indent_size = 2
1313

14+
1415
# These files are edited and tested upstream in nf-core/modules
1516
[/modules/nf-core/**]
1617
charset = unset
@@ -25,13 +26,12 @@ insert_final_newline = unset
2526
trim_trailing_whitespace = unset
2627
indent_style = unset
2728

29+
30+
2831
[/assets/email*]
2932
indent_size = unset
3033

31-
# ignore Readme
32-
[README.md]
33-
indent_style = unset
3434

35-
# ignore python
35+
# ignore python and markdown
3636
[*.{py,md}]
3737
indent_style = unset

.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/smrnaseq, the standard workflow is
1919
1. Check that there isn't already an issue about your idea in the [nf-core/smrnaseq issues](https://github.com/nf-core/smrnaseq/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/smrnaseq repository](https://github.com/nf-core/smrnaseq) 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

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ Learn more about contributing: [CONTRIBUTING.md](https://github.com/nf-core/smrn
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/smrnaseq/tree/master/.github/CONTRIBUTING.md)
1919
- [ ] If necessary, also make a PR on the nf-core/smrnaseq _branch_ on the [nf-core/test-datasets](https://github.com/nf-core/test-datasets) repository.
20-
- [ ] Make sure your code lints (`nf-core lint`).
21-
- [ ] Ensure the test suite passes (`nf-test test main.nf.test -profile test,docker`).
20+
- [ ] Make sure your code lints (`nf-core pipelines lint`).
21+
- [ ] 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.
2424
- [ ] Output Documentation in `docs/output.md` is updated.

.github/workflows/awsfulltest.yml

+26-9
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,36 @@
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:
11-
run-tower:
15+
run-platform:
1216
name: Run AWS full tests
13-
if: github.repository == 'nf-core/smrnaseq'
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/smrnaseq' && github.event.review.state == 'approved' && github.event.pull_request.base.ref == 'master' || github.event_name == 'workflow_dispatch'
1419
runs-on: ubuntu-latest
1520
steps:
16-
- name: Launch workflow via tower
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
33+
- name: Launch workflow via Seqera Platform
1734
uses: seqeralabs/action-tower-launch@v2
1835
# Add full size test data (but still relatively small datasets for few samples)
1936
# on the `test_full.config` test runs with only one set of parameters
@@ -32,7 +49,7 @@ jobs:
3249

3350
- uses: actions/upload-artifact@v4
3451
with:
35-
name: Tower debug log file
52+
name: Seqera Platform debug log file
3653
path: |
37-
tower_action_*.log
38-
tower_action_*.json
54+
seqera_platform_action_*.log
55+
seqera_platform_action_*.json

.github/workflows/awstest.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ name: nf-core AWS test
55
on:
66
workflow_dispatch:
77
jobs:
8-
run-tower:
8+
run-platform:
99
name: Run AWS tests
1010
if: github.repository == 'nf-core/smrnaseq'
1111
runs-on: ubuntu-latest
1212
steps:
13-
# Launch workflow using Tower CLI tool action
14-
- name: Launch workflow via tower
13+
# Launch workflow using Seqera Platform CLI tool action
14+
- name: Launch workflow via Seqera Platform
1515
uses: seqeralabs/action-tower-launch@v2
1616
with:
1717
workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }}
@@ -23,11 +23,11 @@ jobs:
2323
{
2424
"outdir": "s3://${{ secrets.AWS_S3_BUCKET }}/smrnaseq/results-test-${{ github.sha }}"
2525
}
26-
profiles: test
26+
profiles: test,illumina
2727

2828
- uses: actions/upload-artifact@v4
2929
with:
30-
name: Tower debug log file
30+
name: Seqera Platform debug log file
3131
path: |
32-
tower_action_*.log
33-
tower_action_*.json
32+
seqera_platform_action_*.log
33+
seqera_platform_action_*.json

.github/workflows/ci.yml

+50-15
Original file line numberDiff line numberDiff line change
@@ -4,45 +4,80 @@ on:
44
push:
55
branches:
66
- dev
7+
- master
78
pull_request:
9+
branches:
10+
- dev
11+
- master
812
release:
913
types: [published]
14+
workflow_dispatch:
1015

1116
env:
1217
NXF_ANSI_LOG: false
18+
NXF_SINGULARITY_CACHEDIR: ${{ github.workspace }}/.singularity
19+
NXF_SINGULARITY_LIBRARYDIR: ${{ github.workspace }}/.singularity
20+
NFT_VER: "0.9.0"
21+
NFT_WORKDIR: "~"
22+
NFT_DIFF: "pdiff"
23+
NFT_DIFF_ARGS: "--line-numbers --expand-tabs=2"
1324

1425
concurrency:
1526
group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}"
1627
cancel-in-progress: true
1728

1829
jobs:
1930
test:
20-
name: Run pipeline with test data
31+
name: "Run pipeline with test data (${{ matrix.NXF_VER }} | ${{ matrix.test_name }} | ${{ matrix.profile }})"
2132
# Only run on push if this is the nf-core dev branch (merged PRs)
2233
if: "${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/smrnaseq') }}"
2334
runs-on: ubuntu-latest
2435
strategy:
36+
fail-fast: false
2537
matrix:
38+
shard: [1, 2, 3, 4]
2639
NXF_VER:
27-
- "23.04.0"
28-
- "latest-everything"
29-
profile:
30-
- "test"
31-
- "test_no_genome"
32-
- "test_umi"
33-
- "test_index"
40+
- "24.04.2"
41+
profile: ["docker"]
42+
env:
43+
SHARDS: "4"
3444
steps:
3545
- name: Check out pipeline code
36-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
46+
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
47+
with:
48+
fetch-depth: 0
49+
50+
- uses: actions/setup-python@v4
51+
with:
52+
python-version: "3.11"
53+
architecture: "x64"
3754

38-
- name: Install Nextflow
39-
uses: nf-core/setup-nextflow@v1
55+
- name: Install pdiff to see diff between nf-test snapshots
56+
run: |
57+
python -m pip install --upgrade pip
58+
pip install pdiff
59+
60+
- uses: nf-core/setup-nextflow@v2
4061
with:
4162
version: "${{ matrix.NXF_VER }}"
4263

43-
- name: Disk space cleanup
44-
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
64+
- uses: nf-core/setup-nf-test@v1
65+
with:
66+
version: ${{ env.NFT_VER }}
4567

46-
- name: Run pipeline with test data
68+
- name: Run Tests (Shard ${{ matrix.shard }}/${{ env.SHARDS }})
4769
run: |
48-
nextflow run ${GITHUB_WORKSPACE} -profile ${{ matrix.profile }},docker --outdir ./results
70+
nf-test test \
71+
--ci \
72+
--shard ${{ matrix.shard }}/${{ env.SHARDS }} \
73+
--changed-since HEAD^ \
74+
--profile "+${{ matrix.profile }},ci" \
75+
--filter pipeline \
76+
--junitxml=test.xml
77+
78+
- name: Publish Test Report
79+
uses: mikepenz/action-junit-report@v3
80+
if: always() # always run even if the previous step fails
81+
with:
82+
report_paths: test.xml
83+
annotate_only: true
+61-14
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,12 +8,14 @@ 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:
1515
types:
1616
- opened
17+
- edited
18+
- synchronize
1719
branches:
1820
- master
1921
pull_request_target:
@@ -28,15 +30,20 @@ jobs:
2830
runs-on: ubuntu-latest
2931
steps:
3032
- name: Install Nextflow
31-
uses: nf-core/setup-nextflow@v1
33+
uses: nf-core/setup-nextflow@v2
3234

33-
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5
35+
- name: Disk space cleanup
36+
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
37+
38+
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5
3439
with:
35-
python-version: "3.11"
40+
python-version: "3.12"
3641
architecture: "x64"
37-
- uses: eWaterCycle/setup-singularity@931d4e31109e875b13309ae1d07c70ca8fbc8537 # v7
42+
43+
- name: Setup Apptainer
44+
uses: eWaterCycle/setup-apptainer@4bb22c52d4f63406c49e94c804632975787312b3 # v2.0.0
3845
with:
39-
singularity-version: 3.8.3
46+
apptainer-version: 1.3.4
4047

4148
- name: Install dependencies
4249
run: |
@@ -49,24 +56,64 @@ jobs:
4956
echo "REPOTITLE_LOWERCASE=$(basename ${GITHUB_REPOSITORY,,})" >> ${GITHUB_ENV}
5057
echo "REPO_BRANCH=${{ github.event.inputs.testbranch || 'dev' }}" >> ${GITHUB_ENV}
5158
59+
- name: Make a cache directory for the container images
60+
run: |
61+
mkdir -p ./singularity_container_images
62+
5263
- name: Download the pipeline
5364
env:
54-
NXF_SINGULARITY_CACHEDIR: ./
65+
NXF_SINGULARITY_CACHEDIR: ./singularity_container_images
5566
run: |
56-
nf-core download ${{ env.REPO_LOWERCASE }} \
67+
nf-core pipelines download ${{ env.REPO_LOWERCASE }} \
5768
--revision ${{ env.REPO_BRANCH }} \
5869
--outdir ./${{ env.REPOTITLE_LOWERCASE }} \
5970
--compress "none" \
6071
--container-system 'singularity' \
61-
--container-library "quay.io" -l "docker.io" -l "ghcr.io" \
72+
--container-library "quay.io" -l "docker.io" -l "community.wave.seqera.io" \
6273
--container-cache-utilisation 'amend' \
63-
--download-configuration
74+
--download-configuration 'yes'
6475
6576
- name: Inspect download
6677
run: tree ./${{ env.REPOTITLE_LOWERCASE }}
6778

68-
- name: Run the downloaded pipeline
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+
86+
- name: Run the downloaded pipeline (stub)
87+
id: stub_run_pipeline
88+
continue-on-error: true
6989
env:
70-
NXF_SINGULARITY_CACHEDIR: ./
90+
NXF_SINGULARITY_CACHEDIR: ./singularity_container_images
7191
NXF_SINGULARITY_HOME_MOUNT: true
72-
run: nextflow run ./${{ env.REPOTITLE_LOWERCASE }}/$( sed 's/\W/_/g' <<< ${{ env.REPO_BRANCH }}) -stub -profile test,singularity --outdir ./results
92+
run: nextflow run ./${{ env.REPOTITLE_LOWERCASE }}/$( sed 's/\W/_/g' <<< ${{ env.REPO_BRANCH }}) -stub -profile test,singularity,illumina --outdir ./results
93+
- name: Run the downloaded pipeline (stub run not supported)
94+
id: run_pipeline
95+
if: ${{ job.steps.stub_run_pipeline.status == failure() }}
96+
env:
97+
NXF_SINGULARITY_CACHEDIR: ./singularity_container_images
98+
NXF_SINGULARITY_HOME_MOUNT: true
99+
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

0 commit comments

Comments
 (0)