From 8da2401a1c5be2d0dfc5cfa8c88fc06cef2ccbfa Mon Sep 17 00:00:00 2001 From: developerfab Date: Sat, 17 Mar 2018 13:33:49 -0500 Subject: [PATCH 1/3] update README.md --- README.md | 144 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..2b54643 --- /dev/null +++ b/README.md @@ -0,0 +1,144 @@ +StochPy Stochastic modeling in Python +===================================== + +Copyright (c) 2011-2016, Timo R. Maarleveld, Brett G. Olivier, and Frank J. Bruggeman +All rights reserved. + +StochPy is distributed under a BSD style licence. + +File releases: http://sourceforge.net/projects/stochpy +Source code: https://github.com/SystemsBioinformatics/stochpy + +Author information +------------------ + +Timo R. Maarleveld, Brett G. Olivier, and Frank J. Bruggeman +Centrum Wiskunde en Informatica, Amsterdam, Netherlands +VU University, Amsterdam, Netherlands + +e-mail: tmd200@users.sourceforge.net + +Documentation can be found in the user guide (see Documentation directory or http://stochpy.sourceforge.net/html/userguide.html) + +Publication +~~~~~~~~~~~ + +StochPy: A Comprehensive, User-Friendly Tool for Simulating Stochastic Biological Processes +http://dx.doi.org/10.1371/journal.pone.0079345 + +Installation +------------ +The following software is required before installling StochPy (see user guide for more details): + +- Python 2.6+ or Python 3.4+ +- NumPy 1.x+ +- Matplotlib (optional) +- libsbml (optional) +- libxml2 (optional) +- mpmath (optional) + +Linux/MAC OS/Cygwin +~~~~~~~~~~~~~~~~~~~ + +1) cd to directory StochPy-2.1.0 +2) sudo python setup.py install + +Windows +~~~~~~~ +Use the available windows installer or the setup file + +Usage +----- + +import stochpy +smod = stochpy.SSA() + +# 1: Basic Simulation with the Direct method +smod.DoStochSim(IsTrackPropensities=True) +smod.data_stochsim.simulation_endtime +smod.data_stochsim.simulation_timesteps +smod.GetWaitingtimes() +smod.PrintWaitingtimesMeans() +# 2: Do some Plotting +smod.PlotSpeciesTimeSeries() +smod.PlotWaitingtimesDistributions() +smod.PlotPropensitiesTimeSeries() +# 3: Write data to a text file +smod.Export2File() +smod.Export2File(analysis='distribution') +smod.Export2File(analysis='distribution',datatype='species') +smod.Export2File(analysis='mean',datatype='species') +smod.Export2File(analysis='std',datatype='species') +smod.Export2File(analysis='autocorrelation',datatype='species') +# 4: Show the means from the data of 3-th trajectory +smod.DoStochSim(trajectories=3) # multiple trajectories +smod.data_stochsim.simulation_trajectory +smod.PrintSpeciesMeans() +smod.PrintSpeciesStandardDeviations() +# 5: Switch to data from trajectory 1 and show the means of each species +smod.GetTrajectoryData(1) +smod.PrintSpeciesMeans() +smod.PrintSpeciesStandardDeviations() +# 6: Do one long simulation +smod.DoStochSim(trajectories=1,end=1000000,mode='steps') +smod.PrintSpeciesMeans() +smod.PrintSpeciesStandardDeviations() +# 7: Plot the PDF for different bin sizes +smod.PlotSpeciesDistributions() +smod.PlotSpeciesDistributions(bin_size=5) # larger bin size +smod.PlotSpeciesDistributions(bin_size=10) # again a larger bin size +smod.Export2File(analysis='distribution',datatype='species') + +# 8: Usage of the Reload Function: Ksyn = 20, kdeg = 0.2 +smod.ChangeParameter('Ksyn',20.0) +smod.ChangeParameter('Kdeg',0.2) +smod.DoStochSim() +smod.PrintSpeciesMeans() # should be ~Ksyn/Kdeg + +# 9: Use another model to show the Interpolation features +smod.Model('dsmts-001-01.xml.psc') +smod.DoStochSim(trajectories=1000,end=50,mode='time') +smod.GetRegularGrid(npoints=51) +smod.PlotAverageSpeciesTimeSeries() +smod.PrintAverageSpeciesTimeSeries() +smod.Export2File(datatype='species',analysis='timeseries',IsAverage=True) + +# 9: Test each method for different models: +smod.Model('Autoreg.psc') +smod.DoStochSim(trajectories=1,end=1000,mode='steps') +smod.Method('NextReactionMethod') +smod.DoStochSim(trajectories=1,end=1000,mode='steps') +smod.data_stochsim.species +smod.PlotWaitingtimesDistributions() +smod.Method('FirstReactionMethod') +smod.DoStochSim(trajectories=1,end=1000,mode='steps') +smod.Method('TauLeaping') +smod.DoStochSim(trajectories=1,end=1000,mode='steps') + +smod.Model('DecayingDimerizing.psc') +smod.DoStochSim(method = 'Direct',trajectories=1,end=50,mode='time') +smod.DoStochSim(method = 'NextReactionMethod',trajectories=1,end=50,mode='time') +smod.DoStochSim(method = 'FirstReactionMethod',trajectories=1,end=50,mode='time') +smod.PlotWaitingtimesDistributions() +smod.DoStochSim(method = 'TauLeaping',trajectories=1,end=50,mode='time',epsilon=0.03) # Should outperform all other implementations +smod.PlotSpeciesTimeSeries() +#smod.PlotWaitingtimesDistributions() # Should give an error + +smod.Model('chain500.psc') +smod.DoStochSim(method = 'Direct',trajectories=1,end=10000,mode='steps') +smod.DoStochSim(method = 'NextReactionMethod',trajectories=1,end=10000,mode='steps') # should outperform the direct method and all other implementations + +# 10: Use the Next Reaction Method to test a model with a time event +smod.Model('dsmts-003-03.xml.psc') +smod.DoStochSim(method = 'NextReactionMethod') +smod.DoTestsuite() + +# 11: Use the First Reaction method to test a model with a concentration event +smod.Model('dsmts-003-04.xml.psc') +smod.DoStochSim(method = 'FirstReactionMethod') +smod.DoTestsuite() + +# 12: Volume Models +smod.Model('dsmts-001-11.xml.psc') +smod.DoStochSim(method = 'Direct',trajectories=1000,end=50,mode ='time') +smod.PrintAverageSpeciesTimeSeries() From eb899f0b272f412271f4eabd6d0cdfeac219c6b2 Mon Sep 17 00:00:00 2001 From: developerfab Date: Sat, 17 Mar 2018 13:35:39 -0500 Subject: [PATCH 2/3] delete README.txt --- README.md | 149 ++++++++++++++++++++++++++++++++++------------------- README.txt | 144 --------------------------------------------------- 2 files changed, 96 insertions(+), 197 deletions(-) delete mode 100644 README.txt diff --git a/README.md b/README.md index 2b54643..1bc6431 100644 --- a/README.md +++ b/README.md @@ -1,109 +1,123 @@ -StochPy Stochastic modeling in Python -===================================== +# StochPy Stochastic modeling in Python -Copyright (c) 2011-2016, Timo R. Maarleveld, Brett G. Olivier, and Frank J. Bruggeman -All rights reserved. - -StochPy is distributed under a BSD style licence. +StochPy is a versatile stochastic modeling package which is designed for stochastic simulation of molecular control networks File releases: http://sourceforge.net/projects/stochpy Source code: https://github.com/SystemsBioinformatics/stochpy -Author information ------------------- +## Documentation -Timo R. Maarleveld, Brett G. Olivier, and Frank J. Bruggeman -Centrum Wiskunde en Informatica, Amsterdam, Netherlands -VU University, Amsterdam, Netherlands +Documentation can be found in the user guide (see Documentation directory or http://stochpy.sourceforge.net/html/userguide.html) -e-mail: tmd200@users.sourceforge.net +## Installation -Documentation can be found in the user guide (see Documentation directory or http://stochpy.sourceforge.net/html/userguide.html) +The following software is required before installing StochPy (see user guide for more details): -Publication -~~~~~~~~~~~ +- Python 2.6+ or Python 3.4+ +- [NumPy 1.x+](http://www.numpy.org) +- [Matplotlib](https://matplotlib.org) (optional) +- [libsbml](http://sbml.org/Software/libSBML) (optional) +- [libxml2](http://xmlsoft.org) (optional) +- [mpmath](http://mpmath.org) (optional) -StochPy: A Comprehensive, User-Friendly Tool for Simulating Stochastic Biological Processes -http://dx.doi.org/10.1371/journal.pone.0079345 +#### Linux/MAC OS/Cygwin -Installation ------------- -The following software is required before installling StochPy (see user guide for more details): -- Python 2.6+ or Python 3.4+ -- NumPy 1.x+ -- Matplotlib (optional) -- libsbml (optional) -- libxml2 (optional) -- mpmath (optional) +In the directory where you downloaded StochPy, go to the directory _StochPy-2.1.0_ and exec the next command: -Linux/MAC OS/Cygwin -~~~~~~~~~~~~~~~~~~~ +```bash +sudo python setup.py install +``` -1) cd to directory StochPy-2.1.0 -2) sudo python setup.py install +### Windows -Windows -~~~~~~~ Use the available windows installer or the setup file -Usage ------ +## Getting Started + +You can run `ipython` and import `stochpy`: +```py import stochpy smod = stochpy.SSA() +``` -# 1: Basic Simulation with the Direct method +### Basic Simulation with the Direct method +```py smod.DoStochSim(IsTrackPropensities=True) smod.data_stochsim.simulation_endtime smod.data_stochsim.simulation_timesteps smod.GetWaitingtimes() smod.PrintWaitingtimesMeans() -# 2: Do some Plotting +``` + +### Do some Plotting +```py smod.PlotSpeciesTimeSeries() smod.PlotWaitingtimesDistributions() smod.PlotPropensitiesTimeSeries() -# 3: Write data to a text file +``` + +### Write data to a text file +```py smod.Export2File() smod.Export2File(analysis='distribution') smod.Export2File(analysis='distribution',datatype='species') smod.Export2File(analysis='mean',datatype='species') smod.Export2File(analysis='std',datatype='species') smod.Export2File(analysis='autocorrelation',datatype='species') -# 4: Show the means from the data of 3-th trajectory +``` + +### Show the means from the data of 3-th trajectory +```py smod.DoStochSim(trajectories=3) # multiple trajectories smod.data_stochsim.simulation_trajectory smod.PrintSpeciesMeans() smod.PrintSpeciesStandardDeviations() -# 5: Switch to data from trajectory 1 and show the means of each species +``` + +### Switch to data from trajectory 1 and show the means of each species +```py smod.GetTrajectoryData(1) smod.PrintSpeciesMeans() smod.PrintSpeciesStandardDeviations() -# 6: Do one long simulation +``` + +### Do one long simulation +```py smod.DoStochSim(trajectories=1,end=1000000,mode='steps') smod.PrintSpeciesMeans() smod.PrintSpeciesStandardDeviations() -# 7: Plot the PDF for different bin sizes +``` + +### Plot the PDF for different bin sizes +```py smod.PlotSpeciesDistributions() smod.PlotSpeciesDistributions(bin_size=5) # larger bin size smod.PlotSpeciesDistributions(bin_size=10) # again a larger bin size smod.Export2File(analysis='distribution',datatype='species') +``` -# 8: Usage of the Reload Function: Ksyn = 20, kdeg = 0.2 +### Usage of the Reload Function: `Ksyn = 20, kdeg = 0.2` +```py smod.ChangeParameter('Ksyn',20.0) smod.ChangeParameter('Kdeg',0.2) smod.DoStochSim() smod.PrintSpeciesMeans() # should be ~Ksyn/Kdeg +``` -# 9: Use another model to show the Interpolation features +### Use another model to show the Interpolation features +```py smod.Model('dsmts-001-01.xml.psc') -smod.DoStochSim(trajectories=1000,end=50,mode='time') +smod.DoStochSim(trajectories=1000,end=50,mode='time') smod.GetRegularGrid(npoints=51) smod.PlotAverageSpeciesTimeSeries() smod.PrintAverageSpeciesTimeSeries() smod.Export2File(datatype='species',analysis='timeseries',IsAverage=True) +``` -# 9: Test each method for different models: +### Test each method for different models: +```py smod.Model('Autoreg.psc') smod.DoStochSim(trajectories=1,end=1000,mode='steps') smod.Method('NextReactionMethod') @@ -114,31 +128,60 @@ smod.Method('FirstReactionMethod') smod.DoStochSim(trajectories=1,end=1000,mode='steps') smod.Method('TauLeaping') smod.DoStochSim(trajectories=1,end=1000,mode='steps') - +``` +```py smod.Model('DecayingDimerizing.psc') smod.DoStochSim(method = 'Direct',trajectories=1,end=50,mode='time') smod.DoStochSim(method = 'NextReactionMethod',trajectories=1,end=50,mode='time') smod.DoStochSim(method = 'FirstReactionMethod',trajectories=1,end=50,mode='time') -smod.PlotWaitingtimesDistributions() +smod.PlotWaitingtimesDistributions() smod.DoStochSim(method = 'TauLeaping',trajectories=1,end=50,mode='time',epsilon=0.03) # Should outperform all other implementations smod.PlotSpeciesTimeSeries() #smod.PlotWaitingtimesDistributions() # Should give an error - +``` +```py smod.Model('chain500.psc') smod.DoStochSim(method = 'Direct',trajectories=1,end=10000,mode='steps') smod.DoStochSim(method = 'NextReactionMethod',trajectories=1,end=10000,mode='steps') # should outperform the direct method and all other implementations +``` -# 10: Use the Next Reaction Method to test a model with a time event -smod.Model('dsmts-003-03.xml.psc') +### Use the Next Reaction Method to test a model with a time event +```py +smod.Model('dsmts-003-03.xml.psc') smod.DoStochSim(method = 'NextReactionMethod') smod.DoTestsuite() +``` -# 11: Use the First Reaction method to test a model with a concentration event +### Use the First Reaction method to test a model with a concentration event +```py smod.Model('dsmts-003-04.xml.psc') smod.DoStochSim(method = 'FirstReactionMethod') smod.DoTestsuite() +``` -# 12: Volume Models -smod.Model('dsmts-001-11.xml.psc') +### Volume Models +```py +smod.Model('dsmts-001-11.xml.psc') smod.DoStochSim(method = 'Direct',trajectories=1000,end=50,mode ='time') smod.PrintAverageSpeciesTimeSeries() +``` + +## Author information + + +Timo R. Maarleveld, Brett G. Olivier, and Frank J. Bruggeman +Centrum Wiskunde en Informatica, Amsterdam, Netherlands +VU University, Amsterdam, Netherlands + +> e-mail: tmd200@users.sourceforge.net + +## Publication + +StochPy: A Comprehensive, User-Friendly Tool for Simulating Stochastic Biological Processes +http://dx.doi.org/10.1371/journal.pone.0079345 + +## Licence +Copyright (c) 2011-2016, Timo R. Maarleveld, Brett G. Olivier, and Frank J. Bruggeman +All rights reserved. + +StochPy is distributed under a BSD style licence. diff --git a/README.txt b/README.txt deleted file mode 100644 index 2b54643..0000000 --- a/README.txt +++ /dev/null @@ -1,144 +0,0 @@ -StochPy Stochastic modeling in Python -===================================== - -Copyright (c) 2011-2016, Timo R. Maarleveld, Brett G. Olivier, and Frank J. Bruggeman -All rights reserved. - -StochPy is distributed under a BSD style licence. - -File releases: http://sourceforge.net/projects/stochpy -Source code: https://github.com/SystemsBioinformatics/stochpy - -Author information ------------------- - -Timo R. Maarleveld, Brett G. Olivier, and Frank J. Bruggeman -Centrum Wiskunde en Informatica, Amsterdam, Netherlands -VU University, Amsterdam, Netherlands - -e-mail: tmd200@users.sourceforge.net - -Documentation can be found in the user guide (see Documentation directory or http://stochpy.sourceforge.net/html/userguide.html) - -Publication -~~~~~~~~~~~ - -StochPy: A Comprehensive, User-Friendly Tool for Simulating Stochastic Biological Processes -http://dx.doi.org/10.1371/journal.pone.0079345 - -Installation ------------- -The following software is required before installling StochPy (see user guide for more details): - -- Python 2.6+ or Python 3.4+ -- NumPy 1.x+ -- Matplotlib (optional) -- libsbml (optional) -- libxml2 (optional) -- mpmath (optional) - -Linux/MAC OS/Cygwin -~~~~~~~~~~~~~~~~~~~ - -1) cd to directory StochPy-2.1.0 -2) sudo python setup.py install - -Windows -~~~~~~~ -Use the available windows installer or the setup file - -Usage ------ - -import stochpy -smod = stochpy.SSA() - -# 1: Basic Simulation with the Direct method -smod.DoStochSim(IsTrackPropensities=True) -smod.data_stochsim.simulation_endtime -smod.data_stochsim.simulation_timesteps -smod.GetWaitingtimes() -smod.PrintWaitingtimesMeans() -# 2: Do some Plotting -smod.PlotSpeciesTimeSeries() -smod.PlotWaitingtimesDistributions() -smod.PlotPropensitiesTimeSeries() -# 3: Write data to a text file -smod.Export2File() -smod.Export2File(analysis='distribution') -smod.Export2File(analysis='distribution',datatype='species') -smod.Export2File(analysis='mean',datatype='species') -smod.Export2File(analysis='std',datatype='species') -smod.Export2File(analysis='autocorrelation',datatype='species') -# 4: Show the means from the data of 3-th trajectory -smod.DoStochSim(trajectories=3) # multiple trajectories -smod.data_stochsim.simulation_trajectory -smod.PrintSpeciesMeans() -smod.PrintSpeciesStandardDeviations() -# 5: Switch to data from trajectory 1 and show the means of each species -smod.GetTrajectoryData(1) -smod.PrintSpeciesMeans() -smod.PrintSpeciesStandardDeviations() -# 6: Do one long simulation -smod.DoStochSim(trajectories=1,end=1000000,mode='steps') -smod.PrintSpeciesMeans() -smod.PrintSpeciesStandardDeviations() -# 7: Plot the PDF for different bin sizes -smod.PlotSpeciesDistributions() -smod.PlotSpeciesDistributions(bin_size=5) # larger bin size -smod.PlotSpeciesDistributions(bin_size=10) # again a larger bin size -smod.Export2File(analysis='distribution',datatype='species') - -# 8: Usage of the Reload Function: Ksyn = 20, kdeg = 0.2 -smod.ChangeParameter('Ksyn',20.0) -smod.ChangeParameter('Kdeg',0.2) -smod.DoStochSim() -smod.PrintSpeciesMeans() # should be ~Ksyn/Kdeg - -# 9: Use another model to show the Interpolation features -smod.Model('dsmts-001-01.xml.psc') -smod.DoStochSim(trajectories=1000,end=50,mode='time') -smod.GetRegularGrid(npoints=51) -smod.PlotAverageSpeciesTimeSeries() -smod.PrintAverageSpeciesTimeSeries() -smod.Export2File(datatype='species',analysis='timeseries',IsAverage=True) - -# 9: Test each method for different models: -smod.Model('Autoreg.psc') -smod.DoStochSim(trajectories=1,end=1000,mode='steps') -smod.Method('NextReactionMethod') -smod.DoStochSim(trajectories=1,end=1000,mode='steps') -smod.data_stochsim.species -smod.PlotWaitingtimesDistributions() -smod.Method('FirstReactionMethod') -smod.DoStochSim(trajectories=1,end=1000,mode='steps') -smod.Method('TauLeaping') -smod.DoStochSim(trajectories=1,end=1000,mode='steps') - -smod.Model('DecayingDimerizing.psc') -smod.DoStochSim(method = 'Direct',trajectories=1,end=50,mode='time') -smod.DoStochSim(method = 'NextReactionMethod',trajectories=1,end=50,mode='time') -smod.DoStochSim(method = 'FirstReactionMethod',trajectories=1,end=50,mode='time') -smod.PlotWaitingtimesDistributions() -smod.DoStochSim(method = 'TauLeaping',trajectories=1,end=50,mode='time',epsilon=0.03) # Should outperform all other implementations -smod.PlotSpeciesTimeSeries() -#smod.PlotWaitingtimesDistributions() # Should give an error - -smod.Model('chain500.psc') -smod.DoStochSim(method = 'Direct',trajectories=1,end=10000,mode='steps') -smod.DoStochSim(method = 'NextReactionMethod',trajectories=1,end=10000,mode='steps') # should outperform the direct method and all other implementations - -# 10: Use the Next Reaction Method to test a model with a time event -smod.Model('dsmts-003-03.xml.psc') -smod.DoStochSim(method = 'NextReactionMethod') -smod.DoTestsuite() - -# 11: Use the First Reaction method to test a model with a concentration event -smod.Model('dsmts-003-04.xml.psc') -smod.DoStochSim(method = 'FirstReactionMethod') -smod.DoTestsuite() - -# 12: Volume Models -smod.Model('dsmts-001-11.xml.psc') -smod.DoStochSim(method = 'Direct',trajectories=1000,end=50,mode ='time') -smod.PrintAverageSpeciesTimeSeries() From e9f414a7c9f276e422743391ac70051e50ce4aca Mon Sep 17 00:00:00 2001 From: developerfab Date: Mon, 19 Mar 2018 10:04:00 -0500 Subject: [PATCH 3/3] hotfix of titles in --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 1bc6431..38286d3 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,12 @@ StochPy is a versatile stochastic modeling package which is designed for stochastic simulation of molecular control networks -File releases: http://sourceforge.net/projects/stochpy -Source code: https://github.com/SystemsBioinformatics/stochpy +* File releases: http://sourceforge.net/projects/stochpy +* Source code: https://github.com/SystemsBioinformatics/stochpy ## Documentation -Documentation can be found in the user guide (see Documentation directory or http://stochpy.sourceforge.net/html/userguide.html) +Documentation can be found in the user guide (see Documentation directory or in [sourceforge](http://stochpy.sourceforge.net/html/userguide.html)) ## Installation @@ -76,7 +76,7 @@ smod.PrintSpeciesMeans() smod.PrintSpeciesStandardDeviations() ``` -### Switch to data from trajectory 1 and show the means of each species +### Switch to data from trajectory 1 and show the means of each species ```py smod.GetTrajectoryData(1) smod.PrintSpeciesMeans() @@ -159,7 +159,7 @@ smod.DoStochSim(method = 'FirstReactionMethod') smod.DoTestsuite() ``` -### Volume Models +### Volume Models ```py smod.Model('dsmts-001-11.xml.psc') smod.DoStochSim(method = 'Direct',trajectories=1000,end=50,mode ='time')