Skip to content

Commit

Permalink
Add warnings for unused PROPKA options.
Browse files Browse the repository at this point in the history
Fixes #365.
  • Loading branch information
Nathan Baker committed Jul 3, 2023
1 parent e15af86 commit a02a771
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
7 changes: 7 additions & 0 deletions pdb2pqr/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
VERSION = __version__


#: Options for PROPKA that PDB2PQR cannot handle
IGNORED_PROPKA_OPTIONS = [
"thermophiles", "chains", "alignment", "mutations", "mutator",
"mutator_options", "reuse_ligand_mol2_file", "keep_protons",
"protonate_all"
]

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

Expand Down
9 changes: 8 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,13 @@ def check_options(args):
:type args: argparse.Namespace
:raises RuntimeError: silly option combinations were encountered.
"""
for option in IGNORED_PROPKA_OPTIONS:
if option in args:
_LOGGER.warn(
f"PROPKA option '{option}' is not processed correctly by "
f"PDB2PQR. Ignoring."
)
args.__dict__.pop(option)
if (args.ph < 0) or (args.ph > 14):
err = (
f"Specified pH ({args.ph}) is outside the range "
Expand Down

0 comments on commit a02a771

Please sign in to comment.