Skip to content
Open
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
6 changes: 6 additions & 0 deletions modules/nf-core/seqtk/comp/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
channels:
- conda-forge
- bioconda
dependencies:
- "bioconda::seqtk=1.4"
48 changes: 48 additions & 0 deletions modules/nf-core/seqtk/comp/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

process SEQTK_COMP {
tag "$meta.id"
label 'process_low'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/seqtk:1.4--h577a1d6_3':
'biocontainers/seqtk:1.4--h577a1d6_3' }"

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

output:
tuple val(meta), path("*.seqtk_stats.tsv"), emit: seqtk_stats
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}"

"""
seqtk comp \\
${args} \\
${fastx} > ${prefix}.seqtk_stats.tsv

cat <<-END_VERSIONS > versions.yml
"${task.process}":
seqtk: \$(seqtk |& sed '/Version/!d; s/.* //')
END_VERSIONS
"""

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"

"""
echo "" > ${prefix}.seqtk_stats.tsv

cat <<-END_VERSIONS > versions.yml
"${task.process}":
seqtk: \$(seqtk |& sed '/Version/!d; s/.* //')
END_VERSIONS
"""
}
51 changes: 51 additions & 0 deletions modules/nf-core/seqtk/comp/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: "seqtk_comp"
description: Computes sequence statistics from FASTQ or FASTA files
keywords:
- seqtk
- comp
- fastx

tools:
- "seqtk_comp":
description: |
Seqtk is a fast and lightweight tool for processing sequences in the FASTA or FASTQ format.
The seqtk comp command computes base composition, sequence length, and GC content for quality control.

homepage: https://github.com/lh3/seqtk
documentation: https://docs.csc.fi/apps/seqtk/
tool_dev_url: https://github.com/lh3/seqtk
licence: ["MIT"]
identifier: biotools:seqtk

input:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'sample1' ]
- fastx:
type: file
description: A FASTQ or FASTA file
pattern: "*.{fastq,fq,fasta,fa,fas,fna}{,.gz}"

output:
- seqtk_stats:
- meta:
type: map
description: |
Groovy Map containing sample information
e.g. [ id:'sample1', single_end:false ]
- "*.seqtk_stats.tsv":
type: file
description: The output TSV file summarizing sequence statistics with columns for sequence name, length, counts of A, C, G, T, and N bases, and GC content percentage."
pattern: "*.seqtk_stats.tsv"

- versions:
- versions.yml:
type: file
description: File containing software versions
pattern: "versions.yml"
authors:
- "@sainsachiko"
maintainers:
- "@sainsachiko"
60 changes: 60 additions & 0 deletions modules/nf-core/seqtk/comp/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "seqtk"
tag "seqtk/comp"

test("bacteroides_fragilis - fasta") {

when {
process {
"""
input[0] = [
[ id:'test', single_end:true ],
file( params.modules_testdata_base_path + 'genomics/prokaryotes/bacteroides_fragilis/genome/genome.fna.gz', checkIfExists: true),
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
with(process.out.seqtk_stats[0]) {
assert path(get(1)).text.contains("NZ_CP069563.1")
}
}

}

test("bacteroides_fragilis - fasta - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[ id:'test', single_end:true ],
file( params.modules_testdata_base_path + 'genomics/prokaryotes/bacteroides_fragilis/genome/genome.fna.gz', checkIfExists: true),
]
"""
}
}

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

72 changes: 72 additions & 0 deletions modules/nf-core/seqtk/comp/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"bacteroides_fragilis - fasta": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": true
},
"test.seqtk_stats.tsv:md5,46c8788954c64c718a799c0f6a41ecdc"
]
],
"1": [
"versions.yml:md5,f374db7a2510fc66d62d68e309971657"
],
"seqtk_stats": [
[
{
"id": "test",
"single_end": true
},
"test.seqtk_stats.tsv:md5,46c8788954c64c718a799c0f6a41ecdc"
]
],
"versions": [
"versions.yml:md5,f374db7a2510fc66d62d68e309971657"
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.2"
},
"timestamp": "2025-03-26T19:53:51.1946864"
},
"bacteroides_fragilis - fasta - stub": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": true
},
"test.seqtk_stats.tsv:md5,68b329da9893e34099c7d8ad5cb9c940"
]
],
"1": [
"versions.yml:md5,f374db7a2510fc66d62d68e309971657"
],
"seqtk_stats": [
[
{
"id": "test",
"single_end": true
},
"test.seqtk_stats.tsv:md5,68b329da9893e34099c7d8ad5cb9c940"
]
],
"versions": [
"versions.yml:md5,f374db7a2510fc66d62d68e309971657"
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.2"
},
"timestamp": "2025-03-26T19:53:56.444250615"
}
}
2 changes: 2 additions & 0 deletions modules/nf-core/seqtk/comp/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
seqtk/mergepe:
- "modules/nf-core/seqtk/comp/**"