Skip to content

Commit

Permalink
Added nf-test for methyldackel/extract (nf-core#6549)
Browse files Browse the repository at this point in the history
* Added nf-test for methyldackel/extract

* Version bump
  • Loading branch information
GallVp authored Sep 4, 2024
1 parent d612c28 commit 1c2bf5b
Show file tree
Hide file tree
Showing 12 changed files with 245 additions and 64 deletions.
2 changes: 1 addition & 1 deletion modules/nf-core/methyldackel/extract/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ channels:
- bioconda
- defaults
dependencies:
- bioconda::methyldackel=0.6.0
- bioconda::methyldackel=0.6.1
16 changes: 14 additions & 2 deletions modules/nf-core/methyldackel/extract/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ process METHYLDACKEL_EXTRACT {

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/methyldackel:0.6.0--h22771d5_0' :
'biocontainers/methyldackel:0.6.0--h22771d5_0' }"
'https://depot.galaxyproject.org/singularity/methyldackel:0.6.1--he4a0461_7' :
'biocontainers/methyldackel:0.6.1--he4a0461_7' }"

input:
tuple val(meta), path(bam), path(bai)
Expand Down Expand Up @@ -33,4 +33,16 @@ process METHYLDACKEL_EXTRACT {
methyldackel: \$(MethylDackel --version 2>&1 | cut -f1 -d" ")
END_VERSIONS
"""

stub:
def args = task.ext.args ?: ''
def out_extension = args.contains('--methylKit') ? 'methylKit' : 'bedGraph'
"""
touch ${bam.baseName}_CpG.${out_extension}
cat <<-END_VERSIONS > versions.yml
"${task.process}":
methyldackel: \$(MethylDackel --version 2>&1 | cut -f1 -d" ")
END_VERSIONS
"""
}
90 changes: 90 additions & 0 deletions modules/nf-core/methyldackel/extract/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@

nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "methyldackel"
tag "methyldackel/extract"

test("test-methyldackel-extract") {

when {
process {
"""
input[0] = [ [ id:'test', single_end:false ], // meta map
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.methylated.sorted.bam', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.methylated.sorted.bam.bai', checkIfExists: true)
]
input[1] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
input[2] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true)
"""
}
}

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

test("test-methyldackel-extract-methyl-kit") {
config "./nextflow.config"

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.methylated.sorted.bam', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.methylated.sorted.bam.bai', checkIfExists: true)
]
input[1] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
input[2] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true)
"""
}
}

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

