Skip to content

nf-test migration: plink/indeppairwise #8133

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

Merged
merged 10 commits into from
Apr 9, 2025
21 changes: 17 additions & 4 deletions modules/nf-core/plink/indeppairwise/main.nf
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

process PLINK_INDEPPAIRWISE {
tag "$meta.id"
label 'process_low'
Expand Down Expand Up @@ -31,10 +30,24 @@ process PLINK_INDEPPAIRWISE {
--bed ${bed} \\
--bim ${bim} \\
--fam ${fam} \\
--threads $task.cpus \\
--threads ${task.cpus} \\
--indep-pairwise ${window_size} ${variant_count} ${r2_threshold} \\
$args \\
--out $prefix
${args} \\
--out ${prefix}

cat <<-END_VERSIONS > versions.yml
"${task.process}":
plink: \$(echo \$(plink --version) | sed 's/^PLINK v//;s/64.*//')
END_VERSIONS
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"

"""
touch ${prefix}.prune.in
touch ${prefix}.prune.out

cat <<-END_VERSIONS > versions.yml
"${task.process}":
plink: \$(echo \$(plink --version) | sed 's/^PLINK v//;s/64.*//')
Expand Down
76 changes: 76 additions & 0 deletions modules/nf-core/plink/indeppairwise/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "plink"
tag "plink/indeppairwise"
tag "plink/vcf"

setup {

config "./nextflow.config"

params {
module_args = '--make-bed --biallelic-only strict --vcf-half-call haploid --allow-extra-chr'
}

run("PLINK_VCF") {

script "../../vcf/main.nf"

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

test("test_plink_indeppairwise") {
when {
process {
"""
input[0] = PLINK_VCF.out.bed.join(PLINK_VCF.out.bim).join(PLINK_VCF.out.fam)
input[1] = Channel.value(50)
input[2] = Channel.value(5)
input[3] = Channel.value(0.2)
"""
}
}
then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}
}

test("test_plink_indeppairwise - stub") {

options "-stub"

when {
process {
"""
input[0] = PLINK_VCF.out.bed.join(PLINK_VCF.out.bim).join(PLINK_VCF.out.fam)
input[1] = Channel.value(50)
input[2] = Channel.value(5)
input[3] = Channel.value(0.2)
"""
}
}
then {
assertAll(
{ assert process.success },
{ assert snapshot(process.out).match() }
)
}
}
}
108 changes: 108 additions & 0 deletions modules/nf-core/plink/indeppairwise/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
{
"test_plink_indeppairwise": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"test.prune.in:md5,dce7ba75405107468f2ce18fc95a9786"
]
],
"1": [
[
{
"id": "test",
"single_end": false
},
"test.prune.out:md5,1f65f71308f2c4a03b9a4a98bbfb11e9"
]
],
"2": [
"versions.yml:md5,dd52fb8375a5ba36e766f25e9028d128"
],
"prunein": [
[
{
"id": "test",
"single_end": false
},
"test.prune.in:md5,dce7ba75405107468f2ce18fc95a9786"
]
],
"pruneout": [
[
{
"id": "test",
"single_end": false
},
"test.prune.out:md5,1f65f71308f2c4a03b9a4a98bbfb11e9"
]
],
"versions": [
"versions.yml:md5,dd52fb8375a5ba36e766f25e9028d128"
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.5"
},
"timestamp": "2025-03-26T14:55:08.717872783"
},
"test_plink_indeppairwise - stub": {
"content": [
{
"0": [
[
{
"id": "test",
"single_end": false
},
"test.prune.in:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
[
{
"id": "test",
"single_end": false
},
"test.prune.out:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"2": [
"versions.yml:md5,dd52fb8375a5ba36e766f25e9028d128"
],
"prunein": [
[
{
"id": "test",
"single_end": false
},
"test.prune.in:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"pruneout": [
[
{
"id": "test",
"single_end": false
},
"test.prune.out:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions": [
"versions.yml:md5,dd52fb8375a5ba36e766f25e9028d128"
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.5"
},
"timestamp": "2025-03-28T17:45:50.995416015"
}
}
5 changes: 5 additions & 0 deletions modules/nf-core/plink/indeppairwise/tests/nextflow.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
process {
withName: "PLINK_VCF" {
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 @@ -154,9 +154,6 @@ paragraph/multigrmpy:
phyloflash:
- modules/nf-core/phyloflash/**
- tests/modules/nf-core/phyloflash/**
plink/indeppairwise:
- modules/nf-core/plink/indeppairwise/**
- tests/modules/nf-core/plink/indeppairwise/**
pneumocat:
- modules/nf-core/pneumocat/**
- tests/modules/nf-core/pneumocat/**
Expand Down
28 changes: 0 additions & 28 deletions tests/modules/nf-core/plink/indeppairwise/main.nf

This file was deleted.

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

This file was deleted.

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

This file was deleted.

Loading