diff --git a/modules/svdb/merge/main.nf b/modules/svdb/merge/main.nf index 1f479ea4..505e2c0b 100644 --- a/modules/svdb/merge/main.nf +++ b/modules/svdb/merge/main.nf @@ -21,15 +21,19 @@ process SVDB_MERGE { script: def args = task.ext.args ?: '' def prefix = task.ext.prefix ?: "${meta.id}" - def input = "" - for (int index = 0; index < vcfs.size(); index++) { - input += " ${vcfs[index]}:${priority[index]}" + def input = "${vcfs.join(" ")}" + def prio = "" + if(priority) { + prio = "--priority ${priority.join(',')}" + for (int index = 0; index < vcfs.size(); index++) { + input += " ${vcfs[index]}:${priority[index]}" + } } """ svdb \\ --merge \\ $args \\ - --priority ${priority.join(',')} \\ + $prio \\ --vcf $input \\ > ${prefix}_sv_merge.vcf diff --git a/tests/modules/svdb/merge/main.nf b/tests/modules/svdb/merge/main.nf index f417c3f7..3cbb4b44 100644 --- a/tests/modules/svdb/merge/main.nf +++ b/tests/modules/svdb/merge/main.nf @@ -14,3 +14,13 @@ workflow test_svdb_merge { SVDB_MERGE ( input, priority ) } + +workflow test_svdb_merge_noprio { + + input = [ [ id:'test' ], // meta map + [ file(params.test_data['sarscov2']['illumina']['test_vcf'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test2_vcf'], checkIfExists: true) ] + ] + + SVDB_MERGE ( input, [] ) +} diff --git a/tests/modules/svdb/merge/test.yml b/tests/modules/svdb/merge/test.yml index 8d16562f..46c4fef0 100644 --- a/tests/modules/svdb/merge/test.yml +++ b/tests/modules/svdb/merge/test.yml @@ -5,3 +5,10 @@ - svdb/merge files: - path: output/svdb/test_sv_merge.vcf +- name: svdb merge noprio + command: nextflow run ./tests/modules/svdb/merge -entry test_svdb_merge_noprio -c ./tests/config/nextflow.config -c ./tests/modules/svdb/merge/nextflow.config + tags: + - svdb + - svdb/merge + files: + - path: output/svdb/test_sv_merge.vcf