Skip to content

Commit d376a15

Browse files
committed
Template update for nf-core/tools version 2.1
1 parent d557945 commit d376a15

9 files changed

+28
-19
lines changed

.editorconfig

+3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ indent_style = space
1111
[*.{yml,yaml}]
1212
indent_size = 2
1313

14+
[*.json]
15+
insert_final_newline = unset
16+
1417
# These files are edited and tested upstream in nf-core/modules
1518
[/modules/nf-core/**]
1619
charset = unset

.github/CONTRIBUTING.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ If you'd like to write some code for nf-core/rnavar, the standard workflow is as
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/rnavar repository](https://github.com/nf-core/rnavar) 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 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/).
@@ -69,7 +69,7 @@ If you wish to contribute a new step, please use the following coding standards:
6969
2. Write the process block (see below).
7070
3. Define the output channel if needed (see below).
7171
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 .`).
72+
5. Add any new flags/options to `nextflow_schema.json` with help text (with `nf-core schema build`).
7373
6. Add any new flags/options to the help message (for integer/text parameters, print to help the corresponding `nextflow.config` parameter).
7474
7. Add sanity checks for all relevant parameters.
7575
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`.
@@ -83,7 +83,7 @@ If you wish to contribute a new step, please use the following coding standards:
8383

8484
Parameters should be initialised / defined with default values in `nextflow.config` under the `params` scope.
8585

86-
Once there, use `nf-core schema build .` to add to `nextflow_schema.json`.
86+
Once there, use `nf-core schema build` to add to `nextflow_schema.json`.
8787

8888
### Default processes resource requirements
8989

.github/PULL_REQUEST_TEMPLATE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Learn more about contributing: [CONTRIBUTING.md](https://github.com/nf-core/rnav
1818
- [ ] If you've fixed a bug or added code that should be tested, add tests!
1919
- [ ] If you've added a new tool - have you followed the pipeline conventions in the [contribution docs](https://github.com/nf-core/rnavar/tree/master/.github/CONTRIBUTING.md)
2020
- [ ] If necessary, also make a PR on the nf-core/rnavar _branch_ on the [nf-core/test-datasets](https://github.com/nf-core/test-datasets) repository.
21-
- [ ] Make sure your code lints (`nf-core lint .`).
21+
- [ ] Make sure your code lints (`nf-core lint`).
2222
- [ ] Ensure the test suite passes (`nextflow run . -profile test,docker`).
2323
- [ ] Usage Documentation in `docs/usage.md` is updated.
2424
- [ ] Output Documentation in `docs/output.md` is updated.

.github/workflows/linting.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353

5454
- uses: actions/setup-node@v1
5555
with:
56-
node-version: "10"
56+
node-version: '10'
5757

5858
- name: Install editorconfig-checker
5959
run: npm install -g editorconfig-checker

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ On release, automated continuous integration tests run the pipeline on a full-si
3333

3434
## Quick Start
3535

36-
1. Install [`Nextflow`](https://nf-co.re/usage/installation) (`>=21.04.0`)
36+
1. Install [`Nextflow`](https://www.nextflow.io/docs/latest/getstarted.html#installation) (`>=21.04.0`)
3737

3838
2. Install any of [`Docker`](https://docs.docker.com/engine/installation/), [`Singularity`](https://www.sylabs.io/guides/3.0/user-guide/), [`Podman`](https://podman.io/), [`Shifter`](https://nersc.gitlab.io/development/shifter/how-to-use/) or [`Charliecloud`](https://hpc.github.io/charliecloud/) for full pipeline reproducibility _(please only use [`Conda`](https://conda.io/miniconda.html) as a last resort; see [docs](https://nf-co.re/usage/configuration#basic-configuration-profiles))_
3939

bin/scrape_software_versions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
print(" <dt>{}</dt><dd><samp>{}</samp></dd>".format(k, v))
3131
print(" </dl>")
3232

33-
# Write out regexes as csv file:
33+
# Write out as tsv file:
3434
with open("software_versions.tsv", "w") as f:
3535
for k, v in sorted(results.items()):
3636
f.write("{}\t{}\n".format(k, v))

lib/NfcoreTemplate.groovy

+13-9
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,21 @@ class NfcoreTemplate {
2424
public static void hostName(workflow, params, log) {
2525
Map colors = logColours(params.monochrome_logs)
2626
if (params.hostnames) {
27-
def hostname = "hostname".execute().text.trim()
28-
params.hostnames.each { prof, hnames ->
29-
hnames.each { hname ->
30-
if (hostname.contains(hname) && !workflow.profile.contains(prof)) {
31-
log.info "=${colors.yellow}====================================================${colors.reset}=\n" +
32-
"${colors.yellow}WARN: You are running with `-profile $workflow.profile`\n" +
33-
" but your machine hostname is ${colors.white}'$hostname'${colors.reset}.\n" +
34-
" ${colors.yellow_bold}Please use `-profile $prof${colors.reset}`\n" +
35-
"=${colors.yellow}====================================================${colors.reset}="
27+
try {
28+
def hostname = "hostname".execute().text.trim()
29+
params.hostnames.each { prof, hnames ->
30+
hnames.each { hname ->
31+
if (hostname.contains(hname) && !workflow.profile.contains(prof)) {
32+
log.info "=${colors.yellow}====================================================${colors.reset}=\n" +
33+
"${colors.yellow}WARN: You are running with `-profile $workflow.profile`\n" +
34+
" but your machine hostname is ${colors.white}'$hostname'${colors.reset}.\n" +
35+
" ${colors.yellow_bold}Please use `-profile $prof${colors.reset}`\n" +
36+
"=${colors.yellow}====================================================${colors.reset}="
37+
}
3638
}
3739
}
40+
} catch (Exception e) {
41+
log.warn "[$workflow.manifest.name] Could not determine 'hostname' - skipping check. Reason: ${e.message}."
3842
}
3943
}
4044
}

nextflow_schema.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"type": "string",
1919
"format": "file-path",
2020
"mimetype": "text/csv",
21-
"pattern": "\\.csv$",
21+
"pattern": "^\\S+\\.csv$",
2222
"schema": "assets/schema_input.json",
2323
"description": "Path to comma-separated file containing information about the samples in the experiment.",
2424
"help_text": "You will need to create a design file with information about the samples in your experiment before running the pipeline. Use this parameter to specify its location. It has to be a comma-separated file with 3 columns, and a header row. See [usage docs](https://nf-co.re/rnavar/usage#samplesheet-input).",
@@ -60,7 +60,7 @@
6060
"type": "string",
6161
"format": "file-path",
6262
"mimetype": "text/plain",
63-
"pattern": "\\.fn?a(sta)?(\\.gz)?$",
63+
"pattern": "^\\S+\\.fn?a(sta)?(\\.gz)?$",
6464
"description": "Path to FASTA genome file.",
6565
"help_text": "This parameter is *mandatory* if `--genome` is not specified. If you don't have a BWA index available this will be generated for you automatically. Combine with `--save_reference` to save BWA index for future runs.",
6666
"fa_icon": "far fa-file-code"

workflows/rnavar.nf

+3-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ workflow RNAVAR {
130130
*/
131131

132132
workflow.onComplete {
133-
NfcoreTemplate.email(workflow, params, summary_params, projectDir, log, multiqc_report)
133+
if (params.email || params.email_on_fail) {
134+
NfcoreTemplate.email(workflow, params, summary_params, projectDir, log, multiqc_report)
135+
}
134136
NfcoreTemplate.summary(workflow, params, log)
135137
}
136138

0 commit comments

Comments
 (0)