From 290c1bf8b16cf2cc22e1361d52bb2c5a295938ba Mon Sep 17 00:00:00 2001 From: alejandrogzi Date: Wed, 22 Apr 2026 11:34:14 +0200 Subject: [PATCH 1/2] feat: add isotools-adapter --- modules/nextflow/isotools/adapter/main.nf | 60 +++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 modules/nextflow/isotools/adapter/main.nf diff --git a/modules/nextflow/isotools/adapter/main.nf b/modules/nextflow/isotools/adapter/main.nf new file mode 100644 index 0000000..944c460 --- /dev/null +++ b/modules/nextflow/isotools/adapter/main.nf @@ -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. +*/ + +/* +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ISOTOOLS_ADAPTER — Detect and optionally remove adapter sequences from + soft-clipped regions of long-read BAM alignments. +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +*/ + +process ISOTOOLS_ADAPTER { + tag "$meta.id" + label 'process_low' + + conda "${moduleDir}/environment.yml" + container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ? + '' : + 'ghcr.io/alejandrogzi/isotools:latest' }" + + input: + tuple val(meta), path(bam) + tuple val(meta1), path(bai) + + output: + tuple val(meta), path("*.without_adapters.bam"), path("*.bai"), optional: true, emit: files + tuple val(meta), path("*.without_adapters.bam"), optional: true, emit: bam + tuple val(meta), path("*.bai"), optional: true, emit: bai + path "versions.yml", emit: versions + + when: + task.ext.when == null || task.ext.when + + script: + def args = task.ext.args ?: '' + def prefix = task.ext.prefix ?: "${meta.id}" + """ + iso-adapter \\ + $args \\ + --threads ${task.cpus} \\ + --out-bam . \\ + $bam + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + iso-adapter: \$( iso-adapter --version | sed 's/iso-adapter //g' ) + END_VERSIONS + """ + + stub: + """ + touch *.without_adapters.bam + + cat <<-END_VERSIONS > versions.yml + "${task.process}": + iso-adapter: \$( iso-adapter --version | sed 's/iso-adapter //g' ) + END_VERSIONS + """ +} From 23556714c5c996c9a129922913b36a3a4bdfc598 Mon Sep 17 00:00:00 2001 From: alejandrogzi Date: Wed, 22 Apr 2026 11:34:35 +0200 Subject: [PATCH 2/2] feat: add isotools-adapter --- modules/wdl/isotools/adapter/main.wdl | 55 +++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 modules/wdl/isotools/adapter/main.wdl diff --git a/modules/wdl/isotools/adapter/main.wdl b/modules/wdl/isotools/adapter/main.wdl new file mode 100644 index 0000000..5c67acf --- /dev/null +++ b/modules/wdl/isotools/adapter/main.wdl @@ -0,0 +1,55 @@ +# Copyright (c) 2026 The Hiller Lab at the Senckenberg Gessellschaft für Naturforschung +# Distributed under the terms of the Apache License, Version 2.0. + +# ISOTOOLS_ADAPTER — Detect and optionally remove adapter sequences from +# soft-clipped regions of long-read BAM alignments. + +version 1.3 + +task isotools_adapter { + input { + File bam + File bai + String args = "" + String prefix = sub(basename(bam), "\\.bam$", "") + } + + command <<< + set -euo pipefail + + iso-adapter \ + ~{args} \ + --threads ~{cpus} \ + --out-bam . \ + ~{bam} + >>> + + output { + File bam_out = prefix + ".without_adapters.bam" + File? bai_out = prefix + ".bai" + } + + requirements { + container: "ghcr.io/alejandrogzi/isotools:latest" + } +} + +workflow run { + input { + File bam + File bai + String args = "" + } + + call isotools_adapter { + input: + bam = bam, + bai = bai, + args = args + } + + output { + File bam_out = isotools_adapter.bam_out + File? bai_out = isotools_adapter.bai_out + } +} \ No newline at end of file