Skip to content

Commit d99a6af

Browse files
feat: use nf-schema to validate params (CCBR#68)
* feat: use nf-schema to validate params * ci: πŸ“‘ update params docs with 'nf-core pipelines schema docs' * chore: update CHANGELOG.md ---------
1 parent 3a93fd4 commit d99a6af

21 files changed

Lines changed: 436 additions & 93 deletions

β€Ž.github/workflows/auto-format.ymlβ€Ž

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ env:
99

1010
permissions:
1111
contents: write
12+
pull-requests: write
1213

1314
jobs:
1415
auto-format:
@@ -19,19 +20,42 @@ jobs:
1920
if: github.event_name == 'pull_request'
2021
with:
2122
fetch-depth: 0
22-
ref: ${{ github.event.pull_request.head.ref }}
23+
ref: ${{ github.head_ref }}
2324
- uses: actions/checkout@v4
2425
if: github.event_name != 'pull_request'
2526
with:
2627
fetch-depth: 0
2728

28-
- name: format
29+
- uses: actions/setup-python@v4
30+
with:
31+
python-version: 3.11
32+
- name: Install nextflow
33+
uses: nf-core/setup-nextflow@v1
34+
- name: git config
35+
run: |
36+
git config --global user.name "github-actions[bot]"
37+
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
38+
- name: Install dependencies
39+
run: |
40+
python -m pip install --upgrade pip
41+
pip install .[dev]
42+
43+
- name: Write nf-schema docs
44+
run: |
45+
nf-core pipelines schema docs -f -x markdown -o docs/params.tmp
46+
echo "<!-- This doc is generated by: nf-core pipelines schema docs. Edit parameter descriptions in nextflow_schema.json -->\n" > docs/params.md
47+
cat docs/params.tmp >> docs/params.md
48+
rm -f docs/params.tmp
49+
50+
- name: Format
2951
uses: pre-commit/action@v3.0.1
3052
continue-on-error: true
3153

3254
- name: commit & push
3355
run: |
34-
git config --global user.name "github-actions[bot]"
35-
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
56+
git add docs/params.md
57+
git commit -m "ci: πŸ“‘ update params docs with 'nf-core pipelines schema docs'" || echo "nothing to commit"
58+
3659
git add .
37-
git commit -m "ci: πŸ€– format everything with pre-commit" && git push || echo "nothing to commit"
60+
git commit -m "ci: πŸ€– format everything with pre-commit" || echo "nothing to commit"
61+
git push || echo "nothing to push"

β€Ž.github/workflows/build.ymlβ€Ž

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ jobs:
3333
run: |
3434
python -m pip install --upgrade pip setuptools
3535
pip install .[dev,test]
36+
- name: lint nxf
37+
if: always()
38+
run: |
39+
nf-core pipelines schema lint
3640
- name: Check CLI basics
3741
run: |
3842
which crispin

β€Ž.pre-commit-config.yamlβ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ default_stages: [pre-commit]
33
exclude: |
44
(?x)(
55
^assets/|
6-
^docs/.*.html
6+
^docs/.*.html|
7+
^nextflow_schema.json
78
)
89
repos:
910
- repo: https://github.com/pre-commit/pre-commit-hooks

β€ŽCHANGELOG.mdβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
## CRISPIN development version
22

3+
- Nextflow parameters are now validated at the start of the workflow. (#68, @kelly-sovacool)
4+
35
## CRISPIN 1.2.1
46

57
- Improve help message for `crispin run`. (#65, @kelly-sovacool)

β€ŽMANIFEST.inβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ include VERSION
1010
include README.md
1111
include main.nf
1212
include nextflow.config
13+
include nextflow_schema.json
1314
exclude *.py[ocd]

β€Žassets/dag.pngβ€Ž

2.83 KB
Loading

β€Žconf/biowulf.configβ€Ž

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ params {
1111

1212
// CCBR shared resource paths
1313
index_dir = '/data/CCBR_Pipeliner/db/PipeDB/Indices'
14-
fastq_screen {
15-
conf = "assets/fastq_screen_biowulf.conf"
16-
db_dir = '/data/CCBR_Pipeliner/db/PipeDB/lib/fastq_screen_db/'
17-
}
1814
}
1915

2016
singularity {

β€Žconf/containers.configβ€Ž

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
// containers accessed in process definitions with $params.containers.NAME
1+
// containers accessed in process definitions with $params.container_NAME
22
params {
3-
containers {
4-
bagel = 'nciccbr/crispin_bagel_2.0:0.1.0'
5-
base = 'nciccbr/ccbr_ubuntu_base_20.04:v5'
6-
cutadapt = 'nciccbr/ncigb_cutadapt_v1.18:latest'
7-
drugz = 'nciccbr/crispin_drugz:0.1.0'
8-
fastqc = 'nciccbr/ccrgb_qctools:v4.0'
9-
mageck = 'quay.io/biocontainers/mageck:0.5.9.5--py39h1f90b4d_3'
10-
vispr = 'quay.io/biocontainers/mageck-vispr:0.5.6--py_0'
11-
}
3+
container_bagel = 'nciccbr/crispin_bagel_2.0:0.1.0'
4+
container_base = 'nciccbr/ccbr_ubuntu_base_20.04:v5'
5+
container_cutadapt = 'nciccbr/ncigb_cutadapt_v1.18:latest'
6+
container_drugz = 'nciccbr/crispin_drugz:0.1.0'
7+
container_fastqc = 'nciccbr/ccrgb_qctools:v4.0'
8+
container_mageck = 'quay.io/biocontainers/mageck:0.5.9.5--py39h1f90b4d_3'
9+
container_vispr = 'quay.io/biocontainers/mageck-vispr:0.5.6--py_0'
1210
}

β€Žconf/frce.configβ€Ž

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ params {
66

77
// CCBR shared resource paths
88
index_dir = null // TODO
9-
fastq_screen {
10-
conf = "assets/fastq_screen_frce.conf" // TODO
11-
db_dir = null // TODO
12-
}
139
}
1410

1511
singularity {

β€Žconf/interactive.configβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ params {
44
max_cpus = 56
55
max_time = '12 h'
66
}
7+
process.scratch = false

0 commit comments

Comments
Β (0)