IMP logo
IMP Reference Guide  2.18.0
The Integrative Modeling Platform
pdb.h File Reference

Functions to read PDBs. More...

#include <IMP/atom/atom_config.h>
#include "Hierarchy.h"
#include "Atom.h"
#include "element.h"
#include "internal/pdb.h"
#include "atom_macros.h"
#include <IMP/file.h>
#include "Selection.h"
#include <IMP/Model.h>
#include <IMP/Particle.h>
#include <IMP/OptimizerState.h>
#include <IMP/internal/utility.h>
#include <boost/format.hpp>
#include <boost/algorithm/string.hpp>
+ Include dependency graph for pdb.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  IMP::atom::AllPDBSelector
 Defines a selector that will pick every ATOM and HETATM record. More...
 
class  IMP::atom::AndPDBSelector
 Select atoms which are selected by both selectors. More...
 
class  IMP::atom::ATOMPDBSelector
 Select all non-alternative ATOM records. More...
 
class  IMP::atom::AtomTypePDBSelector
 Select all atoms of the given types. More...
 
class  IMP::atom::BackbonePDBSelector
 Select all backbone (N,CA,C,O) ATOM records. More...
 
class  IMP::atom::CAlphaPDBSelector
 Select all CA ATOM records. More...
 
class  IMP::atom::CBetaPDBSelector
 Select all CB ATOM records. More...
 
class  IMP::atom::ChainPDBSelector
 Select all ATOM and HETATM records with the given chain ids. More...
 
class  IMP::atom::CPDBSelector
 Select all C (not CA or CB) ATOM records. More...
 
class  IMP::atom::HydrogenPDBSelector
 Select all hydrogen ATOM and HETATM records. More...
 
class  IMP::atom::NonAlternativePDBSelector
 Select all ATOM and HETATM records which are not alternatives. More...
 
class  IMP::atom::NonHydrogenPDBSelector
 Select non hydrogen atoms. More...
 
class  IMP::atom::NonWaterNonHydrogenPDBSelector
 Select non water and non hydrogen atoms. More...
 
class  IMP::atom::NonWaterPDBSelector
 Select all non-water non-alternative ATOM and HETATM records. More...
 
class  IMP::atom::NotPDBSelector
 Select atoms which are not selected by a given selector. More...
 
class  IMP::atom::NPDBSelector
 Select all N ATOM records. More...
 
class  IMP::atom::OrPDBSelector
 Select atoms which are selected by either or both selectors. More...
 
class  IMP::atom::PDBSelector
 Select which atoms to read from a PDB file. More...
 
class  IMP::atom::PPDBSelector
 Select all P (= phosphate) ATOM records. More...
 
class  IMP::atom::ResidueTypePDBSelector
 Select all atoms in residues of the given types. More...
 
class  IMP::atom::WaterPDBSelector
 Select all non-water ATOM and HETATM records. More...
 
class  IMP::atom::WritePDBOptimizerState
 
class  IMP::atom::XorPDBSelector
 Select atoms which are selected by either selector but not both. More...
 

Namespaces

 IMP
 Base functionality and abstract base classes for representation, scoring and sampling.
 
 IMP::atom
 Functionality for loading, creating, manipulating and scoring atomic structures.
 

Typedefs

typedef IMP::Vector
< IMP::Pointer< PDBSelector > > 
IMP::atom::PDBSelectors
 
typedef IMP::Vector
< IMP::WeakPointer
< PDBSelector > > 
IMP::atom::PDBSelectorsTemp
 

PDB Reading

The read PDB methods produce a hierarchy that looks as follows:

  • One Atom per ATOM or HETATM record in the PDB.
  • All Atom particles have a parent which is a Residue.
  • All Residue particles have a parent which is a Chain.

Waters are currently dropped if they are ATOM records. This can be fixed.

The read_pdb() functions should successfully parse all valid PDB files. It can produce warnings on files which are not valid. It will attempt to read such files, but all bets are off.

In order to track the provenance of IMP-generated models, the provenance of any PDB files read in here - for example, the PDB id, or detail about a comparative model - needs to also be tracked. This is done using the PDB headers:

  • Structures stored in the PDB database should keep the standard HEADER record stating their PDB ID.
  • Comparative models generated using MODELLER should include the MODELLER-generated EXPDTA and REMARK records.
  • Structures that are trivial modifications of an existing PDB structure or comparative model should use the TITLE record to describe the nature of the modification (e.g. rotation and translation) and one of the two following custom EXPDTA record formats to point to the original structure:
    • EXPDTA DERIVED FROM PDB:1XYZ
    • EXPDTA DERIVED FROM COMPARATIVE MODEL, DOI:x.y/z
  • Structures generated from multiple sources (e.g. two structures that have been docked and then concatenated into a single PDB file) are not allowed. Store each constituent structure in its own file and annotate each one with a suitable EXPDTA record, as above. Note that while provenance of PDB files is not currently enforced, it likely will be in future IMP releases.

When reading PDBs, PDBSelector objects can be used to choose to only process certain record types. See the class documentation for more information. When no PDB selector is supplied for reading, the NonWaterPDBSelector is used.

Set the IMP::LogLevel to VERBOSE to see details of parse errors.

PDBSelector * IMP::atom::get_default_pdb_selector ()
 
Hierarchy IMP::atom::read_pdb (TextInput input, Model *model, PDBSelector *selector=get_default_pdb_selector(), bool select_first_model=true)
 Read all the molecules in the first model of the PDB file. More...
 
void IMP::atom::read_pdb (TextInput input, int model, Hierarchy h)
 
Hierarchies IMP::atom::read_multimodel_pdb (TextInput input, Model *model, PDBSelector *selector=get_default_pdb_selector())
 

PDB Writing

The methods to write a PDB expects a Hierarchy that looks as follows:

  • all leaves are Atom particles
  • all Atom particles have Residue particles as parents

All Residue particles that have a Chain particle as an ancestor are considered part of a protein, DNA or RNA, ones without are considered heterogens.

The functions produce files that are not valid PDB files, eg only ATOM/HETATM lines are printed for all Atom particles in the hierarchy. Complain if your favorite program can't read them and we might fix it.

void IMP::atom::write_pdb (const Selection &mhd, TextOutput out, unsigned int model=1)
 
void IMP::atom::write_pdb_of_c_alphas (const Selection &mhd, TextOutput out, unsigned int model=1)
 Write a hierarchy to a PDB as C_alpha atoms. More...
 
void IMP::atom::write_multimodel_pdb (const Hierarchies &mhd, TextOutput out)
 

Detailed Description

Functions to read PDBs.

Copyright 2007-2022 IMP Inventors. All rights reserved.

Definition in file pdb.h.