2023-09-23 21:20:44 +00:00
|
|
|
process HAPLINK_HAPLOTYPES {
|
|
|
|
tag "${prefix}"
|
|
|
|
label 'process_high'
|
2023-09-26 13:27:22 +00:00
|
|
|
label 'haplink'
|
2023-09-23 21:20:44 +00:00
|
|
|
|
2023-09-30 21:01:09 +00:00
|
|
|
container 'ghcr.io/ksumngs/haplink.jl:1.0.0'
|
2023-09-23 21:20:44 +00:00
|
|
|
|
|
|
|
input:
|
2023-09-26 13:06:43 +00:00
|
|
|
tuple val(prefix), path(bam), path(bai), path(vcf)
|
2023-09-23 21:20:44 +00:00
|
|
|
path reference
|
|
|
|
|
|
|
|
output:
|
|
|
|
tuple val(prefix), path("*.yaml")
|
|
|
|
|
2023-10-19 02:40:08 +00:00
|
|
|
publishDir "${params.outdir}/${task.process}", mode: 'copy'
|
2023-09-23 21:20:44 +00:00
|
|
|
|
2023-09-26 13:27:22 +00:00
|
|
|
when:
|
|
|
|
task.ext.when == null || task.ext.when
|
|
|
|
|
2023-09-23 21:20:44 +00:00
|
|
|
script:
|
|
|
|
def ml_args = task.ext.ml_args ?: ''
|
|
|
|
"""
|
|
|
|
export JULIA_NUM_THREADS=${task.cpus}
|
|
|
|
haplink haplotypes \\
|
|
|
|
"${reference}" \\
|
|
|
|
"${vcf}" \\
|
|
|
|
"${bam}" \\
|
|
|
|
--frequency 0.01 \\
|
|
|
|
${ml_args} \\
|
|
|
|
> "${prefix}.yaml"
|
|
|
|
"""
|
|
|
|
}
|