Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meryl count and meryl histogram migration to nf-test #5401

Merged
merged 16 commits into from
Mar 27, 2024
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
2 changes: 2 additions & 0 deletions modules/nf-core/genomescope2/tests/main.nf.test
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ nextflow_process {
[ id: 'test', single_end: true ], // meta map
file( params.modules_testdata_base_path + "/genomics/prokaryotes/bacteroides_fragilis/illumina/fastq/test1_1.fastq.gz", checkIfExists: true )
])
input[1] = Channel.value(21)
"""
}
}
Expand All @@ -28,6 +29,7 @@ nextflow_process {
process {
"""
input[0] = MERYL_COUNT.out.meryl_db
input[1] = Channel.value(21)
"""
}
}
Expand Down
3 changes: 0 additions & 3 deletions modules/nf-core/genomescope2/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
process {
withName: 'MERYL.*' {
ext.args = 'k=21'
}
withName: 'GENOMESCOPE2' {
ext.args = '-k 21 -p 1 --fitted_hist'
}
Expand Down
2 changes: 1 addition & 1 deletion modules/nf-core/meryl/count/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ channels:
- bioconda
- defaults
dependencies:
- bioconda::meryl=1.3
- bioconda::meryl=1.4.1
20 changes: 18 additions & 2 deletions modules/nf-core/meryl/count/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ process MERYL_COUNT {

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/meryl:1.3--h87f3376_1':
'biocontainers/meryl:1.3--h87f3376_1' }"
'https://depot.galaxyproject.org/singularity/meryl:1.4.1--h4ac6f70_0':
'biocontainers/meryl:1.4.1--h4ac6f70_0' }"

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

output:
tuple val(meta), path("*.meryldb"), emit: meryl_db
Expand All @@ -23,6 +24,7 @@ process MERYL_COUNT {
"""
for READ in $reads; do
meryl count \\
k=$kvalue \\
threads=$task.cpus \\
$args \\
$reads \\
Expand All @@ -34,4 +36,18 @@ process MERYL_COUNT {
meryl: \$( meryl --version |& sed 's/meryl //' )
END_VERSIONS
"""

stub:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
"""
for READ in $reads; do
touch read.\${READ%.f*}.meryldb
done

cat <<-END_VERSIONS > versions.yml
"${task.process}":
meryl: \$( meryl --version |& sed 's/meryl //' )
END_VERSIONS
"""
}
6 changes: 5 additions & 1 deletion modules/nf-core/meryl/count/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ description: A genomic k-mer counter (and sequence utility) with nice features.
keywords:
- k-mer
- count
- reference-free
tools:
- "meryl":
description: "A genomic k-mer counter (and sequence utility) with nice features. "
homepage: "https://github.com/marbl/meryl"
documentation: "https://meryl.readthedocs.io/en/latest/quick-start.html"
tool_dev_url: "https://github.com/marbl/meryl"
licence: "['GPL']"
licence: ["GPL"]
input:
- meta:
type: map
Expand All @@ -21,6 +22,9 @@ input:
description: |
List of input FastQ files of size 1 and 2 for single-end and paired-end data,
respectively.
- kvalue:
type: integer
description: An integer value of k to use as the k-mer value.
output:
- meta:
type: map
Expand Down
60 changes: 60 additions & 0 deletions modules/nf-core/meryl/count/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "meryl"
tag "meryl/count"

test("bacteroides_fragilis - fastq") {

when {
process {
"""
input[0] = Channel.value([
[ id: 'test', single_end: true ], // meta map
file( params.modules_testdata_base_path + "/genomics/prokaryotes/bacteroides_fragilis/illumina/fastq/test1_1.fastq.gz", checkIfExists: true )
])
input[1] = Channel.value(21)
"""
}
}

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

}

test("bacteroides_fragilis - fastq - stub") {

options "-stub"

when {
process {
"""
input[0] = Channel.value([
[ id: 'test', single_end: true ], // meta map
file( params.modules_testdata_base_path + "/genomics/prokaryotes/bacteroides_fragilis/illumina/fastq/test1_1.fastq.gz", checkIfExists: true )
])
input[1] = Channel.value(21)
"""
}
}

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

}

}
Loading
Loading