From d596571a03161ee9992b0720c05084cb2ddef324 Mon Sep 17 00:00:00 2001 From: nvnieuwk <101190534+nvnieuwk@users.noreply.github.com> Date: Tue, 28 Jun 2022 16:18:12 +0200 Subject: [PATCH] added an optional vcf index to bcftools/norm (#1821) * added an optional vcf index to bcftools/norm * updated test.yml for failing conda tests --- modules/bcftools/norm/main.nf | 2 +- modules/bcftools/norm/meta.yml | 8 +++++++- tests/modules/bcftools/norm/main.nf | 18 ++++++++++++++++-- tests/modules/bcftools/norm/test.yml | 13 ++++++++++--- 4 files changed, 34 insertions(+), 7 deletions(-) diff --git a/modules/bcftools/norm/main.nf b/modules/bcftools/norm/main.nf index b81a4310..c48aa9bf 100644 --- a/modules/bcftools/norm/main.nf +++ b/modules/bcftools/norm/main.nf @@ -8,7 +8,7 @@ process BCFTOOLS_NORM { 'quay.io/biocontainers/bcftools:1.14--h88f3f91_0' }" input: - tuple val(meta), path(vcf) + tuple val(meta), path(vcf), path(tbi) path(fasta) output: diff --git a/modules/bcftools/norm/meta.yml b/modules/bcftools/norm/meta.yml index ce4aee85..2b3c8eae 100644 --- a/modules/bcftools/norm/meta.yml +++ b/modules/bcftools/norm/meta.yml @@ -24,6 +24,12 @@ input: description: | The vcf file to be normalized e.g. 'file1.vcf' + pattern: "*.{vcf,vcf.gz}" + - tbi: + type: file + description: | + An optional index of the VCF file (for when the VCF is compressed) + pattern: "*.vcf.gz.tbi" - fasta: type: file description: FASTA reference file @@ -37,7 +43,7 @@ output: - vcf: type: file description: VCF normalized output file - pattern: "*.{vcf.gz}" + pattern: "*.vcf.gz" - versions: type: file description: File containing software versions diff --git a/tests/modules/bcftools/norm/main.nf b/tests/modules/bcftools/norm/main.nf index ac056bea..a9ac75ba 100644 --- a/tests/modules/bcftools/norm/main.nf +++ b/tests/modules/bcftools/norm/main.nf @@ -4,10 +4,24 @@ nextflow.enable.dsl = 2 include { BCFTOOLS_NORM } from '../../../../modules/bcftools/norm/main.nf' -workflow test_bcftools_norm { +workflow test_bcftools_norm_no_tbi { input = [ [ id:'test2', single_end:false ], // meta map - file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true)] + file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), + [] + ] + + fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) + + BCFTOOLS_NORM ( input, fasta ) +} + +workflow test_bcftools_norm_tbi { + + input = [ [ id:'test2', single_end:false ], // meta map + file(params.test_data['sarscov2']['illumina']['test_vcf_gz'], checkIfExists: true), + file(params.test_data['sarscov2']['illumina']['test_vcf_gz_tbi'], checkIfExists: true) + ] fasta = file(params.test_data['sarscov2']['genome']['genome_fasta'], checkIfExists: true) diff --git a/tests/modules/bcftools/norm/test.yml b/tests/modules/bcftools/norm/test.yml index bb4f9aca..bdc3ce3f 100644 --- a/tests/modules/bcftools/norm/test.yml +++ b/tests/modules/bcftools/norm/test.yml @@ -1,8 +1,15 @@ -- name: bcftools norm - command: nextflow run ./tests/modules/bcftools/norm -entry test_bcftools_norm -c ./tests/config/nextflow.config -c ./tests/modules/bcftools/norm/nextflow.config +- name: bcftools norm test_bcftools_norm_no_tbi + command: nextflow run ./tests/modules/bcftools/norm -entry test_bcftools_norm_no_tbi -c ./tests/config/nextflow.config -c ./tests/modules/bcftools/norm/nextflow.config + tags: + - bcftools + - bcftools/norm + files: + - path: output/bcftools/test2.vcf.gz + +- name: bcftools norm test_bcftools_norm_tbi + command: nextflow run ./tests/modules/bcftools/norm -entry test_bcftools_norm_tbi -c ./tests/config/nextflow.config -c ./tests/modules/bcftools/norm/nextflow.config tags: - bcftools - bcftools/norm files: - path: output/bcftools/test2.vcf.gz - md5sum: 2b1cac07d1875b8adcd7a85346890f07