Package edPDB :: Module cbook :: Class PDB
[hide private]
[frames] | no frames]

Class PDB

source code

object --+
         |
        PDB

Class that represents a PDB file and allows extractions of interesting parts.

The structure itself is never changed. In order to extract sub-parts of a structure one selects these parts and writes them as new pdb file.

The advantage over a simple :program:`grep` is that you will be able to read any odd pdb file and you will also able to do things like :meth:`~edPDB.cbook.PDB.extract_protein` or :meth:`~edPDB.cbook.PDB.extract_lipids`.

Instance Methods [hide private]
 
__init__(self, pdbname)
Load structure from file *pdbname*.
source code
 
write(self, filename, **kwargs)
Write pdbfile which includes or excludes residues.
source code
 
residues_by_resname(self, resnames, **kwargs)
Return a list of BioPDB residues that match *resnames*.
source code
 
residues_by_selection(self, selection)
Return a list of BioPDB residues that are selected by *selection*.
source code
 
extract_resnames(self, filename, resnames, **kwargs)
Write a pdb file with *resnames* extracted.
source code
 
extract_protein(self, filename, **kwargs)
Write a pdb file with the protein (i.e.
source code
 
extract_notprotein(self, filename, **kwargs)
Write a pdb file without any amino acids extracted.
source code
 
extract_lipids(self, filename, lipid_resnames='POPC|POPG|POPE|DMPC|DPPE|DOPE', **kwargs)
Write a pdb file with the lipids extracted.
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, pdbname)
(Constructor)

source code 

Load structure from file *pdbname*.

Overrides: object.__init__

write(self, filename, **kwargs)

source code 
Write pdbfile which includes or excludes residues.

:Arguments:
    *filename*
        output pdb filename
    *inclusions*
        list of residues to include
    *exclusions*
        list of residues to exclude
    *chain*
        relabel the selection with a new chain identifier


 Residues must be BioPDB residues as returned by, for
 instance, :meth:`~edPDB.cbook.PDB.residues_by_resname`.

 .. Note:: Currently only either *inclusions* or *exclusions* can be
           supplied, not both.

residues_by_resname(self, resnames, **kwargs)

source code 

Return a list of BioPDB residues that match *resnames*.

*resnames* can be a string or a list.

residues_by_selection(self, selection)

source code 

Return a list of BioPDB residues that are selected by *selection*.

*selection* must be BioPDB.PDB.PDBIO.Select instance (see for example :class:`edPDB.xpdb.ProteinSelect`).

extract_protein(self, filename, **kwargs)

source code 

Write a pdb file with the protein (i.e. all amino acids) extracted.

extract_lipids(self, filename, lipid_resnames='POPC|POPG|POPE|DMPC|DPPE|DOPE', **kwargs)

source code 

Write a pdb file with the lipids extracted.

Note that resnames are also tried truncated to the first three characters, which means that POPE and POPG are identical and cannot be distinguished.