2021-03-24 05:07:29 +00:00
|
|
|
// Import generic module functions
|
2021-09-27 08:41:24 +00:00
|
|
|
include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
|
2021-03-24 05:07:29 +00:00
|
|
|
|
|
|
|
params.options = [:]
|
|
|
|
options = initOptions(params.options)
|
|
|
|
|
|
|
|
process STRELKA_GERMLINE {
|
|
|
|
tag "$meta.id"
|
|
|
|
label 'process_high'
|
|
|
|
publishDir "${params.outdir}",
|
|
|
|
mode: params.publish_dir_mode,
|
2021-04-09 16:23:56 +00:00
|
|
|
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) }
|
2021-03-24 05:07:29 +00:00
|
|
|
|
|
|
|
conda (params.enable_conda ? "bioconda::strelka=2.9.10" : null)
|
|
|
|
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
|
|
|
|
container "https://depot.galaxyproject.org/singularity/strelka:2.9.10--0"
|
|
|
|
} else {
|
|
|
|
container "quay.io/biocontainers/strelka:2.9.10--0"
|
|
|
|
}
|
|
|
|
|
|
|
|
input:
|
|
|
|
tuple val(meta), path(bam), path(bai)
|
2021-03-24 09:53:41 +00:00
|
|
|
path fasta
|
|
|
|
path fai
|
|
|
|
path target_bed
|
2021-10-27 14:14:52 +00:00
|
|
|
path target_bed_tbi
|
|
|
|
|
2021-03-24 05:07:29 +00:00
|
|
|
|
|
|
|
output:
|
2021-07-01 15:13:01 +00:00
|
|
|
tuple val(meta), path("*variants.vcf.gz") , emit: vcf
|
|
|
|
tuple val(meta), path("*variants.vcf.gz.tbi"), emit: vcf_tbi
|
|
|
|
tuple val(meta), path("*genome.vcf.gz") , emit: genome_vcf
|
|
|
|
tuple val(meta), path("*genome.vcf.gz.tbi") , emit: genome_vcf_tbi
|
2021-10-27 14:14:52 +00:00
|
|
|
path "versions.yml" , emit: versions
|
2021-03-24 05:07:29 +00:00
|
|
|
|
|
|
|
script:
|
2021-07-01 15:13:01 +00:00
|
|
|
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
|
2021-10-27 14:14:52 +00:00
|
|
|
def regions = target_bed ? "--exome --callRegions ${target_bed}" : ""
|
2021-03-24 05:07:29 +00:00
|
|
|
"""
|
2021-03-24 09:53:41 +00:00
|
|
|
configureStrelkaGermlineWorkflow.py \\
|
|
|
|
--bam $bam \\
|
|
|
|
--referenceFasta $fasta \\
|
2021-07-01 15:13:01 +00:00
|
|
|
$regions \\
|
2021-03-24 09:53:41 +00:00
|
|
|
$options.args \\
|
2021-03-24 05:07:29 +00:00
|
|
|
--runDir strelka
|
2021-03-24 09:53:41 +00:00
|
|
|
|
|
|
|
python strelka/runWorkflow.py -m local -j $task.cpus
|
2021-07-01 15:13:01 +00:00
|
|
|
mv strelka/results/variants/genome.*.vcf.gz ${prefix}.genome.vcf.gz
|
|
|
|
mv strelka/results/variants/genome.*.vcf.gz.tbi ${prefix}.genome.vcf.gz.tbi
|
|
|
|
mv strelka/results/variants/variants.vcf.gz ${prefix}.variants.vcf.gz
|
|
|
|
mv strelka/results/variants/variants.vcf.gz.tbi ${prefix}.variants.vcf.gz.tbi
|
2021-03-24 09:53:41 +00:00
|
|
|
|
2021-09-27 08:41:24 +00:00
|
|
|
cat <<-END_VERSIONS > versions.yml
|
|
|
|
${getProcessName(task.process)}:
|
2021-10-27 14:14:52 +00:00
|
|
|
${getSoftwareName(task.process)}: \$( configureStrelkaSomaticWorkflow.py --version )
|
2021-09-27 08:41:24 +00:00
|
|
|
END_VERSIONS
|
2021-03-24 05:07:29 +00:00
|
|
|
"""
|
|
|
|
}
|