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

Update purecn/coverage to nf-test #7308

Merged
merged 11 commits into from
Mar 11, 2025
10 changes: 6 additions & 4 deletions modules/nf-core/purecn/coverage/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ channels:
- bioconda

dependencies:
- bioconda::bioconductor-org.hs.eg.db=3.16.0
- bioconda::bioconductor-purecn=2.4.0
- bioconda::bioconductor-txdb.hsapiens.ucsc.hg38.knowngene=3.16.0
- bioconductor-txdb.hsapiens.ucsc.hg19.knowngene=3.2.2
- bioconda::bioconductor-org.hs.eg.db=3.20.0
- bioconda::bioconductor-purecn=2.12.0
- bioconda::bioconductor-txdb.hsapiens.ucsc.hg38.knowngene=3.20.0
- bioconda::bioconductor-txdb.hsapiens.ucsc.hg19.knowngene=3.2.2
- conda-forge::r-optparse=1.7.5

16 changes: 7 additions & 9 deletions modules/nf-core/purecn/coverage/main.nf
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ process PURECN_COVERAGE {
// WARN: Version information not provided by tool on CLI. Please update version string below when bumping container versions.
conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/mulled-v2-582ac26068889091d5e798347c637f8208d77a71:a29c64a63498b1ee8b192521fdf6ed3c65506994-0':
'biocontainers/mulled-v2-582ac26068889091d5e798347c637f8208d77a71:a29c64a63498b1ee8b192521fdf6ed3c65506994-0' }"
'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/92/926f2b12a939f84566b934f3fd6136d33137130ed6563f70c3edf6664cdcc5c0/data':
'community.wave.seqera.io/library/bioconductor-org.hs.eg.db_bioconductor-purecn_bioconductor-txdb.hsapiens.ucsc.hg19.knowngene_bioconductor-txdb.hsapiens.ucsc.hg38.knowngene_r-optparse:53ad9839eb9a0de2' }"

