Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync upstream with the final phase workflow updates #103

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions steps/email_results.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,22 @@ requirements:
if csv_full_id:
del annots['scoring']
subject = f"Submission to '{evaluation.name}' scored!"
# message = [
# f"Hello {name},\n\n",
# f"Your submission (id: {sub.id}) has been scored and below are the metric averages:\n\n",
# "\n".join([i + " : " + str(annots[i]) for i in annots]),
# "\n\n"
# ]
message = [
f"Hello {name},\n\n",
f"Your submission (id: {sub.id}) has been scored and below are the metric averages:\n\n",
"\n".join([i + " : " + str(annots[i]) for i in annots]),
f"Your submission (id: {sub.id}) has been scored, and the results will be posted here: https://www.synapse.org/Synapse:syn53065760/wiki/629528."
"\n\n"
]
if csv_full_id:
message.append(f"Your scoring report is available here: https://www.synapse.org/#!Synapse:{csv_id}")
# if csv_full_id:
# message.append(f"Your scoring report is available here: https://www.synapse.org/#!Synapse:{csv_id}")
# message.append(f"\nLegacy scores are available here: https://www.synapse.org/#!Synapse:{csv_full_id}")
else:
message.append(f"Your report is available here: https://www.synapse.org/#!Synapse:{csv_id}")
# else:
# message.append(f"Your report is available here: https://www.synapse.org/#!Synapse:{csv_id}")
message.append("\n\nSincerely,\nChallenge Administrator")
syn.sendMessage(
userIds=[participantid],
Expand Down
10 changes: 10 additions & 0 deletions steps/synapse_upload.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ requirements:
parser.add_argument("--discrepancy_file", required=True)
parser.add_argument("--scoring_file", required=True)
parser.add_argument("--score_value", required=True)
parser.add_argument("--compressed_file", required=True)
parser.add_argument("--synapse_config", required=True)
parser.add_argument("--parent_id", required=True)
args = parser.parse_args()
Expand Down Expand Up @@ -63,6 +64,11 @@ requirements:
score = syn.store(scoring)
results['score'] = data

# Add submitted file to synapse
submitted_file = synapseclient.File(args.compressed_file, parent=args.parent_id)
submitted_file = syn.store(submitted_file)
results['submitted_file'] = submitted_file.id

with open('results.json', 'w') as out:
json.dump(results, out)

Expand All @@ -73,6 +79,8 @@ inputs:
type: File
- id: score_value
type: File
- id: compressed_file
type: File
- id: parent_id
type: string
- id: synapse_config
Expand All @@ -93,6 +101,8 @@ arguments:
- valueFrom: $(inputs.scoring_results.path)
- valueFrom: --score_value
- valueFrom: $(inputs.score_value.path)
- valueFrom: --compressed_file
- valueFrom: $(inputs.compressed_file.path)
- valueFrom: --synapse_config
- valueFrom: $(inputs.synapse_config.path)
- valueFrom: --parent_id
Expand Down
13 changes: 7 additions & 6 deletions steps/test.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ outputs:
pixel_results:
type: File
outputBinding:
glob: 'results/MIDI_1_1_Testing/pixel_validation.xlsx'
glob: 'results/MIDI_1_1_Testing_Phase/pixel_validation.xlsx'

database_created:
type: File
outputBinding:
glob: 'results/MIDI_1_1_Testing/validation_results.db'
glob: 'results/MIDI_1_1_Testing_Phase/validation_results.db'

results:
type: File
Expand All @@ -48,29 +48,30 @@ outputs:
scoring_results:
type: File
outputBinding:
glob: 'results/MIDI_1_1_Testing/scoring_report_series.xlsx'
glob: 'results/MIDI_1_1_Testing_Phase/scoring_report_series.xlsx'

discrepancy_results:
type: File
outputBinding:
glob: 'results/MIDI_1_1_Testing/discrepancy_report_participant.csv'
glob: 'results/MIDI_1_1_Testing_Phase/discrepancy_report_participant.csv'

discrepancy_internal:
type: File
outputBinding:
glob: 'results/MIDI_1_1_Testing/discrepancy_report_internal.csv'
glob: 'results/MIDI_1_1_Testing_Phase/discrepancy_report_internal.csv'




baseCommand: ["/bin/bash", "-c"]
arguments:
- |
cp -r /usr/local/bin/MIDI_validation_script . && \ # copy inputs to the working dir
python /usr/local/bin/MIDI_validation_script/run_validation.py $(inputs.compressed_file.path) && \
python /usr/local/bin/MIDI_validation_script/run_reports.py $(inputs.compressed_file.path) # && \
# mkdir dciodvfy && \
# python /usr/local/bin/MIDI_validation_script/run_dciodvfy.py $(inputs.compressed_file.path)

hints:
DockerRequirement:
dockerPull: docker.synapse.org/syn53065762/validate_score:v12
dockerPull: docker.synapse.org/syn53065762/create_reports:v1.0.0
6 changes: 4 additions & 2 deletions workflow.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ steps:
- id: scoring_results
- id: discrepancy_results
- id: discrepancy_internal

notify_filepath_status:
doc: Notify participant if submission is not acceptable.
run: |-
Expand Down Expand Up @@ -181,10 +181,12 @@ steps:
source: "#create_scoring_report/scoring_results"
- id: score_value
source: "#get_score/results"
- id: compressed_file
source: "#download_submission/filepath"
- id: synapse_config # this input is needed so that uploading to Synapse is possible
source: "#synapseConfig"
- id: parent_id # this input is needed so that Synapse knows where to upload file
source: "#submitterUploadSynId"
source: "#adminUploadSynId"
out:
- id: results

Expand Down