From 65b85d836d66c796f61efe0a745454a0d9da7a55 Mon Sep 17 00:00:00 2001 From: alejandrogzi Date: Tue, 21 Apr 2026 17:31:27 +0200 Subject: [PATCH] feat: add cesar2 --- modules/nextflow/cesar2/main.nf | 56 +++++++++++++++++++++++++++++++ modules/wdl/cesar2/main.wdl | 59 +++++++++++++++++++++++++++++++++ 2 files changed, 115 insertions(+) create mode 100644 modules/nextflow/cesar2/main.nf create mode 100644 modules/wdl/cesar2/main.wdl diff --git a/modules/nextflow/cesar2/main.nf b/modules/nextflow/cesar2/main.nf new file mode 100644 index 0000000..c63f9a3 --- /dev/null +++ b/modules/nextflow/cesar2/main.nf @@ -0,0 +1,56 @@ +/* +Copyright (c) 2026 The Hiller Lab at the Senckenberg Gessellschaft für Naturforschung +Distributed under the terms of the Apache License, Version 2.0. +*/ + +/* +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CESAR2 — Generate chromosome size files from genome FASTA. + Extracts sequence lengths from a FASTA genome and outputs a chrom.sizes + file required by many UCSC tools. +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +*/ + +process CESAR2 { + tag "$meta.id" + label 'process_high' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + '' : + 'ghcr.io/hillerlab/cesar2:latest' }" + + input: + tuple val(meta), path(fasta) + + output: + tuple val(meta), path("*aln*"), emit: cesar2 + path "versions.yml" , emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + """ + cesar \\ + $args \\ + --max-memory ${task.memory} \\ + $fasta + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + cesar: \$(cesar --version | sed -e "s/cesar v//g") + END_VERSIONS + """ + + stub: + """ + touch *aln* + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + cesar: \$(cesar --version | sed -e "s/cesar v//g") + END_VERSIONS + """ +} diff --git a/modules/wdl/cesar2/main.wdl b/modules/wdl/cesar2/main.wdl new file mode 100644 index 0000000..94b67a8 --- /dev/null +++ b/modules/wdl/cesar2/main.wdl @@ -0,0 +1,59 @@ +# Copyright (c) 2026 The Hiller Lab at the Senckenberg Gessellschaft für Naturforschung +# Distributed under the terms of the Apache License, Version 2.0. + +# CESAR2 — Generate chromosome size files from genome FASTA. +# Extracts sequence lengths from a FASTA genome and outputs a chrom.sizes +# file required by many UCSC tools. + +version 1.3 + +task cesar2 { + input { + String meta_id + File fasta + String args = "" + } + + command <<< + set -euo pipefail + + cesar \ + ~{args} \ + --max-memory ~{memory} \ + ~{fasta} + + cat <<-END_VERSIONS > versions.yml + "CESAR2": + cesar: $(cesar --version | sed -e "s/cesar v//g") + END_VERSIONS + >>> + + output { + File cesar = meta_id + ".fa" + File versions = "versions.yml" + } + + requirements { + container: "ghcr.io/hillerlab/cesar2:latest" + } +} + +workflow run { + input { + String meta_id + File fasta + String args = "" + } + + call cesar2 { + input: + meta_id = meta_id, + fasta = fasta, + args = args + } + + output { + File cesar = cesar2.cesar + File versions = cesar2.versions + } +} \ No newline at end of file