input:
tuple val(meta), path(bam), path(bai)
Expand All @@ -26,7 +26,6 @@ process PURECN_COVERAGE {

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def VERSION = '2.4.0' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.

if (task.stageInMode != 'link') {
Expand All @@ -49,20 +48,19 @@ process PURECN_COVERAGE {
"""

stub:

def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def png = args.contains("--skip-gc-norm") ? "" : "touch ${prefix}.png"
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
def png = args.contains("--skip-gc-norm") ? "" : "touch ${prefix}.png"
def loess_qc_txt = args.contains("--skip-gc-norm") ? "" : "touch ${prefix}_loess_qc.txt"
def loess_txt = args.contains("--skip-gc-norm") ? "" : "touch ${prefix}_loess.txt.gz"
def loess_txt = args.contains("--skip-gc-norm") ? "" : "echo | gzip > ${prefix}_loess.txt.gz"
def VERSION = '2.4.0' // WARN: Version information not provided by tool on CLI. Please update this string when bumping container versions.

if (task.stageInMode != 'link') {
error "purecn/coverage can not handle staging files with symlinks. Please change the stageInmode option to 'Link'"
}

"""
touch ${prefix}.txt
echo | gzip > ${prefix}.txt.gz
touch ${prefix}.bed
${png}
${loess_qc_txt}
Expand Down
92 changes: 92 additions & 0 deletions modules/nf-core/purecn/coverage/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "purecn"
tag "purecn/coverage"
config './nextflow.config'

test("homo_sapiens - skip_gc") {
when {
params {
module_args = "--skip-gc-norm"
}
process {
"""
input[0] = [ [ id:'test' ],
file(params.modules_testdata_base_path + '/genomics/homo_sapiens/illumina/purecn/purecn_ex1.bam', checkIfExists: true),
file(params.modules_testdata_base_path + '/genomics/homo_sapiens/illumina/purecn/purecn_ex1.bam.bai', checkIfExists: true)
]
input[1] = file(params.modules_testdata_base_path + '/genomics/homo_sapiens/illumina/purecn/purecn_ex1_intervals.txt', checkIfExists: true)
"""
}
}

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

}

test("homo_sapiens - stub") {
options "-stub"

when {
params {
module_args = ""
}
process {
"""
input[0] = [ [ id:'test' ],
file(params.modules_testdata_base_path + '/genomics/homo_sapiens/illumina/purecn/purecn_ex1.bam', checkIfExists: true),
file(params.modules_testdata_base_path + '/genomics/homo_sapiens/illumina/purecn/purecn_ex1.bam.bai', checkIfExists: true)
]
input[1] = file(params.modules_testdata_base_path + '/genomics/homo_sapiens/illumina/purecn/purecn_ex1_intervals.txt', checkIfExists: true)
"""
}
}

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

}

test("homo_sapiens - skip_gc - stub") {
options "-stub"

when {
params {
module_args = "--skip-gc-norm"
}
process {
"""
input[0] = [ [ id:'test' ],
file(params.modules_testdata_base_path + '/genomics/homo_sapiens/illumina/purecn/purecn_ex1.bam', checkIfExists: true),
file(params.modules_testdata_base_path + '/genomics/homo_sapiens/illumina/purecn/purecn_ex1.bam.bai', checkIfExists: true)
]
input[1] = file(params.modules_testdata_base_path + '/genomics/homo_sapiens/illumina/purecn/purecn_ex1_intervals.txt', checkIfExists: true)
"""
}
}

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

}

}
191 changes: 191 additions & 0 deletions modules/nf-core/purecn/coverage/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
{
"homo_sapiens - stub": {
"content": [
{
"0": [
[
{
"id": "test"
},
[
"test.txt.gz:md5,68b329da9893e34099c7d8ad5cb9c940",
"test_loess.txt.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
]
],
"1": [
[
{
"id": "test"
},
"test.png:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"2": [
[
{
"id": "test"
},
"test_loess_qc.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"3": [
[
{
"id": "test"
},
"test_loess.txt.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
],
"4": [
"versions.yml:md5,96bf7ac8a6dce08c678dc1fc2cb89d66"
],
"loess_qc_txt": [
[
{
"id": "test"
},
"test_loess_qc.txt:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"loess_txt": [
[
{
"id": "test"
},
"test_loess.txt.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
],
"png": [
[
{
"id": "test"
},
"test.png:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"txt": [
[
{
"id": "test"
},
[
"test.txt.gz:md5,68b329da9893e34099c7d8ad5cb9c940",
"test_loess.txt.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
]
],
"versions": [
"versions.yml:md5,96bf7ac8a6dce08c678dc1fc2cb89d66"
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.5"
},
"timestamp": "2025-03-07T20:17:01.199920116"
},
"homo_sapiens - skip_gc - stub": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test.txt.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
],
"1": [

],
"2": [

],
"3": [

],
"4": [
"versions.yml:md5,96bf7ac8a6dce08c678dc1fc2cb89d66"
],
"loess_qc_txt": [

],
"loess_txt": [

],
"png": [

],
"txt": [
[
{
"id": "test"
},
"test.txt.gz:md5,68b329da9893e34099c7d8ad5cb9c940"
]
],
"versions": [
"versions.yml:md5,96bf7ac8a6dce08c678dc1fc2cb89d66"
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.5"
},
"timestamp": "2025-03-07T20:17:11.624889158"
},
"homo_sapiens - skip_gc": {
"content": [
{
"0": [
[
{
"id": "test"
},
"purecn_ex1_coverage.txt.gz:md5,fd82ba1e942aeef3e07d5565cf80bd37"
]
],
"1": [

],
"2": [

],
"3": [

],
"4": [
"versions.yml:md5,96bf7ac8a6dce08c678dc1fc2cb89d66"
],
"loess_qc_txt": [

],
"loess_txt": [

],
"png": [

],
"txt": [
[
{
"id": "test"
},
"purecn_ex1_coverage.txt.gz:md5,fd82ba1e942aeef3e07d5565cf80bd37"
]
],
"versions": [
"versions.yml:md5,96bf7ac8a6dce08c678dc1fc2cb89d66"
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.5"
},
"timestamp": "2025-03-07T20:16:50.672409307"
}
}
5 changes: 5 additions & 0 deletions modules/nf-core/purecn/coverage/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
process {
withName: PURECN_COVERAGE {
ext.args = params.module_args
}
}
3 changes: 0 additions & 3 deletions tests/config/pytest_modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,6 @@ pretextsnapshot:
propr/logratio:
- modules/nf-core/propr/logratio/**
- tests/modules/nf-core/propr/logratio/**
purecn/coverage:
- modules/nf-core/purecn/coverage/**
- tests/modules/nf-core/purecn/coverage/**
purecn/run:
- modules/nf-core/purecn/run/**
- tests/modules/nf-core/purecn/run/**
Expand Down
18 changes: 0 additions & 18 deletions tests/modules/nf-core/purecn/coverage/main.nf

This file was deleted.

8 changes: 0 additions & 8 deletions tests/modules/nf-core/purecn/coverage/nextflow.config

This file was deleted.

10 changes: 0 additions & 10 deletions tests/modules/nf-core/purecn/coverage/test.yml

This file was deleted.

Loading