Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
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
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ repos:
types: [yaml]
additional_dependencies: ["ruamel.yaml"]
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.1.0"
rev: "v4.0.0-alpha.8"
hooks:
- id: prettier
additional_dependencies:
- [email protected]
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.29.4
rev: 0.32.1
hooks:
- id: check-jsonschema
name: "Match meta.ymls in one of the subdirectories of modules/nf-core"
Expand All @@ -36,20 +36,20 @@ repos:

# use ruff for python files
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.3
rev: v0.11.2
hooks:
- id: ruff
files: \.py$
args: [--fix, --exit-non-zero-on-fix, "--select", "I,E1,E4,E7,E9,F,UP,N"] # sort imports and fix (rules taken from nf-core/tools)
- id: ruff-format # formatter
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
rev: "3.0.3"
rev: "3.2.0"
hooks:
- id: editorconfig-checker
alias: ec
# NOTE This runs with Docker instead of the binary. Hoping anyone messing with Dockerfiles has Docker installed
- repo: https://github.com/hadolint/hadolint
rev: v2.12.0
rev: v2.13.1-beta
hooks:
- id: hadolint-docker
- repo: https://github.com/nf-core/tools
Expand Down
20 changes: 16 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,23 @@ 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 ${meta.id}.prune.in

cat <<-END_VERSIONS > versions.yml
"${task.process}":
plink: \$(echo \$(plink --version) | sed 's/^PLINK v//;s/64.*//')
Expand Down
78 changes: 78 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,78 @@
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"

test("test_plink_indeppairwise") {

config "./nextflow.config"

setup {

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("https://github.com/nf-core/test-datasets/raw/modules/data/genomics/homo_sapiens/genome/vcf/ped/justhusky_minimal.vcf.gz", checkIfExists:true)
]
"""
}
}
}
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] = [
[ id:'test', single_end:false ], // meta map
file("test.bed"),
file("test.bim"),
file("test.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() }
)
}
}
}
96 changes: 96 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,96 @@
{
"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": [

],
"2": [
"versions.yml:md5,dd52fb8375a5ba36e766f25e9028d128"
],
"prunein": [
[
{
"id": "test",
"single_end": false
},
"test.prune.in:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"pruneout": [

],
"versions": [
"versions.yml:md5,dd52fb8375a5ba36e766f25e9028d128"
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "24.10.5"
},
"timestamp": "2025-03-26T15:26:32.033778403"
}
}
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 @@ -176,9 +176,6 @@ phyloflash:
plink/indep:
- modules/nf-core/plink/indep/**
- tests/modules/nf-core/plink/indep/**
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