Skip to content

Commit 3dd481f

Browse files
committed
[utils.residue_and_atom.name_from_AA] BUGFIX: Return fully numeric strings ("66") correctly.
This happens with CPs w/o topologies Also got rid of one TODO, yay
1 parent 9d771b0 commit 3dd481f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

mdciao/utils/residue_and_atom.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,10 @@ def name_from_AA(key) -> str:
342342

343343
if isinstance(key, _md.core.topology.Residue):
344344
name = key.name
345+
# CPs w/o topology will have purely numeric residue names, bc. these
346+
# are derived from the residue indices
347+
elif key.isnumeric():
348+
name = key
345349
else:
346350
rev_key = key[::-1]
347351
# Iterate from tail to head and break at the first alphabetic char

0 commit comments

Comments
 (0)