mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-12-22 02:58:17 +00:00
feat added vcflib/vcfbreakmulti module (#2134)
* feat added vcflib/vcfbreakmulti module * fix comments review * Update modules/vcflib/vcfbreakmulti/main.nf Co-authored-by: Anders Jemt <jemten@users.noreply.github.com> * Update modules/vcflib/vcfbreakmulti/main.nf Co-authored-by: Anders Jemt <jemten@users.noreply.github.com> * fix change required by reviewer * fix commiting pytest_modules.yml * fix version * fix version_ * Update tests/modules/vcflib/vcfbreakmulti/test.yml Co-authored-by: nvnieuwk <101190534+nvnieuwk@users.noreply.github.com> * fix undid previous commit * fix test * Update tests/modules/vcflib/vcfbreakmulti/test.yml Co-authored-by: nvnieuwk <101190534+nvnieuwk@users.noreply.github.com> * Update tests/modules/vcflib/vcfbreakmulti/test.yml Co-authored-by: nvnieuwk <101190534+nvnieuwk@users.noreply.github.com> Co-authored-by: Anders Jemt <jemten@users.noreply.github.com> Co-authored-by: nvnieuwk <101190534+nvnieuwk@users.noreply.github.com>
This commit is contained in:
parent
03de60e6fa
commit
ef585046a0
6 changed files with 135 additions and 0 deletions
49
modules/vcflib/vcfbreakmulti/main.nf
Normal file
49
modules/vcflib/vcfbreakmulti/main.nf
Normal file
|
@ -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
|
||||
"""
|
||||
}
|
45
modules/vcflib/vcfbreakmulti/meta.yml
Normal file
45
modules/vcflib/vcfbreakmulti/meta.yml
Normal file
|
@ -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"
|
|
@ -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/**
|
||||
|
|
16
tests/modules/vcflib/vcfbreakmulti/main.nf
Normal file
16
tests/modules/vcflib/vcfbreakmulti/main.nf
Normal file
|
@ -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 )
|
||||
}
|
5
tests/modules/vcflib/vcfbreakmulti/nextflow.config
Normal file
5
tests/modules/vcflib/vcfbreakmulti/nextflow.config
Normal file
|
@ -0,0 +1,5 @@
|
|||
process {
|
||||
|
||||
publishDir = { "${params.outdir}/${task.process.tokenize(':')[-1].tokenize('_')[0].toLowerCase()}" }
|
||||
|
||||
}
|
16
tests/modules/vcflib/vcfbreakmulti/test.yml
Normal file
16
tests/modules/vcflib/vcfbreakmulti/test.yml
Normal file
|
@ -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
|
Loading…
Reference in a new issue