-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6a8269c
commit bd441fb
Showing
3 changed files
with
244 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
#!/usr/bin/env cwl-runner | ||
# | ||
# Main workflow. Runs through synthetic data and submits to internal queue | ||
# Inputs: | ||
# submissionId: ID of the Synapse submission to process | ||
# adminUploadSynId: ID of a folder accessible only to the submission queue administrator | ||
# submitterUploadSynId: ID of a folder accessible to the submitter | ||
# workflowSynapseId: ID of the Synapse entity containing a reference to the workflow file(s) | ||
# | ||
cwlVersion: v1.0 | ||
class: Workflow | ||
|
||
requirements: | ||
- class: StepInputExpressionRequirement | ||
|
||
inputs: | ||
- id: submissionId | ||
type: int | ||
- id: adminUploadSynId | ||
type: string | ||
- id: submitterUploadSynId | ||
type: string | ||
- id: workflowSynapseId | ||
type: string | ||
- id: synapseConfig | ||
type: File | ||
|
||
# there are no output at the workflow engine level. Everything is uploaded to Synapse | ||
outputs: [] | ||
|
||
steps: | ||
create_adminsynid_json: | ||
run: create_adminsynid_annotation.cwl | ||
in: | ||
- id: admin_synid | ||
source: "#adminUploadSynId" | ||
out: [json_out] | ||
|
||
annotate_adminsynid: | ||
run: https://raw.githubusercontent.com/Sage-Bionetworks/ChallengeWorkflowTemplates/v2.5/annotate_submission.cwl | ||
in: | ||
- id: submissionid | ||
source: "#submissionId" | ||
- id: annotation_values | ||
source: "#create_adminsynid_json/json_out" | ||
- id: to_public | ||
default: true | ||
- id: force_change_annotation_acl | ||
default: true | ||
- id: synapse_config | ||
source: "#synapseConfig" | ||
out: [finished] | ||
|
||
set_permissions: | ||
run: https://raw.githubusercontent.com/Sage-Bionetworks/ChallengeWorkflowTemplates/v2.5/set_permissions.cwl | ||
in: | ||
- id: entityid | ||
source: "#submitterUploadSynId" | ||
- id: principalid | ||
valueFrom: "3407544" | ||
- id: permissions | ||
valueFrom: "download" | ||
- id: synapse_config | ||
source: "#synapseConfig" | ||
out: [] | ||
|
||
get_docker_submission: | ||
run: https://raw.githubusercontent.com/Sage-Bionetworks/ChallengeWorkflowTemplates/v2.5/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: entity_type | ||
- id: results | ||
|
||
validate_json: | ||
run: validate_main_submission.cwl | ||
in: | ||
- id: submission | ||
source: "#get_docker_submission/filepath" | ||
- id: synapse_config | ||
source: "#synapseConfig" | ||
out: | ||
- id: results | ||
- id: status | ||
- id: invalid_reasons | ||
- id: docker_repository | ||
- id: docker_digest | ||
|
||
check_status: | ||
run: https://raw.githubusercontent.com/Sage-Bionetworks/ChallengeWorkflowTemplates/v2.5/check_status.cwl | ||
in: | ||
- id: status | ||
source: "#validate_json/status" | ||
- id: previous_annotation_finished | ||
source: "#annotate_docker_validation_with_output/finished" | ||
- id: previous_email_finished | ||
source: "#validate_json_email/finished" | ||
out: [finished] | ||
|
||
get_docker_config: | ||
run: https://raw.githubusercontent.com/Sage-Bionetworks/ChallengeWorkflowTemplates/v2.5/get_docker_config.cwl | ||
in: | ||
- id: synapse_config | ||
source: "#synapseConfig" | ||
out: | ||
- id: docker_registry | ||
- id: docker_authentication | ||
|
||
archive_docker: | ||
run: archive_docker.cwl | ||
in: | ||
- id: previous_step | ||
source: "#check_status/finished" | ||
- id: docker_repository | ||
source: "#validate_json/docker_repository" | ||
- id: docker_digest | ||
source: "#validate_json/docker_digest" | ||
- id: submissionid | ||
source: "#submissionId" | ||
- id: docker_registry | ||
source: "#get_docker_config/docker_registry" | ||
- id: docker_authentication | ||
source: "#get_docker_config/docker_authentication" | ||
- id: status | ||
source: "#validate_json/status" | ||
#- id: parentid | ||
# valueFrom: "syn21905730" | ||
- id: synapse_config | ||
source: "#synapseConfig" | ||
out: | ||
- id: results | ||
- id: archived_docker | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
synapser::synLogin() | ||
|
||
devtools::source_url( | ||
"https://raw.githubusercontent.com/Sage-Bionetworks/synapse_tidy_utils/master/utils.R" | ||
) | ||
|
||
"select * from syn21822681 where objectId = 0" %>% | ||
query_synapse_table(row_data = T) %>% | ||
synapser::synDelete() | ||
|
||
"select * from syn21822682 where objectId = 0" %>% | ||
query_synapse_table(row_data = T) %>% | ||
synapser::synDelete() | ||
|
||
coarse <- "coarse_results.json" %>% | ||
jsonlite::read_json() %>% | ||
purrr::pluck("annotation_string") %>% | ||
stringr::str_split(";") %>% | ||
unlist() %>% | ||
dplyr::tibble("result" = .) %>% | ||
tidyr::separate("result", into = c("result", "metric_value"), sep = ":") %>% | ||
tidyr::separate("result", into = c("dataset", "celltype", "metric"), sep = "_", fill = "left") %>% | ||
dplyr::mutate( | ||
"celltype" = dplyr::if_else( | ||
is.na(.data$celltype), | ||
"Grand mean", | ||
.data$celltype | ||
), | ||
"dataset" = dplyr::if_else( | ||
.data$celltype == "Grand mean", | ||
"Grand mean", | ||
.data$dataset | ||
), | ||
"dataset" = dplyr::if_else( | ||
is.na(.data$dataset), | ||
"Celltype mean", | ||
.data$dataset | ||
) | ||
) %>% | ||
dplyr::mutate( | ||
"objectId" = 0L, | ||
"submitterId" = 3360851L, | ||
"repo_name" = "baseline_method7", | ||
"submitter" = "andrewelamb", | ||
"is_latest" = T, | ||
"metric_value" = as.numeric(.data$metric_value) | ||
) %>% | ||
synapser::Table("syn21822681", .) %>% | ||
synapser::synStore() | ||
|
||
fine <- "fine_results.json" %>% | ||
jsonlite::read_json() %>% | ||
purrr::pluck("annotation_string") %>% | ||
stringr::str_split(";") %>% | ||
unlist() %>% | ||
dplyr::tibble("result" = .) %>% | ||
tidyr::separate("result", into = c("result", "metric_value"), sep = ":") %>% | ||
tidyr::separate("result", into = c("dataset", "celltype", "metric"), sep = "_", fill = "left") %>% | ||
dplyr::mutate( | ||
"celltype" = dplyr::if_else( | ||
is.na(.data$celltype), | ||
"Grand mean", | ||
.data$celltype | ||
), | ||
"dataset" = dplyr::if_else( | ||
.data$celltype == "Grand mean", | ||
"Grand mean", | ||
.data$dataset | ||
), | ||
"dataset" = dplyr::if_else( | ||
is.na(.data$dataset), | ||
"Celltype mean", | ||
.data$dataset | ||
) | ||
) %>% | ||
dplyr::mutate( | ||
"objectId" = 0L, | ||
"submitterId" = 3360851L, | ||
"repo_name" = "baseline_method7", | ||
"submitter" = "andrewelamb", | ||
"is_latest" = T, | ||
"metric_value" = as.numeric(.data$metric_value) | ||
) %>% | ||
synapser::Table("syn21822682", .) %>% | ||
synapser::synStore() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters