PPL Logo

libs/ck-libs/metis/GKlib/pdb.c File Reference

Functions for parsing pdb files. More...

Go to the source code of this file.

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 10711 2011-08-31 22:23:04Z karypis

Definition in file pdb.c.


Function Documentation

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:
res is the three-letter code to be converted.
Returns:
A representing the amino acid.

Definition at line 24 of file pdb.c.

Referenced by gk_readpdbfile().

Here is the caller graph for this function:

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:
p is the pdbf structure to be freed.

Definition at line 105 of file pdb.c.

References pdbf::atoms, pdbf::bbs, pdbf::cas, pdbf::cm, gk_free(), atom::name, pdbf::natoms, pdbf::nresidues, atom::resname, pdbf::resSeq, and pdbf::threeresSeq.

Here is the call graph for this function:

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:
fname is the file name to be read
Returns:
A filled pdbf structure.

Definition at line 132 of file pdb.c.

References atom::altLoc, pdbf::atoms, pdbf::bbs, pdbf::cas, atom::chainid, pdbf::cm, pdbf::corruption, atom::element, gk_fopen(), gk_malloc(), gk_strdup(), gk_threetoone(), atom::icode, atom::name, center_of_mass::name, pdbf::natoms, pdbf::nbbs, pdbf::ncas, pdbf::nresidues, atom::opcy, atom::resname, pdbf::resSeq, atom::rserial, atom::serial, pdbf::threeresSeq, atom::tmpt, atom::x, center_of_mass::x, x, atom::y, center_of_mass::y, atom::z, and center_of_mass::z.

Here is the call graph for this function:

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:
p is the pdbf structure with the sequence of interest
fname is the file name to be written

Definition at line 326 of file pdb.c.

References gk_fopen(), pdbf::nresidues, and pdbf::resSeq.

Here is the call graph for this function:

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:
p is the pdbf structure to write out
fname is the file name to be written

Definition at line 350 of file pdb.c.

References pdbf::cm, gk_fopen(), pdbf::nresidues, pdbf::threeresSeq, center_of_mass::x, center_of_mass::y, and center_of_mass::z.

Here is the call graph for this function:

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:
p is the pdbf structure to write out
fname is the file name to be written

Definition at line 371 of file pdb.c.

References atom::altLoc, pdbf::atoms, atom::chainid, gk_fopen(), atom::icode, atom::name, pdbf::natoms, atom::opcy, atom::resname, atom::rserial, atom::serial, atom::tmpt, atom::x, atom::y, and atom::z.

Here is the call graph for this function:

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:
p is the pdb structure to write out.
fname is the file name to be written.

Definition at line 392 of file pdb.c.

References atom::altLoc, pdbf::bbs, atom::chainid, gk_fopen(), atom::icode, atom::name, pdbf::nbbs, atom::opcy, atom::resname, atom::rserial, atom::serial, atom::tmpt, atom::x, atom::y, and atom::z.

Here is the call graph for this function:

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:
p is the pdb structure to write out.
fname is the file name to be written.

Definition at line 413 of file pdb.c.

References atom::altLoc, pdbf::cas, atom::chainid, gk_fopen(), atom::icode, atom::name, pdbf::ncas, atom::opcy, atom::resname, atom::rserial, atom::serial, atom::tmpt, atom::x, atom::y, and atom::z.

Here is the call graph for this function:

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:
p is the pdb structure to write out.
fname is the file name to be written.

Definition at line 435 of file pdb.c.

References pdbf::corruption.


Generated on Mon Sep 21 08:09:06 2020 for Charm++ by  doxygen 1.5.5