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
60 changes: 60 additions & 0 deletions modules/nextflow/isotools/adapter/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.
*/

/*
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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
"""
}
55 changes: 55 additions & 0 deletions modules/wdl/isotools/adapter/main.wdl
Original file line number Diff line number Diff line change
@@ -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
}
}
Loading