mFES - molecular Finite Element Solver  0.4
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes
Model Class Reference

A model is a surface for the protein or titratable group depending on the approach used. Also building up the whole volume models merging with the boundary is implemented here using NETGEN. More...

#include <Model.h>

List of all members.

Public Member Functions

void calcIonLayer (vector< Atom > &atomList, INI &ini, string fname="exclusion.vol")
 The ion exclusion layer is computed using an atom list, INI options file and an output file (exclusion.vol)
void calcModel (vector< Atom > &atomList, INI &ini, string fname="", bool cavity=false)
 A model (surface) is computed. This may be the molecular surface of the protein, a titratable group or the cavity surface.

Static Public Attributes

static bool exclusionSurface = false

Private Member Functions

void printMeshingOptions (Ng_Meshing_Parameters &mp, string prefix)
 Nearly all available meshing options are printed out for debugging purposes.
void setMeshingOptions (Ng_Meshing_Parameters &mp, string optFile)
 Meshing options are set up using an options file.
int convert (mMesh &mSurface, INI &ini, string fname="", string mode="protein")
 A fine grained mesh is converted into a NETGEN volume mesh including a boundary surface.
void clean (mMesh &mSurface)
 This method performs some cleaning of the mesh. Here, it removes duplicate vertices and removes unreferenced vertices (if any available)
void smooth (mMesh &mSurface, INI &ini)
 A smoothing of the molecular surface is performed.

Private Attributes

Ng_Result ngSurface
Ng_MeshngVolume

Detailed Description

A model is a surface for the protein or titratable group depending on the approach used. Also building up the whole volume models merging with the boundary is implemented here using NETGEN.

A model is either a surface or a volume. A surface is generated for the molecular surface or the ion exclusion layer for the protein or a surface is generated for every titratable group (also one for C- and N-terminus if selected). Whole surface management, also smoothing and merging is performed using NETGEN file structure conversion to VCG lib and vice versa. Exporting surfaces at every step is also possible. First second order surface generation methods are commented out. Meshing options are carefully handled using OPT files defined in the config INI files which is read in by mFES at starting point.

Author:
Ilkay Sakalli

Member Function Documentation

void Model::calcIonLayer ( vector< Atom > &  atomList,
INI ini,
string  fname = "exclusion.vol" 
) [inline]

The ion exclusion layer is computed using an atom list, INI options file and an output file (exclusion.vol)

The ion exclusion layer (IEL) is computed for the protein and titratable groups. The IEL is often defined as the van-der-Waals radius which is inflated by the radius of ions. mFES uses same definition but also rolls a probe sphere over the inflated van-der-Waals surface with a given radius (default: 0.5 Angstroems). This is done for robustness and it seems to be plausible by physical means.

Parameters:
atomListList of atoms be modeled.
iniINI file which defines e.g. the probe radius used for the ion exclusion layer.
fnameName of the volume file which will be generated as a result. (default: exclusion.vol)
Returns:
Void.

The file exclusion.stl has to be computed before using LSMS. If it is there use it, otherwise compute it using LSMS and export is as exclusion.stl.

A file called "times" if created before to perform some timing and writing out to file

The ion exlcusion layer is computed here.

The surface is cleaned which means removing duplicated points and vertices

The surface is smoothed WITHOUT shrinkage using Taubin smoothing or other method defined in the INI config file.

Resulting surface is exported as exclusion.stl to be read in later on or reused in a next computation.

Timing is written out to times and also to console

void Model::calcModel ( vector< Atom > &  atomList,
INI ini,
string  fname = "",
bool  cavity = false 
) [inline]

A model (surface) is computed. This may be the molecular surface of the protein, a titratable group or the cavity surface.

A model is computed using NETGEN. A new molecular surface is computed using the a fine grained template with the help of the advancing front method. Here, a model may be the molecular surface as a vol file for the protein, the titratable group or the cavity.

Parameters:
atomListList of atoms be modeled.
iniINI file which defines e.g. the probe radius used for the ion exclusion layer.
fnameName of the volume file which will be generated as a result.
cavityIf the cavity should be computed, this flag is set to true.
Returns:
Void.

