/*************************************************************************** doc_mod.cpp - description ------------------- begin : Mon Nov 13 16:11:07 2006 copyright : (C) 2002 by Cavalli Andrea email : cavalli@bioc.unizh.ch **************************************************************************/ /*************************************************************************** * * * 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. * * * ***************************************************************************/ #include #include #include #include #include #include #include #include #include #include class SQLDoc { sqlite3 *db; public: SQLDoc(string dbname){ int rc; rc = sqlite3_open("almdoc.sqlite", &db); if( rc ){ fprintf(stderr, "Can't open database: %s\n", sqlite3_errmsg(db)); sqlite3_close(db); exit(1); } } vector update_modules_list(){ vector mod = SymbolTable::instance().modules_list(); for(int i=0;i> Exec "< mod = SymbolTable::instance().modules_list(); for(int i=0;i::iterator iter = zmod->module_map.begin(), end = zmod->module_map.end(); while(iter!=end){ if(dynamic_cast(iter->second)){ ++iter; continue;} if(dynamic_cast(iter->second)){ ++iter; continue;} string cmd = "insert into constants (long_name,name,module) values ('"+mod[i]+"."+iter->first+"','"+iter->first +"','"+mod[i]+"');"; cout<<">> Exec "< mod = SymbolTable::instance().modules_list(); for(int i=0;i::iterator iter = zmod->module_map.begin(), end = zmod->module_map.end(); while(iter!=end){ if(dynamic_cast(iter->second)){ string cmd = "insert into functions (long_name,name,module,type,desc) values ('"+mod[i]+"."+iter->first +"','"+iter->first +"','"+mod[i] +"','"+zmod->module_desc[iter->first] +"','"+zmod->module_doc[iter->first] +"');" ; cout<<">> Exec "< mod = SymbolTable::instance().modules_list(); for(int i=0;i::iterator iter = zmod->module_map.begin(), end = zmod->module_map.end(); while(iter!=end){ if(dynamic_cast(iter->second)){ string cmd = "insert into classes (long_name,name,module) values ('"+mod[i]+"."+iter->first+"','"+iter->first +"','"+mod[i]+"');"; cout<<">> Exec "< inline string to_string(const SQLDoc & sql){ return ""; } //additional docs static int module_title_callback(void *res, int argc, char **argv, char **azColName){ // cout<<"DEB module_title_callback"< * res_v = static_cast *>(res); int i; for(i=0; ipush_back(argv[i]); // cout<<"DEB insert "< res; rc = sqlite3_exec(db, cmd.c_str(), module_title_callback, &res, &zErrMsg); if( rc!=SQLITE_OK ){ fprintf(stderr, "SQL error: %s\n", zErrMsg); sqlite3_free(zErrMsg); } sqlite3_close(db); if(res.size()>0) return res[0]; else { // cout<<"DEB res "< mod_note; map mod_desc; map mod_title; void navig(string href, string img, string alt, string & p){ if(!href.size()){ p += "\""+alt+"\"\n"; } else { p += "\""+alt+"\"\n"; } } bool inaqva = false; struct DocPage { string title; string css; string logo; string save; string body; bool navigation; string prev; string up; string next; string toc; string mod; string idx; vector ref; vector desc; string backmatter; DocPage(){} DocPage(string t, string s, string c="almost.css", string l ="almostlogo.png"){ title = t; css = c; logo = l; save =s; //navi navigation = true; } string page(){ string p; front(*this,p); p += body; back(*this,p); return p; } void mkindex(){ if(ref.size()&&ref.size()==desc.size()){ body += "

Contents

\n"; body += "
    \n"; for(int i=0;i"+desc[i]+"\n"; } body += "
