mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-11-15 06:03:10 +00:00
c363d8c37c
* added gvcftools/extractvariants * linting * Update modules/gvcftools/extractvariants/meta.yml Co-authored-by: Júlia Mir Pedrol <mirp.julia@gmail.com> * Update modules/gvcftools/extractvariants/main.nf Co-authored-by: Júlia Mir Pedrol <mirp.julia@gmail.com> * added uncompressed input handling Co-authored-by: Júlia Mir Pedrol <mirp.julia@gmail.com>
37 lines
1.1 KiB
Text
37 lines
1.1 KiB
Text
process GVCFTOOLS_EXTRACTVARIANTS {
|
|
tag "$meta.id"
|
|
label 'process_low'
|
|
|
|
conda (params.enable_conda ? "bioconda::gvcftools=0.17.0" : null)
|
|
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
|
'https://depot.galaxyproject.org/singularity/gvcftools:0.17.0--he941832_3':
|
|
'quay.io/biocontainers/gvcftools:0.17.0--he941832_3' }"
|
|
|
|
input:
|
|
tuple val(meta), path(gvcf)
|
|
|
|
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 prefix = task.ext.prefix ?: "${meta.id}"
|
|
def open_gvcf = gvcf.extension == "gz" ? "gzip -dc $gvcf" : "cat $gvcf"
|
|
|
|
"""
|
|
$open_gvcf |
|
|
extract_variants \\
|
|
$args \\
|
|
$gvcf |
|
|
gzip -c > ${prefix}.vcf.gz
|
|
|
|
cat <<-END_VERSIONS > versions.yml
|
|
"${task.process}":
|
|
gvcftools: \$(extract_variants --help 2>&1 | grep version | sed 's/version: //')
|
|
END_VERSIONS
|
|
"""
|
|
}
|