new module vcf2db (#1795)

* added vcf2db

* fix test.yml

* possible fix for failing tests

* fix version number

* fix test.yml

* removed some comments
This commit is contained in:
nvnieuwk 2022-06-17 15:54:02 +02:00 committed by GitHub
parent c1eb9cce44
commit 6e7c0e945b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 115 additions and 0 deletions

37
modules/vcf2db/main.nf Normal file
View file

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

47
modules/vcf2db/meta.yml Normal file
View file

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

View file

@ -2140,6 +2140,10 @@ variantbam:
- modules/variantbam/** - modules/variantbam/**
- tests/modules/variantbam/** - tests/modules/variantbam/**
vcf2db:
- modules/vcf2db/**
- tests/modules/vcf2db/**
vcfanno: vcfanno:
- modules/vcfanno/** - modules/vcfanno/**
- tests/modules/vcfanno/** - tests/modules/vcfanno/**

View file

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

View file

@ -0,0 +1,5 @@
process {
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
}

View file

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