From 3572dc808a607250d1dbe2dd4ccd190f905fd6e9 Mon Sep 17 00:00:00 2001 From: Lee-Ping Wang Date: Thu, 2 Jan 2025 16:51:52 -0800 Subject: [PATCH] Fix PDB writing of TER record --- geometric/molecule.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/geometric/molecule.py b/geometric/molecule.py index e2cec39e..eadd5f40 100644 --- a/geometric/molecule.py +++ b/geometric/molecule.py @@ -4669,6 +4669,8 @@ def write_pdb(self, **kwargs): if i < (self.na-1) and chainName != chainNames[i+1]: out.append("TER %5d %3s %s%4s" % (atomIndex, resName, chainName, resId)) atomIndex += 1 + elif i < (self.na-1) and hasattr(self, 'terminal') and self.terminal[i]: + out.append("TER") out.append("TER %5d %3s %s%4s" % (atomIndex, resName, chainName, resId)) if len(self) > 1: out.append("ENDMDL")