2021-06-09 09:14:17 +00:00
|
|
|
// Import generic module functions
|
2021-09-27 08:41:24 +00:00
|
|
|
include { initOptions; saveFiles; getSoftwareName; getProcessName } from './functions'
|
2021-06-09 09:14:17 +00:00
|
|
|
|
|
|
|
params.options = [:]
|
|
|
|
options = initOptions(params.options)
|
|
|
|
|
|
|
|
process COOLER_DUMP {
|
|
|
|
tag "$meta.id"
|
|
|
|
label 'process_high'
|
|
|
|
publishDir "${params.outdir}",
|
|
|
|
mode: params.publish_dir_mode,
|
|
|
|
saveAs: { filename -> saveFiles(filename:filename, options:params.options, publish_dir:getSoftwareName(task.process), meta:meta, publish_by_meta:['id']) }
|
|
|
|
|
|
|
|
conda (params.enable_conda ? "bioconda::cooler=0.8.11" : null)
|
|
|
|
if (workflow.containerEngine == 'singularity' && !params.singularity_pull_docker_container) {
|
|
|
|
container "https://depot.galaxyproject.org/singularity/cooler:0.8.11--pyh3252c3a_0"
|
|
|
|
} else {
|
|
|
|
container "quay.io/biocontainers/cooler:0.8.11--pyh3252c3a_0"
|
|
|
|
}
|
|
|
|
|
|
|
|
input:
|
|
|
|
tuple val(meta), path(cool)
|
2021-11-15 16:18:02 +00:00
|
|
|
val resolution
|
2021-06-09 09:14:17 +00:00
|
|
|
|
|
|
|
output:
|
|
|
|
tuple val(meta), path("*.bedpe"), emit: bedpe
|
2021-11-15 16:18:02 +00:00
|
|
|
path "versions.yml" , emit: versions
|
2021-06-09 09:14:17 +00:00
|
|
|
|
|
|
|
script:
|
|
|
|
def prefix = options.suffix ? "${meta.id}${options.suffix}" : "${meta.id}"
|
2021-11-15 16:18:02 +00:00
|
|
|
def suffix = resolution ? "::$resolution" : ""
|
2021-06-09 09:14:17 +00:00
|
|
|
"""
|
|
|
|
cooler dump \\
|
|
|
|
$options.args \\
|
|
|
|
-o ${prefix}.bedpe \\
|
2021-11-15 16:18:02 +00:00
|
|
|
$cool$suffix
|
2021-06-09 09:14:17 +00:00
|
|
|
|
2021-09-27 08:41:24 +00:00
|
|
|
cat <<-END_VERSIONS > versions.yml
|
|
|
|
${getProcessName(task.process)}:
|
|
|
|
${getSoftwareName(task.process)}: \$(cooler --version 2>&1 | sed 's/cooler, version //')
|
|
|
|
END_VERSIONS
|
2021-06-09 09:14:17 +00:00
|
|
|
"""
|
|
|
|
}
|