Skip to content

Commit 69017e7

Browse files
Add new module: octopusv/plot (#11747)
* Add new module: octopusv/plot * update test * update tests * Update modules/nf-core/octopusv/plot/main.nf --------- Co-authored-by: Simon Pearce <24893913+SPPearce@users.noreply.github.com>
1 parent 9ed7f15 commit 69017e7

5 files changed

Lines changed: 333 additions & 0 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/environment-schema.json
3+
channels:
4+
- conda-forge
5+
- bioconda
6+
dependencies:
7+
- "bioconda::octopusv=0.3.3"
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
process OCTOPUSV_PLOT {
2+
tag "${meta.id}"
3+
label 'process_single'
4+
5+
conda "${moduleDir}/environment.yml"
6+
container "${workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container
7+
? 'https://depot.galaxyproject.org/singularity/octopusv:0.3.3--pyhdfd78af_0'
8+
: 'quay.io/biocontainers/octopusv:0.3.3--pyhdfd78af_0'}"
9+
10+
input:
11+
tuple val(meta), path(txt)
12+
13+
output:
14+
tuple val(meta), path("${prefix}_sv_sizes.png"), emit: sv_sizes_png
15+
tuple val(meta), path("${prefix}_sv_sizes.svg"), emit: sv_sizes_svg
16+
tuple val(meta), path("${prefix}_sv_types.png"), emit: sv_types_png
17+
tuple val(meta), path("${prefix}_sv_types.svg"), emit: sv_types_svg
18+
tuple val(meta), path("${prefix}_chromosome_distribution.png"), emit: chromosome_distribution_png
19+
tuple val(meta), path("${prefix}_chromosome_distribution.svg"), emit: chromosome_distribution_svg
20+
tuple val("${task.process}"), val('octopusv'), eval("python -c \"import importlib.metadata as m; print(m.version('octopusv'))\""), emit: versions_octopusv, topic: versions
21+
22+
when:
23+
task.ext.when == null || task.ext.when
24+
25+
script:
26+
def args = task.ext.args ?: ''
27+
prefix = task.ext.prefix ?: "${meta.id}"
28+
"""
29+
octopusv plot \\
30+
${txt} \\
31+
--output-prefix ${prefix} \\
32+
${args}
33+
"""
34+
35+
stub:
36+
def args = task.ext.args ?: ''
37+
prefix = task.ext.prefix ?: "${meta.id}"
38+
"""
39+
echo ${args}
40+
41+
touch ${prefix}_sv_sizes.svg
42+
touch ${prefix}_sv_sizes.png
43+
touch ${prefix}_sv_types.png
44+
touch ${prefix}_sv_types.svg
45+
touch ${prefix}_chromosome_distribution.png
46+
touch ${prefix}_chromosome_distribution.svg
47+
"""
48+
}
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
# yaml-language-server: $schema=https://raw.githubusercontent.com/nf-core/modules/master/modules/meta-schema.json
2+
name: "octopusv_plot"
3+
description: "Plot structural variant statistics using octopusv stat output"
4+
keywords:
5+
- summary
6+
- structural variant
7+
- statistics
8+
- plot
9+
tools:
10+
- "octopusv":
11+
description: "End-to-end structural variant post-processing: standardize, merge,
12+
compare, and export SVs."
13+
homepage: "https://github.com/ylab-hi/OctopuSV"
14+
documentation: "https://github.com/ylab-hi/OctopuSV"
15+
tool_dev_url: "https://github.com/ylab-hi/octopusV"
16+
doi: "10.1093/bioinformatics/btaf599"
17+
licence:
18+
- "MIT"
19+
identifier: ""
20+
21+
input:
22+
- - meta:
23+
type: map
24+
description: |
25+
Groovy Map containing sample information
26+
e.g. `[ id:'sample1' ]`
27+
- txt:
28+
type: file
29+
description: OctopuSV stats text input
30+
pattern: "*.txt"
31+
ontologies:
32+
- edam: "http://edamontology.org/format_2330" # TXT
33+
34+
output:
35+
sv_sizes_png:
36+
- - meta:
37+
type: map
38+
description: Sample information
39+
- ${prefix}_sv_sizes.png:
40+
type: file
41+
description: SV sizes plot (PNG)
42+
pattern: "*_sv_sizes.png"
43+
ontologies:
44+
- edam: "http://edamontology.org/format_3603" # PNG
45+
sv_sizes_svg:
46+
- - meta:
47+
type: map
48+
description: Sample information
49+
- ${prefix}_sv_sizes.svg:
50+
type: file
51+
description: SV sizes plot (SVG)
52+
pattern: "*_sv_sizes.svg"
53+
ontologies:
54+
- edam: "http://edamontology.org/format_3604" # SVG
55+
sv_types_png:
56+
- - meta:
57+
type: map
58+
description: Sample information
59+
- ${prefix}_sv_types.png:
60+
type: file
61+
description: SV types plot (PNG)
62+
pattern: "*_sv_types.png"
63+
ontologies:
64+
- edam: "http://edamontology.org/format_3603" # PNG
65+
sv_types_svg:
66+
- - meta:
67+
type: map
68+
description: Sample information
69+
- ${prefix}_sv_types.svg:
70+
type: file
71+
description: SV types plot (SVG)
72+
pattern: "*_sv_types.svg"
73+
ontologies:
74+
- edam: "http://edamontology.org/format_3604" # SVG
75+
chromosome_distribution_png:
76+
- - meta:
77+
type: map
78+
description: Sample information
79+
- ${prefix}_chromosome_distribution.png:
80+
type: file
81+
description: Chromosome distribution plot of structural variants (PNG)
82+
pattern: "*_chromosome_distribution.png"
83+
ontologies:
84+
- edam: "http://edamontology.org/format_3603" # PNG
85+
chromosome_distribution_svg:
86+
- - meta:
87+
type: map
88+
description: Sample information
89+
- ${prefix}_chromosome_distribution.svg:
90+
type: file
91+
description: Chromosome distribution plot of structural variants (SVG)
92+
pattern: "*_chromosome_distribution.svg"
93+
ontologies:
94+
- edam: "http://edamontology.org/format_3604" # SVG
95+
versions_octopusv:
96+
- - ${task.process}:
97+
type: string
98+
description: The name of the process
99+
- octopusv:
100+
type: string
101+
description: The name of the tool
102+
- python -c "import importlib.metadata as m; print(m.version('octopusv'))":
103+
type: eval
104+
description: The expression to obtain the version of the tool
105+
106+
topics:
107+
versions:
108+
- - ${task.process}:
109+
type: string
110+
description: The name of the process
111+
- octopusv:
112+
type: string
113+
description: The name of the tool
114+
- python -c "import importlib.metadata as m; print(m.version('octopusv'))":
115+
type: eval
116+
description: The expression to obtain the version of the tool
117+
authors:
118+
- "@manascripts"
119+
maintainers:
120+
- "@manascripts"
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
nextflow_process {
2+
3+
name "Test Process OCTOPUSV_PLOT"
4+
script "../main.nf"
5+
process "OCTOPUSV_PLOT"
6+
7+
tag "modules"
8+
tag "modules_nfcore"
9+
tag "octopusv"
10+
tag "octopusv/plot"
11+
12+
test("homo_sapiens - stat - txt") {
13+
14+
when {
15+
process {
16+
"""
17+
input[0] = [
18+
[ id:'test' ],
19+
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/octopusv/stat/stats_sk-n-as-severus-ont.txt', checkIfExists: true)
20+
]
21+
"""
22+
}
23+
}
24+
25+
then {
26+
assertAll(
27+
{ assert process.success },
28+
{ assert snapshot(
29+
path(process.out.sv_sizes_png.get(0).get(1)),
30+
path(process.out.sv_types_png.get(0).get(1)),
31+
path(process.out.chromosome_distribution_png.get(0).get(1)),
32+
file(process.out.sv_sizes_svg.get(0).get(1)).name,
33+
file(process.out.sv_types_svg.get(0).get(1)).name,
34+
file(process.out.chromosome_distribution_svg.get(0).get(1)).name,
35+
process.out.findAll { key, val -> key.startsWith('versions') }
36+
).match() }
37+
)
38+
}
39+
40+
}
41+
42+
test("homo_sapiens - stat - stub") {
43+
44+
options "-stub"
45+
46+
when {
47+
process {
48+
"""
49+
input[0] = [
50+
[ id:'test' ],
51+
file(params.modules_testdata_base_path + 'genomics/homo_sapiens/genome/vcf/octopusv/stat/stats_sk-n-as-severus-ont.txt', checkIfExists: true)
52+
]
53+
"""
54+
}
55+
}
56+
57+
then {
58+
assert process.success
59+
assertAll(
60+
{ assert snapshot(sanitizeOutput(process.out)).match() }
61+
)
62+
}
63+
64+
}
65+
66+
}
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
{
2+
"homo_sapiens - stat - txt": {
3+
"content": [
4+
"test_sv_sizes.png:md5,a21190f74087066b2588f294fed9f242",
5+
"test_sv_types.png:md5,744cd764b0f54431922bb5047f252095",
6+
"test_chromosome_distribution.png:md5,8bff9ffb7cb75059b609616ceebb52a7",
7+
"test_sv_sizes.svg",
8+
"test_sv_types.svg",
9+
"test_chromosome_distribution.svg",
10+
{
11+
"versions_octopusv": [
12+
[
13+
"OCTOPUSV_PLOT",
14+
"octopusv",
15+
"0.3.3"
16+
]
17+
]
18+
}
19+
],
20+
"timestamp": "2026-05-22T14:14:00.146965966",
21+
"meta": {
22+
"nf-test": "0.9.5",
23+
"nextflow": "25.10.4"
24+
}
25+
},
26+
"homo_sapiens - stat - stub": {
27+
"content": [
28+
{
29+
"chromosome_distribution_png": [
30+
[
31+
{
32+
"id": "test"
33+
},
34+
"test_chromosome_distribution.png:md5,d41d8cd98f00b204e9800998ecf8427e"
35+
]
36+
],
37+
"chromosome_distribution_svg": [
38+
[
39+
{
40+
"id": "test"
41+
},
42+
"test_chromosome_distribution.svg:md5,d41d8cd98f00b204e9800998ecf8427e"
43+
]
44+
],
45+
"sv_sizes_png": [
46+
[
47+
{
48+
"id": "test"
49+
},
50+
"test_sv_sizes.png:md5,d41d8cd98f00b204e9800998ecf8427e"
51+
]
52+
],
53+
"sv_sizes_svg": [
54+
[
55+
{
56+
"id": "test"
57+
},
58+
"test_sv_sizes.svg:md5,d41d8cd98f00b204e9800998ecf8427e"
59+
]
60+
],
61+
"sv_types_png": [
62+
[
63+
{
64+
"id": "test"
65+
},
66+
"test_sv_types.png:md5,d41d8cd98f00b204e9800998ecf8427e"
67+
]
68+
],
69+
"sv_types_svg": [
70+
[
71+
{
72+
"id": "test"
73+
},
74+
"test_sv_types.svg:md5,d41d8cd98f00b204e9800998ecf8427e"
75+
]
76+
],
77+
"versions_octopusv": [
78+
[
79+
"OCTOPUSV_PLOT",
80+
"octopusv",
81+
"0.3.3"
82+
]
83+
]
84+
}
85+
],
86+
"timestamp": "2026-05-22T14:14:07.088138028",
87+
"meta": {
88+
"nf-test": "0.9.5",
89+
"nextflow": "25.10.4"
90+
}
91+
}
92+
}

0 commit comments

Comments
 (0)