diff --git a/song-score-upload/main.nf b/song-score-upload/main.nf index ae19e4f..356e311 100755 --- a/song-score-upload/main.nf +++ b/song-score-upload/main.nf @@ -21,7 +21,7 @@ */ nextflow.enable.dsl = 2 -version = '2.6.1' +version = '2.7.0' // universal params go here, change default value as needed params.publish_dir = "" // set to empty string will disable publishDir @@ -33,6 +33,7 @@ params.first_retry_wait_time = 1 // in seconds params.study_id = "TEST-PR" params.payload = "NO_FILE" params.upload = [] +params.analysis_id = "" // optional, analysis must already exist and in UNPUBLISHED state if analysis_id provided params.api_token = "" @@ -81,16 +82,20 @@ workflow SongScoreUpload { study_id payload upload + analysis_id main: - // Create new analysis - songSub(study_id, payload) + if (!analysis_id) { + // Create new analysis + songSub(study_id, payload) + analysis_id = songSub.out + } // Generate file manifest for upload - songMan(study_id, songSub.out, upload.collect()) + songMan(study_id, analysis_id, upload.collect()) // Upload to SCORE - scoreUp(songSub.out, songMan.out, upload.collect()) + scoreUp(analysis_id, songMan.out, upload.collect()) // Publish the analysis songPub(study_id, scoreUp.out.ready_to_publish) @@ -107,6 +112,7 @@ workflow { SongScoreUpload( params.study_id, file(params.payload), - Channel.fromPath(params.upload) + Channel.fromPath(params.upload), + params.analysis_id ) } diff --git a/song-score-upload/pkg.json b/song-score-upload/pkg.json index 074ad43..572ad52 100644 --- a/song-score-upload/pkg.json +++ b/song-score-upload/pkg.json @@ -1,6 +1,6 @@ { "name": "song-score-upload", - "version": "2.6.1", + "version": "2.7.0", "description": "SONG/SCORE upload", "main": "main.nf", "deprecated": false, diff --git a/song-score-upload/tests/checker.nf b/song-score-upload/tests/checker.nf index 25c219b..59ff8df 100755 --- a/song-score-upload/tests/checker.nf +++ b/song-score-upload/tests/checker.nf @@ -35,6 +35,7 @@ params.first_retry_wait_time = 1 // in seconds params.study_id = "TEST-PR" params.payload = "NO_FILE" params.upload = [] +params.analysis_id = "" params.api_token = "" @@ -59,12 +60,14 @@ workflow checker { study_id payload upload + analysis_id main: SSUp( study_id, payload, - upload + upload, + analysis_id ) } @@ -74,6 +77,7 @@ workflow { checker( params.study_id, file(params.payload), - Channel.fromPath(params.upload) + Channel.fromPath(params.upload), + params.analysis_id ) }