Skip to content

Commit d0f9532

Browse files
authored
Add apbs (nf-core#10185)
* init apbs * updated in and out params and test files (locally) * meta yml updated and passing linting * sourcing files from test-datasets repo * review fixes
1 parent ecf2a77 commit d0f9532

5 files changed

Lines changed: 310 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+
- conda-forge::apbs=3.4.1

modules/nf-core/apbs/main.nf

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
process APBS {
2+
tag "$meta.id"
3+
label 'process_medium'
4+
5+
conda "${moduleDir}/environment.yml"
6+
container "${ workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container ?
7+
'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/28/288b945c2895993a166b5baf67efd85f2111a3efe64bd189dae731e697eae9ef/data':
8+
'community.wave.seqera.io/library/apbs:3.4.1--298b75172827aae7' }"
9+
10+
input:
11+
tuple val(meta), path(apbs_input), path(pqr)
12+
13+
output:
14+
tuple val(meta), path("*.dx") , emit: dx, optional: true
15+
tuple val(meta), path("io.mc") , emit: mc
16+
tuple val(meta), path("${prefix}.log"), emit: log
17+
tuple val("${task.process}"), val('apbs'), eval("apbs --version 2>&1 | sed '6!d;s|^.*Version APBS ||; s| .*\$||'"), topic: versions, emit: versions_apbs
18+
19+
when:
20+
task.ext.when == null || task.ext.when
21+
22+
script:
23+
def args = task.ext.args ?: ''
24+
prefix = task.ext.prefix ?: "${meta.id}"
25+
"""
26+
apbs \\
27+
$args \\
28+
${apbs_input} \\
29+
2>&1 | tee ${prefix}.log
30+
"""
31+
32+
stub:
33+
def args = task.ext.args ?: ''
34+
prefix = task.ext.prefix ?: "${meta.id}"
35+
"""
36+
echo ${args}
37+
38+
touch ${prefix}.dx
39+
touch ${prefix}.log
40+
"""
41+
}

