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.
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 grep is that you will be able to read any odd pdb file and you will also able to do things like extract_protein() or extract_lipids().
Load structure from file pdbname.
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.
Return a list of BioPDB residues that match resnames.
resnames can be a string or a list.
Return a list of BioPDB residues that are selected by selection.
selection must be BioPDB.PDB.PDBIO.Select instance (see for example edPDB.xpdb.ProteinSelect).
Write pdbfile which includes or excludes residues.
Arguments: |
Residues must be BioPDB residues as returned by, for instance, residues_by_resname(). Note Currently only either inclusions or exclusions can be supplied, not both. |
---|
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: |
|
---|---|
Returns: | RMSD of the fit in Angstroem. |
Warning
Assumes only heavy atoms in PDB (I think... check source!)
Remove water (SOL) molecules overlapping with ligand.
Arguments: |
|
---|
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.)