PDBlib

NAME
Detailed Description
Function Documentation
Author

NAME

PDBlib −

Data Structures

struct PDBlib_atom_t

struct PDBlib_chain_t

struct PDBlib_iter_data_t

struct PDBlib_model_t

struct PDBlib_residue_t

struct PDBlib_ssbond_t

struct PDBlib_struct_t

Typedefs

typedef int(* PDBlib_iter_callback_t )(PDBhandle PDBh, PDBlib_iter_data_t *data)

Functions

PDBlib_atom_t * PDBlib_add_atom (PDBhandle PDBh)

PDBlib_chain_t * PDBlib_add_chain (PDBhandle PDBh)

PDBlib_model_t * PDBlib_add_model (PDBhandle PDBh)

PDBlib_residue_t * PDBlib_add_residue (PDBhandle PDBh)

PDBlib_ssbond_t * PDBlib_add_ssbond (PDBhandle PDBh)

PDBlib_struct_t * PDBlib_add_structure (PDBhandle PDBh)

void PDBlib_copy_atom_data (PDBlib_atom_t *dst_a, const PDBlib_atom_t *src_a)

void PDBlib_copy_residue_data (PDBlib_residue_t *dst_r, const PDBlib_residue_t *src_r)

int PDBlib_del_atom (PDBhandle PDBh, int id)

int PDBlib_del_chain (PDBhandle PDBh, int id)

int PDBlib_del_model (PDBhandle PDBh, int id)

int PDBlib_del_residue (PDBhandle PDBh, int id)

int PDBlib_del_ssbond (PDBhandle PDBh, int id)

int PDBlib_del_structure (PDBhandle PDBh, int id)

PDBhandle PDBlib_duplicate (const PDBhandle PDBh)

void PDBlib_free (PDBhandle PDBh)

PDBlib_atom_t * PDBlib_get_atom (PDBhandle PDBh, int id)

PDBlib_chain_t * PDBlib_get_chain (PDBhandle PDBh, int id)

PDBlib_model_t * PDBlib_get_model (PDBhandle PDBh, int id)

PDBlib_residue_t * PDBlib_get_residue (PDBhandle PDBh, int id)

PDBlib_ssbond_t * PDBlib_get_ssbond (PDBhandle PDBh, int id)

PDBlib_struct_t * PDBlib_get_structure (PDBhandle PDBh, int id)

PDBhandle PDBlib_initialize ()

void PDBlib_iterator (PDBhandle PDBh, int type, PDBlib_iter_callback_t callback, void *userdata)

int PDBlib_load_file (PDBhandle PDBh, const char *fname, int pqr_ext)

void PDBlib_perform_optimization (PDBhandle PDBh, int flags)

void PDBlib_remove_heteroatoms (PDBhandle PDBh)

void PDBlib_remove_water (PDBhandle PDBh)

int PDBlib_save_file (PDBhandle PDBh, const char *fname, int pqr_ext)

int PDBlib_set_atom_hashed_id (PDBlib_atom_t *src_a)

int PDBlib_set_residue_hashed_id (PDBlib_residue_t *src_r)

Detailed Description

Library providing basic functionality for accessing PDB files.

Function Documentation

PDBlib_atom_t* PDBlib_add_atom (PDBhandle PDBh)

Add new atom object. Parameters:

PDBh - initialized PDBlib handler

Returns:

Functions returns pointer to PDBlib_atom_t structure.

Function creates new atom object. If needed top-level objects are created as well. Newly created atom object is set as referencing point.

PDBlib_chain_t* PDBlib_add_chain (PDBhandle PDBh)

Add new chain object. Parameters:

PDBh - initialized PDBlib handler

Returns:

Functions returns pointer to PDBlib_chain_t structure.

Function creates new chain object and preallocates space for 150 residues objects within this chain. If needed top-level objects are created as well. Newly created chain object is set as referencing point.

PDBlib_model_t* PDBlib_add_model (PDBhandle PDBh)

Add new model object. Parameters:

PDBh - initialized PDBlib handler

Returns:

Functions returns pointer to PDBlib_model_t structure.

Function creates new model object and preallocates space for 3 chain objects within this model. If needed top-level PDBlib_struct_t object is created as well. Newly created model object is set as referencing point.

PDBlib_residue_t* PDBlib_add_residue (PDBhandle PDBh)

Add new residue object. Parameters:

PDBh - initialized PDBlib handler

Returns:

Functions returns pointer to PDBlib_residue_t structure.

Function creates new residue object and preallocates space for 10 atoms objects within this residue. If needed top-level objects are created as well. Newly created residue object is set as referencing point.

PDBlib_ssbond_t* PDBlib_add_ssbond (PDBhandle PDBh)

Add new ssbond object. Parameters:

PDBh - initialized PDBlib handler

Returns:

