Skip to content

Commit 62550bd

Browse files
committed
Refactor JSON schema to simplify enum definitions and consolidate required properties
1 parent 945291b commit 62550bd

File tree

2 files changed

+13
-66
lines changed

2 files changed

+13
-66
lines changed

assets/schema_input.json

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111
"type": "string",
1212
"pattern": "^\\S+$",
1313
"errorMessage": "Sample name must be provided and cannot contain spaces",
14-
"meta": [
15-
"id"
16-
]
14+
"meta": ["id"]
1715
},
1816
"fastq_1": {
1917
"type": "string",
@@ -32,21 +30,10 @@
3230
"strandedness": {
3331
"type": "string",
3432
"errorMessage": "Strandedness must be provided and be one of 'auto', 'forward', 'reverse' or 'unstranded'",
35-
"enum": [
36-
"forward",
37-
"reverse",
38-
"unstranded",
39-
"auto"
40-
],
41-
"meta": [
42-
"strandedness"
43-
]
33+
"enum": ["forward", "reverse", "unstranded", "auto"],
34+
"meta": ["strandedness"]
4435
}
4536
},
46-
"required": [
47-
"sample",
48-
"fastq_1",
49-
"strandedness"
50-
]
37+
"required": ["sample", "fastq_1", "strandedness"]
5138
}
5239
}

nextflow_schema.json

Lines changed: 9 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@
1010
"type": "object",
1111
"fa_icon": "fas fa-terminal",
1212
"description": "Define where the pipeline should find input data and save output data.",
13-
"required": [
14-
"input",
15-
"outdir"
16-
],
13+
"required": ["input", "outdir"],
1714
"properties": {
1815
"input": {
1916
"type": "string",
@@ -238,10 +235,7 @@
238235
"default": "trimgalore",
239236
"description": "Specifies the trimming tool to use - available options are 'trimgalore' and 'fastp'.",
240237
"fa_icon": "fas fa-cut",
241-
"enum": [
242-
"trimgalore",
243-
"fastp"
244-
]
238+
"enum": ["trimgalore", "fastp"]
245239
},
246240
"extra_trimgalore_args": {
247241
"type": "string",
@@ -329,10 +323,7 @@
329323
"default": "umitools",
330324
"description": "Specifies the tool to use for UMI deduplication - available options are 'umitools' and 'umicollapse'.",
331325
"fa_icon": "fas fa-barcode",
332-
"enum": [
333-
"umitools",
334-
"umicollapse"
335-
]
326+
"enum": ["umitools", "umicollapse"]
336327
},
337328
"umitools_extract_method": {
338329
"type": "string",
@@ -373,13 +364,7 @@
373364
"default": "directional",
374365
"fa_icon": "far fa-object-ungroup",
375366
"description": "Method to use to determine read groups by subsuming those with similar UMIs. All methods start by identifying the reads with the same mapping position, but treat similar yet nonidentical UMIs differently.",
376-
"enum": [
377-
"unique",
378-
"percentile",
379-
"cluster",
380-
"adjacency",
381-
"directional"
382-
]
367+
"enum": ["unique", "percentile", "cluster", "adjacency", "directional"]
383368
},
384369
"umitools_dedup_stats": {
385370
"type": "boolean",
@@ -401,20 +386,13 @@
401386
"default": "star_salmon",
402387
"description": "Specifies the alignment algorithm to use - available options are 'star_salmon', 'star_rsem' and 'hisat2'.",
403388
"fa_icon": "fas fa-map-signs",
404-
"enum": [
405-
"star_salmon",
406-
"star_rsem",
407-
"hisat2"
408-
]
389+
"enum": ["star_salmon", "star_rsem", "hisat2"]
409390
},
410391
"pseudo_aligner": {
411392
"type": "string",
412393
"description": "Specifies the pseudo aligner to use - available options are 'salmon'. Runs in addition to '--aligner'.",
413394
"fa_icon": "fas fa-hamburger",
414-
"enum": [
415-
"salmon",
416-
"kallisto"
417-
]
395+
"enum": ["salmon", "kallisto"]
418396
},
419397
"pseudo_aligner_kmer_size": {
420398
"type": "integer",
@@ -618,10 +596,7 @@
618596
"type": "string",
619597
"description": "Tool to use for detecting contaminants in unaligned reads - available options are 'kraken2' and 'kraken2_bracken'",
620598
"fa_icon": "fas fa-virus-slash",
621-
"enum": [
622-
"kraken2",
623-
"kraken2_bracken"
624-
]
599+
"enum": ["kraken2", "kraken2_bracken"]
625600
},
626601
"kraken_db": {
627602
"type": "string",
@@ -636,15 +611,7 @@
636611
"fa_icon": "fas fa-tree",
637612
"description": "Taxonomic level for Bracken abundance estimations.",
638613
"help_text": "Use the first letter of taxonomic levels: Domain, Phylum, Class, Order, Family, Genus, or Species.",
639-
"enum": [
640-
"D",
641-
"P",
642-
"C",
643-
"O",
644-
"F",
645-
"G",
646-
"S"
647-
]
614+
"enum": ["D", "P", "C", "O", "F", "G", "S"]
648615
}
649616
}
650617
},
@@ -827,14 +794,7 @@
827794
"description": "Method used to save pipeline results to output directory.",
828795
"help_text": "Controls how files are saved to the output directory through Nextflow's `publishDir` directive. See the [Nextflow documentation](https://www.nextflow.io/docs/latest/process.html#publishdir) for available options.",
829796
"fa_icon": "fas fa-copy",
830-
"enum": [
831-
"symlink",
832-
"rellink",
833-
"link",
834-
"copy",
835-
"copyNoFollow",
836-
"move"
837-
],
797+
"enum": ["symlink", "rellink", "link", "copy", "copyNoFollow", "move"],
838798
"hidden": true
839799
},
840800
"email_on_fail": {

0 commit comments

Comments
 (0)