Skip to content
Draft
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
7 changes: 7 additions & 0 deletions modules/nf-core/hifiadapterfilt/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
channels:
- conda-forge
- bioconda
dependencies:
- bioconda::hifiadapterfilt=3.0.0
63 changes: 63 additions & 0 deletions modules/nf-core/hifiadapterfilt/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
process HIFIADAPTERFILT {
tag "$meta.id"
label 'process_medium'

// WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions.
conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/hifiadapterfilt:3.0.0--hdfd78af_0':
'quay.io/biocontainers/hifiadapterfilt:3.0.0--hdfd78af_0' }"

input:
tuple val(meta), path(reads)

output:
tuple val(meta), path("${prefix}.contaminant.blastout"), emit: blastout
tuple val(meta), path("${prefix}.blocklist") , emit: blocklist
tuple val(meta), path("${prefix}.filt.fastq.gz") , emit: fastq
tuple val(meta), path("${prefix}.stats") , emit: stats
tuple val("${task.process}"), val('hifiadapterfilt'), eval('echo 3.0.0'), topic: versions, emit: versions_hifiadapterfilt

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

script:
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${meta.id}"
def input_ext = "$reads".endsWith('.fastq.gz') ? '.fastq.gz' :
"$reads".endsWith('.fq.gz') ? '.fq.gz' :
"$reads".endsWith('.fastq') ? '.fastq' :
"$reads".endsWith('.fq') ? '.fq' :
"$reads".endsWith('.bam') ? '.bam' :
error("Unsupported input file extension for HiFiAdapterFilt: ${reads}")
def tool_prefix = "hifiadapterfilt_input"
"""
mkdir -p hifiadapterfilt_work
ln -sf "../${reads}" "hifiadapterfilt_work/${tool_prefix}${input_ext}"

(
cd hifiadapterfilt_work
hifiadapterfilt.sh \\
-p all \\
-t ${task.cpus} \\
-o .. \\
${args}
)

if [[ "${tool_prefix}" != "${prefix}" ]]; then
mv ${tool_prefix}.contaminant.blastout ${prefix}.contaminant.blastout
mv ${tool_prefix}.blocklist ${prefix}.blocklist
mv ${tool_prefix}.filt.fastq.gz ${prefix}.filt.fastq.gz
mv ${tool_prefix}.stats ${prefix}.stats
fi
"""

