Skip to content

Commit af397b6

Browse files
author
Alan Christie
committed
feat: New schema to cover variables (majority of features)
1 parent 04ac548 commit af397b6

8 files changed

+4422
-0
lines changed

decoder/job-definition-schema.yaml

Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ definitions:
9595
type: string
9696
minLength: 1
9797
maxLength: 4096
98+
variables:
99+
$ref: '#/definitions/job-variables'
98100
tests:
99101
$ref: '#/definitions/job-test'
100102
replaces:
@@ -415,6 +417,197 @@ definitions:
415417
- type: boolean
416418
additionalProperties: false
417419

420+
# Job Variables.
421+
# Consists of inputs, options and variables (not are required)
422+
job-variables:
423+
type: object
424+
additionalProperties: false
425+
properties:
426+
inputs:
427+
$ref: '#/definitions/job-input-variables'
428+
options:
429+
$ref: '#/definitions/job-option-variables'
430+
order:
431+
$ref: '#/definitions/job-order-variables'
432+
outputs:
433+
$ref: '#/definitions/job-output-variables'
434+
435+
# Variable ordering (inputs, options, outputs)
436+
job-order-variables:
437+
type: object
438+
additionalProperties: false
439+
properties:
440+
inputs:
441+
type: array
442+
items:
443+
type: string
444+
options:
445+
type: array
446+
items:
447+
type: string
448+
outputs:
449+
type: array
450+
items:
451+
type: string
452+
453+
# Variables (inputs)
454+
job-input-variables:
455+
type: object
456+
additionalProperties: false
457+
properties:
458+
type:
459+
type: string
460+
enum:
461+
- object
462+
required:
463+
type: array
464+
items:
465+
type: string
466+
properties:
467+
$ref: '#/definitions/job-input-properties'
468+
required:
469+
- type
470+
- properties
471+
472+
job-input-properties:
473+
type: object
474+
additionalProperties: false
475+
patternProperties:
476+
'^[a-zA-Z]{1}[a-zA-Z0-9-_]{0,79}$':
477+
$ref: '#/definitions/job-input-property'
478+
479+
job-input-property:
480+
type: object
481+
additionalProperties: false
482+
properties:
483+
title:
484+
type: string
485+
mime-types:
486+
type: array
487+
items:
488+
type: string
489+
type:
490+
type: string
491+
enum:
492+
- file
493+
- molecules-smi
494+
multiple:
495+
type: boolean
496+
required:
497+
- title
498+
- type
499+
500+
# Variables (outputs)
501+
job-output-variables:
502+
type: object
503+
additionalProperties: false
504+
properties:
505+
type:
506+
type: string
507+
enum:
508+
- object
509+
properties:
510+
$ref: '#/definitions/job-output-properties'
511+
required:
512+
- type
513+
- properties
514+
515+
job-output-properties:
516+
type: object
517+
additionalProperties: false
518+
patternProperties:
519+
'^[a-zA-Z]{1}[a-zA-Z0-9-_]{0,79}$':
520+
$ref: '#/definitions/job-output-property'
521+
522+
job-output-property:
523+
type: object
524+
additionalProperties: false
525+
properties:
526+
title:
527+
type: string
528+
mime-types:
529+
type: array
530+
items:
531+
type: string
532+
creates:
533+
type: string
534+
type:
535+
type: string
536+
enum:
537+
- file
538+
annotation-properties:
539+
type: object
540+
additionalProperties: true
541+
required:
542+
- title
543+
- creates
544+
- type
545+
546+
# Variables (options)
547+
job-option-variables:
548+
type: object
549+
additionalProperties: false
550+
properties:
551+
type:
552+
type: string
553+
enum:
554+
- object
555+
required:
556+
type: array
557+
items:
558+
type: string
559+
properties:
560+
$ref: '#/definitions/job-option-properties'
561+
required:
562+
- type
563+
- properties
564+
565+
job-option-properties:
566+
type: object
567+
additionalProperties: false
568+
patternProperties:
569+
'^[a-zA-Z]{1}[a-zA-Z0-9-_]{0,79}$':
570+
$ref: '#/definitions/job-option-property'
571+
572+
job-option-property:
573+
type: object
574+
additionalProperties: false
575+
properties:
576+
title:
577+
type: string
578+
type:
579+
type: string
580+
enum:
581+
- string
582+
- integer
583+
- number
584+
- boolean
585+
- array
586+
pattern:
587+
type: string
588+
minimum:
589+
type: number
590+
maximum:
591+
type: number
592+
default:
593+
oneOf:
594+
- type: string
595+
- type: number
596+
- type: boolean
597+
enum:
598+
type: array
599+
items:
600+
anyOf:
601+
- type: string
602+
- type: number
603+
- type: boolean
604+
items:
605+
type: object
606+
additionalProperties: true
607+
required:
608+
- title
609+
- type
610+
418611
# An individual Test.
419612
# Consists of a identity (i.e. 'test-filter-molecules')
420613
# followed by a Test object.

