PROFASI  Version 1.5
Public Member Functions | List of all members
prf::PDBReader Class Reference

A top level PDB file parser. More...

#include <PDBReader.hh>

Inheritance diagram for prf::PDBReader:
Inheritance graph

Public Member Functions

 PDBReader (std::string fl)
 Constructor with an implicit call to set_file.
void set_file (std::string fl)
 Sets up PDBReader to work with a given file.
void set_model (int i)
 Select model i for further processing.
std::string file_name () const
 Return currently used file name.
int read_matrix ()
 Read in the PDB file as a character matrix.
void delete_matrix ()
 Discards stored character matrix of the PDB file.
int descriptors (std::list< SelRes > &slc, std::list< AtomDescriptor > &lst)
 Atom descriptor information for a given SelRes list.
int records (std::list< SelRes > &slc, std::list< AtomRecord > &lst)
 AtomRecord objects for the selection list.
int export_shape (std::vector< int > &vct, Shape &shp)
 Make a Shape object out of the coordinates of specified atoms.
int export_records (std::vector< int > &vct, std::list< AtomRecord > &shp)
 Similar to export_shape, but returns the records instead.
int export_descriptors (std::vector< int > &vct, std::list< AtomDescriptor > &shp)
 Similar to export_shape, but returns only AtomDescriptors.
int sequence_of_chain (int ich, std::list< std::string > &seq)
 Sequence of chain ich as a list of 3 letter codes.
std::string chain_name (int i) const
 Label of the i'th chain in the current model.
int num_grp (int ic) const
 Number of groups (residues and capping groups) in chain ic.
int index_of_grp (std::string ires, int ich)
 Natural index of a group with a string index ires in chain ich.
std::string grp_name (int ires, int ich)
 Residue or capping group name for residue with natural index ires.
std::string str_index (int ires, int ich)
 The string index corresponding to the residue with natural index ires.
AtomLabelDictionarydictionary ()
 Return reference to the AtomLabelDictionary used to interpret labels.
- Public Member Functions inherited from prf::PopBase
int num_chains () const
 Number of chains.
int get_model () const
 Currently selected model.
virtual int chain_number (std::string chnm) const
 Integer index (starting from 0) of the chain labeled chnm.
int mk_selection (std::string slcstr, std::list< SelRes > &slc)
 Create a selected list of residues using a selection string slcstr.

Detailed Description

The PDBReader processes a PDB file, selects a (not necessarily contiguous) region of residues in the file, and can return either a list of AtomRecords or AtomDescriptors corresponding to the selection.

Member Function Documentation

void prf::PDBReader::delete_matrix ( )

In the interest of good memory management, when it is clear that the program wont need to make a fresh selection on a PDB file, it is good to release the large amount of memory taken by the character matrix.

int prf::PDBReader::descriptors ( std::list< SelRes > &  slc,
std::list< AtomDescriptor > &  lst 

For a given list of selected residues, put the AtomDescriptor objects corresponding to all atoms in those residues in a given list. Contents of the list before this function is called will be lost.

Reimplemented from prf::PopBase.

int prf::PDBReader::export_shape ( std::vector< int > &  vct,
Shape shp 

One of the most important functions that really makes this class usable. Once selections have been exported, and the exported list has been subject to various filtres, one might want to know the 3-dimensional shape of the filtred selection. In a way, this enables very complicated selections for, say, RMSD evaluations. One can first select a range in the PDB file. Then export the atom descriptors. Then apply filtres so that only a desired subset of atoms remain. Then use this function to get a Shape object consisting only of these selected atoms. The integers in the vector<int> argument must specify the indices internal to this class, which can be used to retrieve a certain AtomDescriptor or AtomRecord. When exporting the descriptors or records, such an index is imprinted in the atom descriptor objects. So, when external filtres have been applied, one can retrieve the necessary integer indices in the remaining AtomDescriptors. The relevant public member of the AtomDescriptor class is called int_label. The vector vct passed to this function is expected contain those internal identifiers for the atoms as given by this class.

Reimplemented from prf::PopBase.

int prf::PDBReader::index_of_grp ( std::string  ires,
int  ich 

The "residue serial number" in PDB files is, in general, best not thought of as a number. Sometimes it will contain non-digit characters. Sometimes, even if all residue serial numbers are integers the difference between two of them may not represent the actual number of residues between them. This is because in PDB files there are often missing residues. The "natural index" is the index relative to what is in the file. It is always a natural number.

As an example, if a PDB file starts with the first few residues numbered 41,42,43,44, the natural index of the one numbered 44 is 3. The counting starts from 0.

Reimplemented from prf::PopBase.

int prf::PDBReader::read_matrix ( )

Expensive operation. Returns 2 and quits without doing anything if it has already been called on a file. A new file can be read only after calling delete_matrix(). Returns 1 if it succeeds reading the file into a character matrix. Returns 0 if it fails for some reason. Allocates the matrix as required. Implicitly calls gather_model_info()

See Also
delete_matrix(), gather_model_info()
int prf::PDBReader::records ( std::list< SelRes > &  slc,
std::list< AtomRecord > &  lst 

One can export AtomRecord objects as well, which includes both the AtomDescriptors and coordinates.

The documentation for this class was generated from the following files:

PROFASI: Protein Folding and Aggregation Simulator, Version 1.5
© (2005-2016) Anders Irbäck and Sandipan Mohanty
Documentation generated on Mon Jul 18 2016 using Doxygen version 1.8.2