Skip to content

Commit

Permalink
proteincomponent: tweak conversions to/from openmm/rdkit
Browse files Browse the repository at this point in the history
helps with some nonstandard residues previously giving KeyError AROMATIC

will not affect serialised representations (i.e. keys) as these don't use this path
  • Loading branch information
richardjgowers committed Jul 18, 2023
1 parent 239302a commit 5ab9ecc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion gufe/components/proteincomponent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 5ab9ecc

Please sign in to comment.