Skip to content

Commit 4c537d7

Browse files
authored
Merge pull request #3 from developerfab/master
Update README.md
2 parents 90ee57b + e9f414a commit 4c537d7

File tree

1 file changed

+98
-55
lines changed

1 file changed

+98
-55
lines changed
Lines changed: 98 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,109 +1,123 @@
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-
~~~~~~~
4834
Use 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
5341
import stochpy
5442
smod = stochpy.SSA()
43+
```
5544

56-
# 1: Basic Simulation with the Direct method
45+
### Basic Simulation with the Direct method
46+
```py
5747
smod.DoStochSim(IsTrackPropensities=True)
5848
smod.data_stochsim.simulation_endtime
5949
smod.data_stochsim.simulation_timesteps
6050
smod.GetWaitingtimes()
6151
smod.PrintWaitingtimesMeans()
62-
# 2: Do some Plotting
52+
```
53+
54+
### Do some Plotting
55+
```py
6356
smod.PlotSpeciesTimeSeries()
6457
smod.PlotWaitingtimesDistributions()
6558
smod.PlotPropensitiesTimeSeries()
66-
# 3: Write data to a text file
59+
```
60+
61+
### Write data to a text file
62+
```py
6763
smod.Export2File()
6864
smod.Export2File(analysis='distribution')
6965
smod.Export2File(analysis='distribution',datatype='species')
7066
smod.Export2File(analysis='mean',datatype='species')
7167
smod.Export2File(analysis='std',datatype='species')
7268
smod.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
7473
smod.DoStochSim(trajectories=3) # multiple trajectories
7574
smod.data_stochsim.simulation_trajectory
7675
smod.PrintSpeciesMeans()
7776
smod.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
7981
smod.GetTrajectoryData(1)
8082
smod.PrintSpeciesMeans()
8183
smod.PrintSpeciesStandardDeviations()
82-
# 6: Do one long simulation
84+
```
85+
86+
### Do one long simulation
87+
```py
8388
smod.DoStochSim(trajectories=1,end=1000000,mode='steps')
8489
smod.PrintSpeciesMeans()
8590
smod.PrintSpeciesStandardDeviations()
86-
# 7: Plot the PDF for different bin sizes
91+
```
92+
93+
### Plot the PDF for different bin sizes
94+
```py
8795
smod.PlotSpeciesDistributions()
8896
smod.PlotSpeciesDistributions(bin_size=5) # larger bin size
8997
smod.PlotSpeciesDistributions(bin_size=10) # again a larger bin size
9098
smod.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
93103
smod.ChangeParameter('Ksyn',20.0)
94104
smod.ChangeParameter('Kdeg',0.2)
95105
smod.DoStochSim()
96106
smod.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
99111
smod.Model('dsmts-001-01.xml.psc')
100-
smod.DoStochSim(trajectories=1000,end=50,mode='time')
112+
smod.DoStochSim(trajectories=1000,end=50,mode='time')
101113
smod.GetRegularGrid(npoints=51)
102114
smod.PlotAverageSpeciesTimeSeries()
103115
smod.PrintAverageSpeciesTimeSeries()
104116
smod.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
107121
smod.Model('Autoreg.psc')
108122
smod.DoStochSim(trajectories=1,end=1000,mode='steps')
109123
smod.Method('NextReactionMethod')
@@ -114,31 +128,60 @@ smod.Method('FirstReactionMethod')
114128
smod.DoStochSim(trajectories=1,end=1000,mode='steps')
115129
smod.Method('TauLeaping')
116130
smod.DoStochSim(trajectories=1,end=1000,mode='steps')
117-
131+
```
132+
```py
118133
smod.Model('DecayingDimerizing.psc')
119134
smod.DoStochSim(method = 'Direct',trajectories=1,end=50,mode='time')
120135
smod.DoStochSim(method = 'NextReactionMethod',trajectories=1,end=50,mode='time')
121136
smod.DoStochSim(method = 'FirstReactionMethod',trajectories=1,end=50,mode='time')
122-
smod.PlotWaitingtimesDistributions()
137+
smod.PlotWaitingtimesDistributions()
123138
smod.DoStochSim(method = 'TauLeaping',trajectories=1,end=50,mode='time',epsilon=0.03) # Should outperform all other implementations
124139
smod.PlotSpeciesTimeSeries()
125140
#smod.PlotWaitingtimesDistributions() # Should give an error
126-
141+
```
142+
```py
127143
smod.Model('chain500.psc')
128144
smod.DoStochSim(method = 'Direct',trajectories=1,end=10000,mode='steps')
129145
smod.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')
133151
smod.DoStochSim(method = 'NextReactionMethod')
134152
smod.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
137157
smod.Model('dsmts-003-04.xml.psc')
138158
smod.DoStochSim(method = 'FirstReactionMethod')
139159
smod.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')
143165
smod.DoStochSim(method = 'Direct',trajectories=1000,end=50,mode ='time')
144166
smod.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

Comments
 (0)