Skip to content

Commit

Permalink
Added nf-test for bbmap/sendsketch (#6335)
Browse files Browse the repository at this point in the history
  • Loading branch information
GallVp authored Aug 26, 2024
1 parent 8b9d2a7 commit 9f234f2
Show file tree
Hide file tree
Showing 7 changed files with 112 additions and 56 deletions.
4 changes: 2 additions & 2 deletions modules/nf-core/bbmap/sendsketch/meta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ tools:
description: "BBMap is a short read aligner, as well as various other bioinformatic tools."
homepage: "https://jgi.doe.gov/data-and-tools/bbtools/bb-tools-user-guide/"
documentation: "https://jgi.doe.gov/data-and-tools/bbtools/bb-tools-user-guide/"
licence: "['UC-LBL license (see package)']"
licence: ["UC-LBL license (see package)"]
input:
- meta:
type: map
Expand All @@ -34,7 +34,7 @@ output:
description: File containing software versions
pattern: "versions.yml"
- hits:
type: txt
type: file
description: .txt file containing hits from a query seuqnce to various reference sequences output
pattern: "*.{txt}"
authors:
Expand Down
70 changes: 70 additions & 0 deletions modules/nf-core/bbmap/sendsketch/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@

nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "bbmap"
tag "bbmap/sendsketch"

test("test-bbmap-sendsketch-single") {

when {
process {
"""
input[0] = [
[ id:'test', single_end:true], // meta map
[
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/genome.fasta', checkIfExists: true)
]
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(
file(process.out.hits[0][1]).readLines()[3..7],
process.out.versions
).match()
}
)
}
}

test("test-bbmap-sendsketch-paired") {

when {
process {
"""
input[0] = [
[ id:'test', single_end:false], // meta map
[
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test2_1.fastq.gz', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/fastq/test2_2.fastq.gz', checkIfExists: true)
]
]
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(
file(process.out.hits[0][1]).readLines()[3..7],
process.out.versions
).match()
}
)
}
}

}
40 changes: 40 additions & 0 deletions modules/nf-core/bbmap/sendsketch/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"test-bbmap-sendsketch-paired": {
"content": [
[
"0.52%\t0.14%\t82.66%\t.\t26.68%\t1.03%\t60\t10\t9534\t30656K\t46\tChlorocebus aethiops",
"0.46%\t0.12%\t82.30%\t.\t26.38%\t1.10%\t53\t7\t33548\t30986K\t46\tColobus guereza",
"9.02%\t0.03%\t91.56%\t.\t0.34%\t1.88%\t48\t8\t9606\t2387M\t26130\tHomo sapiens",
"0.30%\t0.08%\t80.90%\t.\t27.42%\t1.23%\t35\t8\t9523\t29749K\t44\tPlecturocebus moloch",
"6.70%\t0.02%\t90.53%\t.\t0.34%\t4.10%\t36\t0\t9595\t2355M\t5730\tGorilla gorilla gorilla"
],
[
"versions.yml:md5,694697087b868316aa450d1bc3775373"
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.4"
},
"timestamp": "2024-08-26T14:29:22.985067"
},
"test-bbmap-sendsketch-single": {
"content": [
[
"0.66%\t0.53%\t83.30%\t.\t80.66%\t0.56%\t20\t17\t9593\t47555\t9\tGorilla gorilla",
"0.14%\t0.07%\t78.52%\t.\t48.11%\t1.09%\t4\t4\t27679\t78571\t4\tSaimiri boliviensis",
"7.69%\t0.01%\t90.45%\t.\t0.12%\t3.85%\t4\t1\t9534\t30656K\t46\tChlorocebus aethiops",
"0.17%\t0.04%\t79.27%\t.\t23.69%\t1.26%\t3\t1\t67082\t158942\t1\tBeAn 58058 virus",
"5.56%\t0.01%\t89.72%\t.\t0.12%\t5.56%\t3\t0\t9523\t29749K\t44\tPlecturocebus moloch"
],
[
"versions.yml:md5,694697087b868316aa450d1bc3775373"
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.4"
},
"timestamp": "2024-08-26T14:29:03.529673"
}
}
3 changes: 0 additions & 3 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ bbmap/index:
bbmap/pileup:
- modules/nf-core/bbmap/pileup/**
- tests/modules/nf-core/bbmap/pileup/**
bbmap/sendsketch:
- modules/nf-core/bbmap/sendsketch/**
- tests/modules/nf-core/bbmap/sendsketch/**
bcftools/convert:
- modules/nf-core/bcftools/convert/**
- tests/modules/nf-core/bcftools/convert/**
Expand Down
27 changes: 0 additions & 27 deletions tests/modules/nf-core/bbmap/sendsketch/main.nf

This file was deleted.

5 changes: 0 additions & 5 deletions tests/modules/nf-core/bbmap/sendsketch/nextflow.config

This file was deleted.

19 changes: 0 additions & 19 deletions tests/modules/nf-core/bbmap/sendsketch/test.yml

This file was deleted.

0 comments on commit 9f234f2

Please sign in to comment.