Logo Search packages:      
Sourcecode: python-biopython version File versions

def Bio::PDB::StructureBuilder::StructureBuilder::init_atom (   self,
  name,
  coord,
  b_factor,
  occupancy,
  altloc,
  fullname 
)

Initiate a new Atom object.

Arguments:
o name - string, atom name, e.g. CA, spaces should be stripped
o coord - Numpy array (Float0, size 3), atomic coordinates
o b_factor - float, B factor
o occupancy - float
o altloc - string, alternative location specifier
o fullname - string, atom name including spaces, e.g. " CA "

Definition at line 159 of file StructureBuilder.py.

00159                                                                            :
        """
        Initiate a new Atom object.

        Arguments:
        o name - string, atom name, e.g. CA, spaces should be stripped
        o coord - Numpy array (Float0, size 3), atomic coordinates
        o b_factor - float, B factor
        o occupancy - float
        o altloc - string, alternative location specifier
        o fullname - string, atom name including spaces, e.g. " CA "
        """
        residue=self.residue
        # if residue is None, an exception was generated during
        # the construction of the residue
        if residue is None:
            return
        # First check if this atom is already present in the residue. 
        # If it is, it might be due to the fact that the two atoms have atom 
        # names that differ only in spaces (e.g. "CA.." and ".CA.",
        # where the dots are spaces). If that is so, use all spaces
        # in the atom name of the current atom. 
        if residue.has_id(name):
                duplicate_atom=residue[name]
                # atom name with spaces of duplicate atom
                duplicate_fullname=duplicate_atom.get_fullname()
                if duplicate_fullname!=fullname:
                    # name of current atom now includes spaces
                    name=fullname
                    if DEBUG:
                        sys.stderr.write("WARNING: atom names %s and %s differ only in spaces at line %i.\n" 
                            % (duplicate_fullname, fullname, self.line_counter))
        atom=self.atom=Atom(name, coord, b_factor, occupancy, altloc, fullname)
        if altloc!=" ":
            # The atom is disordered
            if residue.has_id(name):
                # Residue already contains this atom
                duplicate_atom=residue[name]
                if duplicate_atom.is_disordered()==2:
                    duplicate_atom.disordered_add(atom)     
                else:
                    # This is an error in the PDB file:
                    # a disordered atom is found with a blanc altloc
                    # Detach the duplicate atom, and put it in a 
                    # DisorderedAtom object together with the current 
                    # atom.
                    residue.detach_child(name)
                    disordered_atom=DisorderedAtom(name)
                    residue.add(disordered_atom)
                    disordered_atom.disordered_add(atom)
                    disordered_atom.disordered_add(duplicate_atom)
                    residue.flag_disordered()
                    if DEBUG:
                        sys.stderr.write("WARNING: disordered atom found with blanc altloc before line %i.\n"  
                                % self.line_counter)
            else:
                # The residue does not contain this disordered atom
                # so we create a new one.
                disordered_atom=DisorderedAtom(name)
                residue.add(disordered_atom)
                # Add the real atom to the disordered atom, and the 
                # disordered atom to the residue
                disordered_atom.disordered_add(atom)
                residue.flag_disordered()
        else:   
            # The atom is not disordered
            residue.add(atom)

    def set_anisou(self, anisou_array):


Generated by  Doxygen 1.6.0   Back to index