Skip to content

Commit

Permalink
Merge pull request #366 from Electrostatics/nathan/365
Browse files Browse the repository at this point in the history
Warn about unused PROPKA options
  • Loading branch information
sobolevnrm authored Jul 4, 2023
2 parents 1c818c0 + 04bc007 commit 8db8d94
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 1 deletion.
5 changes: 5 additions & 0 deletions docs/source/releases.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ Release history
Current version
***************

Changes
=======

* Added warnings about ignored PROPKA options (`#365 <https://github.com/Electrostatics/pdb2pqr/issues/365>`_)

Fixes
=====

Expand Down
7 changes: 7 additions & 0 deletions docs/source/using/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ Information about additional options can be obtained by running:
pdb2pqr --help
.. note::

`PROPKA <https://github.com/jensengroup/propka>`_ options are exposed via the PDB2PQR command line for convenience.
However, not all of these options are supported in PDB2PQR.
We have tried to add warning or error messages when unsupported PROPKA options are passed to the code but we may have missed some.
Please `file an issue <https://github.com/Electrostatics/pdb2pqr/issues>`_ if you find a PROPKA option that is not working in PDB2PQR.

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Additional command-line tools
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
13 changes: 13 additions & 0 deletions pdb2pqr/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@
VERSION = __version__


#: Options for PROPKA that PDB2PQR cannot handle
IGNORED_PROPKA_OPTIONS = {
"thermophiles": None,
"chains": None,
"alignment": None,
"mutations": None,
"mutator": None,
"mutator_options": None,
"reuse_ligand_mol2_file": False,
"keep_protons": False,
"protonate_all": False
}

#: How to format PDB2PQR title in output
TITLE_STR = f"PDB2PQR v{VERSION}: biomolecular structure conversion software."

Expand Down
11 changes: 10 additions & 1 deletion pdb2pqr/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from .ligand.mol2 import Mol2Molecule
from .utilities import noninteger_charge
from .config import VERSION, TITLE_STR, CITATIONS, FORCE_FIELDS
from .config import REPAIR_LIMIT
from .config import REPAIR_LIMIT, IGNORED_PROPKA_OPTIONS


_LOGGER = logging.getLogger(f"PDB2PQR{VERSION}")
Expand Down Expand Up @@ -279,6 +279,15 @@ def check_options(args):
:type args: argparse.Namespace
:raises RuntimeError: silly option combinations were encountered.
"""
for option, new_value in IGNORED_PROPKA_OPTIONS.items():
if option in args:
value = getattr(args, option)
if value:
_LOGGER.warning(
f"PROPKA option '{option}' {getattr(args, option)} is not "
f"processed correctly by PDB2PQR. Ignoring."
)
setattr(args, option, new_value)
if (args.ph < 0) or (args.ph > 14):
err = (
f"Specified pH ({args.ph}) is outside the range "
Expand Down

0 comments on commit 8db8d94

Please sign in to comment.