Skip to content

Commit

Permalink
Migrate to nf-validation
Browse files Browse the repository at this point in the history
  • Loading branch information
jfy133 committed Oct 25, 2024
1 parent 0ac4a5e commit bdbe537
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
15 changes: 9 additions & 6 deletions assets/schema_fasta.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@
"type": "string",
"pattern": "^\\S+$",
"meta": ["id"],
"unique": true,
"errorMessage": "Reference name must be provided and cannot contain spaces."
},
"fasta": {
"type": "string",
"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": {
Expand Down Expand Up @@ -79,15 +77,13 @@
"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": {
"type": "string",
"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": {
Expand Down Expand Up @@ -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" }]
}
22 changes: 13 additions & 9 deletions assets/schema_input.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
},
Expand Down Expand Up @@ -54,31 +53,25 @@
"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": {
"type": "string",
"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": {
"type": "string",
"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."
}
},
Expand All @@ -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" }
]
}

0 comments on commit bdbe537

Please sign in to comment.