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
10 changes: 10 additions & 0 deletions assets/catalog/catalog.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,16 @@

---

## Gene annotation

- [annevo/annotation](../../modules/nextflow/annevo/annotation/main.nf) — One-step ANNEVO annotation (prediction + decoding). Prefer the split modules for production.
- [annevo/prediction](../../modules/nextflow/annevo/prediction/main.nf) — ANNEVO nucleotide-level inference (`process_gpu`; CPU if no GPU profile).
- [annevo/decoding](../../modules/nextflow/annevo/decoding/main.nf) — Decode ANNEVO H5 predictions into GFF3 on CPU.
- [subworkflows/annevo](../../subworkflows/annevo/main.nf) — Scatter (none / chromosome / weighted), predict, decode, and gather GFF3.
- [workflows/annevo](../../workflows/annevo/main.nf) — Standalone ANNEVO pipeline. Bundled ANNEVO is non-commercial.

---

## Transcript assembly & quantification

- [aletsch](../../modules/nextflow/aletsch/main.nf) — Assemble RNA-seq transcripts using Aletsch.
Expand Down
67 changes: 67 additions & 0 deletions modules/nextflow/annevo/annotation/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
Copyright (c) 2026 The Hiller Lab at the Senckenberg Gessellschaft für Naturforschung
Distributed under the terms of the Apache License, Version 2.0.
*/

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ANNEVO_ANNOTATION — One-step ANNEVO annotation (prediction + decoding).

Useful for small genomes and for checking upstream behaviour. Prefer
ANNEVO_PREDICTION → ANNEVO_DECODING for scalable runs so the GPU is not
held during CPU decoding.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

process ANNEVO_ANNOTATION {
tag "$meta.id"
label 'process_high'
label 'process_gpu'

container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'' :
'ghcr.io/hillerlab/annevo:latest' }"

input:
tuple val(meta), path(fasta)
val lineage

output:
tuple val(meta), path("*.gff3"), emit: gff
path "versions.yml", emit: versions

when:
task.ext.when == null || task.ext.when

script:
def args = [task.ext.args ?: '', meta.annevo_args ?: ''].findAll { it }.join(' ')
def prefix = task.ext.prefix ?: "${meta.id}"
def model = task.ext.model ?: (meta.model ?: "/opt/annevo/saved_model/ANNEVO_${lineage}.pt")
def workers = Math.max(1, (task.cpus as int) - 1)
"""
annevo annotation \\
-g ${fasta} \\
-m ${model} \\
-l ${lineage} \\
-o ${prefix}.gff3 \\
-t ${task.cpus} \\
--num_workers ${workers} \\
${args}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
annevo: \$( annevo --version | sed 's/annevo //g' )
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.gff3

cat <<-END_VERSIONS > versions.yml
"${task.process}":
annevo: \$( annevo --version | sed 's/annevo //g' )
END_VERSIONS
"""
}
60 changes: 60 additions & 0 deletions modules/nextflow/annevo/decoding/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*
Copyright (c) 2026 The Hiller Lab at the Senckenberg Gessellschaft für Naturforschung
Distributed under the terms of the Apache License, Version 2.0.
*/

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ANNEVO_DECODING — Convert ANNEVO nucleotide predictions into GFF3.

CPU-only. Keep this process separate from prediction so GPU allocations
can be released as soon as the H5 file is written.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

process ANNEVO_DECODING {
tag "$meta.id"
label 'process_high'

container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'' :
'ghcr.io/hillerlab/annevo:latest' }"

input:
tuple val(meta), path(fasta), path(predictions)

output:
tuple val(meta), path("*.gff3"), emit: gff
path "versions.yml", emit: versions

when:
task.ext.when == null || task.ext.when

