cuikpdb2world.c
Go to the documentation of this file.
1 
2 #include "world.h"
3 #include "bioworld.h"
4 #include "parameters.h"
5 
6 #include "defines.h"
7 #include "error.h"
8 #include "filename.h"
9 
10 #include <stdlib.h>
11 
63 int main(int argc, char **arg)
64 {
65  TBioWorld bioWorld; /* The description of the problem */
66  Tparameters parameters; /* Parameters */
67 
68  Tfilename fparam;
69  double *dof;
70  unsigned int maxAtoms;
71 
72  if (argc>1)
73  {
74 
75  /* Init parameters */
76  CreateFileName(NULL,arg[1],NULL,PARAM_EXT,&fparam);
77  fprintf(stderr,"Reading parameters from : %s\n",GetFileFullName(&fparam));
78  InitParametersFromFile(GetFileFullName(&fparam),&parameters);
79 
80  if (argc>2)
81  maxAtoms=atoi(arg[2]);
82  else
83  maxAtoms=NO_UINT;
84 
85  /* Read the problem from file */
86  InitBioWorld(&parameters,arg[1],maxAtoms,&dof,&bioWorld);
87 
88  /* Print the world information (a world) */
89  PrintBioWorld(&parameters,arg[1],argc,arg,&bioWorld);
90 
91  /* Release allocated objects. */
92  free(dof);
93  DeleteParameters(&parameters);
94  DeleteBioWorld(&bioWorld);
95 
96  DeleteFileName(&fparam);
97  }
98  else
99  {
100  fprintf(stderr," Wrong number of parameters.\n");
101  fprintf(stderr," Use:\n");
102  fprintf(stderr," cuikpdb2world <problem filename>.pdb [maxAtoms]\n");
103  fprintf(stderr," where <problem filename>.pdb contains the molecular information\n");
104  fprintf(stderr," maxAtoms [optional] Maximum number of atoms in a rigid compound to be represented in a fancy way.\n");
105  fprintf(stderr," Rigids clusters larger than this limit are represented using wireframe. The advantage is that\n");
106  fprintf(stderr," wireframe is significantly faster when displaying conformations. The problems is that wireframe\n");
107  fprintf(stderr," is not used when computing collisions. If not given all atoms are represented in a fancy way\n");
108  fprintf(stderr," The extension (e.g., '.pdb') is required\n");
109  fprintf(stderr," All the extensions managed by OpenBabel can be used\n");
110  }
111  return(EXIT_SUCCESS);
112 }
113