stub:
prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.contaminant.blastout
touch ${prefix}.blocklist
echo "" | gzip > ${prefix}.filt.fastq.gz
touch ${prefix}.stats
"""
}
107 changes: 107 additions & 0 deletions modules/nf-core/hifiadapterfilt/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: hifiadapterfilt
description: Remove remnant PacBio adapter sequences from HiFi reads and convert BAM input to compressed FASTQ
keywords:
- PacBio
- HiFi
- adapter filtering
- long reads
- FASTQ
tools:
- hifiadapterfilt:
description: HiFiAdapterFilt removes CCS reads with remnant PacBio adapter sequences and converts outputs to compressed FASTQ.
homepage: https://github.com/sheinasim-USDA/HiFiAdapterFilt
documentation: https://github.com/sheinasim-USDA/HiFiAdapterFilt
tool_dev_url: https://github.com/sheinasim-USDA/HiFiAdapterFilt
doi: "10.1186/s12864-022-08375-1"
licence:
- "GPL-3.0-or-later"
identifier: biotools:hifiadapterfilt
input:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:true ]
- reads:
type: file
description: PacBio HiFi reads in BAM, FASTQ, or gzip-compressed FASTQ format
pattern: "*.{bam,fastq,fq,fastq.gz,fq.gz}"
ontologies:
- edam: http://edamontology.org/format_2572 # BAM
- edam: http://edamontology.org/format_1930 # FASTQ
- edam: http://edamontology.org/format_3989 # GZIP format
output:
blastout:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:true ]
- ${prefix}.contaminant.blastout:
type: file
description: Tabular BLAST output containing reads aligned to PacBio adapter sequences
pattern: "*.contaminant.blastout"
ontologies:
- edam: http://edamontology.org/format_3475 # TSV
blocklist:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:true ]
- ${prefix}.blocklist:
type: file
description: List of read headers identified as PacBio adapter-contaminated and removed
pattern: "*.blocklist"
ontologies:
- edam: http://edamontology.org/format_2330 # Textual format
fastq:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:true ]
- ${prefix}.filt.fastq.gz:
type: file
description: Gzipped FASTQ file containing reads without detected PacBio adapter contamination
pattern: "*.filt.fastq.gz"
ontologies:
- edam: http://edamontology.org/format_1930 # FASTQ
- edam: http://edamontology.org/format_3989 # GZIP format
stats:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'test', single_end:true ]
- ${prefix}.stats:
type: file
description: Text summary of read counts and adapter-contaminated reads removed
pattern: "*.stats"
ontologies:
- edam: http://edamontology.org/format_2330 # Textual format
versions_hifiadapterfilt:
- - ${task.process}:
type: string
description: The process the versions were collected from
- hifiadapterfilt:
type: string
description: The tool name
- echo 3.0.0:
type: eval
description: The expression to obtain the version of the tool
topics:
versions:
- - ${task.process}:
type: string
description: The process the versions were collected from
- hifiadapterfilt:
type: string
description: The tool name
- echo 3.0.0:
type: eval
description: The expression to obtain the version of the tool
authors:
- "@vagkaratzas"
maintainers:
- "@vagkaratzas"
63 changes: 63 additions & 0 deletions modules/nf-core/hifiadapterfilt/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
nextflow_process {

name "Test Process HIFIADAPTERFILT"
script "../main.nf"
process "HIFIADAPTERFILT"

tag "modules"
tag "modules_nfcore"
tag "hifiadapterfilt"

test("homo_sapiens - pacbio fastq.gz") {

when {
process {
"""
input[0] = [
[ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/fastq/alz.ccs.fastq.gz', checkIfExists: true)
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert file(process.out.stats.get(0).get(1)).exists() },
{ assert snapshot(
process.out.blastout,
process.out.blocklist,
process.out.fastq,
process.out.findAll { key, val -> key.startsWith('versions') }
).match() }
)
}

}

test("homo_sapiens - pacbio fastq.gz - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/fastq/alz.ccs.fastq.gz', checkIfExists: true)
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(sanitizeOutput(process.out)).match() }
)
}

}

}
94 changes: 94 additions & 0 deletions modules/nf-core/hifiadapterfilt/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
{
"homo_sapiens - pacbio fastq.gz - stub": {
"content": [
{
"blastout": [
[
{
"id": "test"
},
"test.contaminant.blastout:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"blocklist": [
[
{
"id": "test"
},
"test.blocklist:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"fastq": [
[
{
"id": "test"
},
"test.filt.fastq.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
],
"stats": [
[
{
"id": "test"
},
"test.stats:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions_hifiadapterfilt": [
[
"HIFIADAPTERFILT",
"hifiadapterfilt",
"3.0.0"
]
]
}
],
"meta": {
"nf-test": "0.9.3",
"nextflow": "25.10.4"
},
"timestamp": "2026-04-25T09:25:43.311147037"
},
"homo_sapiens - pacbio fastq.gz": {
"content": [
[
[
{
"id": "test"
},
"test.contaminant.blastout:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
[
[
{
"id": "test"
},
"test.blocklist:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
[
[
{
"id": "test"
},
"test.filt.fastq.gz:md5,23a6d8f301d0fd4d2da21f86ff0afac6"
]
],
{
"versions_hifiadapterfilt": [
[
"HIFIADAPTERFILT",
"hifiadapterfilt",
"3.0.0"
]
]
}
],
"meta": {
"nf-test": "0.9.3",
"nextflow": "25.10.4"
},
"timestamp": "2026-04-25T09:38:42.6537421"
}
}
Loading