script:
def args = [task.ext.args ?: '', meta.annevo_decoding_args ?: ''].findAll { it }.join(' ')
def prefix = task.ext.prefix ?: "${meta.id}"
"""
annevo decoding \\
-g ${fasta} \\
-p ${predictions} \\
-o ${prefix}.gff3 \\
-t ${task.cpus} \\
${args}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
annevo: \$( annevo --version | sed 's/annevo //g' )
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.gff3

cat <<-END_VERSIONS > versions.yml
"${task.process}":
annevo: \$( annevo --version | sed 's/annevo //g' )
END_VERSIONS
"""
}
66 changes: 66 additions & 0 deletions modules/nextflow/annevo/prediction/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*
Copyright (c) 2026 The Hiller Lab at the Senckenberg Gessellschaft für Naturforschung
Distributed under the terms of the Apache License, Version 2.0.
*/

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ANNEVO_PREDICTION — Nucleotide-level ANNEVO inference.

Thin wrapper around `annevo prediction`. GPU is used when `-profile gpu`
exposes a device; otherwise PyTorch falls back to CPU. Does not insert
biological defaults such as `--overlap_pred`.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

process ANNEVO_PREDICTION {
tag "$meta.id"
label 'process_high'
label 'process_gpu'

container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'' :
'ghcr.io/hillerlab/annevo:latest' }"

input:
tuple val(meta), path(fasta)
val lineage

output:
tuple val(meta), path("*.h5"), emit: predictions
path "versions.yml", emit: versions

when:
task.ext.when == null || task.ext.when

script:
def args = [task.ext.args ?: '', meta.annevo_args ?: ''].findAll { it }.join(' ')
def prefix = task.ext.prefix ?: "${meta.id}"
def model = task.ext.model ?: (meta.model ?: "/opt/annevo/saved_model/ANNEVO_${lineage}.pt")
def workers = Math.max(1, (task.cpus as int) - 1)
"""
annevo prediction \\
-g ${fasta} \\
-m ${model} \\
-l ${lineage} \\
-p ${prefix}.h5 \\
--num_workers ${workers} \\
${args}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
annevo: \$( annevo --version | sed 's/annevo //g' )
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.h5

cat <<-END_VERSIONS > versions.yml
"${task.process}":
annevo: \$( annevo --version | sed 's/annevo //g' )
END_VERSIONS
"""
}
18 changes: 13 additions & 5 deletions modules/nextflow/fxsplit/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ Distributed under the terms of the Apache License, Version 2.0.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
FXSPLIT — Split FASTX/FASTQ reads into chunks for parallel processing.
Partitions read files into smaller chunks to enable parallel processing
across multiple CPUs.
across multiple CPUs. Set meta.headers or task.ext.headers to use
fxsplit -H (one output file per FASTA record).
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

Expand Down Expand Up @@ -35,15 +36,18 @@ process FXSPLIT {
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def chunks = task.ext.chunks ?: 400000
def header_mode = (meta.headers == true) || (task.ext.headers ? true : false)
def mode_flag = header_mode ? '-H' : "-c ${chunks}"
def suffix_flag = header_mode ? '' : "--suffix ${prefix}"
def gzip = reads.name.endsWith('.gz') ? true : false
"""
fxsplit \\
$args \\
-f $reads \\
-c $chunks \\
${mode_flag} \\
-t $task.cpus \\
-C \\
--suffix ${prefix}
${suffix_flag}

if [ ${meta.singleton} == true ]; then
for f in chunks/*fasta.gz; do
Expand Down Expand Up @@ -73,10 +77,14 @@ process FXSPLIT {

if [ $gzip == true ]; then
mkdir chunks/gz
mv chunks/*fast*.gz chunks/gz
mv chunks/*fast*.gz chunks/gz 2>/dev/null || mv chunks/*.gz chunks/gz
else
mkdir chunks/fx
mv chunks/*fast* chunks/fx
if [ "${header_mode}" = "true" ]; then
find chunks -maxdepth 1 -type f -exec mv {} chunks/fx/ \\;
else
mv chunks/*fast* chunks/fx
fi
fi

cat <<-END_VERSIONS > versions.yml
Expand Down
Loading
Loading