diff --git a/assets/schema_input.json b/assets/schema_input.json index 237ad38..2775191 100644 --- a/assets/schema_input.json +++ b/assets/schema_input.json @@ -7,15 +7,47 @@ "items": { "type": "object", "properties": { + "patient": { + "type": "string", + "pattern": "^\\S+$", + "errorMessage": "Patient ID must be provided and cannot contain spaces", + "meta": ["patient"] + }, "sample": { "type": "string", "pattern": "^\\S+$", - "errorMessage": "Sample name must be provided and cannot contain spaces" + "errorMessage": "Sample ID must be provided and cannot contain spaces", + "meta": ["sample"] }, - "fastq_1": { + "status": { + "type": "integer", + "errorMessage": "Status can only be 0 (normal), 1 (tumor) or 2 (rna tumour). Defaults to 1, if none is supplied.", + "meta": ["status"], + "default": "1", + "minimum": 0, + "maximum": 2 + }, + "lane": { "type": "string", - "pattern": "^\\S+\\.f(ast)?q\\.gz$", - "errorMessage": "FastQ file for reads 1 must be provided, cannot contain spaces and must have extension '.fq.gz' or '.fastq.gz'" + "pattern": "^\\S+$", + "unique": ["patient", "sample"], + "dependentRequired": ["fastq_1"], + "meta": ["lane"] + }, + "fastq_1": { + "errorMessage": "FastQ file for reads 1 cannot contain spaces and must have extension '.fq.gz' or '.fastq.gz'", + "anyOf": [ + { + "type": "string", + "pattern": "^\\S+\\.f(ast)?q\\.gz$" + }, + { + "type": "string", + "maxLength": 0 + } + ], + "format": "file-path", + "exists": true }, "fastq_2": { "errorMessage": "FastQ file for reads 2 cannot contain spaces and must have extension '.fq.gz' or '.fastq.gz'", @@ -28,9 +60,104 @@ "type": "string", "maxLength": 0 } - ] + ], + "format": "file-path", + "exists": true + }, + "table": { + "errorMessage": "Recalibration table cannot contain spaces and must have extension '.table'", + "anyOf": [ + { + "type": "string", + "pattern": "^\\S+\\.table$" + }, + { + "type": "string", + "maxLength": 0 + } + ], + "format": "file-path", + "exists": true + }, + "cram": { + "errorMessage": "CRAM file cannot contain spaces and must have extension '.cram'", + "anyOf": [ + { + "type": "string", + "pattern": "^\\S+\\.cram$" + }, + { + "type": "string", + "maxLength": 0 + } + ], + "format": "file-path", + "exists": true + }, + "crai": { + "errorMessage": "CRAM index file cannot contain spaces and must have extension '.crai'", + "anyOf": [ + { + "type": "string", + "pattern": "^\\S+\\.crai$" + }, + { + "type": "string", + "maxLength": 0 + } + ], + "format": "file-path", + "exists": true + }, + "bam": { + "errorMessage": "BAM file cannot contain spaces and must have extension '.bam'", + "anyOf": [ + { + "type": "string", + "pattern": "^\\S+\\.bam$" + }, + { + "type": "string", + "maxLength": 0 + } + ], + "format": "file-path", + "exists": true + }, + "bai": { + "errorMessage": "BAM index file cannot contain spaces and must have extension '.bai'", + "anyOf": [ + { + "type": "string", + "pattern": "^\\S+\\.bai$" + }, + { + "type": "string", + "maxLength": 0 + } + ], + "format": "file-path", + "exists": true + }, + "vcf": { + "errorMessage": "VCF file for reads 1 cannot contain spaces and must have extension '.vcf' or '.vcf.gz'", + "anyOf": [ + { + "type": "string", + "pattern": "^\\S+\\.vcf(\\.gz)?$" + }, + { + "type": "string", + "maxLength": 0 + } + ], + "format": "file-path", + "exists": true + }, + "variantcaller": { + "type": "string" } }, - "required": ["sample", "fastq_1"] + "required": ["patient", "sample"] } -} +} \ No newline at end of file diff --git a/bin/check_samplesheet.py b/bin/check_samplesheet.py index 7fae8ed..b1de246 100755 --- a/bin/check_samplesheet.py +++ b/bin/check_samplesheet.py @@ -71,7 +71,7 @@ def validate_and_transform(self, row): Perform all validations on the given row and insert the read pairing status. Args: - row (dict): A mapping from column headers (keys) to elements of that row + row (dict): A bam_align from column headers (keys) to elements of that row (values). """