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")