def add(self, atom): """Add an Atom object. Checks for adding duplicate atoms, and raises a PDBConstructionException if so. """ atom_id = atom.get_id() if self.has_id(atom_id): raise PDBConstructionException( "Atom %s defined twice in residue %s" % (atom_id, self)) Entity.add(self, atom)
def add(self, atom): """Add an Atom object. Checks for adding duplicate atoms, and raises a PDBConstructionException if so. """ atom_id=atom.get_id() if self.has_id(atom_id): raise PDBConstructionException( "Atom %s defined twice in residue %s" % (atom_id, self)) Entity.add(self, atom)
def __init__(self, id, serial_num=None): """ Arguments: o id - int o serial_num - int """ self.level = "M" if serial_num is None: self.serial_num = id else: self.serial_num = serial_num Entity.__init__(self, id)
def __delitem__(self, id): """ Arguments: o id - (string, int, string) or int """ id = self._translate_id(id) return Entity.__delitem__(self, id)
def __delitem__(self, id): """ Arguments: o id - (string, int, string) or int """ id=self._translate_id(id) return Entity.__delitem__(self, id)
def __contains__(self, id): """True if a residue with given id is present in this chain. Arguments: o id - (string, int, string) or int """ id = self._translate_id(id) return Entity.__contains__(self, id)
def __contains__(self, id): """True if a residue with given id is present in this chain. Arguments: o id - (string, int, string) or int """ id=self._translate_id(id) return Entity.__contains__(self, id)
def __getitem__(self, id): """Return the residue with given id. The id of a residue is (hetero flag, sequence identifier, insertion code). If id is an int, it is translated to (" ", id, " ") by the _translate_id method. Arguments: o id - (string, int, string) or int """ id = self._translate_id(id) return Entity.__getitem__(self, id)
def __getitem__(self, id): """Return the residue with given id. The id of a residue is (hetero flag, sequence identifier, insertion code). If id is an int, it is translated to (" ", id, " ") by the _translate_id method. Arguments: o id - (string, int, string) or int """ id=self._translate_id(id) return Entity.__getitem__(self, id)
def __init__(self, id): self.level = "C" Entity.__init__(self, id)
def __init__(self, id, resname, segid): self.level = "R" self.disordered = 0 self.resname = resname self.segid = segid Entity.__init__(self, id)
def __init__(self, id): self.level="C" Entity.__init__(self, id)
def __init__(self, id, resname, segid): self.level="R" self.disordered=0 self.resname=resname self.segid=segid Entity.__init__(self, id)