generated from Sage-Bionetworks-Challenges/model-to-data-challenge-workflow
-
Notifications
You must be signed in to change notification settings - Fork 2
/
create_submission_file.cwl
51 lines (43 loc) · 1.2 KB
/
create_submission_file.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
#!/usr/bin/env cwl-runner
#
# Create JSON submission file with submission Id
#
cwlVersion: v1.0
class: CommandLineTool
baseCommand: [ python3, create.py ]
hints:
DockerRequirement:
dockerPull: sagebionetworks/synapsepythonclient:v2.3.1
inputs:
- id: submissionid
type: int
inputBinding:
prefix: -i
- id: results
type: string
default: "submission.json"
inputBinding:
prefix: -r
- id: previous
type: boolean?
requirements:
- class: InlineJavascriptRequirement
- class: InitialWorkDirRequirement
listing:
- entryname: create.py
entry: |
#!/usr/bin/env python
import argparse
import json
parser = argparse.ArgumentParser()
parser.add_argument("-r", "--results", required=True, help="Scoring results")
parser.add_argument("-i", "--submissionid", required=True, help="Submission ID")
args = parser.parse_args()
submission_dict = {"submissionid": int(args.submissionid)}
with open(args.results, 'w') as json_file:
json_file.write(json.dumps(submission_dict))
outputs:
- id: submission_out
type: File
outputBinding:
glob: submission.json