modules/nf-core/apbs/meta.yml

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
name: "apbs"
2+
description: |
3+
Compute biomolecular electrostatics by solving the Poisson-Boltzmann equation
4+
using APBS (Adaptive Poisson-Boltzmann Solver). Produces electrostatic potential
5+
maps and solvation energy values for large biomolecular assemblages.
6+
keywords:
7+
- electrostatics
8+
- poisson-boltzmann
9+
- solvation
10+
- structural-biology
11+
- biophysics
12+
- computational-chemistry
13+
tools:
14+
- "apbs":
15+
description: |
16+
APBS (Adaptive Poisson-Boltzmann Solver) is a software package for modelling
17+
biomolecular solvation through solution of the Poisson-Boltzmann equation.
18+
It computes electrostatic solvation energies and potentials for large
19+
biomolecular assemblages and is widely used in structural biology and
20+
computational biophysics.
21+
homepage: "https://www.poissonboltzmann.org/"
22+
documentation: "https://apbs.readthedocs.io/en/latest/"
23+
tool_dev_url: "https://github.com/Electrostatics/apbs"
24+
licence:
25+
- "Custom"
26+
identifier: ""
27+
input:
28+
- - meta:
29+
type: map
30+
description: |
31+
Groovy Map containing sample information
32+
e.g. `[ id:'sample1' ]`
33+
- apbs_input:
34+
type: file
35+
description: |
36+
APBS input configuration file specifying the electrostatics calculation,
37+
including paths to molecular structure files (PQR/PDB) and calculation
38+
parameters. The file extension is typically `.in` but `.inp` is also
39+
accepted for legacy purposes.
40+
pattern: "*.{in,inp}"
41+
ontologies: []
42+
- pqr:
43+
type: file
44+
description: |
45+
One or more PQR molecular structure files referenced by the input
46+
configuration file. PQR files contain atomic coordinates, charges, and
47+
radii used by APBS for electrostatics calculations.
48+
pattern: "*.pqr"
49+
ontologies:
50+
- edam: "http://edamontology.org/format_4035" # PQR
51+
output:
52+
dx:
53+
- - meta:
54+
type: map
55+
description: |
56+
Groovy Map containing sample information
57+
e.g. `[ id:'sample1' ]`
58+
- "*.dx":
59+
type: file
60+
description: |
61+
OpenDX format volumetric electrostatic potential map file output by APBS.
62+
Optional: this output is only produced when the input configuration file
63+
contains a `write pot dx <dx_filename>` directive.
64+
pattern: "*.dx"
65+
ontologies: []
66+
mc:
67+
- - meta:
68+
type: map
69+
description: |
70+
Groovy Map containing sample information
71+
e.g. `[ id:'sample1' ]`
72+
- io.mc:
73+
type: file
74+
description: |
75+
APBS multigrid calculation output file containing energy and force
76+
information from the finite difference solver.
77+
pattern: "io.mc"
78+
ontologies: []
79+
log:
80+
- - meta:
81+
type: map
82+
description: |
83+
Groovy Map containing sample information
84+
e.g. `[ id:'sample1' ]`
85+
- ${prefix}.log:
86+
type: file
87+
description: |
88+
APBS standard output log file containing calculation results, including
89+
electrostatic solvation energies and run diagnostics.
90+
pattern: "*.log"
91+
ontologies:
92+
- edam: "http://edamontology.org/format_2330" # Textual format
93+
versions_apbs:
94+
- - ${task.process}:
95+
type: string
96+
description: The name of the process
97+
- apbs:
98+
type: string
99+
description: The name of the tool
100+
- apbs --version 2>&1 | sed '6!d;s|^.*Version APBS ||; s| .*\$||':
101+
type: eval
102+
description: The expression to obtain the version of the tool
103+
topics:
104+
versions:
105+
- - ${task.process}:
106+
type: string
107+
description: The name of the process
108+
- apbs:
109+
type: string
110+
description: The name of the tool
111+
- apbs --version 2>&1 | sed '6!d;s|^.*Version APBS ||; s| .*\$||':
112+
type: eval
113+
description: The expression to obtain the version of the tool
114+
authors:
115+
- "@vagkaratzas"
116+
maintainers:
117+
- "@vagkaratzas"
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
nextflow_process {
2+
3+
name "Test Process APBS"
4+
script "../main.nf"
5+
process "APBS"
6+
7+
tag "modules"
8+
tag "modules_nfcore"
9+
tag "apbs"
10+
11+
test("apbs - in_pqr - dx") {
12+
13+
when {
14+
process {
15+
"""
16+
input[0] = [
17+
[ id:'test' ],
18+
file(params.modules_testdata_base_path + 'proteomics/apbs/apbs-mol.in', checkIfExists: true),
19+
[
20+
file(params.modules_testdata_base_path + 'proteomics/apbs/methanol.pqr', checkIfExists: true),
21+
file(params.modules_testdata_base_path + 'proteomics/apbs/methoxide.pqr', checkIfExists: true)
22+
]
23+
]
24+
"""
25+
}
26+
}
27+
28+
then {
29+
assert process.success
30+
assertAll(
31+
{ assert snapshot(
32+
process.out.dx,
33+
file(process.out.mc[0][1]).name,
34+
path(process.out.log[0][1]).readLines().size(),
35+
process.out.findAll { key, val -> key.startsWith("versions")}
36+
).match() }
37+
)
38+
}
39+
40+
}
41+
42+
test("apbs - in_pqr - dx - stub") {
43+
44+
options "-stub"
45+
46+
when {
47+
process {
48+
"""
49+
input[0] = [
50+
[ id:'test' ],
51+
file(params.modules_testdata_base_path + 'proteomics/apbs/apbs-mol.in', checkIfExists: true),
52+
[
53+
file(params.modules_testdata_base_path + 'proteomics/apbs/methanol.pqr', checkIfExists: true),
54+
file(params.modules_testdata_base_path + 'proteomics/apbs/methoxide.pqr', checkIfExists: true)
55+
]
56+
]
57+
"""
58+
}
59+
}
60+
61+
then {
62+
assert process.success
63+
assertAll(
64+
{ assert snapshot(
65+
process.out.dx,
66+
process.out.log,
67+
file(process.out.mc[0][1]).name,
68+
process.out.findAll { key, val -> key.startsWith("versions")}
69+
).match() }
70+
)
71+
}
72+
73+
}
74+
75+
}
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"apbs - in_pqr - dx": {
3+
"content": [
4+
[
5+
[
6+
{
7+
"id": "test"
8+
},
9+
[
10+
"pot1.dx:md5,2ec2b21c409dd3c5ae68be8202c23c97",
11+
"pot2.dx:md5,cdf35de3034b04e1710181c52be4a925",
12+
"pot3.dx:md5,810e4195370115e5f2539a6bc5297b40",
13+
"pot4.dx:md5,455718702c1b0b83a42cf4d6b8639fde"
14+
]
15+
]
16+
],
17+
"io.mc",
18+
221,
19+
{
20+
"versions_apbs": [
21+
[
22+
"APBS",
23+
"apbs",
24+
"3.4.1"
25+
]
26+
]
27+
}
28+
],
29+
"meta": {
30+
"nf-test": "0.9.3",
31+
"nextflow": "25.10.2"
32+
},
33+
"timestamp": "2026-02-23T12:46:25.40825314"
34+
},
35+
"apbs - in_pqr - dx - stub": {
36+
"content": [
37+
[
38+
[
39+
{
40+
"id": "test"
41+
},
42+
"test.dx:md5,d41d8cd98f00b204e9800998ecf8427e"
43+
]
44+
],
45+
[
46+
[
47+
{
48+
"id": "test"
49+
},
50+
"test.log:md5,d41d8cd98f00b204e9800998ecf8427e"
51+
]
52+
],
53+
"io.mc",
54+
{
55+
"versions_apbs": [
56+
[
57+
"APBS",
58+
"apbs",
59+
"3.4.1"
60+
]
61+
]
62+
}
63+
],
64+
"meta": {
65+
"nf-test": "0.9.3",
66+
"nextflow": "25.10.2"
67+
},
68+
"timestamp": "2026-02-23T12:46:56.301493133"
69+
}
70+
}

0 commit comments

Comments
 (0)