bioworld.h File Reference

Detailed Description

A bridge between world structures and biological information.

See Also
bioworld.c

Definition in file bioworld.h.

Data Structures

struct  TBioWorld
 Structure with the molecular and the mechanical information. More...
 

Functions

boolean InitBioWorld (Tparameters *p, char *filename, unsigned int maxAtomsLink, double **conformation, TBioWorld *bw)
 Initializes a world form a biomolecule. More...
 
void AdjustBioWorldGeometry (Tparameters *p, TBioWorld *bw)
 Enforces all bond lengths and angles to be the same. More...
 
TworldBioWorldWorld (TBioWorld *bw)
 Returns a pointer to the world generated from the bio-information. More...
 
unsigned int BioWorldNAtoms (TBioWorld *bw)
 Number of atoms in the molecule. More...
 
unsigned int BioWorldConformationSize (TBioWorld *bw)
 Number of variables used to represent a conformation. More...
 
void BioWordGetAtomPositionsFromConformation (Tparameters *p, boolean simp, double *conformation, double *pos, TBioWorld *bw)
 Computes the position of the atoms. More...
 
void BioWordSetAtomPositionsFromConformation (Tparameters *p, boolean simp, double *conformation, TBioWorld *bw)
 Changes the position of the atoms. More...
 
double BioWorldRMSE (double *pos, TBioWorld *bw)
 Computes the RMSE. More...
 
unsigned int BioWordConformationFromAtomPositions (Tparameters *p, double *atoms, double **conformation, TBioWorld *bw)
 Produces the internal coordinates from the atom positions. More...
 
double BioWorldEnergy (Tparameters *p, boolean simp, double *conformation, void *bw)
 Computes the energy of a given configuration. More...
 
void SaveBioWorldBioInfo (Tparameters *p, char *fname, boolean simp, double *conformation, TBioWorld *bw)
 Stores the BioWorld information in a molecular format (eg. pdb). More...
 
void PrintBioWorld (Tparameters *p, char *fname, int argc, char **arg, TBioWorld *bw)
 Prints the BioWorld information into a file. More...
 
void DeleteBioWorld (TBioWorld *bw)
 Destructor. More...
 

Function Documentation

boolean InitBioWorld ( Tparameters p,
char *  filename,
unsigned int  maxAtomsLink,
double **  conformation,
TBioWorld bw 
)

Initializes a world structure from biological information.

Parameters
pThe set of parameters.
filenameThe name for the file with the biological information. All formats available in babel can be used.
maxAtomsLinkLinks with more atoms than this limit are represented in wireframe. This is faster for visualization but it does not allow to detect collisions with the link. This is to be used only for visualization. Use NO_UINT for no limit (all in facy).
conformationConfiguration of the molecule (space allocated internally).
bwThe BioWorld to initialize.
Returns
TRUE if the BioWorld could be initialized.

Definition at line 1394 of file bioworld.c.

References BioWordConformationFromAtomPositions(), BioWordSetAtomPositionsFromConformation(), DetectLinksAndJoints(), DetectLinksAndJointsFromResidues(), DetectLinksAndJointsFromRigidsAndHinges(), FALSE, GetAtomPositions(), GetMoleculeBasicInfo(), InitWorldFromMolecule(), TBioWorld::m, TBioWorld::na, TBioWorld::nb, TBioWorld::nbAtom, NEW, TBioWorld::pos, ReadMolecule(), ReadResidueList(), ReadRigidsAndHinges(), RemoveBond(), SetAtomCoordinates(), and TRUE.

Referenced by main().

void AdjustBioWorldGeometry ( Tparameters p,
TBioWorld bw 
)

Enforces all bond lengths and angles to be the same for each pair or triplet of atoms of different type.

We set up a set of constraints and finds a point that holds them form the current conformation using a local procedure. The new point is used to change the atom positions in the given bioworld.