Functions returns pointer to PDBlib_ssbond_t structure.

Newly created ssbond object is set as referencing point.

PDBlib_struct_t* PDBlib_add_structure (PDBhandle PDBh)

Add new structure object. Parameters:

PDBh - initialized PDBlib handler

Returns:

Functions returns pointer to PDBlib_struct_t structure.

Newly created structure object is set as referencing point for various operations on PDB hierarchy.

void PDBlib_copy_atom_data (PDBlib_atom_t * dst_a, const PDBlib_atom_t * src_a)

Copy atom data from src to dst. Parameters:

dst_a - pointer to destination atom structure

Parameters:

src_a - pointer to source atom structure

You should use this function if you want to copy all data from one atom structure to another. This function preserves all crucial information for PDBhandle consistence associated with destination atom structure.

void PDBlib_copy_residue_data (PDBlib_residue_t * dst_r, const PDBlib_residue_t * src_r)

Copy residue data from src to dst. Parameters:

dst_r - pointer to destination residue structure

Parameters:

src_r - pointer to source residue structure

You should use this function if you want to copy all data from one residue structure to another. This function preserves all crucial information for PDBhandle consistence associated with destination residue structure.

int PDBlib_del_atom (PDBhandle PDBh, int id)

Delete atom object. Parameters:

PDBh - initialized PDBlib handler

Parameters:

id - unique atom ID

Returns:

On success 0 is returned, otherwise -1.

For more information see PDBlib_del_structure().

int PDBlib_del_chain (PDBhandle PDBh, int id)

Delete chain object. Parameters:

PDBh - initialized PDBlib handler

Parameters:

id - unique chain ID

Returns:

On success 0 is returned, otherwise -1.

For more information see PDBlib_del_structure().

int PDBlib_del_model (PDBhandle PDBh, int id)

Delete model object. Parameters:

PDBh - initialized PDBlib handler

Parameters:

id - unique model ID

Returns:

On success 0 is returned, otherwise -1.

For more information see PDBlib_del_structure().

int PDBlib_del_residue (PDBhandle PDBh, int id)

Delete residue object. Parameters:

PDBh - initialized PDBlib handler

Parameters:

id - unique residue ID

Returns:

On success 0 is returned, otherwise -1.

For more information see PDBlib_del_structure().

int PDBlib_del_ssbond (PDBhandle PDBh, int id)

Delete ssbond object. Parameters:

PDBh - initialized PDBlib handler

Parameters:

id - unique ssbond ID

Returns:

On success 0 is returned, otherwise -1.

For more information see PDBlib_del_structure().

int PDBlib_del_structure (PDBhandle PDBh, int id)

Delete structure object. Parameters:

PDBh - initialized PDBlib handler

Parameters:

id - unique structure ID

Returns:

On success 0 is returned, otherwise -1.

Function searches for structure object with given ID. If such a structure exists then this structure and all underlaying objects are deleted. Also memory associated with these objects is freed and all referencing points are cleared.

PDBhandle PDBlib_duplicate (const PDBhandle PDBh)

Make new copy of PDB structure. Parameters:

PDBh - initialized PDBlib handler

Returns:

PDBhandle with copied structure

This function makes exact copy of source PDB structure. Note that returned handler has to be freed with a call to PDBlib_free().

void PDBlib_free (PDBhandle PDBh)

Free memory associated with PDB handler. Parameters:

PDBh - initialized PDBlib handler

This function clean memory which has been allocated by PDBlib_initialize() and by various PDBlib_* functions.

PDBlib_atom_t* PDBlib_get_atom (PDBhandle PDBh, int id)

Get atom object. Parameters:

PDBh - initialized PDBlib handler

Parameters:

id - unique atom ID

Returns:

On success pointer to PDBlib_atom_t structure is returned.

For more information see PDBlib_get_structure().

PDBlib_chain_t* PDBlib_get_chain (PDBhandle PDBh, int id)

Get chain object. Parameters:

PDBh - initialized PDBlib handler

Parameters:

id - unique chain ID

Returns:

On success pointer to PDBlib_chain_t structure is returned.

For more information see PDBlib_get_structure().

PDBlib_model_t* PDBlib_get_model (PDBhandle PDBh, int id)

Get model object. Parameters:

PDBh - initialized PDBlib handler

Parameters:

id - unique model ID

Returns:

On success pointer to PDBlib_model_t structure is returned.

For more information see PDBlib_get_structure().

PDBlib_residue_t* PDBlib_get_residue (PDBhandle PDBh, int id)

Get residue object. Parameters:

PDBh - initialized PDBlib handler

Parameters:

id - unique residue ID

Returns:

On success pointer to PDBlib_residue_t structure is returned.

For more information see PDBlib_get_structure().

PDBlib_ssbond_t* PDBlib_get_ssbond (PDBhandle PDBh, int id)

