mdpout.c File Reference

#include "../headers/mdpout.h"

Go to the source code of this file.

Functions

void write_md_grid (s_mdgrid *g, FILE *f, FILE *fiso, s_mdparams *par, float isovalue)
void write_md_pocket_atoms (FILE *f, int *ids, s_pdb *prot, int nids, int sn)
void write_first_bfactor_density (FILE *f, s_pdb *prot)


Function Documentation

void write_first_bfactor_density ( FILE *  f,
s_pdb prot 
)

## FUNCTION: write_first_bfactor_density

## SPECIFICATION: writes the protein structure with pocket densities in the bfactor column.

## PARAMETRES: @ FILE *f : output file handle @ s_pdb *prot : protein handle

## RETURN: void

Definition at line 203 of file mdpout.c.

References s_atm::bfactor, s_atm::chain, s_atm::charge, s_atm::id, s_pdb::latoms_p, s_atm::name, s_pdb::natoms, s_atm::occupancy, s_atm::pdb_aloc, s_atm::pdb_insert, s_atm::res_id, s_atm::res_name, s_atm::symbol, write_pdb_atom_line(), s_atm::x, s_atm::y, and s_atm::z.

Referenced by mdpocket_detect().

00203                                                      {
00204     s_atm *cura;
00205     int i;
00206     //fprintf(f,"MODEL        %d\n",sn);
00207     for(i=0;i<prot->natoms;i++){
00208         cura=prot->latoms_p[i];
00209         write_pdb_atom_line(f, "ATOM", cura->id, cura->name,
00210                                                  cura->pdb_aloc, cura->res_name, cura->chain,
00211                                                  cura->res_id, cura->pdb_insert, cura->x, cura->y, cura->z, cura->occupancy,
00212                                                  cura->bfactor, cura->symbol, cura->charge);
00213     }
00214     fprintf(f,"TER\n");
00215     fprintf(f,"END\n");
00216 
00217 }

void write_md_grid ( s_mdgrid g,
FILE *  f,
FILE *  fiso,
s_mdparams par,
float  isovalue 
)

## FUNCTION: write_md_grid

## SPECIFICATION: Write the md grid to a file.

## PARAMETRES: @ s_mdgrid g : structure containing the grid @ FILE *f : file handle for output file @ FILE *fiso : file handle for iso pdb output file @ s_mdparams *par : parameters for mdpocket @ float isovalue : isovalue at which one wants to extract the iso PDB

## RETURN: void :

Definition at line 95 of file mdpout.c.

References s_fparams::asph_max_size, s_fparams::asph_min_size, s_fparams::clust_max_dist, s_mdparams::flag_scoring, s_mdparams::fpar, s_mdgrid::gridvalues, s_fparams::min_pock_nb_asph, s_mdgrid::nx, s_mdgrid::ny, s_mdgrid::nz, s_mdgrid::origin, s_fparams::refine_clust_dist, s_mdgrid::resolution, s_fparams::sl_clust_max_dist, and s_fparams::sl_clust_min_nneigh.

Referenced by mdpocket_detect().

