update svdb merge (#1274)

* update svdb merge

* fix undefined variable error

* remove prio join in the script block

* fix error

* fix error again

* update tests and refactor
This commit is contained in:
Ramprasad Neethiraj 2022-02-24 09:49:30 +01:00 committed by GitHub
parent 1016c9bd1a
commit ee915a43e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 4 deletions

View file

@ -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

View file

@ -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, [] )
}

View file

@ -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