From 65a1e892041f310c2a60d4eb503de7535ce8687d Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Thu, 21 Dec 2023 16:58:30 +0000 Subject: [PATCH 1/5] clonal_threshold validation uses JSON schema format Fixes #292 --- CHANGELOG.md | 1 + nextflow_schema.json | 58 +++++++++++++++++++++++++++++++++++++------- 2 files changed, 50 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 755f0d29..64a14cba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### `Fixed` - Removed optional output from FilterQuality to not fail silently +- clonal_threshold is validated to be 'auto' or number greater than zero ### `Dependencies` diff --git a/nextflow_schema.json b/nextflow_schema.json index 7117deb4..a909027c 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -10,7 +10,10 @@ "type": "object", "fa_icon": "fas fa-terminal", "description": "Define where the pipeline should find input data and save output data.", - "required": ["input", "outdir"], + "required": [ + "input", + "outdir" + ], "properties": { "input": { "type": "string", @@ -27,7 +30,10 @@ "type": "string", "default": "fastq", "description": "Specify the processing mode for the pipeline. Available options are \"fastq\" and \"assembled\".", - "enum": ["fastq", "assembled"], + "enum": [ + "fastq", + "assembled" + ], "fa_icon": "fas fa-terminal" }, "outdir": { @@ -61,7 +67,12 @@ "type": "string", "fa_icon": "fas fa-flask", "description": "Protocol used for the V(D)J amplicon sequencing library generation.", - "enum": ["specific_pcr_umi", "specific_pcr", "dt_5p_race", "dt_5p_race_umi"], + "enum": [ + "specific_pcr_umi", + "specific_pcr", + "dt_5p_race", + "dt_5p_race_umi" + ], "help_text": "Available protocols are:\n- `specific_pcr_umi`: RT-PCR using transcript-specific primers containing UMIs.\n- `specific_pcr`: RT-PCR using transcript-specific primers.\n- `dt_5p_race_umi`: 5\u2019-RACE PCR using oligo-dT primers and template switch primers containing UMI.\n- `dt_5p_race`: 5\u2019-RACE PCR (i.e. RT is followed by a template switch (TS) step) using oligo-dT primers." }, "race_linker": { @@ -105,7 +116,10 @@ "default": "R1", "fa_icon": "fas fa-dna", "description": "Indicate if C region primers are in the R1 or R2 reads.", - "enum": ["R1", "R2"] + "enum": [ + "R1", + "R2" + ] }, "primer_revpr": { "type": "boolean", @@ -126,7 +140,10 @@ "default": "R1", "description": "Indicate if UMI indices are recorded in the R1 (default) or R1 fastq file.", "help_text": "The pipeline requires UMI barcodes for identifying unique transcripts. These barcodes are typically read from an index file but sometimes can be provided merged with the start of the R1 or R2 reads. If provided in an additional index file, set the `--index_file` parameter, if provided merged with the R1 or R2 reads, set the `--umi_position` parameter to R1 or R2, respectively.", - "enum": ["R1", "R2"], + "enum": [ + "R1", + "R2" + ], "fa_icon": "fas fa-barcode" }, "umi_length": { @@ -235,7 +252,12 @@ "type": "string", "default": "cut", "description": "Masking mode for the pRESTO MaskPrimer step. Available: cut, mask, trim, tag.", - "enum": ["cut", "mask", "trim", "tag"], + "enum": [ + "cut", + "mask", + "trim", + "tag" + ], "help_text": "The primer masking modes will perform the following actions:\n\n* `cut`: remove both the primer region and the preceding sequence.\n* `mask`: replace the primer region with Ns and remove the preceding sequence.\n* `trim`: remove the region preceding the primer, but leave the primer region intact.\n* `tag`: leave the input sequence unmodified.", "fa_icon": "fas fa-mask" }, @@ -335,7 +357,18 @@ "default": "", "properties": { "clonal_threshold": { - "type": ["string", "number"], + "oneOf": [ + { + "type": "string", + "enum": [ + "auto" + ] + }, + { + "type": "number", + "minimum": 0 + } + ], "default": "auto", "fa_icon": "fab fa-pagelines", "description": "Set the clustering threshold Hamming distance value. Default: 'auto'" @@ -559,7 +592,14 @@ "description": "Method used to save pipeline results to output directory.", "help_text": "The Nextflow `publishDir` option specifies which intermediate files should be saved to the output directory. This option tells the pipeline what method should be used to move these files. See [Nextflow docs](https://www.nextflow.io/docs/latest/process.html#publishdir) for details.", "fa_icon": "fas fa-copy", - "enum": ["symlink", "rellink", "link", "copy", "copyNoFollow", "move"], + "enum": [ + "symlink", + "rellink", + "link", + "copy", + "copyNoFollow", + "move" + ], "hidden": true }, "email_on_fail": { @@ -695,4 +735,4 @@ "$ref": "#/definitions/generic_options" } ] -} +} \ No newline at end of file From 2915e70161a1368fcd5c2bdb02b8a81f1bafe495 Mon Sep 17 00:00:00 2001 From: Adam Talbot <12817534+adamrtalbot@users.noreply.github.com> Date: Thu, 21 Dec 2023 17:41:20 +0000 Subject: [PATCH 2/5] cheat linter with extra 'type' entry --- nextflow_schema.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nextflow_schema.json b/nextflow_schema.json index a909027c..98cda6fb 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -184,7 +184,6 @@ }, "adapter_fasta": { "type": "string", - "default": "None", "fa_icon": "fas fa-file", "description": "Fasta file with adapter sequences to be trimmed." }, @@ -369,6 +368,10 @@ "minimum": 0 } ], + "type": [ + "string", + "number" + ], "default": "auto", "fa_icon": "fab fa-pagelines", "description": "Set the clustering threshold Hamming distance value. Default: 'auto'" From 17470cab6702a0405753f3ee8163b7a916149313 Mon Sep 17 00:00:00 2001 From: Gisela Gabernet Date: Fri, 22 Dec 2023 11:52:26 -0500 Subject: [PATCH 3/5] fix docker emulation --- nextflow.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nextflow.config b/nextflow.config index 9fcbed9d..70f03591 100644 --- a/nextflow.config +++ b/nextflow.config @@ -190,7 +190,7 @@ profiles { } docker { docker.enabled = true - docker.userEmulation = true + docker.runOptions = '-u $(id -u):$(id -g)' conda.enabled = false singularity.enabled = false podman.enabled = false From adbdd1a1d46cce4973bd5551205db605c4520f10 Mon Sep 17 00:00:00 2001 From: Gisela Gabernet Date: Fri, 22 Dec 2023 11:54:26 -0500 Subject: [PATCH 4/5] fix schema linting --- nextflow_schema.json | 54 ++++++++------------------------------------ 1 file changed, 10 insertions(+), 44 deletions(-) diff --git a/nextflow_schema.json b/nextflow_schema.json index 98cda6fb..57d0c428 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -10,10 +10,7 @@ "type": "object", "fa_icon": "fas fa-terminal", "description": "Define where the pipeline should find input data and save output data.", - "required": [ - "input", - "outdir" - ], + "required": ["input", "outdir"], "properties": { "input": { "type": "string", @@ -30,10 +27,7 @@ "type": "string", "default": "fastq", "description": "Specify the processing mode for the pipeline. Available options are \"fastq\" and \"assembled\".", - "enum": [ - "fastq", - "assembled" - ], + "enum": ["fastq", "assembled"], "fa_icon": "fas fa-terminal" }, "outdir": { @@ -67,12 +61,7 @@ "type": "string", "fa_icon": "fas fa-flask", "description": "Protocol used for the V(D)J amplicon sequencing library generation.", - "enum": [ - "specific_pcr_umi", - "specific_pcr", - "dt_5p_race", - "dt_5p_race_umi" - ], + "enum": ["specific_pcr_umi", "specific_pcr", "dt_5p_race", "dt_5p_race_umi"], "help_text": "Available protocols are:\n- `specific_pcr_umi`: RT-PCR using transcript-specific primers containing UMIs.\n- `specific_pcr`: RT-PCR using transcript-specific primers.\n- `dt_5p_race_umi`: 5\u2019-RACE PCR using oligo-dT primers and template switch primers containing UMI.\n- `dt_5p_race`: 5\u2019-RACE PCR (i.e. RT is followed by a template switch (TS) step) using oligo-dT primers." }, "race_linker": { @@ -116,10 +105,7 @@ "default": "R1", "fa_icon": "fas fa-dna", "description": "Indicate if C region primers are in the R1 or R2 reads.", - "enum": [ - "R1", - "R2" - ] + "enum": ["R1", "R2"] }, "primer_revpr": { "type": "boolean", @@ -140,10 +126,7 @@ "default": "R1", "description": "Indicate if UMI indices are recorded in the R1 (default) or R1 fastq file.", "help_text": "The pipeline requires UMI barcodes for identifying unique transcripts. These barcodes are typically read from an index file but sometimes can be provided merged with the start of the R1 or R2 reads. If provided in an additional index file, set the `--index_file` parameter, if provided merged with the R1 or R2 reads, set the `--umi_position` parameter to R1 or R2, respectively.", - "enum": [ - "R1", - "R2" - ], + "enum": ["R1", "R2"], "fa_icon": "fas fa-barcode" }, "umi_length": { @@ -251,12 +234,7 @@ "type": "string", "default": "cut", "description": "Masking mode for the pRESTO MaskPrimer step. Available: cut, mask, trim, tag.", - "enum": [ - "cut", - "mask", - "trim", - "tag" - ], + "enum": ["cut", "mask", "trim", "tag"], "help_text": "The primer masking modes will perform the following actions:\n\n* `cut`: remove both the primer region and the preceding sequence.\n* `mask`: replace the primer region with Ns and remove the preceding sequence.\n* `trim`: remove the region preceding the primer, but leave the primer region intact.\n* `tag`: leave the input sequence unmodified.", "fa_icon": "fas fa-mask" }, @@ -359,19 +337,14 @@ "oneOf": [ { "type": "string", - "enum": [ - "auto" - ] + "enum": ["auto"] }, { "type": "number", "minimum": 0 } ], - "type": [ - "string", - "number" - ], + "type": ["string", "number"], "default": "auto", "fa_icon": "fab fa-pagelines", "description": "Set the clustering threshold Hamming distance value. Default: 'auto'" @@ -595,14 +568,7 @@ "description": "Method used to save pipeline results to output directory.", "help_text": "The Nextflow `publishDir` option specifies which intermediate files should be saved to the output directory. This option tells the pipeline what method should be used to move these files. See [Nextflow docs](https://www.nextflow.io/docs/latest/process.html#publishdir) for details.", "fa_icon": "fas fa-copy", - "enum": [ - "symlink", - "rellink", - "link", - "copy", - "copyNoFollow", - "move" - ], + "enum": ["symlink", "rellink", "link", "copy", "copyNoFollow", "move"], "hidden": true }, "email_on_fail": { @@ -738,4 +704,4 @@ "$ref": "#/definitions/generic_options" } ] -} \ No newline at end of file +} From 35463cb0e04ddb25d112f0af92609f631d38a8b8 Mon Sep 17 00:00:00 2001 From: Gisela Gabernet Date: Fri, 22 Dec 2023 11:58:46 -0500 Subject: [PATCH 5/5] making @maxulysse happy --- nextflow_schema.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nextflow_schema.json b/nextflow_schema.json index 57d0c428..0beb2e4a 100644 --- a/nextflow_schema.json +++ b/nextflow_schema.json @@ -61,7 +61,7 @@ "type": "string", "fa_icon": "fas fa-flask", "description": "Protocol used for the V(D)J amplicon sequencing library generation.", - "enum": ["specific_pcr_umi", "specific_pcr", "dt_5p_race", "dt_5p_race_umi"], + "enum": ["dt_5p_race", "dt_5p_race_umi", "specific_pcr", "specific_pcr_umi"], "help_text": "Available protocols are:\n- `specific_pcr_umi`: RT-PCR using transcript-specific primers containing UMIs.\n- `specific_pcr`: RT-PCR using transcript-specific primers.\n- `dt_5p_race_umi`: 5\u2019-RACE PCR using oligo-dT primers and template switch primers containing UMI.\n- `dt_5p_race`: 5\u2019-RACE PCR (i.e. RT is followed by a template switch (TS) step) using oligo-dT primers." }, "race_linker": { @@ -234,7 +234,7 @@ "type": "string", "default": "cut", "description": "Masking mode for the pRESTO MaskPrimer step. Available: cut, mask, trim, tag.", - "enum": ["cut", "mask", "trim", "tag"], + "enum": ["cut", "mask", "tag", "trim"], "help_text": "The primer masking modes will perform the following actions:\n\n* `cut`: remove both the primer region and the preceding sequence.\n* `mask`: replace the primer region with Ns and remove the preceding sequence.\n* `trim`: remove the region preceding the primer, but leave the primer region intact.\n* `tag`: leave the input sequence unmodified.", "fa_icon": "fas fa-mask" },