example-definitions/bad/README.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Any '.yaml' files here are expected NOT to comply with the Job Definition schema
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Any '.yaml' files here are expected to comply with the Job Definition schema
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
---
2+
kind: DataManagerJobDefinition
3+
kind-version: '2021.1'
4+
name: DMPK tools
5+
collection: im-dmpk
6+
7+
jobs:
8+
pk-tmax-cmax-sim:
9+
name: Estimation of absorption
10+
description: >-
11+
Estimation of absorption from t1/2 and Tmax after po administration (one-compartment)
12+
version: '1.0.0'
13+
category: dmpk
14+
keywords:
15+
- dmpk
16+
- absorption
17+
- cmax
18+
- kel
19+
image:
20+
name: informaticsmatters/vs-dmpk
21+
tag: 'stable'
22+
project-directory: /data
23+
working-directory: /data
24+
fix-permissions: true
25+
command: >-
26+
python -m dmpk.pk_tmax_cmax_sim
27+
--half-life {{ halfLife }}
28+
--absorption {{ absorption }}
29+
--dose {{ dose }}
30+
--auc {{ auc }}
31+
--time {{ time }}
32+
--output '{{ outputBaseName }}'
33+
{% if plotWidth is defined %}--plot-width {{ plotWidth }}{% endif %}
34+
{% if plotHeight is defined %}--plot-height {{ plotHeight }}{% endif %}
35+
{% if fontSize is defined %}--font-size {{ fontSize }}{% endif %}
36+
variables:
37+
order:
38+
options:
39+
- outputBaseName
40+
- halfLife
41+
- absorption
42+
- dose
43+
- auc
44+
- time
45+
- plotWidth
46+
- plotHeight
47+
- fontSize
48+
outputs:
49+
type: object
50+
properties:
51+
pngFile:
52+
title: PNG file
53+
mime-types:
54+
- image/png
55+
creates: '{{ outputBaseName }}.png'
56+
type: file
57+
txtFile:
58+
title: Text file
59+
mime-types:
60+
- text/plain
61+
creates: '{{ outputBaseName }}.txt'
62+
type: file
63+
options:
64+
type: object
65+
required:
66+
- outputBaseName
67+
- halfLife
68+
- absorption
69+
- dose
70+
- auc
71+
- time
72+
properties:
73+
outputBaseName:
74+
title: Output file base name
75+
type: string
76+
pattern: "^[A-Za-z0-9_/\\.\\-]+$"
77+
default: output
78+
halfLife:
79+
title: Half life (hours)
80+
type: number
81+
absorption:
82+
title: Half life absorption (hours)
83+
type: number
84+
dose:
85+
title: Initial dose (mg)
86+
type: number
87+
auc:
88+
title: AUC (mg/L*hr)
89+
type: number
90+
time:
91+
title: Time (h)
92+
type: number
93+
plotWidth:
94+
title: Plot width (inches)
95+
type: integer
96+
default: 10
97+
plotHeight:
98+
title: Plot height (inches)
99+
type: integer
100+
default: 4
101+
fontSize:
102+
title: Find size (points)
103+
type: integer
104+
default: 12
105+
tests:
106+
simple-execution:
107+
options:
108+
outputBaseName: foo/output
109+
halfLife: 0.79
110+
absorption: 0.5
111+
dose: 0.14
112+
auc: 0.88
113+
time: 8
114+
plotWidth: 10
115+
plotHeight: 4
116+
checks:
117+
exitCode: 0
118+
outputs:
119+
- name: foo/output.png
120+
checks:
121+
- exists: true
122+
- name: foo/output.txt
123+
checks:
124+
- exists: true
125+
- lineCount: 12

0 commit comments

Comments
 (0)