/***************************************************************************
codegen.h - description
-------------------
begin : Tue Nov 18 01:45:35 2003
copyright : (C) 1999-2006 by Cavalli Andrea
author : : cavalli $
date : : 2003/12/09 11:10:33 $
id : : coor.h,v 1.1.2.2 2003/12/09 11:10:33 cavalli Exp $
email : cavalli@bioc.unizh.ch amc82@cam.ac.uk
**************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef __CODEGEN__
#define __CODEGEN__
#include Very little can be done in almost, until a molecular database file MDB has been loaded.\n"
<<"// Most of the scripts start, therefore, with this command.
\n"
<<"//
This operation is, unfortunately, a little bit more involved than one would expect.\n"
<<"// The reason is that almost needs to associate to each atom,\n"
<<"// bond, etc., the correct force field parameters. In order to do this, atom and fragment names\n"
<<"// need to follow the naming convetions definend in the MDB file.\n"
<<"// If this is not the case, it is possible to rename them. See HOWTO make a working PDB for more informations.
\n
Here we assume that the PDB you provide is \"correct\".
\n" <<"//Structures used as starting point in a molecular dynamics simulation (MD)\n"
<<"// should have a low energy, to avoid problems in the early stages of the \n"
<<"// simulation.\n"
<<"// See the tutorial HOWTO minimize a PDB and the documentation of the PDB, MDB and Molecules modules for more informations.
The protein is build using the build_missing() function. This function differs from the standard build() one,\n"
<<"// in what it does if one or more atoms are missing in the PDB.
"
<<"// In fact, in case of a missing atom, the default build() function will fire an error message and exit.
\n"
<<"// On the contrary, the build_missing() function will try to add all missing atoms\n"
<<"// using the default amino-acid geometry as defined in the molecular database file.
Proteins build with build_missing() have usually a very high energy due to steric (van der Waals) clashes.\n"
<<"// They should, therefore, always be minimized before using them as starting structure in a MD or a Monte Carlo simulation.
\n"
<<"// See the tutorial HOWTO minimize a PDB and the documentation of the PDB, MDB and Molecules modules for more informations.
In almost, a molecular dynamics simulation (MD) is controlled by a structure, mdoptions, that stores all\n"
<<"// user setup.
\n"
<<"// Molecular dynamics options are of two types: (1) force field options and (2) run options.\n"
<<"// With the first category of options one can select the kind of force field to use in the simulation,\n"
<<"// with the second group the details of the simulation such as number of steps, temperature, etc.\n"
<<"// To make life easier, a convenience function initializes all force field options to their default values.\n"
<<"// See the documentation of the md module for additional informations.
Now, create a molecular dynamics object and run the simulation.\n" <<"// That's it!
\n" <<"//The last coordinates are stored in the res Molecules object and saved to\n" <<"// a file with the molecules.molecules2pdb() function.
\n" ; comment = c.str(); } s<<"MD = md.md();\n" <<"res = MD.run(mols,opts,MDB);\n" <<"molecules.molecules2pdb(res,\"res.pdb\");\n" ; return s.str(); } string runmini(string & comment, bool verbose = true){ stringstream s,c; if(verbose){ c<<"Now start the minimization. That's it.\n"; comment = c.str(); } s<<"minimize.sd(mols,opts,MDB,1000,0.001);\n"; return s.str(); } string calcene(string & comment, bool verbose = true){ stringstream s,c; if(verbose){ c<<"//Now compute the enrgy and print the result.\n" <<"// The energy function return an object of type energy.data.
\n" ; string d =find_class_doc("energy","data"); if(d.size()!=0) c << d; comment = c.str(); } s<<"e = energy.energy(mols,opts,MDB);\n" <<"print e;\n" <<"//print e[\"vdw\"]; // To print a component.\n" ; return s.str(); } string mkhowtostr(string comment, string code){ boost::replace_all(comment,"//",""); // string res = ""+code+"\n"; string res = "
"+code+"
"+comment +"