mirror of
https://github.com/MillironX/nf-core_modules.git
synced 2024-12-22 11:08:17 +00:00
61 lines
1.8 KiB
Text
61 lines
1.8 KiB
Text
process BCFTOOLS_ROH {
|
|
tag "$meta.id"
|
|
label 'process_medium'
|
|
|
|
conda (params.enable_conda ? "bioconda::bcftools=1.15.1" : null)
|
|
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
|
'https://depot.galaxyproject.org/singularity/bcftools:1.15.1--h0ea216a_0':
|
|
'quay.io/biocontainers/bcftools:1.15.1--h0ea216a_0' }"
|
|
|
|
input:
|
|
tuple val(meta), path(vcf), path(tbi)
|
|
tuple path(af_file), path(af_file_tbi)
|
|
path genetic_map
|
|
path regions_file
|
|
path samples_file
|
|
path targets_file
|
|
|
|
output:
|
|
tuple val(meta), path("*.roh"), emit: roh
|
|
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 af_read = af_file ? "--AF-file ${af_file}" : ''
|
|
def gen_map = genetic_map ? "--genetic-map ${genetic_map}" : ''
|
|
def reg_file = regions_file ? "--regions-file ${regions_file}" : ''
|
|
def samp_file = samples_file ? "--samples-file ${samples_file}" : ''
|
|
def targ_file = targets_file ? "--targets-file ${targets_file}" : ''
|
|
"""
|
|
bcftools \\
|
|
roh \\
|
|
$args \\
|
|
$af_read \\
|
|
$gen_map \\
|
|
$reg_file \\
|
|
$samp_file \\
|
|
$targ_file \\
|
|
-o ${prefix}.roh \\
|
|
$vcf
|
|
|
|
cat <<-END_VERSIONS > versions.yml
|
|
"${task.process}":
|
|
bcftools: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//')
|
|
END_VERSIONS
|
|
"""
|
|
|
|
stub:
|
|
def prefix = task.ext.prefix ?: "${meta.id}"
|
|
"""
|
|
touch ${prefix}.roh
|
|
|
|
cat <<-END_VERSIONS > versions.yml
|
|
"${task.process}":
|
|
bcftools: \$(bcftools --version 2>&1 | head -n1 | sed 's/^.*bcftools //; s/ .*\$//')
|
|
END_VERSIONS
|
|
"""
|
|
}
|