\n"; } } void savepage(){ ofstream out; out.open(save.c_str()); out << page(); } private: static void front(DocPage & html, string & p){ // p+="\n"; p+="\n"; p+="\n"; p+=""+html.title+"\n"; p+="\n"; p+="\n"; p+="\n"; p+="\n"; p+="
\n"; //Navigation if(html.navigation){ p += "\n"; p += "\n"; p += "\n"; p += "\n"; p += "
\n"; // p += "
\n"; // p += "
\n"; p += "\n"; p += "\n"; navig(html.prev,"previous.png","Previous Page",p); navig(html.up,"up.png","Up",p); navig(html.next,"next.png","Next",p); if(!inaqva){ p += "\n"; } else { p += "\n"; } navig(html.toc,"toc.png","Table Of Contents",p); navig(html.mod,"modules.png","Modules Index",p); navig(html.idx,"index.png","Index",p); p += "\n"; p += "
almost documentationalmost documentation
\n"; // p += "
\n"; // p += "
\n"; p += "
\n"; p += "
\n"; } p+="\n"; p+="\n"; p+="\n"; p+="\n"; p+="\n"; p+="\n"; p+="
\n"; p+="
\n"; p+="\n"; p+="\n"; p+="\n"; p+="\n"; p+="\n"; p+="\n"; p+="\n"; p+="\n"; p+="\n"; p+="\n"; p+="\n"; p+="\n"; p+="\n"; p+="
\"\"/
\n"; p+="\n"; } static void back(DocPage & html,string & p){ p+="
\n"; p+="
\n"; p+="\n"; if(html.backmatter.size()) p+=html.backmatter; //Navigation if(html.navigation){ p += "
\n"; p += "\n"; p += "\n"; p += "\n"; p += "\n"; p += "
\n"; // p += "
\n"; // p += "
\n"; p += "\n"; p += "\n"; navig(html.prev,"previous.png","Previous Page",p); navig(html.up,"up.png","Up",p); navig(html.next,"next.png","Next",p); if(!inaqva){ p += "\n"; } else { p += "\n"; } navig(html.toc,"toc.png","Table Of Contents",p); navig(html.mod,"modules.png","Modules Index",p); navig(html.idx,"index.png","Index",p); p += "\n"; p += "
almost documentationalmost documentation
\n"; // p += "
\n"; // p += "
\n"; p += "
\n"; p += "
\n"; time_t t = time(NULL); string tm = ctime(&t); p += "

Release 1.0, documentation updated on "+tm+ ".

"; } p+="
\n"; p+="\n"; p+="\n"; } }; void doctitle(DocPage &o,string s, string ref=""){ if(ref==""){ o.body += "

"+s+"

"; } else { o.body +="

"+s+"

"; } } void docheader(DocPage &o,string s, string ref=""){ if(ref==""){ o.body += "

"+s+"

"; } else { o.body +="

"+s+"

"; } } void docsubtitle(DocPage &o,string s, string ref=""){ if(ref==""){ o.body += "

"+s+"

"; } else { o.body +="

"+s+"

"; } } void docsubsubtitle(DocPage &o,string s, string ref=""){ if(ref==""){ o.body += "

"+s+"

"; } else { o.body +="

"+s+"

"; } } void docfunction(DocPage &o,string s, string s2) { o.body += "

"+ s +"
" +s2+ "

\n"; } void mkclassdoc(DocPage & mod,ZExtClass * zc){ string n = zc->val; docsubtitle(mod,"Class "+n); if(zc->class_doc.find("__class__")!=zc->class_doc.end()){ string d = zc->class_doc["__class__"]; boost::replace_all(d,"//",""); mod.body += d; cout<<"DEBUG "<class_doc.find("__example__")!=zc->class_doc.end()){ string d = zc->class_doc["__example__"]; boost::replace_all(d,"//",""); docsubsubtitle(mod,"Example:"); mod.body += d; cout<<"DEBUG "<::iterator iter = zc->class_desc.begin(), end = zc->class_desc.end(); while(iter!=end){ string tok = iter->first; if(zc->class_doc.find(tok)!=zc->class_doc.end()){ string dstr = iter->second; boost::replace_first(dstr,iter->first,""+iter->first+""); string docstr = zc->class_doc[tok]; boost::replace_all(docstr,"<","<"); docfunction(mod,dstr,docstr); } ++iter; } } void mkmoddoc(string m, string prev,string up, string next){ DocPage mod(m+" Documentation",m+".html"); mod.navigation = true; //Next up bla bla mod.prev = prev; mod.up = up; mod.next = next; mod.toc = "docindex.html"; mod.mod = "docindex.html"; mod.idx = "idx.html"; ZModule * zmod; if(SymbolTable::instance().is_modulename(m)){ zmod = (ZModule *)SymbolTable::current()[m]; } else { cout<::iterator iter = zmod->module_map.begin(), end = zmod->module_map.end(); vector c; while(iter!=end){ ZExtClass * zclass = dynamic_cast(iter->second); if(zclass) c.push_back(iter->first); ++iter; } if(c.size()){ doctitle(mod,"Module "+m+" classes"); mod.body +="
    \n"; for(int i=0;i\n"; } mod.body +="
