|
9 | 9 | "properties": { |
10 | 10 | "sample": { |
11 | 11 | "type": "string", |
12 | | - "pattern": "^\\S+$", |
13 | | - "errorMessage": "Sample name must be provided and cannot contain spaces", |
| 12 | + "pattern": "^[a-zA-Z0-9_.-]+$", |
| 13 | + "errorMessage": "Sample name must be provided and can only contain alphanumeric characters, underscores, dots and dashes", |
14 | 14 | "meta": ["id"] |
15 | 15 | }, |
16 | 16 | "fastq_1": { |
17 | 17 | "type": "string", |
18 | 18 | "format": "file-path", |
19 | | - "exists": true, |
20 | 19 | "pattern": "^\\S+\\.f(ast)?q\\.gz$", |
21 | 20 | "errorMessage": "FastQ file for reads 1 must be provided, cannot contain spaces and must have extension '.fq.gz' or '.fastq.gz'" |
22 | 21 | }, |
|
25 | 24 | "anyOf": [ |
26 | 25 | { |
27 | 26 | "type": "string", |
28 | | - "pattern": "^\\S+\\.f(ast)?q\\.gz$" |
| 27 | + "pattern": "^\\S+\\.f(ast)?q\\.gz$", |
| 28 | + "format": "file-path" |
29 | 29 | }, |
30 | 30 | { |
31 | 31 | "type": "string", |
|
35 | 35 | }, |
36 | 36 | "replicate": { |
37 | 37 | "type": "integer", |
38 | | - "errorMessage": "Replicate id not an integer!", |
| 38 | + "minimum": 1, |
| 39 | + "errorMessage": "Replicate id must be provided and must be a positive integer", |
39 | 40 | "meta": ["replicate"] |
40 | 41 | }, |
41 | 42 | "antibody": { |
42 | | - "type": "string", |
43 | | - "pattern": "^\\S+$", |
44 | | - "errorMessage": "Antibody entry cannot contain spaces", |
| 43 | + "anyOf": [ |
| 44 | + { |
| 45 | + "type": "string", |
| 46 | + "pattern": "^[a-zA-Z0-9_.-]+$", |
| 47 | + "minLength": 1 |
| 48 | + }, |
| 49 | + { |
| 50 | + "type": "string", |
| 51 | + "maxLength": 0 |
| 52 | + } |
| 53 | + ], |
| 54 | + "errorMessage": "Antibody entry can only contain alphanumeric characters, underscores, dots and dashes", |
45 | 55 | "meta": ["antibody"] |
46 | 56 | }, |
47 | 57 | "control": { |
48 | | - "type": "string", |
49 | | - "pattern": "^\\S+$", |
50 | | - "errorMessage": "Control entry cannot contain spaces", |
| 58 | + "anyOf": [ |
| 59 | + { |
| 60 | + "type": "string", |
| 61 | + "pattern": "^[a-zA-Z0-9_.-]+$", |
| 62 | + "minLength": 1 |
| 63 | + }, |
| 64 | + { |
| 65 | + "type": "string", |
| 66 | + "maxLength": 0 |
| 67 | + } |
| 68 | + ], |
| 69 | + "errorMessage": "Control sample name can only contain alphanumeric characters, underscores, dots and dashes", |
51 | 70 | "meta": ["control"] |
52 | 71 | }, |
53 | 72 | "control_replicate": { |
54 | | - "type": "integer", |
55 | | - "errorMessage": "Replicate id not an integer!", |
| 73 | + "anyOf": [ |
| 74 | + { |
| 75 | + "type": "integer", |
| 76 | + "minimum": 1 |
| 77 | + }, |
| 78 | + { |
| 79 | + "type": "string", |
| 80 | + "maxLength": 0 |
| 81 | + } |
| 82 | + ], |
| 83 | + "errorMessage": "Control replicate id must be a positive integer when specified", |
56 | 84 | "meta": ["control_replicate"] |
57 | 85 | } |
58 | 86 | }, |
59 | | - "required": ["sample", "fastq_1"] |
| 87 | + "required": ["sample", "fastq_1", "replicate"], |
| 88 | + "dependentRequired": { |
| 89 | + "antibody": ["control"], |
| 90 | + "control": ["antibody", "control_replicate"] |
| 91 | + } |
60 | 92 | } |
61 | 93 | } |
0 commit comments