diff --git a/python/BioSimSpace/Sandpit/Exscientia/_SireWrappers/_molecule.py b/python/BioSimSpace/Sandpit/Exscientia/_SireWrappers/_molecule.py index a39fb040..275a59de 100644 --- a/python/BioSimSpace/Sandpit/Exscientia/_SireWrappers/_molecule.py +++ b/python/BioSimSpace/Sandpit/Exscientia/_SireWrappers/_molecule.py @@ -1463,6 +1463,16 @@ def translate(self, vector, property_map={}): _property_map["coordinates"] = "coordinates1" mol = mol.move().translate(_SireMaths.Vector(vec), _property_map).commit() + # A user might have a custom coordinates property, so we need to check + # for this and translate too. + coord_prop = property_map.get("coordinates", "coordinates") + if self._sire_object.has_property(coord_prop): + mol = ( + self._sire_object.move() + .translate(_SireMaths.Vector(vec), _property_map) + .commit() + ) + else: mol = ( self._sire_object.move() diff --git a/python/BioSimSpace/_SireWrappers/_molecule.py b/python/BioSimSpace/_SireWrappers/_molecule.py index cac5839e..108b38de 100644 --- a/python/BioSimSpace/_SireWrappers/_molecule.py +++ b/python/BioSimSpace/_SireWrappers/_molecule.py @@ -1403,6 +1403,16 @@ def translate(self, vector, property_map={}): _property_map["coordinates"] = "coordinates1" mol = mol.move().translate(_SireMaths.Vector(vec), _property_map).commit() + # A user might have a custom coordinates property, so we need to check + # for this and translate too. + coord_prop = property_map.get("coordinates", "coordinates") + if self._sire_object.has_property(coord_prop): + mol = ( + self._sire_object.move() + .translate(_SireMaths.Vector(vec), _property_map) + .commit() + ) + else: mol = ( self._sire_object.move()