\n"; } } //functions { map::iterator iter = zmod->module_map.begin(), end = zmod->module_map.end(); vector c; while(iter!=end){ ZExtFunction * zclass = dynamic_cast(iter->second); if(zclass) c.push_back(iter->first); ++iter; } if(c.size()){ doctitle(mod,"Module "+m+" functions"); mod.body +="
    \n"; for(int i=0;i\n"; } mod.body +="
\n"; } } //classes doc { map::iterator iter = zmod->module_map.begin(), end = zmod->module_map.end(); vector c; vector zcl; while(iter!=end){ ZExtClass * zclass = dynamic_cast(iter->second); if(zclass){ c.push_back(iter->first); zcl.push_back(zclass); } ++iter; } if(c.size()){ doctitle(mod,"Classes Usage"); for(int i=0;i::iterator iter = zmod->module_map.begin(), end = zmod->module_map.end(); vector c; vector fun; while(iter!=end){ ZExtFunction * zclass = dynamic_cast(iter->second); if(zclass) c.push_back(iter->first); ++iter; } if(c.size()){ doctitle(mod,"Functions Usage"); for(int i=0;i::const_iterator desc = zmod->module_desc.find(c[i]); if(desc!=zmod->module_desc.end()){ // Almost::aout<second<<"\t" // <first // <<"\n"; map::const_iterator doc = zmod->module_doc.find(c[i]); if(doc!=zmod->module_doc.end()){ // Almost::aout<<"\t"<second // <<"\n\n"; string des = desc->second; boost::replace_first(des,c[i],""+c[i]+""); docfunction(mod,des,doc->second); } } // else { // Almost::aout<<"unknown \t" // <first // <<"\n"; // } } } } //add note if existe if(mod_note.find(m)!=mod_note.end()){ mod.backmatter = mod_note[m]; } mod.savepage(); } void mkhowtomd(string f){ //howtobanner DocPage howtomd("HOWTO run a molecular dynamic simulation",f); howtomd.navigation = true; howtomd.prev = "docindex.html"; howtomd.up = "docindex.html"; howtomd.next = "docindex.html"; howtomd.toc = "docindex.html"; howtomd.mod = "docindex.html"; howtomd.idx = "idx.html"; docheader(howtomd,"HOWTO run a molecular dynamic simulation"); string comment; string code; code = Almost::mdbload("all19_eef1.mdb",comment); howtomd.body += Almost::mkhowtostr(comment,code); code = Almost::pdbload("1ubq.pdb",comment); howtomd.body += Almost::mkhowtostr(comment,code); code = Almost::buildmols_and_prot("UBQ",comment); howtomd.body += Almost::mkhowtostr(comment,code); code = Almost::setupmdoptions(comment); howtomd.body += Almost::mkhowtostr(comment,code); code = Almost::runmd(comment); howtomd.body += Almost::mkhowtostr(comment,code); howtomd.savepage(); } void mkhowtomini(string f){ //howtobanner DocPage howtomini("HOWTO minimize a PDB",f); howtomini.navigation = true; howtomini.prev = "docindex.html"; howtomini.up = "docindex.html"; howtomini.next = "docindex.html"; howtomini.toc = "docindex.html"; howtomini.mod = "docindex.html"; howtomini.idx = "idx.html"; docheader(howtomini,"HOWTO minimize a PDB"); string comment; string code; code = Almost::mdbload("all19_eef1.mdb",comment); howtomini.body += Almost::mkhowtostr(comment,code); code = Almost::pdbload("1ubq.pdb",comment); howtomini.body += Almost::mkhowtostr(comment,code); code = Almost::build_missingmols_and_prot("UBQ",comment); howtomini.body += Almost::mkhowtostr(comment,code); code = Almost::setupenergyoptions(comment); howtomini.body += Almost::mkhowtostr(comment,code); code = Almost::runmini(comment); howtomini.body += Almost::mkhowtostr(comment,code); howtomini.savepage(); } void mkhowtoene(string f){ //howtobanner DocPage howtoene("HOWTO compute the energy of a PDB",f); howtoene.navigation = true; howtoene.prev = "docindex.html"; howtoene.up = "docindex.html"; howtoene.next = "docindex.html"; howtoene.toc = "docindex.html"; howtoene.mod = "docindex.html"; howtoene.idx = "idx.html"; docheader(howtoene,"HOWTO compute the energy of a PDB"); string comment; string code; code = Almost::mdbload("all19_eef1.mdb",comment); howtoene.body += Almost::mkhowtostr(comment,code); code =Almost::pdbload("1ubq.pdb",comment); howtoene.body += Almost::mkhowtostr(comment,code); code =Almost::build_missingmols_and_prot("UBQ",comment); howtoene.body += Almost::mkhowtostr(comment,code); code =Almost::setupenergyoptions(comment); howtoene.body += Almost::mkhowtostr(comment,code); code =Almost::calcene(comment); howtoene.body += Almost::mkhowtostr(comment,code); howtoene.savepage(); } void mkmodule_index(){ DocPage index("almost doc","docindex.html"); index.navigation = true; //Next up bla bla index.body += "

