Skip to content

Commit

Permalink
Bump version: 2.9.0 → 2.9.2
Browse files Browse the repository at this point in the history
 - added support to use sites with fixed protonation states (fixed_sites) from the CLI
 - small bug fix for CpHMD
  • Loading branch information
pedrishi committed Jul 12, 2022
1 parent 2e7d878 commit dd1498e
Show file tree
Hide file tree
Showing 14 changed files with 68,873 additions and 549 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 2.9.0
current_version = 2.9.2
commit = True
tag = True

Expand Down
600 changes: 71 additions & 529 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pypka/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
__author__ = "Pedro B. P. S. Reis"
__email__ = "pdreis@fc.ul.pt"
__version__ = "2.9.0"
__version__ = "2.9.2"

from .main import Titration, getTitrableSites
17 changes: 11 additions & 6 deletions pypka/clean/checksites.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,12 +338,17 @@ def correct_res_names(molecule, chain, resnumb, resname, aname):
):
aname = molecule.correct_atoms[resnumb][aname]

if (
Config.pypka_params["ff_family"] == "CHARMM"
and resname == "HIS"
# and ((fixed_sites and chain in fixed_sites and resnumb not in fixed_sites[chain]) or (fixed_sites and chain not in fixed_sites))
):
resname = "HSP"
if Config.pypka_params["ff_family"] == "CHARMM" and resname == "HIS":
if (
not fixed_sites
or (
fixed_sites
and chain in fixed_sites
and resnumb not in fixed_sites[chain]
)
or (fixed_sites and chain not in fixed_sites)
):
resname = "HSP"

return resnumb, resname, aname

Expand Down
23 changes: 14 additions & 9 deletions pypka/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,19 @@ def read_settings(filename):
parameters[param_name] = param_value
# Search for all titrable sites in different chains
sites = {}
fixed_sites = {}
for param_name in parameters:
if "_" in param_name:
chain = param_name.split("_")[-1]
else:
chain = " "
if param_name.startswith("site"):
if "_" in param_name:
chain = param_name.split("_")[1]
else:
chain = " "
sites_str = parameters[param_name]
chain_sites = [i.strip() for i in sites_str.split(",")]
sites[chain] = chain_sites
elif param_name.startswith("fixed_site"):
fixed_sites_str = parameters[param_name]
fixed_sites[chain] = eval(fixed_sites_str)

if " " in sites and sites[" "] == ["all"]:
if len(sites) != 1:
Expand All @@ -69,7 +73,7 @@ def read_settings(filename):
'Missing mandatory "sites" parameter\nTitratate all sites: sites = all\nTitrate all sites only from chain A: sites_A = all'
)

return sites, parameters
return sites, fixed_sites, parameters


def check_cli_args():
Expand Down Expand Up @@ -110,14 +114,15 @@ def check_cli_args():
raise IOError("File {0} does not exist.".format(args.settings))

# Read Settings File
sites, parameters = read_settings(args.settings)
sites, fixed_sites, parameters = read_settings(args.settings)

return sites, parameters, args.debug
return sites, fixed_sites, parameters, args.debug


def CLI():
# Read command line arguments
sites, parameters, debug = check_cli_args()
sites, fixed_sites, parameters, debug = check_cli_args()

Titration(parameters, sites=sites, debug=debug)

Titration(parameters, sites=sites, fixed_sites=fixed_sites, debug=debug)
print("CLI exited successfully")
6 changes: 5 additions & 1 deletion pypka/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ def filter_params(cls, parameters):
"""
# Define all parameters
for param_name, param_value in parameters.items():
if param_name.startswith("sites") or param_name in IGNORED_PARAMS:
if (
param_name.startswith("sites")
or param_name.startswith("fixed_sites")
or param_name in IGNORED_PARAMS
):
continue
config_obj = cls.getConfigObj(param_name)
if config_obj:
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ commands=
"""
[tool.poetry]
name = "pypka"
version = "2.9.0"
version = "2.9.2"
description = "A python module for flexible Poisson-Boltzmann based pKa calculations with proton tautomerism"
authors = ["Pedro Reis <pdreis@fc.ul.pt>"]
license = "LGPLv3"
Expand All @@ -48,7 +48,7 @@ numpy = [
]
pytest = ">=6.2.5"
delphi4py = "==1.2.0"
pdbmender = "==0.5.0"
pdbmender = "==0.5.3"

[tool.poetry.dev-dependencies]
recommonmark = "*"
Expand Down
9,667 changes: 9,667 additions & 0 deletions tests/cphmd/7ntt.gro

Large diffs are not rendered by default.

0 comments on commit dd1498e

Please sign in to comment.