From 5297d27fbf50b7aa5a37cce9b85c7aac3ff7c4ff Mon Sep 17 00:00:00 2001 From: Ramprasad Neethiraj <20065894+ramprasadn@users.noreply.github.com> Date: Mon, 21 Mar 2022 10:39:34 +0100 Subject: [PATCH] update svdb to version 2.5.2 (#1390) * update svdb version and tests * update link --- modules/svdb/merge/main.nf | 6 +-- modules/svdb/query/main.nf | 55 ++++++++++++++++++++---- modules/svdb/query/meta.yml | 14 +++++- tests/config/test_data.config | 1 + tests/modules/svdb/query/main.nf | 26 ++++++++++- tests/modules/svdb/query/nextflow.config | 4 -- tests/modules/svdb/query/test.yml | 10 ++++- 7 files changed, 97 insertions(+), 19 deletions(-) diff --git a/modules/svdb/merge/main.nf b/modules/svdb/merge/main.nf index 505e2c0b..58aef652 100644 --- a/modules/svdb/merge/main.nf +++ b/modules/svdb/merge/main.nf @@ -2,10 +2,10 @@ process SVDB_MERGE { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::svdb=2.5.0" : null) + conda (params.enable_conda ? "bioconda::svdb=2.5.2" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/svdb:2.5.0--py39hcbe4a3b_0': - 'quay.io/biocontainers/svdb:2.5.0--py39hcbe4a3b_0' }" + 'https://depot.galaxyproject.org/singularity/svdb:2.5.2--py39h5371cbf_0': + 'quay.io/biocontainers/svdb:2.5.2--py39h5371cbf_0' }" input: tuple val(meta), path(vcfs) diff --git a/modules/svdb/query/main.nf b/modules/svdb/query/main.nf index 292fe4ce..37ce432c 100644 --- a/modules/svdb/query/main.nf +++ b/modules/svdb/query/main.nf @@ -2,36 +2,73 @@ process SVDB_QUERY { tag "$meta.id" label 'process_medium' - conda (params.enable_conda ? "bioconda::svdb=2.5.0" : null) + conda (params.enable_conda ? "bioconda::svdb=2.5.2" : null) container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? - 'https://depot.galaxyproject.org/singularity/svdb:2.5.0--py39hcbe4a3b_0': - 'quay.io/biocontainers/svdb:2.5.0--py39hcbe4a3b_0' }" + 'https://depot.galaxyproject.org/singularity/svdb:2.5.2--py39h5371cbf_0': + 'quay.io/biocontainers/svdb:2.5.2--py39h5371cbf_0' }" input: tuple val(meta), path(vcf) - path (vcf_db) + val(in_occs) + val(in_frqs) + val(out_occs) + val(out_frqs) + path (vcf_dbs) output: - tuple val(meta), path("*_ann_svdbq.vcf"), emit: vcf + tuple val(meta), path("*_query.vcf"), emit: vcf path "versions.yml" , emit: versions when: task.ext.when == null || task.ext.when script: - def args = task.ext.args ?: '' - def prefix = task.ext.prefix ?: "${meta.id}" + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def in_occ = "" + def in_frq = "" + def out_occ = "" + def out_frq = "" + if (in_occs) { + in_occ = "--in_occ ${in_occs.join(',')}" + } + if (in_frqs) { + in_frq = "--in_frq ${in_frqs.join(',')}" + } + if (out_occs) { + out_occ = "--out_occ ${out_occs.join(',')}" + } + if (out_frqs) { + out_frq = "--out_frq ${out_frqs.join(',')}" + } + """ svdb \\ --query \\ + $in_occ \\ + $in_frq \\ + $out_occ \\ + $out_frq \\ $args \\ - --db $vcf_db \\ + --db ${vcf_dbs.join(',')} \\ --query_vcf $vcf \\ - >${prefix}_ann_svdbq.vcf + --prefix ${prefix} cat <<-END_VERSIONS > versions.yml "${task.process}": svdb: \$( echo \$(svdb) | head -1 | sed 's/usage: SVDB-\\([0-9]\\.[0-9]\\.[0-9]\\).*/\\1/' ) END_VERSIONS """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + """ + touch ${prefix}_query.vcf + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + svdb: \$( echo \$(svdb) | head -1 | sed 's/usage: SVDB-\\([0-9]\\.[0-9]\\.[0-9]\\).*/\\1/' ) + END_VERSIONS + """ + } diff --git a/modules/svdb/query/meta.yml b/modules/svdb/query/meta.yml index e2a9e456..57e67e15 100644 --- a/modules/svdb/query/meta.yml +++ b/modules/svdb/query/meta.yml @@ -15,6 +15,12 @@ input: description: | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] + - in_occs: + type: list + description: A list of allele count tags + - in_frqs: + type: list + description: A list of allele frequency tags - vcf: type: file description: query vcf file @@ -34,10 +40,16 @@ output: type: file description: File containing software versions pattern: "versions.yml" + - out_occs: + type: list + description: A list of allele count tags + - out_frqs: + type: list + description: A list of allele frequency tags - vcf: type: file description: Annotated output VCF file - pattern: "*_ann_svdbq.vcf" + pattern: "*_query.vcf" authors: - "@ramprasadn" diff --git a/tests/config/test_data.config b/tests/config/test_data.config index 0d61d1e9..45732f47 100644 --- a/tests/config/test_data.config +++ b/tests/config/test_data.config @@ -140,6 +140,7 @@ params { syntheticvcf_short_vcf_gz_tbi = "${test_data_dir}/genomics/homo_sapiens/genome/vcf/syntheticvcf_short.vcf.gz.tbi" syntheticvcf_short_score = "${test_data_dir}/genomics/homo_sapiens/genome/vcf/syntheticvcf_short.score" gnomad_r2_1_1_sv_vcf_gz = "${test_data_dir}/genomics/homo_sapiens/genome/vcf/gnomAD.r2.1.1-sv.vcf.gz" + gnomad2_r2_1_1_sv_vcf_gz = "${test_data_dir}/genomics/homo_sapiens/genome/vcf/gnomAD2.r2.1.1-sv.vcf.gz" hapmap_3_3_hg38_21_vcf_gz = "${test_data_dir}/genomics/homo_sapiens/genome/chr21/germlineresources/hapmap_3.3.hg38.vcf.gz" hapmap_3_3_hg38_21_vcf_gz_tbi = "${test_data_dir}/genomics/homo_sapiens/genome/chr21/germlineresources/hapmap_3.3.hg38.vcf.gz.tbi" diff --git a/tests/modules/svdb/query/main.nf b/tests/modules/svdb/query/main.nf index 972f99e1..c014320f 100644 --- a/tests/modules/svdb/query/main.nf +++ b/tests/modules/svdb/query/main.nf @@ -14,5 +14,29 @@ workflow test_svdb_query { file(params.test_data['homo_sapiens']['genome']['gnomad_r2_1_1_sv_vcf_gz'], checkIfExists: true) ] - SVDB_QUERY ( input, vcf_db ) + in_occs = ['AC'] + in_frqs = ['AF'] + out_occs = ['gnomad_svAC'] + out_frqs = ['gnomad_svAF'] + + SVDB_QUERY ( input, in_occs, in_frqs, out_occs, out_frqs, vcf_db ) +} + +workflow test_svdb_query_multiple { + + input = [ [ id:'test' ], // meta map + [ file(params.test_data['homo_sapiens']['illumina']['test_sv_vcf'], checkIfExists: true) ] + ] + + vcf_db = [ + file(params.test_data['homo_sapiens']['genome']['gnomad_r2_1_1_sv_vcf_gz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['genome']['gnomad2_r2_1_1_sv_vcf_gz'], checkIfExists: true) + ] + + in_occs = ['AC','AC'] + in_frqs = ['AF','AF'] + out_occs = ['gnomad_svAC','gnomad_svAC'] + out_frqs = ['gnomad_svAF','gnomad_svAF'] + + SVDB_QUERY ( input, in_occs, in_frqs, out_occs, out_frqs, vcf_db ) } diff --git a/tests/modules/svdb/query/nextflow.config b/tests/modules/svdb/query/nextflow.config index 2a6c9d90..8730f1c4 100644 --- a/tests/modules/svdb/query/nextflow.config +++ b/tests/modules/svdb/query/nextflow.config @@ -2,8 +2,4 @@ process { publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } - withName: SVDB_QUERY { - ext.args = '--in_occ AC --out_occ gnomad_svAC --in_frq AF --out_frq gnomad_svAF' - } - } diff --git a/tests/modules/svdb/query/test.yml b/tests/modules/svdb/query/test.yml index b95ecafe..a7cbe3a6 100644 --- a/tests/modules/svdb/query/test.yml +++ b/tests/modules/svdb/query/test.yml @@ -4,4 +4,12 @@ - svdb - svdb/query files: - - path: output/svdb/test_ann_svdbq.vcf + - path: output/svdb/test_query.vcf + +- name: svdb query multiple + command: nextflow run ./tests/modules/svdb/query -entry test_svdb_query_multiple -c ./tests/config/nextflow.config -c ./tests/modules/svdb/query/nextflow.config + tags: + - svdb + - svdb/query + files: + - path: output/svdb/test_query.vcf