almost documentation

\n"; index.body += "

Andrea Cavalli

\n"; index.body += "

amc82@cam.ac.uk

\n"; index.body += "

Release 1.0

\n"; time_t t = time(NULL); string tm = ctime(&t); index.body += "

"+tm+"

\n"; index.body += "
\n"; //Tutorial docheader(index,"Tutorial"); index.body +="\n"; index.body +="
\n"; index.prev = "docindex.html"; index.up = "docindex.html"; index.next = "docindex.html"; index.toc = "docindex.html"; index.mod = "docindex.html"; index.idx = "idx.html"; vector mod = SymbolTable::instance().modules_list(); for(int i=0;i"; if(mod_title.find(mod[i])!=mod_title.end()){ desc +=" -- "+mod_title[mod[i]]; } else { desc += " -- module"; } index.desc.push_back(desc); // string prev,up,next; if(i!=0) prev = mod[i-1]+".html"; else prev = "docindex.html"; up = "docindex.html"; if(i!=mod.size()-1) next = mod[i+1]+".html"; else next = mod[i]+".html"; mkmoddoc(mod[i],prev,up,next); } index.mkindex(); index.savepage(); } ZExtClass * find_class(string m, string c){ //Energy additions ZModule * zmod; ZExtClass * zclass = NULL; if(SymbolTable::instance().is_modulename(m)){ zmod = (ZModule *)SymbolTable::current()[m]; if(zmod->module_map.find(c)!=zmod->module_map.end()){ zclass = (ZExtClass*)zmod->module_map[c]; return zclass; } } return NULL; } ZModule * find_function(string m, string c){ ZModule * zmod; ZExtFunction * zclass; // ZExtFunction * zclass = NULL; if(SymbolTable::instance().is_modulename(m)){ zmod = (ZModule *)SymbolTable::current()[m]; if(zmod->module_map.find(c)!=zmod->module_map.end()){ zclass = (ZExtFunction*)zmod->module_map[c]; if(zclass) return zmod; } } return NULL; } int mkdoc__(){ { //Module almost ZModule *f; f = find_function("almost","banner"); if(f){ f->module_doc["banner"] += "
\n"
	">>> almost.banner();\n"
	"almost 0.99.2 GNU C++ version 4.0.1 (Apple Computer, Inc. build 5363)\n"
	"Copyright (c) 2001-2004, Andrea Cavalli.\n"
	"This program is free software; you can redistribute it and/or\n"
	"modify it under the terms of the GNU General Public License\n"
	"as published by the Free Software Foundation; either version 2\n"
	"of the License, or (at your option) any later version.\n"
	"
