2021-10-27 13:48:49 +00:00
|
|
|
process PARACLU {
|
|
|
|
tag "$meta.id"
|
|
|
|
label 'process_low'
|
|
|
|
|
2022-06-27 08:35:41 +00:00
|
|
|
// WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions.
|
2021-10-27 13:48:49 +00:00
|
|
|
conda (params.enable_conda ? "bioconda::paraclu=10" : null)
|
2021-11-26 07:58:40 +00:00
|
|
|
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
|
2022-01-03 18:00:46 +00:00
|
|
|
'https://depot.galaxyproject.org/singularity/paraclu:10--h9a82719_1' :
|
2021-11-26 07:58:40 +00:00
|
|
|
'quay.io/biocontainers/paraclu:10--h9a82719_1' }"
|
2021-10-27 13:48:49 +00:00
|
|
|
|
|
|
|
input:
|
|
|
|
tuple val(meta), path(bed)
|
|
|
|
val(min_cluster)
|
|
|
|
|
|
|
|
output:
|
|
|
|
tuple val(meta), path("*.bed"), emit: bed
|
|
|
|
path "versions.yml" , emit: versions
|
|
|
|
|
2022-02-04 08:53:32 +00:00
|
|
|
when:
|
|
|
|
task.ext.when == null || task.ext.when
|
|
|
|
|
2021-10-27 13:48:49 +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}"
|
2022-06-27 08:35:41 +00:00
|
|
|
def VERSION = '10' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.
|
2021-10-27 13:48:49 +00:00
|
|
|
"""
|
|
|
|
|
|
|
|
awk -F "\t" '{print\$1"\t"\$6"\t"\$2"\t"\$5}' < $bed > ${bed}_4P
|
|
|
|
sort -k1,1 -k3n ${bed}_4P > ${bed}_4Ps
|
|
|
|
paraclu $min_cluster ${bed}_4Ps > ${prefix}.clustered
|
|
|
|
paraclu-cut ${prefix}.clustered > ${prefix}.clustered.simplified
|
|
|
|
awk -F '\t' '{print \$1"\t"\$3"\t"\$4"\t"\$1":"\$3".."\$4","\$2"\t"\$6"\t"\$2}' ${prefix}.clustered.simplified > ${prefix}.clustered.simplified.bed
|
|
|
|
|
|
|
|
cat <<-END_VERSIONS > versions.yml
|
2021-11-26 07:58:40 +00:00
|
|
|
"${task.process}":
|
|
|
|
paraclu: $VERSION
|
2021-10-27 13:48:49 +00:00
|
|
|
END_VERSIONS
|
|
|
|
"""
|
|
|
|
}
|