generated from Sage-Bionetworks-Challenges/data-to-model-challenge-workflow
-
Notifications
You must be signed in to change notification settings - Fork 1
/
workflow.cwl
186 lines (170 loc) · 5.35 KB
/
workflow.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
#!/usr/bin/env cwl-runner
cwlVersion: v1.0
class: Workflow
label: <YOUR CHALLENGE> Evaluation
doc: >
BRIEF DESCRIPTION ABOUT THE CHALLENGE, e.g.
This workflow will run and evaluate Docker submissions to the
Awesome Challenge (syn123). Metrics returned are x, y, z.
requirements:
- class: StepInputExpressionRequirement
inputs:
submissionId:
label: Submission ID
type: int
submitterUploadSynId:
label: Synapse Folder ID accessible by the submitter
type: string
synapseConfig:
label: filepath to .synapseConfig file
type: File
outputs: {}
steps:
set_submitter_folder_permissions:
run: https://raw.githubusercontent.com/Sage-Bionetworks/ChallengeWorkflowTemplates/v3.1/cwl/set_permissions.cwl
in:
- id: entityid
source: "#submitterUploadSynId"
- id: principalid
valueFrom: "3477032"
- id: permissions
valueFrom: "download"
- id: synapse_config
source: "#synapseConfig"
out: []
download_submission:
run: https://raw.githubusercontent.com/Sage-Bionetworks/ChallengeWorkflowTemplates/v3.1/cwl/get_submission.cwl
in:
- id: submissionid
source: "#submissionId"
- id: synapse_config
source: "#synapseConfig"
out:
- id: filepath
- id: docker_repository
- id: docker_digest
- id: entity_id
- id: evaluation_id
- id: entity_type
- id: results
download_goldstandard:
run: https://raw.githubusercontent.com/Sage-Bionetworks-Workflows/cwl-tool-synapseclient/v1.4/cwl/synapse-get-tool.cwl
in:
# TODO: replace `valueFrom` with the Synapse ID to the challenge goldstandard
- id: synapseid
valueFrom: "syn53645141"
- id: synapse_config
source: "#synapseConfig"
out:
- id: filepath
validate:
run: steps/validate.cwl
in:
- id: evaluation_id
source: "#download_submission/evaluation_id"
- id: input_file
source: "#download_submission/filepath"
- id: validate_script
default:
class: File
location: "scripts/validate.py"
out:
- id: results
- id: status
- id: invalid_reasons
email_validation:
run: https://raw.githubusercontent.com/Sage-Bionetworks/ChallengeWorkflowTemplates/v3.1/cwl/validate_email.cwl
in:
- id: submissionid
source: "#submissionId"
- id: synapse_config
source: "#synapseConfig"
- id: status
source: "#validate/status"
- id: invalid_reasons
source: "#validate/invalid_reasons"
# OPTIONAL: set `default` to `false` if email notification about valid submission is needed
- id: errors_only
default: true
out: [finished]
annotate_validation_with_output:
run: https://raw.githubusercontent.com/Sage-Bionetworks/ChallengeWorkflowTemplates/v3.1/cwl/annotate_submission.cwl
in:
- id: submissionid
source: "#submissionId"
- id: annotation_values
source: "#validate/results"
- id: to_public
default: true
- id: force
default: true
- id: synapse_config
source: "#synapseConfig"
out: [finished]
check_status:
run: https://raw.githubusercontent.com/Sage-Bionetworks/ChallengeWorkflowTemplates/v3.1/cwl/check_status.cwl
in:
- id: status
source: "#validate/status"
- id: previous_annotation_finished
source: "#annotate_validation_with_output/finished"
- id: previous_email_finished
source: "#email_validation/finished"
out: [finished]
score:
run: steps/score.cwl
in:
- id: evaluation_id
source: "#download_submission/evaluation_id"
- id: input_file
source: "#download_submission/filepath"
- id: groundtruth_path
source: "#download_goldstandard/filepath"
# valueFrom: "/home/ec2-user/challenge-data/TestingData"
# valueFrom: "/Users/rchai/DREAM/Dynamic-AI/Data/TestingData"
- id: score_script
default:
class: File
location: "scripts/score.py"
out:
- id: results
- id: status
email_score:
run: steps/email_scores.cwl
in:
- id: submissionid
source: "#submissionId"
- id: synapse_config
source: "#synapseConfig"
- id: results
source: "#score/results"
# OPTIONAL: add annotations to be withheld from participants to `[]`
# - id: private_annotations
# default: []
out: [finished]
annotate_submission_with_output:
run: https://raw.githubusercontent.com/Sage-Bionetworks/ChallengeWorkflowTemplates/v3.1/cwl/annotate_submission.cwl
in:
- id: submissionid
source: "#submissionId"
- id: annotation_values
source: "#score/results"
- id: to_public
default: true
- id: force
default: true
- id: synapse_config
source: "#synapseConfig"
- id: previous_annotation_finished
source: "#annotate_validation_with_output/finished"
out: [finished]
check_score_status:
run: https://raw.githubusercontent.com/Sage-Bionetworks/ChallengeWorkflowTemplates/v3.1/cwl/check_status.cwl
in:
- id: status
source: "#score/status"
- id: previous_annotation_finished
source: "#annotate_submission_with_output/finished"
- id: previous_email_finished
source: "#email_score/finished"
out: [finished]