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 
void InitBioWorld(Tparameters *p, char *filename, unsigned int maxAtomsLink, double **conformation, TBioWorld *bw)
Initializes a world form a biomolecule.
Definition: bioworld.c:1394
void DeleteBioWorld(TBioWorld *bw)
Destructor.
Definition: bioworld.c:1918
void PrintBioWorld(Tparameters *p, char *fname, int argc, char **arg, TBioWorld *bw)
Prints the BioWorld information into a file.
Definition: bioworld.c:1913
Data structure to hold the information about the name of a file.
Definition: filename.h:248
Definition of the Tfilename type and the associated functions.
#define PARAM_EXT
File extension for parameter files.
Definition: filename.h:131
int main(int argc, char **arg)
Main body of the cuikpdb2world application.
Definition: cuikpdb2world.c:63
Definition of the Tworld type and the associated functions.
Error and warning functions.
void DeleteFileName(Tfilename *fn)
Destructor.
Definition: filename.c:205
Definitions of constants and macros used in several parts of the cuik library.
A table of parameters.
void CreateFileName(char *path, char *name, char *suffix, char *ext, Tfilename *fn)
Constructor.
Definition: filename.c:22
A bridge between world structures and biological information.
void InitParametersFromFile(char *file, Tparameters *p)
Constructor from a file.
Definition: parameters.c:51
char * GetFileFullName(Tfilename *fn)
Gets the file full name (paht+name+extension).
Definition: filename.c:151
#define NO_UINT
Used to denote an identifier that has not been initialized.
Definition: defines.h:435
void DeleteParameters(Tparameters *p)
Destructor.
Definition: parameters.c:295
Structure with the molecular and the mechanical information.
Definition: bioworld.h:28
Definition of the Tparameters type and the associated functions.