1- StochPy Stochastic modeling in Python
2- =====================================
1+ # StochPy Stochastic modeling in Python
32
4- Copyright (c) 2011-2016, Timo R. Maarleveld, Brett G. Olivier, and Frank J. Bruggeman
5- All rights reserved.
3+ StochPy is a versatile stochastic modeling package which is designed for stochastic simulation of molecular control networks
64
7- StochPy is distributed under a BSD style licence.
5+ * File releases: http://sourceforge.net/projects/stochpy
6+ * Source code: https://github.com/SystemsBioinformatics/stochpy
87
9- File releases: http://sourceforge.net/projects/stochpy
10- Source code: https://github.com/SystemsBioinformatics/stochpy
8+ ## Documentation
119
12- Author information
13- ------------------
10+ Documentation can be found in the user guide (see Documentation directory or in [ sourceforge] ( http://stochpy.sourceforge.net/html/userguide.html ) )
1411
15- Timo R. Maarleveld, Brett G. Olivier, and Frank J. Bruggeman
16- Centrum Wiskunde en Informatica, Amsterdam, Netherlands
17- VU University, Amsterdam, Netherlands
12+ ## Installation
1813
19- 14+ The following software is required before installing StochPy (see user guide for more details):
2015
21- Documentation can be found in the user guide (see Documentation directory or http://stochpy.sourceforge.net/html/userguide.html)
16+ - Python 2.6+ or Python 3.4+
17+ - [ NumPy 1.x+] ( http://www.numpy.org )
18+ - [ Matplotlib] ( https://matplotlib.org ) (optional)
19+ - [ libsbml] ( http://sbml.org/Software/libSBML ) (optional)
20+ - [ libxml2] ( http://xmlsoft.org ) (optional)
21+ - [ mpmath] ( http://mpmath.org ) (optional)
2222
23- Publication
24- ~~~~~~~~~~~
23+ #### Linux/MAC OS/Cygwin
2524
26- StochPy: A Comprehensive, User-Friendly Tool for Simulating Stochastic Biological Processes
27- http://dx.doi.org/10.1371/journal.pone.0079345
2825
29- Installation
30- ------------
31- The following software is required before installling StochPy (see user guide for more details):
26+ In the directory where you downloaded StochPy, go to the directory _ StochPy-2.1.0_ and exec the next command:
3227
33- - Python 2.6+ or Python 3.4+
34- - NumPy 1.x+
35- - Matplotlib (optional)
36- - libsbml (optional)
37- - libxml2 (optional)
38- - mpmath (optional)
28+ ``` bash
29+ sudo python setup.py install
30+ ```
3931
40- Linux/MAC OS/Cygwin
41- ~~~~~~~~~~~~~~~~~~~
32+ ### Windows
4233
43- 1) cd to directory StochPy-2.1.0
44- 2) sudo python setup.py install
45-
46- Windows
47- ~~~~~~~
4834Use the available windows installer or the setup file
4935
50- Usage
51- -----
36+ ## Getting Started
37+
38+ You can run ` ipython ` and import ` stochpy ` :
5239
40+ ``` py
5341import stochpy
5442smod = stochpy.SSA()
43+ ```
5544
56- # 1: Basic Simulation with the Direct method
45+ ### Basic Simulation with the Direct method
46+ ``` py
5747smod.DoStochSim(IsTrackPropensities = True )
5848smod.data_stochsim.simulation_endtime
5949smod.data_stochsim.simulation_timesteps
6050smod.GetWaitingtimes()
6151smod.PrintWaitingtimesMeans()
62- # 2: Do some Plotting
52+ ```
53+
54+ ### Do some Plotting
55+ ``` py
6356smod.PlotSpeciesTimeSeries()
6457smod.PlotWaitingtimesDistributions()
6558smod.PlotPropensitiesTimeSeries()
66- # 3: Write data to a text file
59+ ```
60+
61+ ### Write data to a text file
62+ ``` py
6763smod.Export2File()
6864smod.Export2File(analysis = ' distribution' )
6965smod.Export2File(analysis = ' distribution' ,datatype = ' species' )
7066smod.Export2File(analysis = ' mean' ,datatype = ' species' )
7167smod.Export2File(analysis = ' std' ,datatype = ' species' )
7268smod.Export2File(analysis = ' autocorrelation' ,datatype = ' species' )
73- # 4: Show the means from the data of 3-th trajectory
69+ ```
70+
71+ ### Show the means from the data of 3-th trajectory
72+ ``` py
7473smod.DoStochSim(trajectories = 3 ) # multiple trajectories
7574smod.data_stochsim.simulation_trajectory
7675smod.PrintSpeciesMeans()
7776smod.PrintSpeciesStandardDeviations()
78- # 5: Switch to data from trajectory 1 and show the means of each species
77+ ```
78+
79+ ### Switch to data from trajectory 1 and show the means of each species
80+ ``` py
7981smod.GetTrajectoryData(1 )
8082smod.PrintSpeciesMeans()
8183smod.PrintSpeciesStandardDeviations()
82- # 6: Do one long simulation
84+ ```
85+
86+ ### Do one long simulation
87+ ``` py
8388smod.DoStochSim(trajectories = 1 ,end = 1000000 ,mode = ' steps' )
8489smod.PrintSpeciesMeans()
8590smod.PrintSpeciesStandardDeviations()
86- # 7: Plot the PDF for different bin sizes
91+ ```
92+
93+ ### Plot the PDF for different bin sizes
94+ ``` py
8795smod.PlotSpeciesDistributions()
8896smod.PlotSpeciesDistributions(bin_size = 5 ) # larger bin size
8997smod.PlotSpeciesDistributions(bin_size = 10 ) # again a larger bin size
9098smod.Export2File(analysis = ' distribution' ,datatype = ' species' )
99+ ```
91100
92- # 8: Usage of the Reload Function: Ksyn = 20, kdeg = 0.2
101+ ### Usage of the Reload Function: ` Ksyn = 20, kdeg = 0.2 `
102+ ``` py
93103smod.ChangeParameter(' Ksyn' ,20.0 )
94104smod.ChangeParameter(' Kdeg' ,0.2 )
95105smod.DoStochSim()
96106smod.PrintSpeciesMeans() # should be ~Ksyn/Kdeg
107+ ```
97108
98- # 9: Use another model to show the Interpolation features
109+ ### Use another model to show the Interpolation features
110+ ``` py
99111smod.Model(' dsmts-001-01.xml.psc' )
100- smod.DoStochSim(trajectories=1000,end=50,mode='time')
112+ smod.DoStochSim(trajectories = 1000 ,end = 50 ,mode = ' time' )
101113smod.GetRegularGrid(npoints = 51 )
102114smod.PlotAverageSpeciesTimeSeries()
103115smod.PrintAverageSpeciesTimeSeries()
104116smod.Export2File(datatype = ' species' ,analysis = ' timeseries' ,IsAverage = True )
117+ ```
105118
106- # 9: Test each method for different models:
119+ ### Test each method for different models:
120+ ``` py
107121smod.Model(' Autoreg.psc' )
108122smod.DoStochSim(trajectories = 1 ,end = 1000 ,mode = ' steps' )
109123smod.Method(' NextReactionMethod' )
@@ -114,31 +128,60 @@ smod.Method('FirstReactionMethod')
114128smod.DoStochSim(trajectories = 1 ,end = 1000 ,mode = ' steps' )
115129smod.Method(' TauLeaping' )
116130smod.DoStochSim(trajectories = 1 ,end = 1000 ,mode = ' steps' )
117-
131+ ```
132+ ``` py
118133smod.Model(' DecayingDimerizing.psc' )
119134smod.DoStochSim(method = ' Direct' ,trajectories = 1 ,end = 50 ,mode = ' time' )
120135smod.DoStochSim(method = ' NextReactionMethod' ,trajectories = 1 ,end = 50 ,mode = ' time' )
121136smod.DoStochSim(method = ' FirstReactionMethod' ,trajectories = 1 ,end = 50 ,mode = ' time' )
122- smod.PlotWaitingtimesDistributions()
137+ smod.PlotWaitingtimesDistributions()
123138smod.DoStochSim(method = ' TauLeaping' ,trajectories = 1 ,end = 50 ,mode = ' time' ,epsilon = 0.03 ) # Should outperform all other implementations
124139smod.PlotSpeciesTimeSeries()
125140# smod.PlotWaitingtimesDistributions() # Should give an error
126-
141+ ```
142+ ``` py
127143smod.Model(' chain500.psc' )
128144smod.DoStochSim(method = ' Direct' ,trajectories = 1 ,end = 10000 ,mode = ' steps' )
129145smod.DoStochSim(method = ' NextReactionMethod' ,trajectories = 1 ,end = 10000 ,mode = ' steps' ) # should outperform the direct method and all other implementations
146+ ```
130147
131- # 10: Use the Next Reaction Method to test a model with a time event
132- smod.Model('dsmts-003-03.xml.psc')
148+ ### Use the Next Reaction Method to test a model with a time event
149+ ``` py
150+ smod.Model(' dsmts-003-03.xml.psc' )
133151smod.DoStochSim(method = ' NextReactionMethod' )
134152smod.DoTestsuite()
153+ ```
135154
136- # 11: Use the First Reaction method to test a model with a concentration event
155+ ### Use the First Reaction method to test a model with a concentration event
156+ ``` py
137157smod.Model(' dsmts-003-04.xml.psc' )
138158smod.DoStochSim(method = ' FirstReactionMethod' )
139159smod.DoTestsuite()
160+ ```
140161
141- # 12: Volume Models
142- smod.Model('dsmts-001-11.xml.psc')
162+ ### Volume Models
163+ ``` py
164+ smod.Model(' dsmts-001-11.xml.psc' )
143165smod.DoStochSim(method = ' Direct' ,trajectories = 1000 ,end = 50 ,mode = ' time' )
144166smod.PrintAverageSpeciesTimeSeries()
167+ ```
168+
169+ ## Author information
170+
171+
172+ Timo R. Maarleveld, Brett G. Olivier, and Frank J. Bruggeman
173+ Centrum Wiskunde en Informatica, Amsterdam, Netherlands
174+ VU University, Amsterdam, Netherlands
175+
176+ 177+
178+ ## Publication
179+
180+ StochPy: A Comprehensive, User-Friendly Tool for Simulating Stochastic Biological Processes
181+ http://dx.doi.org/10.1371/journal.pone.0079345
182+
183+ ## Licence
184+ Copyright (c) 2011-2016, Timo R. Maarleveld, Brett G. Olivier, and Frank J. Bruggeman
185+ All rights reserved.
186+
187+ StochPy is distributed under a BSD style licence.
0 commit comments