Parameters
pThe set of parameters.
bwThe BioWorld to initialize.

Definition at line 1475 of file bioworld.c.

References AddCt2Monomial(), AddEquation2CS(), AddMonomial(), AddVariable2CS(), AddVariable2Monomial(), DeleteBondIterator(), DeleteBox(), DeleteCuikSystem(), DeleteEquation(), DeleteMonomial(), DeleteVariable(), DifferenceVector(), Distance(), DotProduct(), DUMMY_EQ, DUMMY_VAR, EQU, Error(), GenerateDotProductEquation(), GenerateNormEquation(), GetAtomicNumber(), GetCSSystemVars(), GetCSVariableID(), GetCSVariableNames(), GetFirstNeighbour(), GetNextNeighbour(), InitBoxFromPoint(), InitCuikSystem(), InitEquation(), InitMonomial(), TBioWorld::m, TBioWorld::na, TBioWorld::nb, TBioWorld::nba, NEW, NewInterval(), NewVariable(), NFUN, NO_UINT, TBioWorld::pos, PrintBoxSubset(), PrintCuikSystem(), ResetMonomial(), SetEquationCmp(), SetEquationType(), SetEquationValue(), SetVariableInterval(), SYSTEM_EQ, and SYSTEM_VAR.

Tworld* BioWorldWorld ( TBioWorld bw)

Returns a pointer to the world generated from the bio-information.

This function is provided for convenience but caution must be taken not to modify this internal structure.

Parameters
bwThe BioWorld to query.
Returns
A pointer to the internal world structure.

Definition at line 1807 of file bioworld.c.

References TBioWorld::w.

Referenced by main().

unsigned int BioWorldNAtoms ( TBioWorld bw)

Number of atoms in the molecule.

Parameters
bwThe BioWorld to query.
Returns
The number of atoms in the molecule.

Definition at line 1812 of file bioworld.c.

References TBioWorld::na.

Referenced by main().

unsigned int BioWorldConformationSize ( TBioWorld bw)

Number of variables used to represent a conformation. This changes for different representations (see CT_REPRESENTATION) In any case this function returns the number of system varibles used to represent a conformation. This is the number of variables appearing in the output files. Internally, though, a different number of variables migth be used (resulting from the simplification and dummification of the equations, if applied).

Parameters
bwThe BioWorld to query.
Returns
The number of variables representing a conformation.

Definition at line 1817 of file bioworld.c.

References GetWorldNumSystemVariables(), and TBioWorld::w.

Referenced by main().

void BioWordGetAtomPositionsFromConformation ( Tparameters p,
boolean  simp,
double *  conformation,
double *  pos,
TBioWorld bw 
)

Computes the position of the atoms in a molecule from the conformation encoded in the conformation vector. The contents of this vector changes according to the representation used for the equations (see CT_REPRESENTATION).

Parameters
pThe set of parameters.
simpTRUE if the sample is given in the simplified system.
conformationThe configuration.
posArray where to store the new positions (3 entries per atom).
bwThe BioWorld information.

Definition at line 1822 of file bioworld.c.

References DeleteLinkTransforms(), GetLinkTransformsFromSolutionPoint(), GetVectorElement(), HTransformApply(), TBioWorld::linkList, TBioWorld::links, TBioWorld::localPos, TBioWorld::nl, NO_UINT, and TBioWorld::w.

Referenced by BioWordSetAtomPositionsFromConformation(), and main().

void BioWordSetAtomPositionsFromConformation ( Tparameters p,
boolean  simp,
double *  conformation,
TBioWorld bw 
)

Changes the position of the atoms in a molecule. The new position is computed from the conformation encoded in the conformation vector. The contents of this vector changes according to the representation used for the equations (see CT_REPRESENTATION).

Parameters
pThe set of parameters.
simpTRUE if the sample is given in the simplified system.
conformationThe configuration.
bwThe BioWorld information.

Definition at line 1852 of file bioworld.c.