\n" ; } } { //Module MDB ZExtClass * zclass = find_class("mdb","MDB"); zclass->class_doc["__class__"] = "// In almost the topology, i.e. the information about bonds, angles, etc., of molecules and the\n" "// parameters to build force fields are stored in a unique, plain text molecular database file.
" "// A MDB object is created using the class constructor mdb.MDB(file) that parses the file.
\n" ; } { ZExtClass * zclass = find_class("pdb","pdb"); zclass->class_doc["__class__"] = "//

The pdb module provides an (almost) complete interface to Protein databank files.

\n" "//

A pdb object is created by invoking the class constructor with the path to the pdb file as unique argument:\n" "// pdb.pdb(\"file\"). Note that almost is able to read compressed (with gzip or bzip2) files on the fly.

\n" "//

A pdb object is organized as a tree. A pdb can contain one or more models. Each model contains one or more chains (segments).\n" "// Chains are made of fragments and fragment of atoms.

\n" "//

In other words, if 'PDB' is an object of type PDB, then PDB[0] is the first model, PDB[0][0] the first segment of the first model,\n" "// and so on.

\n" ; zclass->class_doc["__example__"] = "
\n"
      ">> PDB = pdb.pdb(\"1ubq.pdb\");\n"
      ">> PDB = pdb.pdb(\"1ubq.pdb.bz2\");\n"
      ">> PDB = pdb.pdb(\"1ubq.pdb.gz\");\n"
      "
\n" ; } { //module Molecules ZExtClass * zclass = find_class("molecules","protein"); zclass->class_doc["__class__"] = "//

