Skip to content

Commit 395079f

Browse files
authored
Merge pull request #535 from nf-core/dev
Dev -> Master for 3.0 release
2 parents 3731dd3 + 290f0b9 commit 395079f

File tree

564 files changed

+67859
-7584
lines changed

Some content is hidden

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

564 files changed

+67859
-7584
lines changed

.devcontainer/devcontainer.json

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,20 @@
11
{
22
"name": "nfcore",
3-
"image": "nfcore/gitpod:latest",
4-
"remoteUser": "gitpod",
3+
"image": "nfcore/devcontainer:latest",
54

6-
// Configure tool-specific properties.
7-
"customizations": {
8-
// Configure properties specific to VS Code.
9-
"vscode": {
10-
// Set *default* container specific settings.json values on container create.
11-
"settings": {
12-
"python.defaultInterpreterPath": "/opt/conda/bin/python",
13-
"python.linting.enabled": true,
14-
"python.linting.pylintEnabled": true,
15-
"python.formatting.autopep8Path": "/opt/conda/bin/autopep8",
16-
"python.formatting.yapfPath": "/opt/conda/bin/yapf",
17-
"python.linting.flake8Path": "/opt/conda/bin/flake8",
18-
"python.linting.pycodestylePath": "/opt/conda/bin/pycodestyle",
19-
"python.linting.pydocstylePath": "/opt/conda/bin/pydocstyle",
20-
"python.linting.pylintPath": "/opt/conda/bin/pylint"
21-
},
5+
"remoteUser": "root",
6+
"privileged": true,
227

23-
// Add the IDs of extensions you want installed when the container is created.
24-
"extensions": ["ms-python.python", "ms-python.vscode-pylance", "nf-core.nf-core-extensionpack"]
25-
}
8+
"remoteEnv": {
9+
// Workspace path on the host for mounting with docker-outside-of-docker
10+
"LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}"
11+
},
12+
13+
"onCreateCommand": "./.devcontainer/setup.sh",
14+
15+
"hostRequirements": {
16+
"cpus": 4,
17+
"memory": "16gb",
18+
"storage": "32gb"
2619
}
2720
}

.devcontainer/setup.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
3+
# Customise the terminal command prompt
4+
echo "export PROMPT_DIRTRIM=2" >> $HOME/.bashrc
5+
echo "export PS1='\[\e[3;36m\]\w ->\[\e[0m\\] '" >> $HOME/.bashrc
6+
export PROMPT_DIRTRIM=2
7+
export PS1='\[\e[3;36m\]\w ->\[\e[0m\\] '
8+
9+
# Update Nextflow
10+
nextflow self-update
11+
12+
# Update welcome message
13+
echo "Welcome to the nf-core/viralrecon devcontainer!" > /usr/local/etc/vscode-dev-containers/first-run-notice.txt

.editorconfig

Lines changed: 0 additions & 24 deletions
This file was deleted.

.github/CONTRIBUTING.md

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

33
Hi there!
44
Many thanks for taking an interest in improving nf-core/viralrecon.
@@ -9,6 +9,7 @@ Please use the pre-filled template to save time.
99
However, don't be put off by this template - other more general issues and suggestions are welcome!
1010
Contributions to the code are even more welcome ;)
1111

