diff --git a/moldesign/molecules/residue.py b/moldesign/molecules/residue.py index 4bcc05e..b8325e9 100644 --- a/moldesign/molecules/residue.py +++ b/moldesign/molecules/residue.py @@ -247,11 +247,10 @@ def _is_ending_residue(self): except KeyError: # If we're here, the residue is missing some atoms. We'll fall back to checking the # next residues in line - if self.index == len(self.molecule.residues): + if self.index == len(self.molecule.residues) - 1: return True else: - print('WARNING: %s is missing expected atoms. Attempting to infer chain end' % \ - self) + print('WARNING: %s is missing expected atoms. Attempting to infer chain end' % self) nextres = self.molecule.residues[self.index + 1] return not self._same_polymer(nextres)