fpmain.h File Reference

#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
#include "fpocket.h"
#include "rpdb.h"
#include "fparams.h"
#include "fpout.h"
#include "memhandler.h"

Go to the source code of this file.

Functions

void process_pdb (char *pdbname, s_fparams *params)


Function Documentation

void process_pdb ( char *  pdbname,
s_fparams params 
)

## FUNCTION: process_pdb

## SPECIFICATION: Handle a single pdb: check the pdb name, load data, and launch fpocket if the pdb file have been successfully read.

## PARAMETRES: @ char *pdbname : Name of the pdb @ s_fparams *params : Parameters of the algorithm. See fparams.c/.h

## RETURN: void

Definition at line 130 of file fpmain.c.

References c_lst_pocket_free(), s_fparams::db_run, s_pdb::fpdb, M_DONT_KEEP_LIG, M_KEEP_LIG, M_MAX_PDB_NAME_LEN, rpdb_open(), rpdb_read(), search_pocket(), write_descriptors_DB(), write_out_fpocket(), and write_out_fpocket_DB().

Referenced by main().

00131 {
00132         /* Check the PDB file */
00133         if(pdbname == NULL) return ;
00134         
00135         int len = strlen(pdbname) ;
00136         if(len >= M_MAX_PDB_NAME_LEN || len <= 0) {
00137                 fprintf(stderr, "! Invalid length for the pdb file name. (Max: %d, Min 1)\n",
00138                                 M_MAX_PDB_NAME_LEN) ;
00139                 return ;
00140         }
00141         
00142         /* Try to open it */
00143         s_pdb *pdb =  rpdb_open(pdbname, NULL, M_DONT_KEEP_LIG) ;
00144         s_pdb *pdb_w_lig =  rpdb_open(pdbname, NULL, M_KEEP_LIG) ;
00145         
00146         if(pdb) {
00147                 /* Actual reading of pdb data and then calculation */
00148                         rpdb_read(pdb, NULL, M_DONT_KEEP_LIG) ;
00149                         rpdb_read(pdb_w_lig, NULL, M_KEEP_LIG) ;
00150                         c_lst_pockets *pockets = search_pocket(pdb, params,pdb_w_lig);
00151                         if(pockets) {
00152                                 
00153                                 if(params->db_run) {
00154                                     write_descriptors_DB(pockets,stdout);
00155                                     write_out_fpocket_DB(pockets, pdb, pdbname);
00156                                 }
00157                                 else write_out_fpocket(pockets, pdb, pdbname);
00158                                 c_lst_pocket_free(pockets) ;
00159                         }
00160                         fclose(pdb->fpdb);
00161         }
00162         else fprintf(stderr, "! PDB reading failed!\n");
00163 }


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