00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef _SBMLREADER_H
00018 #define _SBMLREADER_H
00019 #ifdef USE_SBML
00020
00021 #include <sbml/SBMLTypes.h>
00022
00023 #include "../basecode/Id.h"
00024
00025 typedef struct {
00026 string enzyme;
00027 Id complex;
00028 vector<Id> substrates;
00029 vector<Id> products;
00030 double k1;
00031 double k2;
00032 double k3;
00033 int stage;
00034 } EnzymeInfo;
00035
00036 class SbmlReader {
00037 public:
00038 SbmlReader() {
00039 errorFlag_ = false;
00040 }
00041 ~SbmlReader() {
00042 ;
00043 }
00044 Id read(string filename,string location,string solverClass);
00045 map< string, Id> createCompartment(string location,Id parentId,string modelName,Id base_);
00046 typedef map<string, Id> sbmlStr_mooseId;
00047
00048
00049
00050 const sbmlStr_mooseId createMolecule(map<string,Id> &);
00051 void createReaction(const sbmlStr_mooseId &);
00052
00053 private:
00054 bool errorFlag_;
00055
00056 Model* model_;
00057 SBMLDocument* document_;
00058 SBMLReader reader_;
00059 map< string, Id >molSidMIdMap_;
00060 int noOfsub_;
00061 int noOfprd_;
00062 Id baseId;
00063 double transformUnits( double msize,UnitDefinition * ud,string type,bool hasonlySubUnit );
00064 double unitsforRates();
00065 void getRules();
00066 string nameString( string str );
00067 void printMembers( const ASTNode* p,vector <string> & ruleMembers );
00068 void addSubPrd(Reaction * reac,Id reaction_,string type);
00069 void getKLaw( KineticLaw * klaw,bool rev,vector< double > & rate );
00070 void pushParmstoVector( const ASTNode* p,vector <string> & parameters );
00071 void getParameters( const ASTNode* node,vector <string> & parameters );
00072 void setupMMEnzymeReaction( Reaction * reac,string id ,string name,const map<string, Id> &);
00073 string getAnnotation( Reaction* reaction,map<string,EnzymeInfo> & );
00074 void setupEnzymaticReaction( const EnzymeInfo & einfo,string name,const map< string, Id > & ,string name1);
00075 void findModelParent( Id cwe, const string& path,Id& parentId, string& modelName );
00076 void getGlobalParameter();
00077 };
00078 #endif //USE_SBML
00079 #endif // _SBMLREADER_H
00080