Skip to content
Closed
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
16 changes: 10 additions & 6 deletions modules/nf-core/jellyfish/count/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,26 @@ process JELLYFISH_COUNT {
task.ext.when == null || task.ext.when

script:
def is_compressed = fasta.getName().endsWith(".gz") ? true : false
def fasta_name = fasta.getName().replace(".gz", "")
def fasta_list = fasta instanceof List ? fasta : [fasta]
def decompress = fasta_list
.findAll { input_file -> input_file.getName().endsWith(".gz") }
.collect { input_file -> "gzip -c -d ${input_file} > ${input_file.getName().replace(".gz", "")}" }
.join("\n")
def fasta_names = fasta_list
.collect { input_file -> input_file.getName().replace(".gz", "") }
.join(" ")
def args = task.ext.args ?: ''
prefix = task.ext.prefix ?: "${meta.id}"
"""
if [ "${is_compressed}" == "true" ]; then
gzip -c -d ${fasta} > ${fasta_name}
fi
${decompress}
jellyfish \\
count \\
$args \\
-m ${kmer_length} \\
-s ${size} \\
-t $task.cpus \\
-o ${prefix}.jf \\
${fasta_name}
${fasta_names}
"""

stub:
Expand Down
2 changes: 1 addition & 1 deletion modules/nf-core/jellyfish/count/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ input:
e.g. `[ id:'sample1' ]`
- fasta:
type: file
description: Nucleotide sequences in FASTA format, can be gzipped.
description: A single or list of input nucleotide sequence files in FASTA/FASTQ format, optionally gzipped.
pattern: "*.{fasta,fa,fna,faa,gz}"
ontologies:
- edam: http://edamontology.org/format_1929 # FASTA
Expand Down
27 changes: 27 additions & 0 deletions modules/nf-core/jellyfish/count/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,33 @@ nextflow_process {

}

test("sarscov2 - fastq - paired end") {

when {
process {
"""
input[0] = [
[ id:'test' ],
[
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_2.fastq.gz', checkIfExists: true)
]
]
input[1] = 7
input[2] = '100M'
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(sanitizeOutput(process.out, unstableKeys:["jf"])).match() }
)
}

}

test("sarscov2 - fasta - stub") {

options "-stub"
Expand Down
26 changes: 26 additions & 0 deletions modules/nf-core/jellyfish/count/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,32 @@
"nextflow": "26.04.1"
}
},
"sarscov2 - fastq - paired end": {
"content": [
{
"jf": [
[
{
"id": "test"
},
"test.jf"
]
],
"versions_jellyfish": [
[
"JELLYFISH_COUNT",
"jellyfish",
"2.3.1"
]
]
}
],
"timestamp": "2026-10-03T11:32:53.924827",
"meta": {
"nf-test": "0.9.5",
"nextflow": "26.04.6"
}
},
"sarscov2 - fasta": {
"content": [
{
Expand Down
Loading