Template surface generated using LSMS

Surface conversion to use with VCG lib

Volume file name (VOL file)

Surface file name (STL file)

Generator to use for protien. Either standard (default; may be always used) or voxelizer (used for small molecules, may more accurate but cannot handle cavities)

Resolution to use for the surface generator (default: 512)

Generator to use for titratable groups

Resolution to use for the surface generator (default: 256; because this is a smaller molecule and not a protein)

ionc is the ion concentration given in M

if ionc is set and it is not zero compute the ion exclusion surfaces for every model

Cavity is calculated. A cavity can just be computed using the generator "standard" which is default behaviour

Perform some timing on the computation of the cavity

First compute the cavity using LSMS and generate a template surface

Clean and smooth the surface smoothly

Export the resulting surface as "cavity.stl" (default)

Here, the template cavity surface is regularized using the advancing front method perfomed by NETGEN

Timing is performed and written out to times and console

Test if the protein molecular surface was already be computed.

If the molecular surface of the protein already exists, import it.

The protein molecular surface was not computed yet.

If the generator is standard, compute the molecular surface using LSMS tSurface and convert it to mMesh the VCG surface data structure

Here, the LSMS computation is performed using the whole atom list and options defined in config INI.

The surface is cleaned and smoothed leaving the surface shape invariant

Define a standard output file name for the fine grained molecular surface (default: protein.stl)

Export STL

Import STL to VCG lib structure This is done to be sure that the structure is loaded correctly and is easier tom implement

If the generator is Voxelizer

If the molecular surface does not yet exist, compute it using the voxelizer

Here, the voxelizer is used to compute the molecular surface. and the result is written into protein.stl

The surface is cleaned as before (removing duplicates, etc.)

Afterwards the output (default: protein.stl) is read in again as VCG lib molecular surface data structure.

Timing is performed and written into times and output to console.

