diff --git a/pdb2pqr/definitions.py b/pdb2pqr/definitions.py index 896e4c30..8217003e 100644 --- a/pdb2pqr/definitions.py +++ b/pdb2pqr/definitions.py @@ -101,11 +101,14 @@ def characters(self, text): if text.isspace(): return _LOGGER.debug(f"Got text for <{self.curelement}>: {text}") - # If this is a float, make it so - try: - value = float(str(text)) - except ValueError: - value = str(text) + + # If this is a float, make it so. Except for residue names which should stay string + value = str(text) + if self.curelement != "name": + try: + value = float(value) + except ValueError: + pass # Special cases - lists and dictionaries if self.curelement == "bond":