Get ssbond object. Parameters:

PDBh - initialized PDBlib handler

Parameters:

id - unique ssbond ID

Returns:

On success pointer to PDBlib_ssbond_t structure is returned.

For more information see PDBlib_get_structure().

PDBlib_struct_t* PDBlib_get_structure (PDBhandle PDBh, int id)

Get structure object. Parameters:

PDBh - initialized PDBlib handler

Parameters:

id - unique structure ID

Returns:

On success pointer to PDBlib_struct_t structure is returned.

Function searches for structure object with given ID. If such a structure exists then pointer to this structure is returned, otherwise function returns NULL. If succeed, founded structure object is set as referencing point.

PDBhandle PDBlib_initialize ()

Initialize main data memory block. Returns:

On success returns initialized PDBlib handler, otherwise NULL.

This function allocate memory for PDBlib handler object and prepares it to use. Returned pointer has to be freed by call to PDBlib_free() function.

void PDBlib_iterator (PDBhandle PDBh, int type, PDBlib_iter_callback_t callback, void * userdata)

Iteration over specified objects. Parameters:

PDBh - initialized PDBlib handler

Parameters:

type - iteration type

Parameters:

callback - callback function

Parameters:

userdata - pointer to user data

Defined iteration types:
+ PDBLIB_ITER_ATOM - iteration over all atoms
+ PDBLIB_ITER_RESIDUE - iteration over all residues
+ PDBLIB_ITER_CHAIN - iteration over all chains
+ PDBLIB_ITER_MODEL - iteration over all models
+ PDBLIB_ITER_STRUCTURE - iteration over all structures
+ PDBLIB_ITER_SSBOND - iteration over all S-S bonds

Invoke callback function for every object in PDB structure. Iteration is breaking if callback function returns 1. Redo the same iteration if callback returns 2 (e.g. after object deletion).

int PDBlib_load_file (PDBhandle PDBh, const char * fname, int pqr_ext)

Load PDB file. Parameters:

PDBh - initialized PDBlib handler

Parameters:

fname - PDB file name

Parameters:

pqr_ext - PQR extension flag

Returns:

On success this function returns 0, otherwise -1.

This function loads PDB file into PDBlib structure. If loaded file is standard PDB file, then pqr_ext must be set to 0. If you want to load PQR file, then pqr_ext must be set to 1.

Note: If PQR file is opened then partial charges and atoms radii are stored in occupancy and bfactor fields respectively.

void PDBlib_perform_optimization (PDBhandle PDBh, int flags)

Perform optimization on PDB structure. Parameters:

PDBh - initialized PDBlib handler

Parameters:

flags - optimization flag(s)

This optimization may includes:
+ sorting atoms in residue (order: N, CA, C, O, alphabetically)
+ correction in atom->serial_nb numbering
+ adding element field if omitted (by guessing it from atom name)

Available flags (can be combined with ’|’):
+ PDBLIB_OPTI_SORTATOMS
+ PDBLIB_OPTI_RENUMBERING
+ PDBLIB_OPTI_ADDELEMENT
+ PDBLIB_OPTI_ADDCHAINAME
+ PDBLIB_OPTI_ALL

void PDBlib_remove_heteroatoms (PDBhandle PDBh)

Remove heteroatoms from structure. Parameters:

PDBh - initialized PDBlib handler

This function removes from PDB structure all atoms which are marked as heteroatoms. If in particular residue are only such atoms then whole residue is removed.

void PDBlib_remove_water (PDBhandle PDBh)

Remove water atoms from structure. Parameters:

PDBh - initialized PDBlib handler

This function removes from PDB structure all water atoms. Water is recognized as residue with ’HOH’ or ’WAT’ name.

int PDBlib_save_file (PDBhandle PDBh, const char * fname, int pqr_ext)

Save PDB structure into file. Parameters:

PDBh - initialized PDBlib handler

Parameters:

fname - PDB file name

Parameters:

pqr_ext - PQR extension flag

Returns:

On success this function returns 0, otherwise -1.

This function saves PDB structure into file. For PQR extension flag meaning see PDBlib_load_file function.

int PDBlib_set_atom_hashed_id (PDBlib_atom_t * src_a)

Set atom ID to hash value. Parameters:

src_a - pointer to atom structure

Returns:

Unique hashed atom ID

Atom ID is set to hash value based on:
+ chain: name
+ residue: name, sequence number
+ atom: name, hetero bit, alternative location

After this operation atom ID should be unique for whole PDB structure.

int PDBlib_set_residue_hashed_id (PDBlib_residue_t * src_r)

Set residue ID to hash value. Parameters:

src_r - pointer to residue structure

Returns:

Unique hashed residue ID

Residue ID is set to hash value based on:
+ chain: name
+ residue: name, sequence number

Author

Generated automatically by Doxygen for pdblib from the source code.