References BioWordGetAtomPositionsFromConformation(), TBioWorld::m, TBioWorld::pos, and SetAtomCoordinates().

Referenced by BioWorldEnergy(), InitBioWorld(), and SaveBioWorldBioInfo().

double BioWorldRMSE ( double *  pos,
TBioWorld bw 
)

Computes the Root Mean Square Error (RMSE) between the current the atom positions stored int he BioWorld structure and the atom position corresponding to another conformation. These atom postiions can be computed form conformations using BioWordGetAtomPositionsFromConformation.

If the flexibility of the molecule is reduced to only few residues only those are considered for the error.

Parameters
posThe atom positions for the new conformation.
bwThe BioWorld to be used as a reference.
Returns
The RMSE.

Definition at line 1860 of file bioworld.c.

References Distance(), TBioWorld::linkID, TBioWorld::na, and TBioWorld::pos.

Referenced by main().

unsigned int BioWordConformationFromAtomPositions ( Tparameters p,
double *  atoms,
double **  conformation,
TBioWorld bw 
)

Generates a conformation (internal coordinates) from the atom positions). The exact form of the internal coordinates depend on the CT_REPRESENTATION value in the file of parameters. If DOF is used, the conformation is represented in the tradional internal coordinates in molecular modeling (dihedral angles). Other representations are not typical in bio-engineering but in Robotics.

Parameters
pThe set of parameters.
atomsThe 3d positions of the atoms.
conformationThe output conformation. Space is allocated internally.
bwThe BioWorld to query.
Returns
The size of the conformation.

Definition at line 1882 of file bioworld.c.

References Atoms2Transforms(), GetSolutionPointFromLinkTransforms(), HTransformDelete(), NEW, TBioWorld::nl, and TBioWorld::w.

Referenced by InitBioWorld(), and main().

double BioWorldEnergy ( Tparameters p,
boolean  simp,
double *  conformation,
void *  bw 
)

Computes the energy of a given configuraion. This is used to implement T-RRT like algorithms on biomolecules. The signature of this function is generic for all cost function (see EvaluateCSCost).

Parameters
pThe set of parameters.
simpTRUE if the conformation is given in the simplified system.
conformationArray giving the conformation.
bwThe BioWorld information.

Definition at line 1902 of file bioworld.c.

References BioWordSetAtomPositionsFromConformation(), and ComputeEnergy().

Referenced by main().

void SaveBioWorldBioInfo ( Tparameters p,
char *  fname,
boolean  simp,
double *  conformation,
TBioWorld bw 
)

Changes the atom positions and stores the resulting conformation into a molecular format.

Parameters
pThe set of parameters.
fnameThe name for the output file. The format of the file is infered from the extension of the filename. All the formats available in OpenBabel can be used.
simpTRUE if the conformation is given in the simplified system.
conformationArray giving the conformation.
bwThe BioWorld information store.

Definition at line 1911 of file bioworld.c.

References BioWordSetAtomPositionsFromConformation(), TBioWorld::m, and WriteMolecule().

Referenced by main().

void PrintBioWorld ( Tparameters p,
char *  fname,
int  argc,
char **  arg,
TBioWorld bw 
)

Store the world information (stored into the BioWorld structure) into a file so that it can be read as

Moreover we generate a conformation deduced from the atom positions. This can be given it is already available to the caller (for instance as an output of InitBioWorld).

The world and the conformation file can be used to generate the atlas or to plan.

Parameters
pThe set of parameters.
fnameName of the file where to store the information (different extensions are used for the world and the sample files).
argcNumber of strings to be added to the world file header as comments.
argStrings to be added to the world file as comments. Right now, this is used to store in the command line used to create it.
bwThe BioWorld with the information to save.

Definition at line 1919 of file bioworld.c.

References PrintWorld(), and TBioWorld::w.

Referenced by main().

void DeleteBioWorld ( TBioWorld bw)