Skip to content

Commit c343fb9

Browse files
authored
Merge pull request #56 from d4straub/merging-template-updates-2.1
Merging template updates 2.1
2 parents 745fa0b + 002fcd0 commit c343fb9

File tree

98 files changed

+5096
-2554
lines changed

Some content is hidden

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

98 files changed

+5096
-2554
lines changed

.editorconfig

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
trim_trailing_whitespace = true
8+
indent_size = 4
9+
indent_style = space
10+
11+
[*.{yml,yaml}]
12+
indent_size = 2
13+
14+
[*.json]
15+
insert_final_newline = unset
16+
17+
# These files are edited and tested upstream in nf-core/modules
18+
[/modules/nf-core/**]
19+
charset = unset
20+
end_of_line = unset
21+
insert_final_newline = unset
22+
trim_trailing_whitespace = unset
23+
indent_style = unset
24+
indent_size = unset
25+
26+
[/assets/email*]
27+
indent_size = unset

.github/.dockstore.yml

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ version: 1.2
33
workflows:
44
- subclass: nfl
55
primaryDescriptorPath: /nextflow.config
6+
publish: True

.github/CONTRIBUTING.md

+75-4
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ If you'd like to write some code for nf-core/bacass, the standard workflow is as
1818
1. Check that there isn't already an issue about your idea in the [nf-core/bacass issues](https://github.com/nf-core/bacass/issues) to avoid duplicating work
1919
* 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/bacass repository](https://github.com/nf-core/bacass) to your GitHub account
21-
3. Make the necessary changes / additions within your forked repository
22-
4. Submit a Pull Request against the `dev` branch and wait for the code to be reviewed and merged
21+
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).
23+
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

@@ -30,14 +31,14 @@ Typically, pull-requests are only fully reviewed when these tests are passing, t
3031

3132
There are typically two types of tests that run:
3233

33-
### Lint Tests
34+
### Lint tests
3435

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

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

40-
### Pipeline Tests
41+
### Pipeline tests
4142

4243
Each `nf-core` pipeline should be set up with a minimal set of test-data.
4344
`GitHub Actions` then runs the pipeline on this data to ensure that it exits successfully.
@@ -55,3 +56,73 @@ These tests are run both with the latest available version of `Nextflow` and als
5556
## Getting help
5657

5758
For further information/help, please consult the [nf-core/bacass documentation](https://nf-co.re/bacass/usage) and don't hesitate to get in touch on the nf-core Slack [#bacass](https://nfcore.slack.com/channels/bacass) channel ([join our Slack here](https://nf-co.re/join/slack)).
59+
60+
## Pipeline contribution conventions
61+
62+
To make the nf-core/bacass 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.
63+
64+
### Adding a new step
65+
66+
If you wish to contribute a new step, please use the following coding standards:
67+
68+
1. Define the corresponding input channel into your new process from the expected previous process channel
69+
2. Write the process block (see below).
70+
3. Define the output channel if needed (see below).
71+
4. Add any new flags/options to `nextflow.config` with a default (see below).
72+
5. Add any new flags/options to `nextflow_schema.json` with help text (with `nf-core schema build`).
73+
6. Add any new flags/options to the help message (for integer/text parameters, print to help the corresponding `nextflow.config` parameter).
74+
7. Add sanity checks for all relevant parameters.
75+
8. Add any new software to the `scrape_software_versions.py` script in `bin/` and the version command to the `scrape_software_versions` process in `main.nf`.
76+
9. Do local tests that the new code works properly and as expected.
77+
10. Add a new test command in `.github/workflow/ci.yml`.
78+
11. If applicable add a [MultiQC](https://https://multiqc.info/) module.
79+
12. Update MultiQC config `assets/multiqc_config.yaml` so relevant suffixes, name clean up, General Statistics Table column order, and module figures are in the right order.
80+
13. Optional: Add any descriptions of MultiQC report sections and output files to `docs/output.md`.
81+
82+
### Default values
83+
84+
Parameters should be initialised / defined with default values in `nextflow.config` under the `params` scope.
85+
86+
Once there, use `nf-core schema build` to add to `nextflow_schema.json`.
87+
88+
### Default processes resource requirements
89+
90+
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.
91+
92+
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.
93+
94+
### Naming schemes
95+
96+
Please use the following naming schemes, to make it easy to understand what is going where.
97+
98+
* initial process channel: `ch_output_from_<process>`
99+
* intermediate and terminal channels: `ch_<previousprocess>_for_<nextprocess>`
100+
101+
### Nextflow version bumping
102+
103+
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]`
104+
105+
### Software version reporting
106+
107+
If you add a new tool to the pipeline, please ensure you add the information of the tool to the `get_software_version` process.
108+
109+
Add to the script block of the process, something like the following:
110+
111+
```bash
112+
<YOUR_TOOL> --version &> v_<YOUR_TOOL>.txt 2>&1 || true
113+
```
114+
115+
or
116+
117+
```bash
118+
<YOUR_TOOL> --help | head -n 1 &> v_<YOUR_TOOL>.txt 2>&1 || true
119+
```
120+
121+
You then need to edit the script `bin/scrape_software_versions.py` to:
122+
123+
1. Add a Python regex for your tool's `--version` output (as in stored in the `v_<YOUR_TOOL>.txt` file), to ensure the version is reported as a `v` and the version number e.g. `v2.1.1`
124+
2. Add a HTML entry to the `OrderedDict` for formatting in MultiQC.
125+
126+
### Images and figures
127+
128+
For overview images and other documents we follow the nf-core [style guidelines and examples](https://nf-co.re/developers/design_guidelines).

.github/ISSUE_TEMPLATE/bug_report.md

+22-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,25 @@
1+
---
2+
name: Bug report
3+
about: Report something that is broken or incorrect
4+
labels: bug
5+
---
6+
17
<!--
28
# nf-core/bacass bug report
39
410
Hi there!
511
612
Thanks for telling us about a problem with the pipeline.
7-
813
Please delete this text and anything that's not relevant from the template below:
914
-->
1015

16+
## Check Documentation
17+
18+
I have checked the following places for your error:
19+
20+
- [ ] [nf-core website: troubleshooting](https://nf-co.re/usage/troubleshooting)
21+
- [ ] [nf-core/bacass pipeline documentation](https://nf-co.re/bacass/usage)
22+
1123
## Description of the bug
1224

1325
<!-- A clear and concise description of what the bug is. -->
@@ -23,6 +35,13 @@ Steps to reproduce the behaviour:
2335

2436
<!-- A clear and concise description of what you expected to happen. -->
2537

38+
## Log files
39+
40+
Have you provided the following extra information/files:
41+
42+
- [ ] The command used to run the pipeline
43+
- [ ] The `.nextflow.log` file <!-- this is a hidden file in the directory where you launched the pipeline -->
44+
2645
## System
2746

2847
- Hardware: <!-- [e.g. HPC, Desktop, Cloud...] -->
@@ -32,13 +51,12 @@ Steps to reproduce the behaviour:
3251

3352
## Nextflow Installation
3453

35-
- Version: <!-- [e.g. 19.10.0] -->
54+
- Version: <!-- [e.g. 21.04.0] -->
3655

3756
## Container engine
3857

39-
- Engine: <!-- [e.g. Conda, Docker, Singularity or Podman] -->
58+
- Engine: <!-- [e.g. Conda, Docker, Singularity, Podman, Shifter or Charliecloud] -->
4059
- version: <!-- [e.g. 1.0.0] -->
41-
- Image tag: <!-- [e.g. nfcore/bacass:1.0.0] -->
4260

4361
## Additional context
4462

.github/ISSUE_TEMPLATE/config.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Join nf-core
4+
url: https://nf-co.re/join
5+
about: Please join the nf-core community here
6+
- name: "Slack #bacass channel"
7+
url: https://nfcore.slack.com/channels/bacass
8+
about: Discussion about the nf-core/bacass pipeline

.github/ISSUE_TEMPLATE/feature_request.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for the nf-core/bacass pipeline
4+
labels: enhancement
5+
---
6+
17
<!--
28
# nf-core/bacass feature request
39

.github/PULL_REQUEST_TEMPLATE.md

+10-4
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,17 @@ Remember that PRs should be made against the dev branch, unless you're preparing
1010
1111
Learn more about contributing: [CONTRIBUTING.md](https://github.com/nf-core/bacass/tree/master/.github/CONTRIBUTING.md)
1212
-->
13+
<!-- markdownlint-disable ul-indent -->
1314

1415
## PR checklist
1516

16-
- [ ] This comment contains a description of changes (with reason)
17-
- [ ] `CHANGELOG.md` is updated
17+
- [ ] This comment contains a description of changes (with reason).
1818
- [ ] If you've fixed a bug or added code that should be tested, add tests!
19-
- [ ] Documentation in `docs` is updated
20-
- [ ] If necessary, also make a PR on the [nf-core/bacass branch on the nf-core/test-datasets repo](https://github.com/nf-core/test-datasets/pull/new/nf-core/bacass)
19+
- [ ] If you've added a new tool - have you followed the pipeline conventions in the [contribution docs](https://github.com/nf-core/bacass/tree/master/.github/CONTRIBUTING.md)
20+
- [ ] If necessary, also make a PR on the nf-core/bacass _branch_ on the [nf-core/test-datasets](https://github.com/nf-core/test-datasets) repository.
21+
- [ ] Make sure your code lints (`nf-core lint`).
22+
- [ ] Ensure the test suite passes (`nextflow run . -profile test,docker`).
23+
- [ ] Usage Documentation in `docs/usage.md` is updated.
24+
- [ ] Output Documentation in `docs/output.md` is updated.
25+
- [ ] `CHANGELOG.md` is updated.
26+
- [ ] `README.md` is updated (including new tool citations and authors/contributors).

.github/markdownlint.yml

-5
This file was deleted.

.github/workflows/awsfulltest.yml

+18-26
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,33 @@
11
name: nf-core AWS full size tests
22
# This workflow is triggered on published releases.
3-
# It can be additionally triggered manually with GitHub actions workflow dispatch.
3+
# 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:
77
release:
88
types: [published]
99
workflow_dispatch:
10-
1110
jobs:
12-
run-awstest:
11+
run-tower:
1312
name: Run AWS full tests
1413
if: github.repository == 'nf-core/bacass'
1514
runs-on: ubuntu-latest
1615
steps:
17-
- name: Setup Miniconda
18-
uses: goanpeca/[email protected]
19-
with:
20-
auto-update-conda: true
21-
python-version: 3.7
22-
- name: Install awscli
23-
run: conda install -c conda-forge awscli
24-
- name: Start AWS batch job
16+
- name: Launch workflow via tower
17+
uses: nf-core/tower-action@master
2518
# Add full size test data (but still relatively small datasets for few samples)
2619
# on the `test_full.config` test runs with only one set of parameters
27-
# Then specify `-profile test_full` instead of `-profile test` on the AWS batch command
28-
env:
29-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
30-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
31-
TOWER_ACCESS_TOKEN: ${{ secrets.AWS_TOWER_TOKEN }}
32-
AWS_JOB_DEFINITION: ${{ secrets.AWS_JOB_DEFINITION }}
33-
AWS_JOB_QUEUE: ${{ secrets.AWS_JOB_QUEUE }}
34-
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
35-
run: |
36-
aws batch submit-job \
37-
--region eu-west-1 \
38-
--job-name nf-core-bacass \
39-
--job-queue $AWS_JOB_QUEUE \
40-
--job-definition $AWS_JOB_DEFINITION \
41-
--container-overrides '{"command": ["nf-core/bacass", "-r '"${GITHUB_SHA}"' -profile test --outdir s3://'"${AWS_S3_BUCKET}"'/bacass/results-'"${GITHUB_SHA}"' -w s3://'"${AWS_S3_BUCKET}"'/bacass/work-'"${GITHUB_SHA}"' -with-tower"], "environment": [{"name": "TOWER_ACCESS_TOKEN", "value": "'"$TOWER_ACCESS_TOKEN"'"}]}'
20+
21+
with:
22+
workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }}
23+
bearer_token: ${{ secrets.TOWER_BEARER_TOKEN }}
24+
compute_env: ${{ secrets.TOWER_COMPUTE_ENV }}
25+
pipeline: ${{ github.repository }}
26+
revision: ${{ github.sha }}
27+
workdir: s3://${{ secrets.AWS_S3_BUCKET }}/work/bacass/work-${{ github.sha }}
28+
parameters: |
29+
{
30+
"outdir": "s3://${{ secrets.AWS_S3_BUCKET }}/bacass/results-${{ github.sha }}"
31+
}
32+
profiles: '[ "test_full", "aws_tower" ]'
33+

.github/workflows/awstest.yml

+18-28
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,28 @@
11
name: nf-core AWS test
2-
# This workflow is triggered on push to the master branch.
3-
# It can be additionally triggered manually with GitHub actions workflow dispatch.
4-
# It runs the -profile 'test' on AWS batch.
2+
# This workflow can be triggered manually with the GitHub actions workflow dispatch button.
3+
# It runs the -profile 'test' on AWS batch
54

65
on:
76
workflow_dispatch:
8-
97
jobs:
10-
run-awstest:
8+
run-tower:
119
name: Run AWS tests
1210
if: github.repository == 'nf-core/bacass'
1311
runs-on: ubuntu-latest
1412
steps:
15-
- name: Setup Miniconda
16-
uses: goanpeca/[email protected]
13+
- name: Launch workflow via tower
14+
uses: nf-core/tower-action@master
15+
1716
with:
18-
auto-update-conda: true
19-
python-version: 3.7
20-
- name: Install awscli
21-
run: conda install -c conda-forge awscli
22-
- name: Start AWS batch job
23-
# For example: adding multiple test runs with different parameters
24-
# Remember that you can parallelise this by using strategy.matrix
25-
env:
26-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
27-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
28-
TOWER_ACCESS_TOKEN: ${{ secrets.AWS_TOWER_TOKEN }}
29-
AWS_JOB_DEFINITION: ${{ secrets.AWS_JOB_DEFINITION }}
30-
AWS_JOB_QUEUE: ${{ secrets.AWS_JOB_QUEUE }}
31-
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
32-
run: |
33-
aws batch submit-job \
34-
--region eu-west-1 \
35-
--job-name nf-core-bacass \
36-
--job-queue $AWS_JOB_QUEUE \
37-
--job-definition $AWS_JOB_DEFINITION \
38-
--container-overrides '{"command": ["nf-core/bacass", "-r '"${GITHUB_SHA}"' -profile test --outdir s3://'"${AWS_S3_BUCKET}"'/bacass/results-'"${GITHUB_SHA}"' -w s3://'"${AWS_S3_BUCKET}"'/bacass/work-'"${GITHUB_SHA}"' -with-tower"], "environment": [{"name": "TOWER_ACCESS_TOKEN", "value": "'"$TOWER_ACCESS_TOKEN"'"}]}'
17+
workspace_id: ${{ secrets.TOWER_WORKSPACE_ID }}
18+
bearer_token: ${{ secrets.TOWER_BEARER_TOKEN }}
19+
compute_env: ${{ secrets.TOWER_COMPUTE_ENV }}
20+
pipeline: ${{ github.repository }}
21+
revision: ${{ github.sha }}
22+
workdir: s3://${{ secrets.AWS_S3_BUCKET }}/work/bacass/work-${{ github.sha }}
23+
parameters: |
24+
{
25+
"outdir": "s3://${{ secrets.AWS_S3_BUCKET }}/bacass/results-${{ github.sha }}"
26+
}
27+
profiles: '[ "test", "aws_tower" ]'
28+

.github/workflows/branch.yml

+13-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: nf-core branch protection
22
# This workflow is triggered on PRs to master branch on the repository
33
# It fails when someone tries to make a PR against the nf-core `master` branch instead of `dev`
44
on:
5-
pull_request:
5+
pull_request_target:
66
branches: [master]
77

88
jobs:
@@ -13,7 +13,7 @@ jobs:
1313
- name: Check PRs
1414
if: github.repository == 'nf-core/bacass'
1515
run: |
16-
{ [[ ${{github.event.pull_request.head.repo.full_name}} == nf-core/bacass ]] && [[ $GITHUB_HEAD_REF = "dev" ]]; } || [[ $GITHUB_HEAD_REF == "patch" ]]
16+
{ [[ ${{github.event.pull_request.head.repo.full_name }} == nf-core/bacass ]] && [[ $GITHUB_HEAD_REF = "dev" ]]; } || [[ $GITHUB_HEAD_REF == "patch" ]]
1717
1818
1919
# If the above check failed, post a comment on the PR explaining the failure
@@ -23,13 +23,22 @@ jobs:
2323
uses: mshick/add-pr-comment@v1
2424
with:
2525
message: |
26+
## This PR is against the `master` branch :x:
27+
28+
* Do not close this PR
29+
* Click _Edit_ and change the `base` to `dev`
30+
* This CI test will remain failed until you push a new commit
31+
32+
---
33+
2634
Hi @${{ github.event.pull_request.user.login }},
2735
28-
It looks like this pull-request is has been made against the ${{github.event.pull_request.head.repo.full_name}} `master` branch.
36+
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.
2937
The `master` branch on nf-core repositories should always contain code from the latest release.
30-
Because of this, PRs to `master` are only allowed if they come from the ${{github.event.pull_request.head.repo.full_name}} `dev` branch.
38+
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.
3139
3240
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.
41+
Note that even after this, the test will continue to show as failing until you push a new commit.
3342
3443
Thanks again for your contribution!
3544
repo-token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)