Skip to content

Commit

Permalink
Merge pull request #16 from icgc-argo/ega-download-wf@0.1.1
Browse files Browse the repository at this point in the history
[release]
  • Loading branch information
edsu7 authored Aug 17, 2022
2 parents fd34289 + 5e3ec20 commit 4b2788a
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 38 deletions.
42 changes: 9 additions & 33 deletions ega-download-wf/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*/

nextflow.enable.dsl = 2
version = '0.1.0' // package version
version = '0.1.1'

// universal params go here, change default value as needed
params.container = ""
Expand All @@ -36,14 +36,13 @@ params.input_file = ""
params.cleanup = true

params.download_mode=""
params.files_to_download=[]
params.ids_to_download=[]
params.file_info_tsv="NO_FILE1"

params.ascp_scp_host=""
params.ascp_scp_user=""
params.aspera_scp_pass=""

params.c4gh_secret_key="NO_FILE"
params.c4gh_secret_key="NO_FILE2"
params.c4gh_pass_phrase=""

params.pyega3_ega_user=""
Expand All @@ -53,15 +52,11 @@ include { downloadPyega3 } from './wfpr_modules/github.com/icgc-argo/argo-data-s
include { downloadAspera } from './wfpr_modules/github.com/icgc-argo/argo-data-submission/download-aspera@0.1.0/main.nf' params([*:params, 'cleanup': false])
include { decryptAspera } from './wfpr_modules/github.com/icgc-argo/argo-data-submission/decrypt-aspera@0.1.0/main.nf' params([*:params, 'cleanup': false])

Channel.fromList(params.files_to_download).set{file_ch}
Channel.fromList(params.ids_to_download).set{id_ch}

// please update workflow code as needed
workflow EgaDownloadWf {
take: // update as needed
download_mode
files_to_download
ids_to_download
file_info_tsv
ascp_scp_host
ascp_scp_user
aspera_scp_pass
Expand All @@ -70,24 +65,13 @@ workflow EgaDownloadWf {
c4gh_secret_key
c4gh_pass_phrase
main: // update as needed

Channel.fromPath(file_info_tsv).splitCsv(sep:'\t',header:true).map( row -> row.path).set{file_ch}
Channel.fromPath(file_info_tsv).splitCsv(sep:'\t',header:true).map( row -> row.ega_file_id).set{id_ch}

if ( download_mode=='aspera' ){
if (id_ch.count()!=file_ch.count()){
println "# of ega_file_ids != # of file paths. Please Correct."
exit 1
}
else if (files_to_download.size()==0){
println "# of ega_file_ids != # of file paths. Please Correct."
exit 1
}
else if (ids_to_download.size()==0){
println "# of ega_file_ids != # of file paths. Please Correct."
exit 1
} else {
downloadAspera(
files_to_download,
ids_to_download,
file_ch,
id_ch,
ascp_scp_host,
ascp_scp_user,
aspera_scp_pass)
Expand All @@ -99,14 +83,7 @@ workflow EgaDownloadWf {
)

sequence_files=decryptAspera.out.output_files.collect()
}
} else if (download_mode=='pyega3'){

if (ids_to_download.size()==0){
println "# of ega_file_ids must be greater than 0. Please Correct."
exit 1
}

downloadPyega3(
id_ch,
pyega3_ega_user,
Expand All @@ -131,8 +108,7 @@ workflow EgaDownloadWf {
workflow {
EgaDownloadWf(
params.download_mode,
params.files_to_download,
params.ids_to_download,
params.file_info_tsv,
params.ascp_scp_host,
params.ascp_scp_user,
params.aspera_scp_pass,
Expand Down
2 changes: 1 addition & 1 deletion ega-download-wf/pkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ega-download-wf",
"version": "0.1.0",
"version": "0.1.1",
"description": "Workflow wrapper for various methods to download data from EGA-archive",
"main": "main.nf",
"deprecated": false,
Expand Down
2 changes: 1 addition & 1 deletion ega-download-wf/tests/checker.nf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*/

nextflow.enable.dsl = 2
version = '0.1.0' // package version
version = '0.1.1'

// universal params
params.publish_dir = ""
Expand Down
2 changes: 2 additions & 0 deletions ega-download-wf/tests/input/pyega3.tsv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ega_file_id path
EGAF00001770106 EGAF00001770106.bam
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"ids_to_download," : "EGAF00001770106",
"files_to_download," : "EGAF00001770106.bam",
"file_info_tsv" : "tests/input/pyega3.tsv",
"pyega3_ega_user" : "ega-test-data@ebi.ac.uk",
"pyega3_ega_pass" : "egarocks",
"download_mode" : "aspera",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"ids_to_download" : ["EGAF00001770106"],
"file_info_tsv" : "tests/input/pyega3.tsv",
"pyega3_ega_user" : "ega-test-data@ebi.ac.uk",
"pyega3_ega_pass" : "egarocks",
"download_mode" : "pyega3",
Expand Down

0 comments on commit 4b2788a

Please sign in to comment.