Skip to content

Commit 4402218

Browse files
authored
Merge pull request #125 from nf-core/dev
Release v1.3.1
2 parents e765843 + 8556707 commit 4402218

File tree

120 files changed

+4074
-1420
lines changed

Some content is hidden

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

120 files changed

+4074
-1420
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/nanostring: Contributing Guidelines
1+
# `nf-core/nanostring`: Contributing Guidelines
22

33
Hi there!
44
Many thanks for taking an interest in improving nf-core/nanostring.
@@ -19,7 +19,7 @@ If you'd like to write some code for nf-core/nanostring, the standard workflow i
1919
1. Check that there isn't already an issue about your idea in the [nf-core/nanostring issues](https://github.com/nf-core/nanostring/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/nanostring repository](https://github.com/nf-core/nanostring) 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/nanostring documentation](https://nf-co.re/nanostring/usage) and don't hesitate to get in touch on the nf-core Slack [#nanostring](https://nfcore.slack.com/channels/nanostring) channel ([join our Slack here](https://nf-co.re/join/slack)).
6565

6666
## Pipeline contribution conventions
6767

68-
To make the nf-core/nanostring 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/nanostring` 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/nanostring pipeline documentation](https://nf-co.re/nanostring/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/nano
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/nanostring/tree/master/.github/CONTRIBUTING.md)
1919
- [ ] If necessary, also make a PR on the nf-core/nanostring _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/nanostring'
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/nanostring' && 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/request-action@v2.x
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
# Add full size test data (but still relatively small datasets for few samples)

.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/nanostring'
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: 85 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,46 +5,118 @@ on:
55
branches:
66
- dev
77
pull_request:
8+
branches:
9+
- dev
10+
- master
811
release:
912
types: [published]
13+
workflow_dispatch:
1014

1115
env:
16+
NFT_DIFF: "pdiff"
17+
NFT_DIFF_ARGS: "--line-numbers --expand-tabs=2"
18+
NFT_VER: "0.9.2"
19+
NFT_WORKDIR: "~"
1220
NXF_ANSI_LOG: false
21+
NXF_SINGULARITY_CACHEDIR: ${{ github.workspace }}/.singularity
22+
NXF_SINGULARITY_LIBRARYDIR: ${{ github.workspace }}/.singularity
1323

1424
concurrency:
1525
group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}"
1626
cancel-in-progress: true
1727

1828
jobs:
1929
test:
20-
name: Run pipeline with test data
30+
name: "${{ matrix.NXF_VER }} | ${{ matrix.test_profile }} | ${{ matrix.compute_profile }}"
2131
# Only run on push if this is the nf-core dev branch (merged PRs)
2232
if: "${{ github.event_name != 'push' || (github.event_name == 'push' && github.repository == 'nf-core/nanostring') }}"
2333
runs-on: ubuntu-latest
2434
strategy:
35+
fail-fast: false
2536
matrix:
2637
NXF_VER:
27-
- "23.04.0"
28-
- "latest-everything"
38+
- "24.04.2"
39+
- "latest-stable"
40+
test_profile:
41+
- "test"
42+
- "test_scores"
43+
- "test_samples"
44+
compute_profile:
45+
- "docker"
46+
- "singularity"
47+
isMaster:
48+
- ${{ github.base_ref == 'master' }}
49+
# Exclude conda and singularity on dev
50+
exclude:
51+
- isMaster: false
52+
compute_profile: "conda"
53+
- isMaster: false
54+
compute_profile: "singularity"
2955
steps:
3056
- name: Check out pipeline code
31-
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4
57+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
58+
with:
59+
fetch-depth: 0
3260

33-
- name: Install Nextflow
61+
- name: Set up Nextflow
3462
uses: nf-core/setup-nextflow@v2
3563
with:
3664
version: "${{ matrix.NXF_VER }}"
3765

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

41-
- name: Run pipeline with test data
70+
- name: Set up Singularity
71+
if: matrix.compute_profile == 'singularity'
4272
run: |
43-
nextflow run ${GITHUB_WORKSPACE} -profile test,docker --outdir ./results
44-
- name: Run pipeline with test data and gene scores
73+
mkdir -p $NXF_SINGULARITY_CACHEDIR
74+
mkdir -p $NXF_SINGULARITY_LIBRARYDIR
75+
76+
- name: Set up Miniconda
77+
if: matrix.compute_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.compute_profile == 'conda'
4587
run: |
46-
nextflow run ${GITHUB_WORKSPACE} -profile test_scores,docker --outdir ./results
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
4793

48-
- name: Run pipeline with test data and duplicate sample ids
94+
- uses: actions/setup-python@v4
95+
with:
96+
python-version: "3.11"
97+
architecture: "x64"
98+
99+
- name: Install pdiff to see diff between nf-test snapshots
100+
run: |
101+
python -m pip install --upgrade pip
102+
pip install pdiff
103+
104+
- uses: nf-core/setup-nf-test@v1
105+
with:
106+
version: ${{ env.NFT_VER }}
107+
108+
- name: Run Tests (${{matrix.NXF_VER}} | ${{matrix.test_profile}} | ${{matrix.compute_profile}})
49109
run: |
50-
nextflow run ${GITHUB_WORKSPACE} -profile test_samples,docker --outdir ./results
110+
nf-test test \
111+
--ci \
112+
--tag ${{matrix.test_profile}} \
113+
--profile "+${{ matrix.compute_profile }}" \
114+
--junitxml=test.xml \
115+
--debug --verbose
116+
117+
- name: Publish Test Report
118+
uses: mikepenz/action-junit-report@v3
119+
if: always() # always run even if the previous step fails
120+
with:
121+
report_paths: test.xml
122+
annotate_only: true

0 commit comments

Comments
 (0)