Skip to content

Commit

Permalink
Add nf-test to chromap/chromap (#5678)
Browse files Browse the repository at this point in the history
* Add nf-test to chromap/chromap

* Add nf-test to chromap/chromap (tags added)

* Update modules/nf-core/chromap/chromap/tests/main.nf.test

* Update modules/nf-core/chromap/chromap/tests/tags.yml

* Update pytest_modules.yml

* Update main.nf.test

* Update main.nf.test.snap

* Update main.nf.test

* Update main.nf.test.snap

---------

Co-authored-by: Maxime U Garcia <maxime.garcia@seqera.io>
Co-authored-by: Maxime U Garcia <max.u.garcia@gmail.com>
  • Loading branch information
3 people committed May 22, 2024
1 parent 0040936 commit e37348c
Show file tree
Hide file tree
Showing 8 changed files with 284 additions and 131 deletions.
145 changes: 145 additions & 0 deletions modules/nf-core/chromap/chromap/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "chromap"
tag "chromap/chromap"
tag "chromap/index"

test("test_chromap_chromap_single_end") {

setup {
run("CHROMAP_INDEX") {
script "../../index/main.nf"
process {
"""
input[0] = Channel.of([
[:], // meta map
[file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)]
])
"""
}
}
}

when {
process {
"""
input[0] = Channel.of([
[ id:'test', single_end:true ], // meta map
[file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/fastq/test_1.fastq.gz', checkIfExists: true)]
])
input[1] = Channel.of([[:], [file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)]])
input[2] = CHROMAP_INDEX.out.index
input[3] = []
input[4] = []
input[5] = []
input[6] = []
"""
}
}

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

test("test_chromap_chromap_paired_end") {

setup {
run("CHROMAP_INDEX") {
script "../../index/main.nf"
process {
"""
input[0] = Channel.of([
[:], // meta map
[file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)]
])
"""
}
}
}

when {
process {
"""
input[0] = Channel.of([
[ id:'test', single_end:false ], // meta map
[
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] = Channel.of([[:], [file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)]])
input[2] = CHROMAP_INDEX.out.index
input[3] = []
input[4] = []
input[5] = []
input[6] = []
"""
}
}

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


test("test_chromap_chromap_paired_bam") {

setup {
run("CHROMAP_INDEX") {
script "../../index/main.nf"
process {
"""
input[0] = Channel.of([
[:], // meta map
[file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)]
])
"""
}
}
}

when {
config "./nextflow.config"
process {
"""
input[0] = Channel.of([
[ id:'test', single_end:false ], // meta map
[
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] = Channel.of([[:], [file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)]])
input[2] = CHROMAP_INDEX.out.index
input[3] = []
input[4] = []
input[5] = []
input[6] = []
"""
}
}

then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out.versions).match("versions") },
{ assert snapshot(file(process.out.bam[0][1]).name).match() }
)
}

}
}
130 changes: 130 additions & 0 deletions modules/nf-core/chromap/chromap/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
{
"test_chromap_chromap_paired_end": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"test.bed.gz:md5,54c1feb6f714b72f73befae8435e242b"
]
],
"1": [

],
"2": [

],
"3": [

],
"4": [
"versions.yml:md5,80647c2956e504334ad25ce31d33b539"
],
"bam": [

],
"bed": [
[
{
"id": "test",
"single_end": false
},
"test.bed.gz:md5,54c1feb6f714b72f73befae8435e242b"
]
],
"pairs": [

],
"tagAlign": [

],
"versions": [
"versions.yml:md5,80647c2956e504334ad25ce31d33b539"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.1"
},
"timestamp": "2024-05-22T19:08:55.497043"
},
"test_chromap_chromap_paired_bam": {
"content": [
"test.bam"
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.1"
},
"timestamp": "2024-05-22T19:09:02.957218"
},
"test_chromap_chromap_single_end": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": true
},
"test.bed.gz:md5,c45f5bb1c6eb56359760ce3827bfe3f4"
]
],
"1": [

],
"2": [

],
"3": [

],
"4": [
"versions.yml:md5,80647c2956e504334ad25ce31d33b539"
],
"bam": [

],
"bed": [
[
{
"id": "test",
"single_end": true
},
"test.bed.gz:md5,c45f5bb1c6eb56359760ce3827bfe3f4"
]
],
"pairs": [

],
"tagAlign": [

],
"versions": [
"versions.yml:md5,80647c2956e504334ad25ce31d33b539"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.1"
},
"timestamp": "2024-05-22T19:08:47.822066"
},
"versions": {
"content": [
[
"versions.yml:md5,80647c2956e504334ad25ce31d33b539"
]
],
"meta": {
"nf-test": "0.8.4",
"nextflow": "24.04.1"
},
"timestamp": "2024-05-22T19:09:02.94685"
}
}
7 changes: 7 additions & 0 deletions modules/nf-core/chromap/chromap/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
process {

withName: CHROMAP_CHROMAP {
ext.args = '--SAM'
}

}
2 changes: 2 additions & 0 deletions modules/nf-core/chromap/chromap/tests/tags.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
chromap/chromap:
- modules/nf-core/chromap/chromap/**
3 changes: 0 additions & 3 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,6 @@ cellrangeratac/mkref:
checkm/qa:
- modules/nf-core/checkm/qa/**
- tests/modules/nf-core/checkm/qa/**
chromap/chromap:
- modules/nf-core/chromap/chromap/**
- tests/modules/nf-core/chromap/chromap/**
circexplorer2/annotate:
- modules/nf-core/circexplorer2/annotate/**
- tests/modules/nf-core/circexplorer2/annotate/**
Expand Down
87 changes: 0 additions & 87 deletions tests/modules/nf-core/chromap/chromap/main.nf

This file was deleted.

9 changes: 0 additions & 9 deletions tests/modules/nf-core/chromap/chromap/nextflow.config

This file was deleted.

Loading

0 comments on commit e37348c

Please sign in to comment.