From 8d9fb2e3f2cb910528416197da3b24bc149e273d Mon Sep 17 00:00:00 2001 From: richard gowers Date: Tue, 18 Jul 2023 15:42:15 +0100 Subject: [PATCH] proteincomponent: tweak conversions to/from openmm/rdkit helps with some nonstandard residues previously giving KeyError AROMATIC will not affect serialised representations (i.e. keys) as these don't use this path --- gufe/components/proteincomponent.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gufe/components/proteincomponent.py b/gufe/components/proteincomponent.py index ead18b2c..3700f733 100644 --- a/gufe/components/proteincomponent.py +++ b/gufe/components/proteincomponent.py @@ -27,6 +27,10 @@ 1: BondType.SINGLE, 2: BondType.DOUBLE, 3: BondType.TRIPLE, + app.Single: BondType.SINGLE, + app.Double: BondType.DOUBLE, + app.Triple: BondType.TRIPLE, + app.Aromatic: BondType.AROMATIC, None: BondType.UNSPECIFIED, } _BONDORDERS_RDKIT_TO_OPENMM = { @@ -361,7 +365,8 @@ def chainkey(m): a1 = atom_lookup[bond.GetBeginAtomIdx()] a2 = atom_lookup[bond.GetEndAtomIdx()] top.addBond(a1, a2, - order=_BONDORDERS_RDKIT_TO_OPENMM[bond.GetBondType()]) + order=_BONDORDERS_RDKIT_TO_OPENMM.get( + bond.GetBondType(), None)) return top