hp2FEM  0.1
Functions
src/metis-5.0/GKlib/pdb.c File Reference

Functions for parsing pdb files. More...

#include <GKlib.h>
Include dependency graph for pdb.c:

Functions

char gk_threetoone (char *res)
 Converts three-letter amino acid codes to one-leter codes.
void gk_freepdbf (pdbf *p)
 Frees the memory of a pdbf structure.
pdbfgk_readpdbfile (char *fname)
 Reads a pdb file into a pdbf structure.
void gk_writefastafrompdb (pdbf *pb, char *fname)
 Writes the sequence of residues from a pdb file.
void gk_writecentersofmass (pdbf *p, char *fname)
 Writes all centers of mass in pdb-format to file fname.
void gk_writefullatom (pdbf *p, char *fname)
 Writes all atoms in p in pdb-format to file fname.
void gk_writebackbone (pdbf *p, char *fname)
 Writes out all the backbone atoms of a structure in pdb format.
void gk_writealphacarbons (pdbf *p, char *fname)
 Writes out all the alpha carbon atoms of a structure.
void gk_showcorruption (pdbf *p)
 Decodes the corruption bitswitch and prints any problems.

Detailed Description

Functions for parsing pdb files.

Pdb reader (parser). Loads arrays of pointers for easy backbone access.

Date:
Started 10/20/06
Author:
Kevin
Version:
Id:
pdb.c 9363 2011-02-04 22:26:51Z karypis

Function Documentation

void gk_freepdbf ( pdbf p)

Frees the memory of a pdbf structure.

This function takes a pdbf pointer and frees all the memory below it.

Parameters:
pis the pdbf structure to be freed.
pdbf* gk_readpdbfile ( char *  fname)

Reads a pdb file into a pdbf structure.

This function allocates a pdbf structure and reads the file fname into that structure.

Parameters:
fnameis the file name to be read
Returns:
A filled pdbf structure.
void gk_showcorruption ( pdbf p)

Decodes the corruption bitswitch and prints any problems.

Due to the totally unreliable nature of the pdb format, reading a pdb file stores a corruption bitswitch, and this function decodes that switch and prints the result on stdout.

Parameters:
pis the pdb structure to write out.
fnameis the file name to be written.
char gk_threetoone ( char *  res)

Converts three-letter amino acid codes to one-leter codes.

This function takes a three letter * and converts it to a single

Parameters:
resis the three-letter code to be converted.
Returns:
A representing the amino acid.
void gk_writealphacarbons ( pdbf p,
char *  fname 
)

Writes out all the alpha carbon atoms of a structure.

This function takes a pdbf structure p and writes only the alpha carbon atoms to a filename fname.

Parameters:
pis the pdb structure to write out.
fnameis the file name to be written.
void gk_writebackbone ( pdbf p,
char *  fname 
)

Writes out all the backbone atoms of a structure in pdb format.

This function takes a pdbf structure p and writes only the backbone atoms to a filename fname.

Parameters:
pis the pdb structure to write out.
fnameis the file name to be written.
void gk_writecentersofmass ( pdbf p,
char *  fname 
)

Writes all centers of mass in pdb-format to file fname.

This function takes a pdbf structure and writes out the calculated mass center information to file fname as though each one was a c-alpha.

Parameters:
pis the pdbf structure to write out
fnameis the file name to be written
void gk_writefastafrompdb ( pdbf pb,
char *  fname 
)

Writes the sequence of residues from a pdb file.

This function takes a pdbf structure and a filename, and writes out the amino acid sequence according to the atomic coordinates. The output is in fasta format.

Parameters:
pis the pdbf structure with the sequence of interest
fnameis the file name to be written
void gk_writefullatom ( pdbf p,
char *  fname 
)

Writes all atoms in p in pdb-format to file fname.

This function takes a pdbf structure and writes out all the atom information to file fname.

Parameters:
pis the pdbf structure to write out
fnameis the file name to be written
 All Classes Files Functions Variables Typedefs Friends Defines