Main Page | Class List | Directories | File List | Class Members | File Members

pdbcoord.h File Reference

PDB coordinate reader and writer. More...

#include "adt/list.h"
#include "mdio/file.h"
#include "mdapi/mdtypes.h"

Go to the source code of this file.

Classes

struct  mdio_Pdbcoord_t
 PDB coordinate reader and writer class. More...
struct  mdio_Pdbatom_t
 ATOM and HETATM record information. More...

Typedefs

typedef mdio_Pdbcoord_t mdio_Pdbcoord
 PDB coordinate reader and writer class.
typedef mdio_Pdbatom_t mdio_Pdbatom
 ATOM and HETATM record information.

Functions

mdio_Pdbcoordmdio_createPdbcoord (void)
 Constructor.
void mdio_destroyPdbcoord (mdio_Pdbcoord *)
 Destructor.
int mdio_readPdbcoord (mdio_Pdbcoord *, const char *name, int n_expect)
 Read PDB coordinate file.
MD_Dvec * mdio_getPdbcoord (mdio_Pdbcoord *, int *nelems)
 Obtain array of coordinates.
mdio_Pdbatommdio_getAtomPdbcoord (mdio_Pdbcoord *, int *nelems)
 Obtain array of ATOM record information.
int mdio_setPdbcoord (mdio_Pdbcoord *, MD_Dvec *dvec, int nelems)
 Set an array of coordinates.
int mdio_setAtomPdbcoord (mdio_Pdbcoord *, mdio_Pdbatom *atom, int nelems)
 Set an array of ATOM record information.
int mdio_writePdbcoord (mdio_Pdbcoord *, const char *name)
 Write PDB coordinate file.
int mdio_initializePdbcoord (mdio_Pdbcoord *)
 Alternative constructor.
void mdio_cleanupPdbcoord (mdio_Pdbcoord *)
 Alternative destructor.


Detailed Description

PDB coordinate reader and writer.

Author:
David J. Hardy
Date:
2003-2005
The mdio_Pdbcoord class reads coordinates from PDB files, where atomic coordinates are parsed from ATOM and HETATM records. Note that other records are completely ignored. This class can also be used to write a PDB coordinate file, saved as ATOM records, with preliminary remarks indicating the filename, the creator, the date, and the time.

The complete PDB file specification is available at http://www.rcsb.org/pdb/docs/format/pdbguide2.2/guide2.2_frame.html .

The mdio_Pdbcoord class is derived from mdio_File so that error handling is performed by typecasting (mdio_Pdbcoord *) to (mdio_File *).


Typedef Documentation

typedef struct mdio_Pdbatom_t mdio_Pdbatom
 

ATOM and HETATM record information.

Auxiliary structure for information from PDB ATOM or HETATM records. The field names and notes below are from the PDB format description guide: http://www.rcsb.org/pdb/docs/format/pdbguide2.2/guide2.2_frame.html . The extra space in the char arrays are for nil-termination and 32-bit padding. The column numbering given is FORTRAN-based, ranging from 1 to 80.

typedef struct mdio_Pdbcoord_t mdio_Pdbcoord
 

PDB coordinate reader and writer class.

Members should be treated as private.


Function Documentation

void mdio_cleanupPdbcoord mdio_Pdbcoord  ) 
 

Alternative destructor.

Use to destroy a preallocated mdio_Pdbcoord object (i.e. one constructed using mdio_initializePdbcoord() ).

mdio_Pdbcoord* mdio_createPdbcoord void   ) 
 

Constructor.

Creates dynamically allocated PDB coordinate file reader and writer object.

Returns:
Pointer to new object or NULL on failure.

void mdio_destroyPdbcoord mdio_Pdbcoord  ) 
 

Destructor.

Frees dynamically allocated PDB coordinate file reader and writer object after freeing allocated arrays of MD_Dvec and mdio_Pdbatom.

Note that MD_Dvec and mdio_Pdbatom arrays obtained from reading a file do not persist beyond the destruction of the mdio_Pdbcoord object.

mdio_Pdbatom* mdio_getAtomPdbcoord mdio_Pdbcoord ,
int *  nelems
 

Obtain array of ATOM record information.

Parameters:
[out] nelems Length of array returned into indicated variable.
If this array resulted from mdio_readPdbcoord(), then it will persist only until destruction of the mdio_Pdbcoord object.

Returns:
The mdio_Pdbatom record information array as a pointer.

MD_Dvec* mdio_getPdbcoord mdio_Pdbcoord ,
int *  nelems
 

Obtain array of coordinates.

Parameters:
[out] nelems Length of array returned into indicated variable.
If this array resulted from mdio_readPdbcoord(), then it will persist only until destruction of the mdio_Pdbcoord object.

Returns:
The MD_Dvec coordinate array as a pointer.

int mdio_initializePdbcoord mdio_Pdbcoord  ) 
 

Alternative constructor.

Use to construct a preallocated mdio_Pdbcoord object. See mdio_createPdbcoord() for a description of expected arguments.

int mdio_readPdbcoord mdio_Pdbcoord ,
const char *  name,
int  n_expect
 

Read PDB coordinate file.

Parameters:
[in] name A nil-terminated string naming the PDB coordinate file.
[in] n_expect The number of coordinates expected in the file.
If the number of coordinates is unknown, then n_expect should be set to 0. Otherwise, this value is used to validate the expected number of coordinates.

Returns:
0 on success, MDIO_ERROR on failure. It is considered an error for n_expect to not match the number of coordinates contained in the file.

int mdio_setAtomPdbcoord mdio_Pdbcoord ,
mdio_Pdbatom atom,
int  nelems
 

Set an array of ATOM record information.

Parameters:
[in] atom Array of ATOM record information.
[in] nelems Number of elements in array.
The atom array will still belong to the user, which means that no attempt will be made to free it, and the burden of any dynamic memory management still belongs to the user.

Returns:
0 on success, MDIO_ERROR on failure.

int mdio_setPdbcoord mdio_Pdbcoord ,
MD_Dvec *  dvec,
int  nelems
 

Set an array of coordinates.

Parameters:
[in] dvec Array of coordinates.
[in] nelems Number of elements in array.
The dvec array will still belong to the user, which means that no attempt will be made to free it, and the burden of any dynamic memory management still belongs to the user.

Returns:
0 on success, MDIO_ERROR on failure.

int mdio_writePdbcoord mdio_Pdbcoord ,
const char *  name
 

Write PDB coordinate file.

Parameters:
[in] name A nil-terminated string naming the PDB coordinate file.
The coordinates and corresponding ATOM record information will be whatever is known by the mdio_Pdbcoord object, either from previous calls to mdio_setPdbcoord() and mdio_setAtomPdbcoord() or a previous read using mdio_readPdbcoord().

Returns:
0 on success, MDIO_ERROR on failure.


Generated on Mon Sep 26 10:55:19 2005 for MDX by  doxygen 1.4.4