From bdbe5371b18f9150217e83772f28d6757f92a6ae Mon Sep 17 00:00:00 2001 From: "James A. Fellows Yates" Date: Fri, 25 Oct 2024 14:53:05 +0200 Subject: [PATCH] Migrate to nf-validation --- assets/schema_fasta.json | 15 +++++++++------ assets/schema_input.json | 22 +++++++++++++--------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/assets/schema_fasta.json b/assets/schema_fasta.json index 54e00de8e..c6a13f8f6 100644 --- a/assets/schema_fasta.json +++ b/assets/schema_fasta.json @@ -11,7 +11,6 @@ "type": "string", "pattern": "^\\S+$", "meta": ["id"], - "unique": true, "errorMessage": "Reference name must be provided and cannot contain spaces." }, "fasta": { @@ -19,7 +18,6 @@ "format": "file-path", "pattern": "^\\S+\\.f(na|asta|a|as)(\\.gz)?$", "exists": true, - "unique": true, "errorMessage": "Fasta files for the mapping reference must be provided with file extensions '.fasta', '.fa', '.fas', '.fna', '.fasta.gz','.fa.gz','.fas.gz', '.fna.gz' and cannot contain any spaces." }, "fai": { @@ -79,7 +77,6 @@ "format": "file-path", "pattern": "^\\S+\\.bed(\\.gz)?$", "exists": true, - "dependentRequired": ["pileupcaller_snpfile"], "errorMessage": "SNP capture bed files for pileupcaller must not contain any spaces, have file extensions '.bed' or '.bed.gz' and be provided alongside a pileupcall_bedfile." }, "pileupcaller_snpfile": { @@ -87,7 +84,6 @@ "format": "file-path", "pattern": "^\\S+\\.snp$", "exists": true, - "dependentRequired": ["pileupcaller_bedfile"], "errorMessage": "SNP panel files for pileupcaller must not contain any spaces, have file extension '.snp' and be provided alongside a pileupcaller_snpfile." }, "hapmap_file": { @@ -138,6 +134,13 @@ "errorMessage": "SNP annotation files for GATK must not contain any spaces and have file extension '.vcf'." } }, - "required": ["reference_name", "fasta"] - } + "required": ["reference_name", "fasta"], + "dependentRequired": { + "pileupcaller_snpfile": ["pileupcaller_bedfile"], + "pileupcaller_bedfile": ["pileupcaller_snpfile"], + "bam": ["bam_reference_id"], + "bam_reference_id": ["bam"] + } + }, + "allOf": [{ "uniqueEntries": "reference_name" }, { "uniqueEntries": "fasta" }] } diff --git a/assets/schema_input.json b/assets/schema_input.json index 7956b0f09..673a694a2 100644 --- a/assets/schema_input.json +++ b/assets/schema_input.json @@ -21,7 +21,6 @@ }, "lane": { "type": "integer", - "unique": ["library_id"], "meta": ["lane"], "errorMessage": "Sequencing lane number must be provided and specified as an integer. If no lane information, specify 0." }, @@ -54,7 +53,6 @@ "format": "file-path", "pattern": "^\\S+\\.f(ast)?q\\.gz$", "exists": true, - "unique": true, "errorMessage": "FastQ file for reads 1 cannot contain spaces and must have extension '.fq.gz' or '.fastq.gz'." }, "r2": { @@ -62,8 +60,6 @@ "format": "file-path", "pattern": "^\\S+\\.f(ast)?q\\.gz$", "exists": true, - "unique": true, - "dependentRequired": ["r1"], "errorMessage": "FastQ file for reads 2 require files for reads 1, cannot contain spaces and must have extension '.fq.gz' or '.fastq.gz'." }, "bam": { @@ -71,14 +67,11 @@ "format": "file-path", "pattern": "^\\S+\\.bam$", "exists": true, - "unique": true, - "dependentRequired": ["bam_reference_id"], "errorMessage": "BAM files cannot contain any spaces and must have extension '.bam'." }, "bam_reference_id": { "type": "string", "meta": ["bam_reference_id"], - "dependentRequired": ["bam"], "errorMessage": "A BAM reference ID (corresponding to what is supplied to `--fasta`) must always be provided when providing a BAM file." } }, @@ -98,6 +91,17 @@ { "required": ["bam"] } - ] - } + ], + "dependentRequired": { + "r2": ["r1"], + "bam": ["bam_reference_id"], + "bam_reference_id": ["bam"] + } + }, + "allOf": [ + { "uniqueEntries": ["lane", "library_id"] }, + { "uniqueEntries": "r1" }, + { "uniqueEntries": "r2" }, + { "uniqueEntries": "bam" } + ] }