diff --git a/modules/vcflib/vcfbreakmulti/main.nf b/modules/vcflib/vcfbreakmulti/main.nf new file mode 100644 index 00000000..0eb9cd7b --- /dev/null +++ b/modules/vcflib/vcfbreakmulti/main.nf @@ -0,0 +1,49 @@ +process VCFLIB_VCFBREAKMULTI { + tag "$meta.id" + label 'process_low' + + conda (params.enable_conda ? "bioconda::vcflib=1.0.3" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/vcflib:1.0.3--hecb563c_1': + 'quay.io/biocontainers/vcflib:1.0.3--ha025227_0' }" + + input: + tuple val(meta), path(vcf), path(tbi) + + output: + tuple val(meta), path("*.vcf.gz"), emit: vcf + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def args2 = task.ext.args2 ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + def VERSION = '1.0.3' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + + """ + vcfbreakmulti \\ + $vcf \\ + $args \\ + | bgzip -c $args2 > ${prefix}.breakmulti.vcf.gz + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + vcflib: $VERSION + END_VERSIONS + """ + + stub: + def prefix = task.ext.prefix ?: "${meta.id}" + def VERSION = '1.0.3' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions. + """ + touch ${prefix}.breakmulti.vcf.gz + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + vcflib: $VERSION + END_VERSIONS + """ +} diff --git a/modules/vcflib/vcfbreakmulti/meta.yml b/modules/vcflib/vcfbreakmulti/meta.yml new file mode 100644 index 00000000..1f2835e6 --- /dev/null +++ b/modules/vcflib/vcfbreakmulti/meta.yml @@ -0,0 +1,45 @@ +name: "vcflib_vcfbreakmulti" +description: If multiple alleles are specified in a single record, break the record into several lines preserving allele-specific INFO fields +keywords: + - vcflib + - vcflib/vcfbreakmulti +tools: + - "vcflib": + description: "Command-line tools for manipulating VCF files" + homepage: https://github.com/vcflib/vcflib + documentation: https://github.com/vcflib/vcflib#USAGE + doi: "https://doi.org/10.1101/2021.05.21.445151" + licence: "['MIT']" + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - vcf: + type: file + description: Compressed VCF file + pattern: "*.{.vcf.gz,vcf}" + - tbi: + type: file + description: Index of VCF file + pattern: "*.vcf.gz.tbi" + +output: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - versions: + type: file + description: File containing software versions + pattern: "versions.yml" + - vcf: + type: file + description: Compressed VCF file + pattern: "*.vcf.gz" + +authors: + - "@lucpen" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index d1fbe0d8..bfc14a03 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -2500,6 +2500,10 @@ vcfanno: - modules/vcfanno/** - tests/modules/vcfanno/** +vcflib/vcfbreakmulti: + - modules/vcflib/vcfbreakmulti/** + - tests/modules/vcflib/vcfbreakmulti/** + vcflib/vcfuniq: - modules/vcflib/vcfuniq/** - tests/modules/vcflib/vcfuniq/** diff --git a/tests/modules/vcflib/vcfbreakmulti/main.nf b/tests/modules/vcflib/vcfbreakmulti/main.nf new file mode 100644 index 00000000..7e973300 --- /dev/null +++ b/tests/modules/vcflib/vcfbreakmulti/main.nf @@ -0,0 +1,16 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { VCFLIB_VCFBREAKMULTI } from '../../../../modules/vcflib/vcfbreakmulti/main.nf' + +workflow test_vcflib_vcfbreakmulti { + + input = [ + [ id:'test', 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) + ] + + VCFLIB_VCFBREAKMULTI ( input ) +} diff --git a/tests/modules/vcflib/vcfbreakmulti/nextflow.config b/tests/modules/vcflib/vcfbreakmulti/nextflow.config new file mode 100644 index 00000000..50f50a7a --- /dev/null +++ b/tests/modules/vcflib/vcfbreakmulti/nextflow.config @@ -0,0 +1,5 @@ +process { + + publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" } + +} \ No newline at end of file diff --git a/tests/modules/vcflib/vcfbreakmulti/test.yml b/tests/modules/vcflib/vcfbreakmulti/test.yml new file mode 100644 index 00000000..d8ed82db --- /dev/null +++ b/tests/modules/vcflib/vcfbreakmulti/test.yml @@ -0,0 +1,16 @@ +- name: vcflib vcfbreakmulti + command: nextflow run ./tests/modules/vcflib/vcfbreakmulti -entry test_vcflib_vcfbreakmulti -c tests/config/nextflow.config + tags: + - vcflib/vcfbreakmulti + - vcflib + files: + - path: output/vcflib/test.breakmulti.vcf.gz + md5sum: 666d2d970399cf219dc1dc1eadff9170 + +- name: vcflib vcfbreakmulti stub + command: nextflow run ./tests/modules/vcflib/vcfbreakmulti -entry test_vcflib_vcfbreakmulti -c tests/config/nextflow.config -stub + tags: + - vcflib/vcfbreakmulti + - vcflib + files: + - path: output/vcflib/test.breakmulti.vcf.gz