Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

LaubLoomisDictyNetworkMinimizableDirector.cpp

Go to the documentation of this file.
00001 // LaubLoomisDictyNetworkMinimizableDirector.cpp: implementation of the CLaubLoomisDictyNetworkMinimizableDirector class.
00002 //
00004 
00005 #include "LaubLoomisDictyNetworkMinimizableDirector.h"
00006 
00008 // Construction/Destruction
00010 
00011 CLaubLoomisDictyNetworkMinimizableDirector::CLaubLoomisDictyNetworkMinimizableDirector()
00012 {
00013         // create networks,experiments,observers,movers,minimizables
00014         double maxSimTime = 91.0;
00015         double stepSize = 0.0001;
00016         double frequency = 1.0;
00017         int nCells = 1;
00018         double moveTol = 1.0e-06;
00019 
00020         m_dGammaSquared = 1.0e-07;
00021         
00022         // flags for all minimizables
00023         bool rateFlag = true;
00024         bool chemFlag = false;
00025         bool logsFlag = false;
00026         double timeWeight = 1.0;
00027         double rateWeight = 0.0;
00028         double chemWeight = 0.0;
00029 
00030         int cnt = 0;
00031 
00032         // expt. 1 - Roos 1977
00033         // networks and data
00034         _networkList.push_back(new CLaubLoomisDictyNetwork());
00035         _experimentList.push_back(new Experiment(_networkList[cnt],"Roos et. al. 1977"));
00036         // put data files here
00037         _experimentList[cnt]->AddDataFileToList("../DataFiles/TimeSeries/cAMPiRoos.dat");
00038         // mover and plotter
00039         _moverList.push_back(new CQualityControlCashKarpMover(frequency,stepSize,moveTol));
00040         _plotterList.push_back(new GnuPlotterTimeSeriesObserver());
00041         // title
00042         _plotterList[cnt]->SetTitle("D. discoideum cAMP Production:Roos et. al. 1977:ODE");
00043         // minimizable
00044         _minimizableList.push_back(new SingleNetworkMinimizable());
00045         // parameters
00046         _minimizableList[cnt]->Initialize(_experimentList[cnt],_moverList[cnt],nCells,rateFlag,chemFlag,logsFlag,timeWeight,rateWeight,chemWeight);
00047         _minimizableList[cnt]->SetRateConstantsWeight(0.0);
00048         // attach observer
00049         _minimizableList[cnt]->Attach(_plotterList[cnt]);
00050         cnt++;
00051         
00052         // expt. 2 - Aubry 1997
00053         // networks and data
00054         _networkList.push_back(new CLaubLoomisDictyNetwork);
00055         _experimentList.push_back(new Experiment(_networkList[cnt],"Aubry et. al. 1997"));
00056         // put data files here
00057         _experimentList[cnt]->AddDataFileToList("../DataFiles/TimeSeries/dictyERK2Aubry.dat");
00058         // mover and plotter
00059         _moverList.push_back(new CQualityControlCashKarpMover(frequency,stepSize,moveTol));
00060         _plotterList.push_back(new GnuPlotterTimeSeriesObserver());
00061         // title
00062         _plotterList[cnt]->SetTitle("WT D. discoideum ERK2 Activation:Aubry et. al. 1997:ODE");
00063         // minimizable
00064         _minimizableList.push_back(new SingleNetworkMinimizable());
00065         // parameters
00066         _minimizableList[cnt]->Initialize(_experimentList[cnt],_moverList[cnt],nCells,rateFlag,chemFlag,logsFlag,timeWeight,rateWeight,chemWeight);
00067         _minimizableList[cnt]->SetRateConstantsWeight(0.0);
00068         // attach observer
00069         _minimizableList[cnt]->Attach(_plotterList[cnt]);
00070         cnt++;
00071 
00072         // expt. 3 - Aubry 1997
00073         // networks and data
00074         _networkList.push_back(new CLaubLoomisDictyNetwork);
00075         _experimentList.push_back(new Experiment(_networkList[cnt],"Aubry et. al. 1997"));
00076         // put data files here
00077         _experimentList[cnt]->AddDataFileToList("../DataFiles/TimeSeries/dictyERK2PKANullAubry.dat");
00078         // mover and plotter
00079         _moverList.push_back(new CQualityControlCashKarpMover(frequency,stepSize,moveTol));
00080         _plotterList.push_back(new GnuPlotterTimeSeriesObserver());
00081         // title
00082         _plotterList[cnt]->SetTitle("PKA- D. discoideum ERK2 Activation:Aubry et. al. 1997:ODE");
00083         // minimizable
00084         _minimizableList.push_back(new SingleNetworkMinimizable());
00085         // parameters
00086         _minimizableList[cnt]->Initialize(_experimentList[cnt],_moverList[cnt],nCells,rateFlag,chemFlag,logsFlag,timeWeight,rateWeight,chemWeight);
00087         _minimizableList[cnt]->SetRateConstantsWeight(0.0);
00088         // attach observer
00089         _minimizableList[cnt]->Attach(_plotterList[cnt]);
00090         cnt++;
00091         
00092         // allocate the master residuals list
00093         int masterResidualsSize = 0;
00094         for(int i = 0; i < _minimizableList.size(); i++)
00095         {
00096                 int subRes = _minimizableList[i]->GetNResiduals();
00097                 masterResidualsSize += subRes;
00098                 cout << subRes << " residuals in minimizable " << i << endl;
00099         }
00100         if(m_dGammaSquared > 0.0)
00101         {
00102                 masterResidualsSize += 1;
00103         }
00104         Allocate(masterResidualsSize);
00105 
00106         cout << "Master Residuals size : " << masterResidualsSize << endl;
00107 
00108         // define the experiments
00109         DefineExperiments();
00110 
00111 }
00112 
00113 CLaubLoomisDictyNetworkMinimizableDirector::~CLaubLoomisDictyNetworkMinimizableDirector()
00114 {
00115         for(int i = 0; i < _plotterList.size(); i++)
00116         {
00117                 _minimizableList[i]->Detach(_plotterList[i]);
00118                 delete _plotterList[i];
00119         }
00120 
00121 }
00122 
00123 void CLaubLoomisDictyNetworkMinimizableDirector::DefineExperiments()
00124 {
00125         
00126         // treatment with 30 uM cAMP
00127         _minimizableList[1]->GetExperiment()->GetReactionNetwork()->GetChemical(5)->SetInitialAmount(300000*30);
00128         _minimizableList[1]->GetExperiment()->GetReactionNetwork()->ChemicalReset();
00129         
00130         // treatment with 30 uM cAMP, PKA Null
00131         _minimizableList[2]->GetExperiment()->GetReactionNetwork()->GetChemical(5)->SetInitialAmount(300000*30);
00132         _minimizableList[2]->GetExperiment()->GetReactionNetwork()->ChemicalReset();
00133         _minimizableList[2]->GetExperiment()->GetReactionNetwork()->RemoveReaction(5);
00134         _minimizableList[2]->GetExperiment()->GetReactionNetwork()->RemoveReaction(3);
00135         _minimizableList[2]->GetExperiment()->GetReactionNetwork()->RemoveReaction(2);
00136         _minimizableList[2]->GetExperiment()->GetReactionNetwork()->RemoveReaction(1);
00137         
00138 }
00139 
00140 double CLaubLoomisDictyNetworkMinimizableDirector::GetParameter(int parIndex)
00141 {
00142         // for this director, everyone has the same parameters so any set 
00143         // can be returned
00144         return _minimizableList[0]->GetParameter(parIndex);
00145 }
00146 
00147 int CLaubLoomisDictyNetworkMinimizableDirector::GetNParameters()
00148 {
00149         // ditto as for GetParameters()
00150         return _minimizableList[0]->GetNParameters();
00151 }

Generated on Mon Nov 3 09:37:56 2003 by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002