From 9088f145a3db802d43a8c74e2d9ce14178dc38fe Mon Sep 17 00:00:00 2001 From: Nathan Baker Date: Sat, 20 Nov 2021 19:40:20 -0800 Subject: [PATCH] Fixes #250. --- docs/source/releases.rst | 9 +++++++++ pdb2pqr/biomolecule.py | 2 +- pdb2pqr/main.py | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/source/releases.rst b/docs/source/releases.rst index 2ac9869a..59b68154 100644 --- a/docs/source/releases.rst +++ b/docs/source/releases.rst @@ -2,6 +2,15 @@ Release history ############### +*************** +Current version +*************** + +Fixes +===== + +* Fix bug for application of pKa predictions to proteins with more than 999 residues (`#250 `_). + ****************** 3.3.1 (2021-11-13) ****************** diff --git a/pdb2pqr/biomolecule.py b/pdb2pqr/biomolecule.py index 5c482eb2..8518255b 100644 --- a/pdb2pqr/biomolecule.py +++ b/pdb2pqr/biomolecule.py @@ -822,7 +822,7 @@ def apply_pka_values(self, force_field, ph, pkadic): _LOGGER.warning(warn) else: self.apply_patch("NEUTRAL-CTERM", residue) - key = f"{resname:<3} {resnum:>3} {chain_id}" + key = f"{resname} {resnum} {chain_id}" key = key.strip() if key in pkadic: value = pkadic[key] diff --git a/pdb2pqr/main.py b/pdb2pqr/main.py index 082fc260..0216e543 100644 --- a/pdb2pqr/main.py +++ b/pdb2pqr/main.py @@ -637,7 +637,7 @@ def non_trivial(args, biomolecule, ligand, definition, is_cif): biomolecule.apply_pka_values( forcefield_.name, args.ph, - {row["group_label"]: row["pKa"] for row in pka_df}, + {f"{row['res_name']} {row['res_num']} {row['chain_id']}": row["pKa"] for row in pka_df}, ) _LOGGER.info("Adding hydrogens to biomolecule.")