From 78788593b7c5e03927448dc37e0f98816055061d Mon Sep 17 00:00:00 2001 From: Robert Ernst Date: Tue, 26 May 2020 14:56:52 +0200 Subject: [PATCH 1/3] Update README.md --- README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index bdaa803f..ccd5c3a1 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ See `utils/template.nf` for a process template which uses the following guidelin - Use the original tool version numbering - Use CamelCase for tool, command and process names - Use lowercase with words separated by underscores for params, inputs, outputs and scripts. +- Use 4 spaces per indentation level. - All input and output identifiers should reflect their conceptual identity. Use informative names like unaligned_sequences, reference_genome, phylogeny, or aligned_sequences instead of foo_input, foo_file, result, input, output, and so forth. - Define two labels for each process, containing toolname, version and command separated by an underscore. - BWA_0.7.17 @@ -42,16 +43,16 @@ See `utils/template.nf` for a process template which uses the following guidelin - Use separate process input channels as much as possible. Use tuples for linked inputs only. ``` input: - tuple sample_id, rg_id, bam, bai - path genome_fasta + val(analysis_id) + tuple(sample_id, path(bam), path(bai)) ``` - Define named process output channels. This ensures that outputs can be referenced in external scope by their respective names. Indicate whether an output channel is optional. ``` output: - path "my_file.txt", emit: my_file - path "my_optional_file.txt", optional: my_optional_file, emit: my_optional_file - ...... + path("my_file.txt", emit: my_file) + path("my_optional_file.txt", optional: my_optional_file, emit: my_optional_file) ``` +- Use `params` for resource files, for example `genome.fasta`, `database.vcf`. ## GUIX 1. Creating squashfs immage From dda1e41de3676413218c264d0d81f42f3737e9ba Mon Sep 17 00:00:00 2001 From: Robert Ernst Date: Tue, 26 May 2020 14:59:03 +0200 Subject: [PATCH 2/3] Update template.nf --- Utils/template.nf | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Utils/template.nf b/Utils/template.nf index fb059716..481a2b70 100644 --- a/Utils/template.nf +++ b/Utils/template.nf @@ -6,15 +6,16 @@ process Command { shell = ['/bin/bash', '-euo', 'pipefail'] input: + val(analysis_id) tuple(sample_id, path(input_file)) output: tuple(sample_id, path(output_file), emit: output_file) - path("*.{tsv,txt}", emit: my_output) + path("log.txt", emit: log) script: """ - tool command ${params.optional} + tool command ${params.optional} ${analysis_id} ${params.resource_file} ${input_file} """ } From 2820d2725aa26bba330ddbf160e23d07802c37d3 Mon Sep 17 00:00:00 2001 From: Robert Ernst Date: Tue, 26 May 2020 14:59:25 +0200 Subject: [PATCH 3/3] Update template.nf --- Utils/template.nf | 1 - 1 file changed, 1 deletion(-) diff --git a/Utils/template.nf b/Utils/template.nf index 481a2b70..5ed8e204 100644 --- a/Utils/template.nf +++ b/Utils/template.nf @@ -13,7 +13,6 @@ process Command { tuple(sample_id, path(output_file), emit: output_file) path("log.txt", emit: log) - script: """ tool command ${params.optional} ${analysis_id} ${params.resource_file} ${input_file}