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

Module cbook

source code


:mod:`edPDB.cbook` -- Recipes for editing PDB files
===================================================

The cook book contains short python functions that demonstrate how to
implement basic PDB editing functionality. They do not do exhaustive
error checking and might have to be altered for your purpose.

.. autoclass:: PDB
   :members:
.. autofunction:: align_ligand
.. autofunction:: remove_overlap_water
.. autofunction:: extract_residue

Classes [hide private]
  PDB
Class that represents a PDB file and allows extractions of interesting parts.
Functions [hide private]
 
align_ligand(protein_struct, ligand_struct, ligand_resname, output='ligand_aligned.pdb')
Align a ligand to the same ligand in a protein, based on the heavy atoms.
source code
 
remove_overlap_water(pdbname, output, ligand_resname, distance=3.0, water='SOL', **kwargs)
Remove water (SOL) molecules overlapping with ligand.
source code
 
extract_resnames(pdbname, output, resnames, **kwargs)
Write a pdb file with *resname* extracted.
source code
 
extract_protein(pdbname, output, **kwargs)
Write a pdb file with the protein (i.e.
source code
 
extract_lipids(pdbname, output, lipid_resnames='POPC|POPG|POPE|DMPC|DPPE|DOPE', **kwargs)
Write a pdb file with the lipids extracted.
source code
Variables [hide private]
  logger = logging.getLogger('edPDB.cbook')
Function Details [hide private]

align_ligand(protein_struct, ligand_struct, ligand_resname, output='ligand_aligned.pdb')

source code 
Align a ligand to the same ligand in a protein, based on the heavy atoms.

This is useful when a new ligand was generated with hydrogens but
the position in space changed.

:Arguments:
  *protein_struct*
     protein + ligand pdb
  *ligand_struct*
     ligand pdb
  *ligand_resname*
     residue name of the ligand in the file *protein_struct*
  *ligand_aligned*
     output

:Returns: RMSD of the fit in Angstroem.

.. Warning:: Assumes only heavy atoms in PDB (I think... check source!) 

remove_overlap_water(pdbname, output, ligand_resname, distance=3.0, water='SOL', **kwargs)

source code 
Remove water (SOL) molecules overlapping with ligand.

:Arguments:
  pdbname
    pdb file that contains the ligand and the water
  output
    pdb output filename
  ligand_resname
    name of the ligand residue(s) in the pdb
  distance
    overlap is defined as a centre-centre distance of any solvent
    OW atom with any ligand atom of less than *distance*

.. note:: The residue and atom numbering will be fairly
          meaningless in the final PDB because it wraps at 100,000
          or 10,000.

          Also make sure that there are either consistent chain
          identifiers or none (blank) because otherwise the
          residue blocks migh become reordered. (This is due to the
          way the Bio.PDB.PDBIO writes files.)

extract_protein(pdbname, output, **kwargs)

source code 

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

extract_lipids(pdbname, output, 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.