2021-02-24 14:59:10 +00:00
|
|
|
process TIDDIT_SV {
|
|
|
|
tag "$meta.id"
|
|
|
|
label 'process_medium'
|
|
|
|
|
2022-06-03 08:52:50 +00:00
|
|
|
conda (params.enable_conda ? "bioconda::tiddit=3.0.0" : null)
|
2021-11-26 07:58:40 +00:00
|
|
|
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
2022-06-03 08:52:50 +00:00
|
|
|
'https://depot.galaxyproject.org/singularity/tiddit:3.0.0--py39h59fae87_1' :
|
|
|
|
'quay.io/biocontainers/tiddit:3.0.0--py39h59fae87_1' }"
|
2021-02-24 14:59:10 +00:00
|
|
|
|
|
|
|
input:
|
2022-06-08 09:38:02 +00:00
|
|
|
tuple val(meta), path(input), path(input_index)
|
2021-07-01 15:13:01 +00:00
|
|
|
path fasta
|
2022-06-03 08:52:50 +00:00
|
|
|
path bwa_index
|
2021-02-24 14:59:10 +00:00
|
|
|
|
|
|
|
output:
|
2022-06-03 11:00:29 +00:00
|
|
|
tuple val(meta), path("*.vcf") , emit: vcf
|
|
|
|
tuple val(meta), path("*.ploidies.tab"), emit: ploidy
|
|
|
|
path "versions.yml" , emit: versions
|
2021-02-24 14:59:10 +00:00
|
|
|
|
2022-02-04 08:53:32 +00:00
|
|
|
when:
|
|
|
|
task.ext.when == null || task.ext.when
|
|
|
|
|
2021-02-24 14:59:10 +00:00
|
|
|
script:
|
2021-11-26 07:58:40 +00:00
|
|
|
def args = task.ext.args ?: ''
|
2021-12-02 12:39:55 +00:00
|
|
|
def prefix = task.ext.prefix ?: "${meta.id}"
|
2021-02-24 14:59:10 +00:00
|
|
|
"""
|
2022-06-08 09:46:45 +00:00
|
|
|
[[ -d $bwa_index ]] && for i in $bwa_index/*; do [[ -f $fasta && ! "\$i" =~ .*"$fasta".* ]] && ln -s \$i ${fasta}.\${i##*.} || ln -s \$i .; done
|
2022-06-03 08:52:50 +00:00
|
|
|
|
2021-02-24 14:59:10 +00:00
|
|
|
tiddit \\
|
2021-09-28 13:37:47 +00:00
|
|
|
--sv \\
|
2021-11-26 07:58:40 +00:00
|
|
|
$args \\
|
2022-06-03 08:52:50 +00:00
|
|
|
--bam $input \\
|
2022-06-03 13:51:02 +00:00
|
|
|
--ref $fasta \\
|
2021-07-01 15:13:01 +00:00
|
|
|
-o $prefix
|
2021-02-24 14:59:10 +00:00
|
|
|
|
2021-09-27 08:41:24 +00:00
|
|
|
cat <<-END_VERSIONS > versions.yml
|
2021-11-26 07:58:40 +00:00
|
|
|
"${task.process}":
|
2022-06-03 11:00:29 +00:00
|
|
|
tiddit: \$(echo \$(tiddit 2>&1) | sed 's/^.*tiddit-//; s/ .*\$//')
|
2021-09-27 08:41:24 +00:00
|
|
|
END_VERSIONS
|
2021-02-24 14:59:10 +00:00
|
|
|
"""
|
2022-03-28 15:48:39 +00:00
|
|
|
|
|
|
|
stub:
|
|
|
|
def prefix = task.ext.prefix ?: "${meta.id}"
|
|
|
|
"""
|
2022-03-30 18:21:06 +00:00
|
|
|
touch ${prefix}.vcf
|
2022-06-03 13:51:02 +00:00
|
|
|
touch ${prefix}.ploidies.tab
|
2022-03-28 15:48:39 +00:00
|
|
|
|
|
|
|
cat <<-END_VERSIONS > versions.yml
|
|
|
|
"${task.process}":
|
2022-06-03 11:00:29 +00:00
|
|
|
tiddit: \$(echo \$(tiddit 2>&1) | sed 's/^.*tiddit-//; s/ .*\$//')
|
2022-03-28 15:48:39 +00:00
|
|
|
END_VERSIONS
|
|
|
|
"""
|
2021-02-24 14:59:10 +00:00
|
|
|
}
|