This repository has been archived by the owner on Oct 12, 2023. It is now read-only.
generated from Sage-Bionetworks-Workflows/nf-model2data
-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.nf
43 lines (40 loc) · 2.28 KB
/
main.nf
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
// Find your tower s3 bucket and upload your input files into it
// The tower space is PHI safe
nextflow.enable.dsl = 2
// Synapse ID for Submission View
params.view_id = "syn51356905"
// Synapse ID for Input Data folder
params.input_id = "syn51390589"
// CPUs to dedicate to RUN_DOCKER
params.cpus = "4"
// Memory to dedicate to RUN_DOCKER
params.memory = "16.GB"
// import modules
include { SYNAPSE_STAGE } from './modules/synapse_stage.nf'
include { GET_SUBMISSIONS } from './modules/get_submissions.nf'
include { UPDATE_SUBMISSION_STATUS as UPDATE_SUBMISSION_STATUS_BEFORE_RUN } from './modules/update_submission_status.nf'
include { DOWNLOAD_SUBMISSION } from './modules/download_submission.nf'
include { UPDATE_SUBMISSION_STATUS as UPDATE_SUBMISSION_STATUS_AFTER_VALIDATE } from './modules/update_submission_status.nf'
include { UPDATE_SUBMISSION_STATUS as UPDATE_SUBMISSION_STATUS_AFTER_SCORE } from './modules/update_submission_status.nf'
include { VALIDATE } from './modules/validate.nf'
include { SCORE } from './modules/score.nf'
include { ANNOTATE_SUBMISSION as ANNOTATE_SUBMISSION_AFTER_VALIDATE } from './modules/annotate_submission.nf'
include { ANNOTATE_SUBMISSION as ANNOTATE_SUBMISSION_AFTER_SCORE } from './modules/annotate_submission.nf'
workflow {
// SYNAPSE_STAGE(params.input_id)
GET_SUBMISSIONS(params.view_id)
image_ch = GET_SUBMISSIONS.output
.splitCsv(header:true)
.map { row -> tuple(row.submission_id, row.image_id) }
UPDATE_SUBMISSION_STATUS_BEFORE_RUN(image_ch.map { tuple(it[0], "EVALUATION_IN_PROGRESS") })
// TOOD: Need to add download submission module
DOWNLOAD_SUBMISSION(image_ch.map {it[0]})
// RUN_DOCKER(image_ch, SYNAPSE_STAGE.output, params.cpus, params.memory, UPDATE_SUBMISSION_STATUS_BEFORE_RUN.output)
// UPDATE_SUBMISSION_STATUS_AFTER_RUN(RUN_DOCKER.output.map { tuple(it[0], "ACCEPTED") })
VALIDATE(DOWNLOAD_SUBMISSION.output, "ready")
UPDATE_SUBMISSION_STATUS_AFTER_VALIDATE(VALIDATE.output.map { tuple(it[0], it[2]) })
ANNOTATE_SUBMISSION_AFTER_VALIDATE(VALIDATE.output)
SCORE(VALIDATE.output, UPDATE_SUBMISSION_STATUS_AFTER_VALIDATE.output, ANNOTATE_SUBMISSION_AFTER_VALIDATE.output)
UPDATE_SUBMISSION_STATUS_AFTER_SCORE(SCORE.output.map { tuple(it[0], it[2]) })
ANNOTATE_SUBMISSION_AFTER_SCORE(SCORE.output)
}