Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
7 changes: 7 additions & 0 deletions modules/nf-core/pcangsd/inbreeding/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
channels:
- conda-forge
- bioconda
dependencies:
- "bioconda::pcangsd=1.36.4"
41 changes: 41 additions & 0 deletions modules/nf-core/pcangsd/inbreeding/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
process PCANGSD_INBREEDING {
tag "$meta.id"
label 'process_single'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container ?
'https://depot.galaxyproject.org/singularity/pcangsd:1.36.4--py313h5d164f8_1':
'quay.io/biocontainers/pcangsd:1.36.4--py313h5d164f8_1' }"

input:
tuple val(meta), path(beagle_file)

output:
tuple val(meta), path("*.inbreed.samples"), emit: inbreeding_coefficients
tuple val("${task.process}"), val('pcangsd'), eval("pcangsd --version"), topic: versions, emit: versions_pcangsd

when:
task.ext.when == null || task.ext.when

script:
def args = task.ext.args ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"

"""
pcangsd \\
--threads ${task.cpus} \\
--beagle ${beagle_file} \\
--inbreed-samples \\
--out ${prefix} \\
$args
"""

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

touch ${prefix}.inbreed.samples
"""
}
66 changes: 66 additions & 0 deletions modules/nf-core/pcangsd/inbreeding/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
name: "pcangsd_inbreeding"
description: Estimate per-sample inbreeding coefficients from genotype likelihoods
keywords:
- pcangsd
- inbreeding coefficients
- genomics
tools:
- "pcangsd":
description: "Framework for analyzing low-depth next-generation sequencing (NGS)
data in heterogeneous/structured populations using principal component analysis
(PCA)."
homepage: "https://github.com/Rosemeis/pcangsd"
documentation: "https://github.com/Rosemeis/pcangsd"
tool_dev_url: "https://github.com/Rosemeis/pcangsd"
doi: "10.1534/genetics.118.301336"
licence: ["GPL v3-or-later"]
identifier: ""
input:
- - meta:
type: map
description: |
Groovy Map containing population information
e.g. [ id:'test', population:'population id', samples:'sample IDs' ]
- beagle_file:
type: file
description: Beagle genotype likelihood file produced by ANGSD
pattern: "*.beagle.gz"
ontologies: []
output:
inbreeding_coefficients:
- - meta:
type: map
description: |
Groovy Map containing population information
e.g. [ id:'test', population:'population id', samples:'sample IDs' ]
- "*.inbreed.samples":
type: file
description: Per-sample inbreeding coefficients file produced by pcangsd
pattern: "*.inbreed.samples"
ontologies: []
versions_pcangsd:
- - "${task.process}":
type: string
description: The name of the process
- "pcangsd":
type: string
description: The name of the tool
- "pcangsd --version":
type: eval
description: The expression to obtain the version of the tool
topics:
versions:
- - ${task.process}:
type: string
description: The name of the process
- pcangsd:
type: string
description: The name of the tool
- pcangsd --version:
type: eval
description: The expression to obtain the version of the tool
authors:
- "@ASendellPrice"
maintainers:
- "@ASendellPrice"
66 changes: 66 additions & 0 deletions modules/nf-core/pcangsd/inbreeding/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// nf-core modules test pcangsd/inbreeding
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "pcangsd"
tag "pcangsd/inbreeding"

test("pcangsd - beagle") {

when {

process {
"""
input[0] = [
[ id: "FIN", population: "FIN", samples: ["HG00349", "HG00358", "HG00350", "HG00351"] ],
[ file(params.modules_testdata_base_path + 'delete_me/pcangsd/FIN.beagle.gz', checkIfExists: true) ]
]
"""
}
}

then {
// As process is non-deterministic, we cannot check the output file contents, but we can check
// that the file exists and contains the expected number of lines (one line per sample).
def inbreedFile = file(process.out.inbreeding_coefficients.get(0).get(1))
def lines = inbreedFile.readLines()

assertAll(
{ assert process.success },
{ assert inbreedFile.exists() },
{ assert lines.size() == 4 }
)
}

}

test("pcangsd - beagle - stub") {

options "-stub"

when {
process {
"""
input[0] = [
[ id: "FIN", population: "FIN", samples: ["HG00349", "HG00358", "HG00350", "HG00351"] ],
[ file(params.modules_testdata_base_path + 'delete_me/pcangsd/FIN.beagle.gz', checkIfExists: true) ]
]
"""
}
}

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

}

}
35 changes: 35 additions & 0 deletions modules/nf-core/pcangsd/inbreeding/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"pcangsd - beagle - stub": {
"content": [
{
"inbreeding_coefficients": [
[
{
"id": "FIN",
"population": "FIN",
"samples": [
"HG00349",
"HG00358",
"HG00350",
"HG00351"
]
},
"FIN.inbreed.samples:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions_pcangsd": [
[
"PCANGSD_INBREEDING",
"pcangsd",
"v1.36.4"
]
]
}
],
"timestamp": "2026-08-12T07:01:29.675109",
"meta": {
"nf-test": "0.9.5",
"nextflow": "26.04.1"
}
}
}