Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions modules/nextflow/cesar2/main.nf
Original file line number Diff line number Diff line change
@@ -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
"""
}
59 changes: 59 additions & 0 deletions modules/wdl/cesar2/main.wdl
Original file line number Diff line number Diff line change
@@ -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
}
}
Loading