12+
> [!NOTE]
1213
> If you need help using or modifying nf-core/viralrecon then the best place to ask is on the nf-core Slack [#viralrecon](https://nfcore.slack.com/channels/viralrecon) channel ([join our Slack here](https://nf-co.re/join/slack)).
1314
1415
## Contribution workflow
@@ -18,13 +19,19 @@ If you'd like to write some code for nf-core/viralrecon, the standard workflow i
1819
1. Check that there isn't already an issue about your idea in the [nf-core/viralrecon issues](https://github.com/nf-core/viralrecon/issues) to avoid duplicating work. If there isn't one already, please create one so that others know you're working on this
1920
2. [Fork](https://help.github.com/en/github/getting-started-with-github/fork-a-repo) the [nf-core/viralrecon repository](https://github.com/nf-core/viralrecon) to your GitHub account
2021
3. Make the necessary changes / additions within your forked repository following [Pipeline conventions](#pipeline-contribution-conventions)
21-
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).
2223
5. Submit a Pull Request against the `dev` branch and wait for the code to be reviewed and merged
2324

2425
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/).
2526

2627
## Tests
2728

29+
You have the option to test your changes locally by running the pipeline. For receiving warnings about process selectors and other `debug` information, it is recommended to use the debug profile. Execute all the tests with the following command:
30+
31+
```bash
32+
nf-test test --profile debug,test,docker --verbose
33+
```
34+
2835
When you create a pull request with changes, [GitHub Actions](https://github.com/features/actions) will run automatic tests.
2936
Typically, pull-requests are only fully reviewed when these tests are passing, though of course we can help out before then.
3037

@@ -33,7 +40,7 @@ There are typically two types of tests that run:
3340
### Lint tests
3441

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

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

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

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

51-
- 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`.
5259
- Fix the bug, and bump version (X.Y.Z+1).
53-
- 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.
5461

5562
## Getting help
5663

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

5966
## Pipeline contribution conventions
6067

61-
To make the nf-core/viralrecon 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/viralrecon` 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.
6269

6370
### Adding a new step
6471

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

67-
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.
6875
2. Write the process block (see below).
6976
3. Define the output channel if needed (see below).
7077
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).
78+
5. Add any new parameters to `nextflow_schema.json` with help text (via the `nf-core pipelines schema build` tool).
7279
6. Add sanity checks and validation for all relevant parameters.
7380
7. Perform local tests to validate that the new code works as expected.
74-
8. If applicable, add a new test command in `.github/workflow/ci.yml`.
81+
8. If applicable, add a new test in the `tests` directory.
7582
9. Update MultiQC config `assets/multiqc_config.yml` so relevant suffixes, file name clean up and module plots are in the appropriate order. If applicable, add a [MultiQC](https://https://multiqc.info/) module.
7683
10. Add a description of the output files and if relevant any appropriate images from the MultiQC report to `docs/output.md`.
7784

7885
### Default values
7986

80-
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`.
8188

82-
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`.
8390

8491
### Default processes resource requirements
8592

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.
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.
8794

88-
The process resources can be passed on to the tool dynamically within the process with the `${task.cpu}` and `${task.memory}` variables in the `script:` block.
95+
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.
8996

9097
### Naming schemes
9198

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

97104
### Nextflow version bumping
98105

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]`
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]`
100107

101108
### Images and figures
102109

@@ -116,4 +123,3 @@ To get started:
116123
Devcontainer specs:
117124

118125
- [DevContainer config](.devcontainer/devcontainer.json)
119-
- [Dockerfile](.devcontainer/Dockerfile)

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 2 additions & 3 deletions
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/viralrecon pipeline documentation](https://nf-co.re/viralrecon/usage)
12-
1312
- type: textarea
1413
id: description
1514
attributes:
@@ -42,9 +41,9 @@ body:
4241
attributes:
4342
label: System information
4443
description: |
45-
* Nextflow version _(eg. 22.10.1)_
44+
* Nextflow version _(eg. 23.04.0)_
4645
* Hardware _(eg. HPC, Desktop, Cloud)_
4746
* Executor _(eg. slurm, local, awsbatch)_
48-
* Container engine: _(e.g. Docker, Singularity, Conda, Podman, Shifter or Charliecloud)_
47+
* Container engine: _(e.g. Docker, Singularity, Conda, Podman, Shifter, Charliecloud, or Apptainer)_
4948
* OS _(eg. CentOS Linux, macOS, Linux Mint)_
5049
* Version of nf-core/viralrecon _(eg. 1.1, 1.5, 1.8.2)_

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ Learn more about contributing: [CONTRIBUTING.md](https://github.com/nf-core/vira
1515

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!
18-
- [ ] If you've added a new tool - have you followed the pipeline conventions in the [contribution docs](https://github.com/nf-core/viralrecon/tree/master/.github/CONTRIBUTING.md)- [ ] If necessary, also make a PR on the nf-core/viralrecon _branch_ on the [nf-core/test-datasets](https://github.com/nf-core/test-datasets) repository.
19-
- [ ] Make sure your code lints (`nf-core lint`).
18+
- [ ] If you've added a new tool - have you followed the pipeline conventions in the [contribution docs](https://github.com/nf-core/viralrecon/tree/master/.github/CONTRIBUTING.md)
19+
- [ ] If necessary, also make a PR on the nf-core/viralrecon _branch_ on the [nf-core/test-datasets](https://github.com/nf-core/test-datasets) repository.
20+
- [ ] Make sure your code lints (`nf-core pipelines lint`).
2021
- [ ] Ensure the test suite passes (`nextflow run . -profile test,docker --outdir <OUTDIR>`).
22+
- [ ] Check for unexpected warnings in debug mode (`nextflow run . -profile debug,test,docker --outdir <OUTDIR>`).
2123
- [ ] Usage Documentation in `docs/usage.md` is updated.
2224
- [ ] Output Documentation in `docs/output.md` is updated.
2325
- [ ] `CHANGELOG.md` is updated.
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: "Get number of shards"
2+
description: "Get the number of nf-test shards for the current CI job"
3+
inputs:
4+
max_shards:
5+
description: "Maximum number of shards allowed"
6+
required: true
7+
paths:
8+
description: "Component paths to test"
9+
required: false
10+
tags:
11+
description: "Tags to pass as argument for nf-test --tag parameter"
12+
required: false
13+
outputs:
14+
shard:
15+
description: "Array of shard numbers"
16+
value: ${{ steps.shards.outputs.shard }}
17+
total_shards:
18+
description: "Total number of shards"
19+
value: ${{ steps.shards.outputs.total_shards }}
20+
runs:
21+
using: "composite"
22+
steps:
23+
- name: Install nf-test
24+
uses: nf-core/setup-nf-test@v1
25+
with:
26+
version: ${{ env.NFT_VER }}
27+
- name: Get number of shards
28+
id: shards
29+
shell: bash
30+
run: |
31+
# Run nf-test with dynamic parameter
32+
nftest_output=$(nf-test test \
33+
--profile +docker \
34+
$(if [ -n "${{ inputs.tags }}" ]; then echo "--tag ${{ inputs.tags }}"; fi) \
35+
--dry-run \
36+
--ci \
37+
--changed-since HEAD^) || {
38+
echo "nf-test command failed with exit code $?"
39+
echo "Full output: $nftest_output"
40+
exit 1
41+
}
42+
echo "nf-test dry-run output: $nftest_output"
43+
44+
# Default values for shard and total_shards
45+
shard="[]"
46+
total_shards=0
47+
48+
# Check if there are related tests
49+
if echo "$nftest_output" | grep -q 'No tests to execute'; then
50+
echo "No related tests found."
51+
else
52+
# Extract the number of related tests
53+
number_of_shards=$(echo "$nftest_output" | sed -n 's|.*Executed \([0-9]*\) tests.*|\1|p')
54+
if [[ -n "$number_of_shards" && "$number_of_shards" -gt 0 ]]; then
55+
shards_to_run=$(( $number_of_shards < ${{ inputs.max_shards }} ? $number_of_shards : ${{ inputs.max_shards }} ))
56+
shard=$(seq 1 "$shards_to_run" | jq -R . | jq -c -s .)
57+
total_shards="$shards_to_run"
58+
else
59+
echo "Unexpected output format. Falling back to default values."
60+
fi
61+
fi
62+
63+
# Write to GitHub Actions outputs
64+
echo "shard=$shard" >> $GITHUB_OUTPUT
65+
echo "total_shards=$total_shards" >> $GITHUB_OUTPUT
66+
67+
# Debugging output
68+
echo "Final shard array: $shard"
69+
echo "Total number of shards: $total_shards"

0 commit comments

Comments
 (0)