Commit 65920c60 authored by peastman's avatar peastman
Browse files

Merge branch 'master' into membrane

parents e4974837 ec580215
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -155,6 +155,8 @@ class Topology(object): ...@@ -155,6 +155,8 @@ class Topology(object):
Residue Residue
the newly created Residue the newly created Residue
""" """
if len(chain._residues) > 0 and self._numResidues != chain._residues[-1].index+1:
raise ValueError('All residues within a chain must be contiguous')
if id is None: if id is None:
id = str(self._numResidues+1) id = str(self._numResidues+1)
residue = Residue(name, self._numResidues, chain, id) residue = Residue(name, self._numResidues, chain, id)
...@@ -182,6 +184,8 @@ class Topology(object): ...@@ -182,6 +184,8 @@ class Topology(object):
Atom Atom
the newly created Atom the newly created Atom
""" """
if len(residue._atoms) > 0 and self._numAtoms != residue._atoms[-1].index+1:
raise ValueError('All atoms within a residue must be contiguous')
if id is None: if id is None:
id = str(self._numAtoms+1) id = str(self._numAtoms+1)
atom = Atom(name, element, self._numAtoms, residue, id) atom = Atom(name, element, self._numAtoms, residue, id)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment