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
10 changes: 10 additions & 0 deletions modules/nf-core/strdrop/build/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
channels:
- conda-forge
- bioconda
dependencies:
- conda-forge::pip=25.3
- conda-forge::python=3.14.1
- pip:
- strdrop==0.3
34 changes: 34 additions & 0 deletions modules/nf-core/strdrop/build/main.nf
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
process STRDROP_BUILD {
tag "$meta.id"
label 'process_single'

conda "${moduleDir}/environment.yml"
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/4f/4fc3114f6d67fadb826981d29ae67f8564ee81283184893c2db677d919b5b32d/data':
'community.wave.seqera.io/library/pip_strdrop:df8d5dc993ea6848' }"

input:
tuple val(meta), path(training_set, stageAs: 'input/*')

output:
tuple val(meta), path("*.json"), emit: json
tuple val("${task.process}"), val('strdrop'), eval("strdrop --version | sed 's/.* //g'"), topic: versions, emit: versions_strdrop

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

script:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
strdrop \\
build \\
--training-set ./input \\
${prefix}.json
"""

stub:
def prefix = task.ext.prefix ?: "${meta.id}"
"""
touch ${prefix}.json
"""
}
68 changes: 68 additions & 0 deletions modules/nf-core/strdrop/build/meta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
name: "strdrop_build"
description: Build reference json from sequencing coverage in STR VCFs
keywords:
- str
- vcf
- lrs
tools:
- "strdrop":
description: "Flag STR coverage drops in LRS data"
homepage: "https://github.com/dnil/strdrop"
documentation: "https://github.com/dnil/strdrop/blob/main/docs/README.md"
tool_dev_url: "https://github.com/dnil/strdrop"
licence: ["MIT"]
identifier: ""

input:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- training_set:
type: file
description: Input VCF training set files
pattern: "*.{vcf,vcf.gz,bcf,bcf.gz}"
ontologies:
- edam: "http://edamontology.org/format_3016" # VCF
- edam: "http://edamontology.org/format_3020" # BCF
output:
json:
- - meta:
type: map
description: |
Groovy Map containing sample information
e.g. `[ id:'sample1' ]`
- "*.json":
type: file
description: Output reference json file
pattern: "*.json"
ontologies:
- edam: "http://edamontology.org/format_3464" # JSON
versions_strdrop:
- - ${task.process}:
type: string
description: The name of the process
- strdrop:
type: string
description: The name of the tool
- strdrop --version | sed 's/.* //g':
type: eval
description: The expression to obtain the version of the tool

topics:
versions:
- - ${task.process}:
type: string
description: The name of the process
- strdrop:
type: string
description: The name of the tool
- strdrop --version | sed 's/.* //g':
type: eval
description: The expression to obtain the version of the tool
authors:
- "@fellen31"
maintainers:
- "@fellen31"
101 changes: 101 additions & 0 deletions modules/nf-core/strdrop/build/tests/main.nf.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
nextflow_process {

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

tag "modules"
tag "modules_nfcore"
tag "strdrop"
tag "strdrop/build"
tag "samtools/faidx"
tag "gunzip"
tag "trgt/genotype"

setup {
run("GUNZIP"){
script "../../../gunzip/main.nf"
process {
"""
input[0] = [
[ id : 'chr22' ],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/chr22_chr22_KI270734v1_random/sequence/genome.fa.gz', checkIfExists: true)
]
"""
}
}
run("SAMTOOLS_FAIDX"){
script "../../../samtools/faidx/main.nf"
process {
"""
input[0] = GUNZIP.out.gunzip
input[1] = [[],[]]
input[2] = false
"""
}
}
run("TRGT_GENOTYPE"){
script "../../../trgt/genotype/main.nf"
process {
"""
input[0] = [
[ id:'test' ],
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test.sorted.bam', checkIfExists: true),
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/pacbio/bam/test.sorted.bam.bai', checkIfExists: true),
'XX'
]
input[1] = GUNZIP.out.gunzip
input[2] = SAMTOOLS_FAIDX.out.fai
input[3] = Channel.of('chr22\t18890357\t18890451\tID=TEST;MOTIFS=AT;STRUC=(AT)n')
.collectFile(name : 'repeats.bed', newLine: false)
.map { file -> [ [ id : 'chr22' ], file ] }
"""
}
}
}

test("test") {
when {
process {
"""
input[0] = TRGT_GENOTYPE.out.vcf
"""
}
}

then {
assert process.success
assertAll(
{ assert snapshot(
process.out,
process.out.findAll { key, val -> key.startsWith("versions")}
).match() }
)
}

}

test("test-stub") {

options "-stub"

when {
process {
"""
input[0] = TRGT_GENOTYPE.out.vcf
"""
}
}

then {
assert process.success
assertAll(
{ assert snapshot(
process.out,
process.out.findAll { key, val -> key.startsWith("versions")}
).match() }
)
}

}
}
102 changes: 102 additions & 0 deletions modules/nf-core/strdrop/build/tests/main.nf.test.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{
"test": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test.json:md5,e918b92effa7c7c4696f3ae80e51d0d5"
]
],
"1": [
[
"STRDROP_BUILD",
"strdrop",
"0.3"
]
],
"json": [
[
{
"id": "test"
},
"test.json:md5,e918b92effa7c7c4696f3ae80e51d0d5"
]
],
"versions_strdrop": [
[
"STRDROP_BUILD",
"strdrop",
"0.3"
]
]
},
{
"versions_strdrop": [
[
"STRDROP_BUILD",
"strdrop",
"0.3"
]
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "25.04.6"
},
"timestamp": "2025-12-06T11:11:57.601817569"
},
"test-stub": {
"content": [
{
"0": [
[
{
"id": "test"
},
"test.json:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"1": [
[
"STRDROP_BUILD",
"strdrop",
"0.3"
]
],
"json": [
[
{
"id": "test"
},
"test.json:md5,d41d8cd98f00b204e9800998ecf8427e"
]
],
"versions_strdrop": [
[
"STRDROP_BUILD",
"strdrop",
"0.3"
]
]
},
{
"versions_strdrop": [
[
"STRDROP_BUILD",
"strdrop",
"0.3"
]
]
}
],
"meta": {
"nf-test": "0.9.2",
"nextflow": "25.04.6"
},
"timestamp": "2025-12-06T11:12:03.26800462"
}
}
Loading