test("test-methyldackel-extract-methyl-kit-stub") {
config "./nextflow.config"
options '-stub'

when {
process {
"""
input[0] = [
[ id:'test', single_end:false ], // meta map
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.methylated.sorted.bam', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/sarscov2/illumina/bam/test.paired_end.methylated.sorted.bam.bai', checkIfExists: true)
]
input[1] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta', checkIfExists: true)
input[2] = file(params.modules_testdata_base_path + 'genomics/sarscov2/genome/genome.fasta.fai', checkIfExists: true)
"""
}
}

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

}
125 changes: 125 additions & 0 deletions modules/nf-core/methyldackel/extract/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
{
"test-methyldackel-extract-methyl-kit": {
"content": [
{
"0": [

],
"1": [
[
{
"id": "test",
"single_end": false
},
"test.paired_end.methylated.sorted_CpG.methylKit:md5,b1dc217909cd5f8174058c7af785f51c"
]
],
"2": [
"versions.yml:md5,9e23b0c31bf0f98e9348321fe9226498"
],
"bedgraph": [

],
"methylkit": [
[
{
"id": "test",
"single_end": false
},
"test.paired_end.methylated.sorted_CpG.methylKit:md5,b1dc217909cd5f8174058c7af785f51c"
]
],
"versions": [
"versions.yml:md5,9e23b0c31bf0f98e9348321fe9226498"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-09-04T20:34:17.513866"
},
"test-methyldackel-extract-methyl-kit-stub": {
"content": [
{
"0": [

],
"1": [
[
{
"id": "test",
"single_end": false
},
"test.paired_end.methylated.sorted_CpG.methylKit:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"2": [
"versions.yml:md5,9e23b0c31bf0f98e9348321fe9226498"
],
"bedgraph": [

],
"methylkit": [
[
{
"id": "test",
"single_end": false
},
"test.paired_end.methylated.sorted_CpG.methylKit:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,9e23b0c31bf0f98e9348321fe9226498"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-09-04T20:34:22.343382"
},
"test-methyldackel-extract": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"test.paired_end.methylated.sorted_CpG.bedGraph:md5,abcc9d1db6e48d5aced567c337b563d4"
]
],
"1": [

],
"2": [
"versions.yml:md5,9e23b0c31bf0f98e9348321fe9226498"
],
"bedgraph": [
[
{
"id": "test",
"single_end": false
},
"test.paired_end.methylated.sorted_CpG.bedGraph:md5,abcc9d1db6e48d5aced567c337b563d4"
]
],
"methylkit": [

],
"versions": [
"versions.yml:md5,9e23b0c31bf0f98e9348321fe9226498"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-09-04T20:34:12.605013"
}
}
5 changes: 5 additions & 0 deletions modules/nf-core/methyldackel/extract/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
process {
withName: METHYLDACKEL_EXTRACT {
ext.args = "--methylKit"
}
}
2 changes: 1 addition & 1 deletion modules/nf-core/methyldackel/mbias/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ channels:
- bioconda
- defaults
dependencies:
- bioconda::methyldackel=0.6.0
- bioconda::methyldackel=0.6.1
4 changes: 2 additions & 2 deletions modules/nf-core/methyldackel/mbias/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ process METHYLDACKEL_MBIAS {

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/methyldackel:0.6.0--h22771d5_0' :
'biocontainers/methyldackel:0.6.0--h22771d5_0' }"
'https://depot.galaxyproject.org/singularity/methyldackel:0.6.1--he4a0461_7' :
'biocontainers/methyldackel:0.6.1--he4a0461_7' }"

input:
tuple val(meta), path(bam), path(bai)
Expand Down
14 changes: 7 additions & 7 deletions modules/nf-core/methyldackel/mbias/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
]
],
"1": [
"versions.yml:md5,08cbfd1c80fd6a7c1f0c46831f70bb1c"
"versions.yml:md5,0d6cea2918112948708bd1c2f5309398"
],
"txt": [
[
Expand All @@ -24,15 +24,15 @@
]
],
"versions": [
"versions.yml:md5,08cbfd1c80fd6a7c1f0c46831f70bb1c"
"versions.yml:md5,0d6cea2918112948708bd1c2f5309398"
]
}
],
"meta": {
"nf-test": "0.8.4",
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-08-30T13:53:24.630766"
"timestamp": "2024-09-04T20:35:24.956573"
},
"test-methyldackel-mbias": {
"content": [
Expand All @@ -44,13 +44,13 @@
"OT\t1\t4\t52\t3"
],
[
"versions.yml:md5,08cbfd1c80fd6a7c1f0c46831f70bb1c"
"versions.yml:md5,0d6cea2918112948708bd1c2f5309398"
]
],
"meta": {
"nf-test": "0.8.4",
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-08-30T13:53:19.7992"
"timestamp": "2024-09-04T20:35:20.084046"
}
}
3 changes: 0 additions & 3 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -503,9 +503,6 @@ metaphlan3/mergemetaphlantables:
metaphlan3/metaphlan3:
- modules/nf-core/metaphlan3/metaphlan3/**
- tests/modules/nf-core/metaphlan3/metaphlan3/**
methyldackel/extract:
- modules/nf-core/methyldackel/extract/**
- tests/modules/nf-core/methyldackel/extract/**
midas/run:
- modules/nf-core/midas/run/**
- tests/modules/nf-core/midas/run/**
Expand Down
31 changes: 0 additions & 31 deletions tests/modules/nf-core/methyldackel/extract/main.nf

This file was deleted.

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

This file was deleted.

8 changes: 0 additions & 8 deletions tests/modules/nf-core/methyldackel/extract/test.yml

This file was deleted.

0 comments on commit 1c2bf5b

Please sign in to comment.