Skip to content

Commit 081ca04

Browse files
caroottkMutagene
authored andcommitted
Add cwl model
1 parent 76e9b62 commit 081ca04

5 files changed

Lines changed: 178 additions & 0 deletions

File tree

src/CWL/CWL.fs

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
namespace ARCtrl.CWL
2+
3+
open DynamicObj
4+
open CWLTypes
5+
open Requirements
6+
open Inputs
7+
open Outputs
8+
9+
module CWL =
10+
11+
type CWL (
12+
cwlVersion: string,
13+
cls: Class,
14+
outputs: Output [],
15+
?baseCommand: string [],
16+
?requirements: Requirement [],
17+
?hints: Requirement [],
18+
?inputs: Input []
19+
) =
20+
inherit DynamicObj ()
21+
22+
let mutable _cwlVersion: string = cwlVersion
23+
let mutable _class: Class = cls
24+
let mutable _outputs: Output [] = outputs
25+
let mutable _baseCommand: string [] option = baseCommand
26+
let mutable _requirements: Requirement [] option = requirements
27+
let mutable _hints: Requirement [] option = hints
28+
let mutable _inputs: Input [] option = inputs
29+
30+
member this.CWLVersion
31+
with get() = _cwlVersion
32+
and set(version) = _cwlVersion <- version
33+
34+
member this.Class
35+
with get() = _class
36+
and set(cls) = _class <- cls
37+
38+
member this.Outputs
39+
with get() = _outputs
40+
and set(outputs) = _outputs <- outputs
41+
42+
member this.BaseCommand
43+
with get() = _baseCommand
44+
and set(baseCommand) = _baseCommand <- baseCommand
45+
46+
member this.Requirements
47+
with get() = _requirements
48+
and set(requirements) = _requirements <- requirements
49+
50+
member this.Hints
51+
with get() = _hints
52+
and set(hints) = _hints <- hints
53+
54+
member this.Inputs
55+
with get() = _inputs
56+
and set(inputs) = _inputs <- inputs

src/CWL/CWLTypes.fs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
namespace ARCtrl.CWL
2+
3+
open DynamicObj
4+
5+
module CWLTypes =
6+
7+
type FileInstance () =
8+
inherit DynamicObj ()
9+
10+
type DirectoryInstance () =
11+
inherit DynamicObj ()
12+
13+
type DirentInstance = {
14+
// can be string or expression, but expression is string as well
15+
Entry: string
16+
Entryname: string option
17+
Writable: bool option
18+
}
19+
20+
type CWLType =
21+
| File of FileInstance
22+
| Directory of DirectoryInstance
23+
| Dirent of DirentInstance
24+
| String
25+
| Int
26+
| Long
27+
| Float
28+
| Double
29+
| Boolean
30+
| Stdout
31+
| Null
32+
| Array of CWLType
33+
34+
type Class =
35+
| Workflow
36+
| CommandLineTool
37+
| ExpressionTool

src/CWL/Inputs.fs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
namespace ARCtrl.CWL
2+
3+
open CWLTypes
4+
5+
module Inputs =
6+
7+
type InputBinding = {
8+
Prefix: string option
9+
Position: int option
10+
ItemSeparator: string option
11+
Separate: bool option
12+
}
13+
14+
type Input = {
15+
Name: string
16+
Type: CWLType
17+
InputBinding: InputBinding option
18+
}

src/CWL/Outputs.fs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
namespace ARCtrl.CWL
2+
3+
open CWLTypes
4+
5+
module Outputs =
6+
7+
type OutputBinding = {
8+
Glob: string option
9+
}
10+
11+
type Output = {
12+
Name: string
13+
Type: CWLType
14+
OutputBinding: OutputBinding option
15+
}
16+

src/CWL/Requirements.fs

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
namespace ARCtrl.CWL
2+
3+
open DynamicObj
4+
open CWLTypes
5+
6+
module Requirements =
7+
type DockerRequirement = {
8+
DockerPull: string option
9+
DockerFile: string option
10+
DockerImageId: string option
11+
}
12+
13+
type InputRecordSchema () =
14+
inherit DynamicObj ()
15+
16+
type InputEnumSchema () =
17+
inherit DynamicObj ()
18+
19+
type InputArraySchema () =
20+
inherit DynamicObj ()
21+
22+
type SchemaDefRequirementType =
23+
| InputRecordSchema of InputRecordSchema
24+
| InputEnumSchema of InputEnumSchema
25+
| InputArraySchema of InputArraySchema
26+
27+
type SoftwarePackage = {
28+
Package: string
29+
Version: string [] option
30+
Specs: string [] option
31+
}
32+
33+
type EnvironmentDef = {
34+
EnvName: string
35+
EnvValue: string
36+
}
37+
38+
type ResourceRequirementInstance () =
39+
inherit DynamicObj ()
40+
41+
type Requirement =
42+
| InlineJavascriptRequirement
43+
| SchemaDefRequirement of SchemaDefRequirementType []
44+
| DockerRequirement of DockerRequirement
45+
| SoftwareRequirement of SoftwarePackage []
46+
| InitialWorkDirRequirement of CWLType []
47+
| EnvVarRequirement of EnvironmentDef
48+
| ShellCommandRequirement
49+
| ResourceRequirement of ResourceRequirementInstance
50+
| NetworkAccessRequirement
51+

0 commit comments

Comments
 (0)