00096 {
00097     int cx,cy,cz;
00098     float cv;
00099     float rx,ry,rz;
00100     size_t cnt=0;
00101     /*write the header of the dx file*/
00102     fprintf(f,"# Data calculated by mdpocket, part of the fpocket package\n");
00103     fprintf(f,"# This is a standard DX file of occurences of cavities within MD trajectories.\n");
00104     fprintf(f,"# The file can be visualised using the freely available VMD software\n");
00105     fprintf(f,"# fpocket parameters used to create this dx file : \n");
00106     fprintf(f,"# \t-m %2.f (min alpha sphere size) -M %.2f (max alpha sphere size)\n",par->fpar->asph_min_size, par->fpar->asph_max_size);
00107     fprintf(f,"# \t-i %d (min number of alpha spheres per pocket)\n",par->fpar->min_pock_nb_asph);
00108     fprintf(f,"# \t-D %.2f (Max distance for 1st clustering algo)\n#\t-r %.2f (Max dist for 2nd clustering algo)\n#\t-s %.2f (Max dist for third clustering algo)\n",par->fpar->clust_max_dist, par->fpar->refine_clust_dist, par->fpar->sl_clust_max_dist);
00109     fprintf(f,"# \t-n %d (Min neighbour atoms for multi linkage clustering)\n",par->fpar->sl_clust_min_nneigh);
00110     if(par->flag_scoring) fprintf(f,"# \t-S (Map drug score to density map!)\n");
00111     fprintf(f,"object 1 class gridpositions counts %d %d %d\n",g->nx,g->ny,g->nz);
00112     fprintf(f,"origin %.2f %.2f %.2f\n",g->origin[0],g->origin[1],g->origin[2]);
00113     fprintf(f,"delta %.2f 0 0\n",g->resolution);
00114     fprintf(f,"delta 0 %.2f 0\n",g->resolution);
00115     fprintf(f,"delta 0 0 %.2f\n",g->resolution);
00116     fprintf(f,"object 2 class gridconnections counts %d %d %d\n",g->nx,g->ny,g->nz);
00117     fprintf(f,"object 3 class array type double rank 0 items %d data follows\n",g->nx*g->ny*g->nz);
00118     int i=0;
00119     for(cx=0;cx<g->nx;cx++){
00120         for(cy=0;cy<g->ny;cy++){
00121             for(cz=0;cz<g->nz;cz++){
00122                 if(i==3) {
00123                     i=0;
00124                     fprintf(f,"\n");
00125                 }
00126                 cv=g->gridvalues[cx][cy][cz];
00127                 fprintf(f,"%.3f ",cv);
00128                 if(cv>=isovalue){
00129                     cnt++;
00130                     rx=g->origin[0]+cx*g->resolution;
00131                     ry=g->origin[1]+cy*g->resolution;
00132                     rz=g->origin[2]+cz*g->resolution;
00133                     fprintf(fiso,"ATOM  %5d  C   PTH     1    %8.3f%8.3f%8.3f%6.2f%6.2f\n",(int)cnt,rx,ry,rz,0.0,0.0);
00134                 }
00135                 i++;
00136             }
00137         }
00138     }
00139 }

void write_md_pocket_atoms ( FILE *  f,
int *  ids,
s_pdb prot,
int  nids,
int  sn 
)

## FUNCTION: write_md_pocket_atoms

## SPECIFICATION: writes a pdb file containing all pocket atoms at each snapshot in distinct models

## PARAMETRES: @ FILE *f : output file handle @ int *ids : list of atom identifiers @ s_pdb *prot : the protein handle @ int nids : number of ids in ids list @ int sn : number of snapshots

## RETURN: void

Definition at line 162 of file mdpout.c.

References s_atm::bfactor, s_atm::chain, s_atm::charge, s_atm::id, s_pdb::latoms_p, s_atm::name, s_atm::occupancy, s_atm::pdb_aloc, s_atm::pdb_insert, s_atm::res_id, s_atm::res_name, s_atm::symbol, write_pdb_atom_line(), s_atm::x, s_atm::y, and s_atm::z.

Referenced by mdpocket_characterize().

00162                                                                           {
00163     s_atm *cura;
00164     int i,j,flag;
00165     i=0;
00166     j=0;
00167     fprintf(f,"MODEL        %d\n",sn);
00168     for(i=0;i<nids;i++){
00169         flag=0;
00170         while(flag==0 && j<prot->natoms){
00171             cura=prot->latoms_p[j];
00172             if(cura->id==ids[i]){
00173                 flag=1;
00174                 write_pdb_atom_line(f, "ATOM", cura->id, cura->name,
00175                                                  cura->pdb_aloc, cura->res_name, cura->chain,
00176                                                  cura->res_id, cura->pdb_insert, cura->x, cura->y, cura->z, cura->occupancy,
00177                                                  cura->bfactor, cura->symbol, cura->charge);
00178             }
00179             j++;
00180         }
00181     }
00182     fprintf(f,"ENDMDL\n");
00183     
00184 }


Generated on Mon Jun 7 16:44:23 2010 for fpocket by  doxygen 1.5.6