From 6e7c0e945b490a7c1e9d2d01cc37e45d581e78bd Mon Sep 17 00:00:00 2001 From: nvnieuwk <101190534+nvnieuwk@users.noreply.github.com> Date: Fri, 17 Jun 2022 15:54:02 +0200 Subject: [PATCH] new module vcf2db (#1795) * added vcf2db * fix test.yml * possible fix for failing tests * fix version number * fix test.yml * removed some comments --- modules/vcf2db/main.nf | 37 ++++++++++++++++++++++ modules/vcf2db/meta.yml | 47 ++++++++++++++++++++++++++++ tests/config/pytest_modules.yml | 4 +++ tests/modules/vcf2db/main.nf | 16 ++++++++++ tests/modules/vcf2db/nextflow.config | 5 +++ tests/modules/vcf2db/test.yml | 6 ++++ 6 files changed, 115 insertions(+) create mode 100644 modules/vcf2db/main.nf create mode 100644 modules/vcf2db/meta.yml create mode 100644 tests/modules/vcf2db/main.nf create mode 100644 tests/modules/vcf2db/nextflow.config create mode 100644 tests/modules/vcf2db/test.yml diff --git a/modules/vcf2db/main.nf b/modules/vcf2db/main.nf new file mode 100644 index 00000000..1030c596 --- /dev/null +++ b/modules/vcf2db/main.nf @@ -0,0 +1,37 @@ +VERSION = "2020.02.24" + +process VCF2DB { + tag "$meta.id" + label 'process_medium' + + conda (params.enable_conda ? "bioconda::vcf2db=2020.02.24" : null) + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + 'https://depot.galaxyproject.org/singularity/vcf2db:2020.02.24--hdfd78af_1': + 'quay.io/biocontainers/vcf2db:2020.02.24--hdfd78af_1' }" + + input: + tuple val(meta), path(vcf), path(ped) + + output: + tuple val(meta), path("*.db") , emit: db + 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}" + """ + vcf2db.py \\ + $vcf \\ + $ped \\ + ${prefix}.db \\ + $args + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + vcf2db: $VERSION + END_VERSIONS + """ +} diff --git a/modules/vcf2db/meta.yml b/modules/vcf2db/meta.yml new file mode 100644 index 00000000..65e41113 --- /dev/null +++ b/modules/vcf2db/meta.yml @@ -0,0 +1,47 @@ +name: "vcf2db" +description: A tool to create a Gemini-compatible DB file from an annotated VCF +keywords: + - vcf2db + - vcf + - gemini +tools: + - "vcf2db": + description: "Create a gemini-compatible database from a VCF" + homepage: "https://github.com/quinlan-lab/vcf2db" + documentation: "https://github.com/quinlan-lab/vcf2db" + tool_dev_url: "https://github.com/quinlan-lab/vcf2db" + doi: "" + licence: "['MIT']" + +input: + - meta: + type: map + description: | + Groovy Map containing sample information + e.g. [ id:'test', single_end:false ] + - vcf: + type: file + description: VCF file + pattern: "*.vcf.gz" + - ped: + type: file + description: PED file + pattern: "*.ped" + +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" + - db: + type: file + description: Gemini-compatible database file + pattern: "*.db" + +authors: + - "@nvnieuwk" diff --git a/tests/config/pytest_modules.yml b/tests/config/pytest_modules.yml index 198785e6..63cd0f39 100644 --- a/tests/config/pytest_modules.yml +++ b/tests/config/pytest_modules.yml @@ -2140,6 +2140,10 @@ variantbam: - modules/variantbam/** - tests/modules/variantbam/** +vcf2db: + - modules/vcf2db/** + - tests/modules/vcf2db/** + vcfanno: - modules/vcfanno/** - tests/modules/vcfanno/** diff --git a/tests/modules/vcf2db/main.nf b/tests/modules/vcf2db/main.nf new file mode 100644 index 00000000..0d4be5d2 --- /dev/null +++ b/tests/modules/vcf2db/main.nf @@ -0,0 +1,16 @@ +#!/usr/bin/env nextflow + +nextflow.enable.dsl = 2 + +include { VCF2DB } from '../../../modules/vcf2db/main.nf' + +workflow test_vcf2db { + + input = [ + [ id:'test', single_end:false ], // meta map + file(params.test_data['homo_sapiens']['genome']['justhusky_minimal_vcf_gz'], checkIfExists: true), + file(params.test_data['homo_sapiens']['genome']['justhusky_ped'], checkIfExists: true) + ] + + VCF2DB ( input ) +} diff --git a/tests/modules/vcf2db/nextflow.config b/tests/modules/vcf2db/nextflow.config new file mode 100644 index 00000000..50f50a7a --- /dev/null +++ b/tests/modules/vcf2db/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/vcf2db/test.yml b/tests/modules/vcf2db/test.yml new file mode 100644 index 00000000..df276b1c --- /dev/null +++ b/tests/modules/vcf2db/test.yml @@ -0,0 +1,6 @@ +- name: vcf2db test_vcf2db + command: nextflow run ./tests/modules/vcf2db -entry test_vcf2db -c ./tests/config/nextflow.config -c ./tests/modules/vcf2db/nextflow.config + tags: + - vcf2db + files: + - path: output/vcf2db/test.db