Exemple #1
0
    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)
Exemple #2
0
    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)
Exemple #3
0
    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)
Exemple #4
0
    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)
Exemple #5
0
 def __delitem__(self, id):
     """
     Arguments:
     o id - (string, int, string) or int
     """
     id = self._translate_id(id)
     return Entity.__delitem__(self, id)
Exemple #6
0
 def __delitem__(self, id):
     """
     Arguments:
     o id - (string, int, string) or int
     """
     id=self._translate_id(id)
     return Entity.__delitem__(self, id)
Exemple #7
0
    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)
Exemple #8
0
    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)
Exemple #9
0
    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)
Exemple #10
0
    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)
Exemple #11
0
 def __init__(self, id):
     self.level = "C"
     Entity.__init__(self, id)
Exemple #12
0
 def __init__(self, id, resname, segid):
     self.level = "R"
     self.disordered = 0
     self.resname = resname
     self.segid = segid
     Entity.__init__(self, id)
Exemple #13
0
 def __init__(self, id):
     self.level="C"
     Entity.__init__(self, id)
Exemple #14
0
 def __init__(self, id, resname, segid):
     self.level="R"
     self.disordered=0
     self.resname=resname
     self.segid=segid
     Entity.__init__(self, id)