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

Added nf-test for cnvpytor/partition #6513

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
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: 1 addition & 1 deletion modules/nf-core/cnvpytor/callcnvs/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ process CNVPYTOR_CALLCNVS {
"""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has no args.

cnvpytor \\
-root $pytor \\
$bin_sizes
$bins

cat <<-END_VERSIONS > versions.yml
"${task.process}":
Expand Down
3 changes: 2 additions & 1 deletion modules/nf-core/cnvpytor/partition/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ channels:
- bioconda
- defaults
dependencies:
- bioconda::cnvpytor=1.2.1
- bioconda::cnvpytor=1.3.1
- conda-forge::numpy=1.24.3 # Locked from container
12 changes: 6 additions & 6 deletions modules/nf-core/cnvpytor/partition/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ process CNVPYTOR_PARTITION {

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/cnvpytor:1.2.1--pyhdfd78af_0':
'biocontainers/cnvpytor:1.2.1--pyhdfd78af_0' }"
'https://depot.galaxyproject.org/singularity/cnvpytor:1.3.1--pyhdfd78af_1':
'biocontainers/cnvpytor:1.3.1--pyhdfd78af_1' }"

input:
tuple val(meta), path(pytor)
Expand All @@ -19,15 +19,15 @@ process CNVPYTOR_PARTITION {
task.ext.when == null || task.ext.when

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No args here either.

script:
def bins = bin_sizes ?: '1000'
def bins = bin_sizes ? "-partition $bin_sizes" : '-partition 1000'
"""
cnvpytor \\
-root $pytor \\
-partition $bins
$bins

cat <<-END_VERSIONS > versions.yml
"${task.process}":
cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/CNVpytor //' )
cnvpytor: \$(cnvpytor --version | sed -n 's/.*CNVpytor \\(.*\\)/\\1/p')
END_VERSIONS
"""

Expand All @@ -37,7 +37,7 @@ process CNVPYTOR_PARTITION {

cat <<-END_VERSIONS > versions.yml
"${task.process}":
cnvpytor: \$(echo \$(cnvpytor --version 2>&1) | sed 's/CNVpytor //' )
cnvpytor: \$(cnvpytor --version | sed -n 's/.*CNVpytor \\(.*\\)/\\1/p')
END_VERSIONS
"""
}
10 changes: 6 additions & 4 deletions modules/nf-core/cnvpytor/partition/meta.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: cnvpytor_partition
description: partitioning read depth histograms
description: Partitioning read depth histograms
keywords:
- cnv calling
- partition histograms
- cnv
- call
- partition
- histogram
tools:
- cnvpytor:
description: calling CNVs using read depth
description: Calling CNVs using read depth
homepage: https://github.com/abyzovlab/CNVpytor
documentation: https://github.com/abyzovlab/CNVpytor
tool_dev_url: https://github.com/abyzovlab/CNVpytor
Expand Down
60 changes: 60 additions & 0 deletions modules/nf-core/cnvpytor/partition/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@

nextflow_process {

name "Test Process CNVPYTOR_PARTITION"
script "../main.nf"
process "CNVPYTOR_PARTITION"
config "./nextflow.config"

tag "modules"
tag "modules_nfcore"
tag "cnvpytor"
tag "cnvpytor/partition"

test("test-cnvpytor-partition") {

when {
process {
"""
input[0] = [
[ id:'test'], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/pytor/test.pytor', checkIfExists: true)
]
input[1] = []
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Think we need a test checking that this works, given that it didn't previously.


"""
}
}

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

test("test-cnvpytor-partition-stub") {
options '-stub'
when {
process {
"""
input[0] = [
[ id:'test'], // meta map
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/illumina/pytor/test.pytor', checkIfExists: true)
]
input[1] = []

"""
}
}

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

}
68 changes: 68 additions & 0 deletions modules/nf-core/cnvpytor/partition/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"test-cnvpytor-partition-stub": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test.pytor:md5,aa03a8fa15b39f77816705a48e10312a"
]
],
"1": [
"versions.yml:md5,fbe0931ab8560ef17d80c37c10e9d466"
],
"pytor": [
[
{
"id": "test"
},
"test.pytor:md5,aa03a8fa15b39f77816705a48e10312a"
]
],
"versions": [
"versions.yml:md5,fbe0931ab8560ef17d80c37c10e9d466"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-09-02T11:10:57.073678"
},
"test-cnvpytor-partition": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test.pytor:md5,aa03a8fa15b39f77816705a48e10312a"
]
],
"1": [
"versions.yml:md5,fbe0931ab8560ef17d80c37c10e9d466"
],
"pytor": [
[
{
"id": "test"
},
"test.pytor:md5,aa03a8fa15b39f77816705a48e10312a"
]
],
"versions": [
"versions.yml:md5,fbe0931ab8560ef17d80c37c10e9d466"
]
}
],
"meta": {
"nf-test": "0.9.0",
"nextflow": "24.04.4"
},
"timestamp": "2024-09-02T11:09:54.629869"
}
}
5 changes: 5 additions & 0 deletions modules/nf-core/cnvpytor/partition/tests/nextflow.config
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't think this is doing anything as args is missing, and suspect it should be in the value channel anyway.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
process {
withName: CNVPYTOR_PARTITION {
ext.args = '10000 100000'
}
}
15 changes: 0 additions & 15 deletions tests/modules/nf-core/cnvpytor/partition/main.nf

This file was deleted.

7 changes: 0 additions & 7 deletions tests/modules/nf-core/cnvpytor/partition/nextflow.config

This file was deleted.

17 changes: 0 additions & 17 deletions tests/modules/nf-core/cnvpytor/partition/test.yml

This file was deleted.

Loading