The class protein is one of the four molecular classes implemented in almost. (The other are\n" "// lipid, nucleicacid and solvent). It stores chemical and geometric information about proteins.
\n" "// A protein object is constructed by creating first an empty \"protein container\" using\n" "// the class constructor molecules.protein(\"name\"). The name can be any string, but we suggest \n" "// that only string of length 3 are used, and this to follow the PDB convention that reserves\n" "// three letters for the chain name.
\n" "// An empty protein can then be filled using the build(), build_missing() or build_sequ() methods.
\n" "// The first two methods build a protein by taking the necessary information from the PDB segemt passed as first argument,\n" "// that last one (build_sequ()) will create a linear molecule using the default amino-acid geometry, as defined\n" "// in the molecular database file.

\n" ; } { //Module energy ZExtClass * zclass = find_class("energy","data"); if(zclass){ zclass->class_doc["__class__"] = "//

The class data stores the result of an energy calculation.\n" "// The energy of the molecules is divided in components which can be accessed\n" "// with the \"e[\"component\"]\" function. So, as an example, e[\"energy\"] is equal to the total\n" "// energy of the molecules and e[\"vdw\"] to its van der Waals component.

\n" "//

Available terms are: energy, bond, angle, dihe, imph, vdw, elec, solv, ub and const.

\n" ; } } return 1; } void mkdoc(){ static int init = mkdoc__(); //Sql { sqlite3 *db; char *zErrMsg = 0; int rc; // if( argc!=3 ){ // fprintf(stderr, "Usage: %s DATABASE SQL-STATEMENT\n", argv[0]); // exit(1); // } rc = sqlite3_open("almdoc.sqlite", &db); if( rc ){ fprintf(stderr, "Can't open database: %s\n", sqlite3_errmsg(db)); sqlite3_close(db); exit(1); } string cmd = "select * from modules;"; rc = sqlite3_exec(db, cmd.c_str(), callback, 0, &zErrMsg); if( rc!=SQLITE_OK ){ fprintf(stderr, "SQL error: %s\n", zErrMsg); sqlite3_free(zErrMsg); } sqlite3_close(db); } mkmodule_index(); } void mkdoc_template_header(ofstream & out){ out<<"\n"; out<<"\n"; out<<"\n"; out<<"\n"; out<<"\n"; } void mkdoc_template_class(ofstream & out, ZExtClass * zc){ map::iterator iter = zc->class_desc.begin(), end = zc->class_desc.end(); while(iter!=end){ string tok = iter->first; if(zc->class_desc.size()>0){ out<<"\n"; string dstr = iter->second; boost::replace_first(dstr,iter->first,""+iter->first+""); string docstr; if(zc->class_doc.find(tok)!=zc->class_doc.end()){ docstr = zc->class_doc[tok]; } boost::replace_all(dstr,"&","&"); boost::replace_all(docstr,"<","<"); boost::replace_all(docstr,"&","&"); out<<""<\n"; out<<""<\n"; // docfunction(mod,dstr,zc->class_doc[tok]); out<<"\n"; } ++iter; } } void mkdoc_template_modc(ofstream &out, string m){ ZModule * zmod; if(SymbolTable::instance().is_modulename(m)){ zmod = (ZModule *)SymbolTable::current()[m]; } else { cout<::iterator iter = zmod->module_map.begin(), end = zmod->module_map.end(); vector c; while(iter!=end){ if(zmod->module_desc.find(iter->first)!=zmod->module_desc.end()&& zmod->module_desc[iter->first]=="symbolic constant") c.push_back(iter->first); ++iter; } if(c.size()){ out<<"\n"; for(int i=0;i\n"; //format class out<<""<\n"; out<<"\n"; } out<<"\n"; } } //classes { map::iterator iter = zmod->module_map.begin(), end = zmod->module_map.end(); vector c; while(iter!=end){ ZExtClass * zclass = dynamic_cast(iter->second); if(zclass) c.push_back(iter->first); ++iter; } if(c.size()){ out<<"\n"; for(int i=0;i\n"; //format class mkdoc_template_class(out, dynamic_cast(zmod->module_map[c[i]])); out<<"\n"; } out<<"\n"; } } //functions { map::iterator iter = zmod->module_map.begin(), end = zmod->module_map.end(); vector c; while(iter!=end){ ZExtFunction * zfunction = dynamic_cast(iter->second); if(zfunction) c.push_back(iter->first); ++iter; } if(c.size()){ out<<"\n"; for(int i=0;i\n"; //format function out<<""<\n"; map::const_iterator desc = zmod->module_desc.find(c[i]); if(desc!=zmod->module_desc.end()){ string d = desc->second; boost::replace_all(d,"&","&"); out<<""<\n"; { //Find out return value boost::regex expression("[^[:space:]]+"); boost::match_results what; boost::match_flag_type flags = boost::match_default; if(regex_search(desc->second.begin(), desc->second.end(), what, expression, flags)){ cout<<"Rerun val: "<::const_iterator doc = zmod->module_doc.find(c[i]); if(doc!=zmod->module_doc.end()){ out<<""<second<<"\n"; } out<<"\n"; } out<<"\n"; } } } void mkdoc_template_modulelist(ofstream & out){ out<<"\n"; vector mod = SymbolTable::instance().modules_list(); for(int i=0;i\n"; out<<""<\n"; out<<""; if(mod_title.find(mod[i])!=mod_title.end()){ out<<mod_title[mod[i]]; } // else { // out<<"##MISSING##"; // cout<<"Warning title of module: "<<mod[i]<<" missing\n"; // } out<<"\n"; out<<"\n"; out<<"\n"; // mkmoddoc(mod[i],prev,up,next); mkdoc_template_modc(out,mod[i]); out<<"\n"; } out<<"\n"; } void mkdoc_template(string name){ ofstream out; out.open(name.c_str()); if(!out){ Almost::aout<<"Unable to open: "<\n"; out<<"\n"; mkdoc_template_header(out); mkdoc_template_modulelist(out); out<<"\n"; } using namespace Almost; extern "C" { void init_doc(){ //declarations here //Modules titles { mod_title["aggresign"] = "Aggregation propensity tools"; mod_title["almost"] = "Environment"; mod_title["analysis"] = "Analysis tools"; mod_title["blast"] = "Interface to ncbi blast"; mod_title["const"] = "Molecular dynamics and Monte Carlo restraints"; mod_title["dcd"] = "Trajectory tools"; mod_title["dyna"] = "Monte Carlo simulations"; mod_title["dynamip"] = "Replica Monte Carlo simulations"; mod_title["energy"] = "Energy computation"; mod_title["fragments"] = "Fragment replacement tools"; mod_title["math"] = "Mathematical functions"; mod_title["mbmd"] = "Multi-Berendsen molecular dyanmics"; mod_title["md"] = "Molecular dynamics"; mod_title["mdb"] = "Molecular database"; mod_title["mdx"] = "Replica molecular dynamics"; mod_title["minimize"] = "Energy minimization"; mod_title["modeler"] = "Homoogy modeler"; mod_title["molecules"] = "Build and modify molecules"; mod_title["moveset"] = "Monte Carlo moveset"; mod_title["os"] = "Operating system functions"; mod_title["pdb"] = "Protein Databank parser"; mod_title["pdbstat"] = "Compute statistics on sets of PDBs"; mod_title["regex"] = "boost regular expression engine"; mod_title["rose"] = "Molecular fragment replacement"; mod_title["secstruct"] = "Compute secondary structure of proteins"; mod_title["select"] = "Select atoms in molecules"; mod_title["shx"] = "All about chemical shifts "; mod_title["sys"] = "System functions"; mod_title["zeta"] = "Script language functions"; } //add notes mod_note["math"] = "
Note: " "The math module consists mostly of thin wrappers around " "the platform C math library functions. Behavior in exceptional cases is " "loosely specified by the C standards, and almost inherits much of its " "math-function error-reporting behavior from the platform C " "implementation. As a result, " "the specific exceptions raised in error cases (and even whether some " "arguments are considered to be exceptional at all) are not defined in any " "useful cross-platform or cross-release way. For example, whether " "math.log(0) returns -Inf or raises ValueError or " "OverflowError isn't defined, and in " "cases where math.log(0) raises OverflowError, " "math.log(0L) may raise ValueError instead. " "
" ; mod_desc["math"] = "

This module provides access to the mathematical functions and constants defined by the C standard.

" "

Example

" "

print math.sin(1.2);
" "Should print 0.932039 to your console.

"; mod_desc["mdb"] = "

The mdb module implements classes an functions to parse and edit MDB files.
" "almost uses mdb files to store informations about the topology of molecules and to store the parameters\n" "needed to build firce fields.

\n" ; mod_desc["pdb"] = "

This module provides an (almost) complete access to Protein databank files.

"; Module mod = Module("doc","Generate doc") .def_function("mkdoc","Generates almost documentation",mkdoc) .def_function("mkdoc_template","Generates almost documentation template in XML format.",mkdoc_template) .def_function("module_title","",module_title) .def_function("set_module_title","",set_module_title) ; Class >(mod.self(),"sqldoc") .def_method("update_modules_list",&SQLDoc::update_modules_list) .def_method("set_module_title",&SQLDoc::set_module_title) .def_method("set_module_desc",&SQLDoc::set_module_desc) .def_method("set_function_desc",&SQLDoc::set_function_desc) .def_method("update_constants",&SQLDoc::update_constants) .def_method("update_functions",&SQLDoc::update_functions) .def_method("update_classes",&SQLDoc::update_classes) ; } }