Here, the STL molecular surface is converted to a VOL file (NETGEN datastructure performing the advancing front method and using the parameters defined in config INI and options files OPT.

Molecular surface for titratable group with id nr will be calculated Optionally the ion exclusion layer is computed

If the ion exclusion layer surface for the specific titratable group is not yet computed, compute it after choosing the appropriate surface generator (standard or voxelizer).

Here, the ion exclusion layer is computed using the mode "residue_exclusion" in the LSMS wrapper method.

After cleaning and smoothing the molecular surface leaving the surface invariant, the surface is exported as an STL file.

If the generator is Voxelizer, compute it with this generator and save the surface as STL.

Import the surface created into a VCG lib surface datastructure

After the ion exclusion layer is computed, create the molecular surface of the titratable group.

If the generator is "standard" (default), compute the molecular surface using the LSMS wrapper method.

After cleaning and smoothing the molecular surface, export the result as an STL file.

If the generator "Voxelizer" is chosen, compute the molecular surface export it as an STL file and import it as an VCG lib surface.

Here, the molecular surface is generated. Now, we need to regularize the molecular surface using NETGEN by performing the advancing front method. Options defined in the INI file are used.

Elapsed time for timing purposes is written into times and also to the console.

The current molecular surface for the titratable group was computed previously and saved as an STL file. So it just needs to be imported as a VCG lib surface.

... and converted into a VOL file (NETGEN) regularizing the surface using the advancing front method and the meshing options defined in the INI options files.

void Model::clean ( mMesh mSurface) [inline, private]

This method performs some cleaning of the mesh. Here, it removes duplicate vertices and removes unreferenced vertices (if any available)

Here, the surface may be cleaned or modified. Because we want to leave the molecular surface invariant just a removing of duplicate vertices and a removing of unreferenced vertices is performed using methods from the VCG lib.

Parameters:
mMeshA VCG lib surface structure.
Returns:
Void.
int Model::convert ( mMesh mSurface,
INI ini,
string  fname = "",
string  mode = "protein" 
) [inline, private]

A fine grained mesh is converted into a NETGEN volume mesh including a boundary surface.

A VCG mMesh structure is converted into an Ng_STL_Geometry. The geometry is then regularized using parameters defined in OPT files using the advancing front algorithm implemented by Joachim Schoeberl. If a volume meshed cavity surface is available it is merged with the molecular surface. The protein is volume meshed and merged with an ion exclusion layer if it is available. If the protein is merged with the ion exclusion layer, the volume between the molecular surface and the exclusion layer is also meshed. In the end, the whole preceding model is merged with a boundary layer and volume meshed again. The whole molecular model is saved as defined in the config INI file.

Parameters:
mMeshA VCG lib surface structure.
INIThe options defined in the config INI files are read in
fnameSuffix of the filename of the resulting molecular model VOL file
modeDefining which type of surface is going to be converted (possible values: protein / cavity / residue).
Returns:
Integer 1 if everything went fine. Now, just an exit occurs if there there was a failure.

NETGEN stl geometry structure

Initialise the Netgen Core library

Actually create the mesh structure

Convert VCG MyMesh to Ng_STL_Geometry

Set the Meshing Parameters to be used

If the ion exclusion layer has to be computed (ionc != 0)

If the ion exclusion layer is not computed (ionc = 0)

It is possible to use a file with points and h parameter to have control over density manually (not recommended yet)

Loading the boundary layer

Meshing the whole model

Volume mesh is saved

void Model::printMeshingOptions ( Ng_Meshing_Parameters mp,
string  prefix 
) [inline, private]

Nearly all available meshing options are printed out for debugging purposes.

Meshing options are provided by NETGEN. One may play with them using the NETGEN GUI. Here we use options which are found out to be useful for our purposes.

Parameters:
Ng_Meshing_ParametersData structure to store meshing parameters for NETGEN.
stringThis is some text to get sure, which options are used for which model step.
Returns:
Void.
void Model::setMeshingOptions ( Ng_Meshing_Parameters mp,
string  optFile 
) [inline, private]

Meshing options are set up using an options file.

An OPT file is defined for every meshing step. This is the meshing of the surface of a protein or titratable and and this is the meshing of the volume of a protein or titratable group. An options file has a variable and a value. The value is assigned to the variable name which is one of the meshing parameters.

Parameters:
Ng_Meshing_ParametersData structure to store meshing parameters for NETGEN.
stringoptions file (OPT) to be read in and parsed so that it is used for specific meshing step.
Returns:
Void.

Open the OPT file

For every variable and value pair

If the variable has a specific name, fill the specific Meshing property with the given value.

Switch to enable / disable usage of local mesh size modifiers

Maximum global mesh size allowed

Minimum global mesh size allowed

Mesh density: 0...1 (0 => coarse; 1 => fine)

Mesh grading: 0...1 (0 => uniform mesh; 1 => aggressive local grading)

Elements to generate per curvature radius

Number of elements to generate per edge of the geometry

Generate second-order surface and volume elements

Creates a Quad-dominated mesh

Enable / Disable mesh refinement at close edges

Factor to use for refinement at close edges (larger => finer)

Number of optimize steps to use for 2-D mesh optimization

Number of optimize steps to use for 3-D mesh optimization

Invert all the volume elements

Invert all the surface triangle elements

Check for overlapping surfaces during Surface meshing

Check for overlapping surface elements before volume meshing

void Model::smooth ( mMesh mSurface,
INI ini 
) [inline, private]

A smoothing of the molecular surface is performed.

The aim of this method is to smooth the molecular surface, leaving the surface invariant and without injecting self intersections. This is possible using the Taubin smoothing algorithm which may be performed many times. This step has to be done to boost up the advancing front algorithm implemented with NETGEN and to make the molecular surface meshing more robust. Other smoothing algorithms are possible but did not show better performance: Laplace, HC Laplace, Angle weigthed Laplace, Scale dependent Laplace.

Parameters:
mMeshA VCG lib surface structure.
INIOptions file to declare which smoothing to perform with how many iterations.
Returns:
Void.

Member Data Documentation

bool Model::exclusionSurface = false [static]

True if the ion exclusion surface be computed. Is the case if ion concentration ionc != 0.


The documentation for this class was generated from the following file: