Skip to content

Commit

Permalink
Updating schema and check_samplesheet.py
Browse files Browse the repository at this point in the history
  • Loading branch information
RaqManzano committed Aug 21, 2023
1 parent 28fe888 commit fac25ea
Show file tree
Hide file tree
Showing 2 changed files with 135 additions and 8 deletions.
141 changes: 134 additions & 7 deletions assets/schema_input.json
Original file line number Diff line number Diff line change
Expand Up @@ -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'",
Expand All @@ -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"]
}
}
}
2 changes: 1 addition & 1 deletion bin/check_samplesheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -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).
"""
Expand Down

0 comments on commit fac25ea

Please sign in to comment.