generated from Sage-Bionetworks-Challenges/model-to-data-challenge-workflow
-
Notifications
You must be signed in to change notification settings - Fork 2
/
determine_annotator_type.cwl
46 lines (38 loc) · 1.22 KB
/
determine_annotator_type.cwl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env cwl-runner
#
# Maps evaluation id to annotator type
#
$namespaces:
s: https://schema.org/
s:author:
- class: s:Person
s:identifier: https://orcid.org/0000-0002-5841-0198
s:email: [email protected]
s:name: Thomas Yu
cwlVersion: v1.0
class: ExpressionTool
inputs:
- id: queue
type: string
outputs:
- id: annotator_type
type: string
requirements:
- class: InlineJavascriptRequirement
# No need to add in more queues other than the initial main queues
expression: |
${
if(inputs.queue == "9614658" || inputs.queue == "9614684"){
return {annotator_type: "nlpsandbox:location-annotator"};
} else if (inputs.queue == "9614652" || inputs.queue == "9614654"){
return {annotator_type: "nlpsandbox:date-annotator"};
} else if (inputs.queue == "9614657" || inputs.queue == "9614685"){
return {annotator_type: "nlpsandbox:person-name-annotator"};
} else if (inputs.queue == "9614797" || inputs.queue == "9614798"){
return {annotator_type: "nlpsandbox:id-annotator"};
} else if (inputs.queue == "9614799" || inputs.queue == "9614800"){
return {annotator_type: "nlpsandbox:contact-annotator"};
} else {
throw 'invalid queue';
}
}