Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
1b93bdf
Fix #10: Allow api.addAgent() to take double or int
davidcsterratt Apr 3, 2014
a6bb304
Get initialiseSim() to pass errors on rather than continuing
davidcsterratt Jun 19, 2014
04d3a81
Added text progress indicator
davidcsterratt Jun 19, 2014
a05be53
Further #10, provide setAgentIntialValue(String, int)
davidcsterratt Jun 19, 2014
5148c66
Made some more println statements respect verbose
davidcsterratt Jun 19, 2014
a82e4a6
Added printAgentAgentInteractions() to give simplified map of kappa m…
davidcsterratt Jun 26, 2014
00cf63e
Slightly more logical ordering of functions
davidcsterratt Jun 26, 2014
4d121f7
Added ability to create transition in API and in python
davidcsterratt Jun 27, 2014
7ef36ed
Reused code from getAgent() in addAgent() and setAgentInitialValue()
davidcsterratt Jun 27, 2014
e0d0e7f
Beginning of unittest suite
davidcsterratt Jun 27, 2014
fc8d206
More tests for addAgent()
davidcsterratt Jun 27, 2014
0a6f988
Removed cruft
davidcsterratt Jun 27, 2014
db06065
First stab at fix for #12: Allow variables to be created within python
davidcsterratt Jul 2, 2014
13888bf
More work on #12: allow Variables to be specified as a Map
davidcsterratt Jul 2, 2014
9c40657
More work on #12: Complete VariableMap interface
davidcsterratt Jul 2, 2014
67a320a
Reordered file into more logical sections
davidcsterratt Jul 2, 2014
99f3031
Taken code out of addVariableMap() into function agentList() for reuse
davidcsterratt Jul 2, 2014
1cc1fb4
Extended the addTransition() interface to allow left side agents
davidcsterratt Jul 2, 2014
2459f8a
Kill gateway process from destructor rather than using die_on_exit
davidcsterratt Jul 3, 2014
6be860e
Added getAgentMap() method
davidcsterratt Jul 4, 2014
9a537a9
Added ability to set seed of RNG
davidcsterratt Jul 25, 2014
40dcc93
Modified test_addVariableMap() to take label argument
davidcsterratt Jul 31, 2014
aaf51b0
Added setSeed() method
davidcsterratt Jul 31, 2014
7d303b1
Fix for Issue #13: some minor java issues
davidcsterratt Jul 31, 2014
f4df6cd
Merge branch 'issue-13'
davidcsterratt Aug 1, 2014
cddccb1
Fixed path to caPump.ka
davidcsterratt Aug 4, 2014
bbadf7d
Converted tests to package
davidcsterratt Aug 4, 2014
aae1978
Got tests running from Makefile
davidcsterratt Aug 4, 2014
85e7fdb
Ensure that the jar is build before building
davidcsterratt Aug 4, 2014
b41e6ff
Get rid of printing classpath
davidcsterratt Aug 6, 2014
3d079c1
Make sure install builds!
davidcsterratt Aug 8, 2014
8f9ab6e
Information about installation with pip
davidcsterratt Aug 8, 2014
8b9edb1
Exception thrown by getAgent() rather than carrying on silently
davidcsterratt Aug 8, 2014
026b5b4
Added isAgent()
davidcsterratt Sep 24, 2014
564ec9f
Use getVariable() instead of getObservation() in setAgentInitialValue()
davidcsterratt Sep 24, 2014
13c8aeb
Improved installation instructions
davidcsterratt Sep 29, 2014
2842f65
Renamed to so Markdown formatting appears
davidcsterratt Sep 29, 2014
ac8e3fd
Set link
davidcsterratt Sep 29, 2014
681d494
Info on python install
davidcsterratt Sep 29, 2014
b3cea91
Update README.md
davidcsterratt Jan 4, 2017
d7c95f6
Update README.md
davidcsterratt Jan 4, 2017
79f6be4
Update INSTALL.md
davidcsterratt Jan 4, 2017
d866719
Update INSTALL.md
davidcsterratt Jan 4, 2017
e0c3f93
Update INSTALL.md
davidcsterratt Jan 4, 2017
160ff07
Added ant-antlr3.jar to make compile reliable
davidcsterratt Jan 6, 2017
39de15d
Corrected name of python-pip package
davidcsterratt Jan 6, 2017
bb5b639
Update README.md
davidcsterratt Jan 6, 2017
feb8001
Added no_init.ka
davidcsterratt Jan 6, 2017
9a07835
Merge branch 'master' of https://github.com/davidcsterratt/SpatialKappa
davidcsterratt Jan 6, 2017
365848b
More HTML -> Markdown
davidcsterratt Aug 8, 2018
72a8062
Initial attempt at wheel package for pip
davidcsterratt Aug 9, 2018
071ebec
Allow output of SpatialKappa python to be redirected with redirect_ou…
davidcsterratt Nov 7, 2018
15685e1
Set seed when SpatialKappaSim is created rather than later, since the…
davidcsterratt Nov 7, 2018
e87d667
Merge branch 'master' of https://github.com/davidcsterratt/SpatialKappa
davidcsterratt Nov 7, 2018
a5e45b5
Fix? file closing errors
davidcsterratt Dec 3, 2018
fe2aa2d
Docstrings
davidcsterratt Dec 3, 2018
73acd65
Various API changes
davidcsterratt Dec 3, 2018
0bde49c
Notes on distribution
davidcsterratt Dec 4, 2018
c2bf775
Bumped to version 2.1.2
davidcsterratt Dec 4, 2018
be1bfc6
Ignore tokens
davidcsterratt Dec 17, 2018
579d48b
Refactor API to separate model and simulation logic and allow program…
davidcsterratt Dec 17, 2018
66fa933
isInitialised() and specify NOT_LOCATED in addTransition()
davidcsterratt Dec 20, 2018
7e22d6d
Report every function called for debugging purposes
davidcsterratt Dec 20, 2018
5548b2c
Ability to overrideInitialValue from complex
davidcsterratt Dec 20, 2018
062fa53
Updated jar
davidcsterratt Dec 20, 2018
1be0981
Information about python interface
davidcsterratt Jan 18, 2019
ee9dd5b
Bumped to version 2.1.3
davidcsterratt Feb 22, 2019
4ab93fe
Fix Issue #20: Numerical errors with high propensities at long times
davidcsterratt Apr 9, 2019
e990b27
Merge branch 'master' of https://github.com/davidcsterratt/SpatialKappa
davidcsterratt Apr 9, 2019
bd3442a
Fixed build instructions
davidcsterratt May 6, 2019
865e4ea
Add transitionsFiredMap to getDebugOutput() and expose to API
davidcsterratt May 6, 2019
0c55a37
Issue #20: Numerical errors with high propensities at long times
davidcsterratt May 6, 2019
7d12065
Don't reset transitionsFiredMap in runByTime2()
davidcsterratt May 6, 2019
f55ece2
Fixed minor doc bug
davidcsterratt May 8, 2019
3c320d7
Bumped verion to 2.1.5
davidcsterratt May 8, 2019
ac8d36d
KaSim 3.5 manual added for reference
davidcsterratt May 10, 2019
0c8a5df
Update README.md
davidcsterratt May 10, 2019
db64951
EU funding acknowledgment
davidcsterratt Jul 1, 2019
ad8ddd5
EU funding acknowledgment
davidcsterratt Jul 1, 2019
bba1cda
Merge branch 'master' of https://github.com/davidcsterratt/SpatialKappa
davidcsterratt Jul 1, 2019
fd1395e
Flag alignment
davidcsterratt Jul 1, 2019
57e238f
add jar file to fix python compilation
rjwen2045458 Jun 23, 2021
1a12f48
Merge pull request #1 from rjwen2045458/master
davidcsterratt Jun 23, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@
*.pyc
*.pdf
*.class

*.tokens
python/build
python/dist
python/SpatialKappa.egg-info
python/SpatialKappa/share
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,16 @@
# OR sudo apt-get install antlr3

# N.B.: The CLASSPATH has to have both parts and has to be aboslute
CLASSPATH=$(realpath .)/src/lib/antlr-3.2.jar:$(HOME)/.ant/lib/ant-antlr3.jar
CLASSPATH=$(realpath .)/src/lib/antlr-3.2.jar:$(realpath .)/ant-antlr3.jar

SKJAR_FILE = SpatialKappa-v2.1.5.jar
ANTLRJAR_FILE = ant-antlr-3.2.jar
PYTHON_SHARE_DIR = python/SpatialKappa/share/SpatialKappa

all:
cd build && ant
cd build && CLASSPATH=$(CLASSPATH) ant compile-all
cd build && ant -f buildSpatialKappa.xml
cd build && ant -f buildSpatialKappa.xml
mkdir -p $(PYTHON_SHARE_DIR)
cp $(SKJAR_FILE) $(PYTHON_SHARE_DIR)
cp $(ANTLRJAR_FILE) $(PYTHON_SHARE_DIR)
77 changes: 52 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,48 @@ SpatialKappa
<p style="text-align: center;">14 September 2012</p>

<p style="text-align: center;">Copyright &copy; 2012 DemonSoft.org
&lt;<a href="http://www.demonsoft.org/">http://www.demonsoft.org/</a>&gt;</p>
&lt;<a
href="http://www.demonsoft.org/">http://www.demonsoft.org/</a>&gt;<br/>
Copyright &copy; 2014-2019 David C Sterratt <david.c.sterratt@ed.ac.uk>
</p>

<h4>INTRODUCTION</h4>
INTRODUCTION
------------

<p>This project contains an implementation of a syntactic extension
of Kappa to allow expression of location and transport in models. A user manual is available [here][manual-link].</p>
This project contains an implementation of a syntactic extension
of Kappa to allow expression of location and transport in models. A user manual is available [here][manual-link].

Feel free to add bug reports or feature requests [here][bug-link].</p>
Feel free to add bug reports or feature requests [here][bug-link].

<h4>LICENSE</h4>
INSTALLATION
------------

<p>This project is licenced under the GNU Lesser General Public
Licence Version 3 (LGPLv3), included as &lt;<a href="LICENSE.html">LICENSE.html</a>&gt;.
Either

1. Run the standalone jar file (SpatialKappa-v2.1.3.jar)
2. Install the python interface using pip:
```pip install SpatialKappa``` and then test using ```python -m unittest SpatialKappa.tests```. Within python ```help(SpatialKappa)``` gives the list of model-building and control functions.


COMPILATION
-----------

To make the `SpatialKappa.jar` file either:

1. Import this code as an Ecclipse project; or
2. Install ant (`sudo apt install ant openjdk-7-jdk` on Debian/Ubuntu) and run `make all`

To install the python interface, cd into the python directory, and
follow the instructions in [python/INSTALL.md](python/INSTALL.md)

LICENSE
-------

This project is licenced under the GNU Lesser General Public
Licence Version 3 (LGPLv3), included as [LICENSE.html](LICENSE.html).

Included third party libraries are released under their respective
licences, listed below:</p>
licences, listed below:

<table style="border: groove;">
<tr>
Expand Down Expand Up @@ -76,27 +102,28 @@ licences, listed below:</p>
</table>


<h4>ACKNOWLEDGEMENTS</h4>
ACKNOWLEDGEMENTS
----------------

The development of Spatial Kappa was funded in part by <a href="http://www.csbe.ed.ac.uk/">SynthSys</a>. SynthSys is a Centre for
Integrative Systems Biology (CISB) funded by BBSRC and EPSRC, reference BB/D019621/1.
The development of Spatial Kappa was funded in part by <a href="http://www.csbe.ed.ac.uk/">SynthSys</a>. SynthSys is a Centre for Integrative Systems Biology (CISB) funded by BBSRC and EPSRC, reference BB/D019621/1.

<img width=200px align="left" alt="EU flag" src="docs/figs/flag_yellow_low.jpg"/>

<h4>DISCLAIMER</h4>
This open source software code was developed with funding from the
European Union Seventh Framework Programme (FP7/2007-2013) under grant
agreement nos. 241498 (EUROSPIN project), 242167 (SynSys-project) and
604102 (Human Brain Project), and in the Human Brain Project, funded
from the European Union’s Horizon 2020 Framework Programme for
Research and Innovation under Specific Grant Agreements No. 720270 and
No. 785907 (Human Brain Project SGA1 and SGA2).

<p>THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</p>

DISCLAIMER
----------

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

[bug-link]: https://github.com/lptolik/SpatialKappa/issues
[manual-link]: https://github.com/lptolik/SpatialKappa/raw/master/docs/manual/SpatialKappaManual-v2.1.0.pdf

[1]: python/INSTALL.md
Binary file renamed SpatialKappa-v2.1.1.jar → SpatialKappa-v2.1.5.jar
Binary file not shown.
Binary file added ant-antlr3.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion build/buildSpatialKappa.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!--this file was created by Eclipse Runnable JAR Export Wizard (then tweaked) -->
<!--ANT 1.7 is required -->
<target name="create_run_jar">
<property name="VERSION" value="v2.1.1"/> <!-- Remember to update this -->
<property name="VERSION" value="v2.1.5"/> <!-- Remember to update this -->

<property name="JAR_FILENAME" value="SpatialKappa-${VERSION}.jar"/>

Expand Down
Binary file added docs/figs/flag_yellow_low.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/manual/KaSim_manual_v3.5.pdf
Binary file not shown.
10 changes: 10 additions & 0 deletions docs/manual/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# SpatialKappa manuals

Documents

* [The main SpatialKappa manual](SpatialKappaManual-v2.1.0.pdf)

* [Manual for tranalating SpatialKappa files into files compatible with v2.01 of KaSim](SpatialKappaTranslatorManual-v2.0.1.pdf)

* [KaSim v3.5 manual, for fuller description of Kappa Language](KaSim_manual_v3.5.pdf) -
Note that SpatialKappa does not implement the full spec.
22 changes: 0 additions & 22 deletions python/INSTALL

This file was deleted.

41 changes: 41 additions & 0 deletions python/INSTALL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
Installing the Python interface to SpatialKappa
===============================================

0. Build the SpatialKappa jar as described in [../README.md][1]

1. Either:

a. Install py4j using `pip`:

sudo apt-get install python-pip
sudo pip install py4j --upgrade

To install in a non-standard location, use the `-t` flag, e.g.:

pip install py4j --upgrade -t ${HOME}/lib/python2.7/site-packages/

b. Install py4j with python 2.7 from source:

git clone https://github.com/davidcsterratt/py4j
cd py4j
cd py4j-java
ant jar
cd ../py4j/py4j-python
sudo python2.7 setup.py install


2. Install SpatialKappa python files

sudo python2.7 setup.py install

An alternative prefix can be specified like this:

python2.7 setup.py install --prefix=${HOME}

3. Run the tests:

python2.7 -m unittest test

This gives an indication of what methods are exposed to python.

[1]: ../README.md
16 changes: 16 additions & 0 deletions python/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
This project is licenced under the GNU Lesser General Public Licence
Version 3 (LGPLv3, http://www.gnu.org/licenses/lgpl.html).

Included third party libraries are released under their respective
licences, listed below:

Library Home site License
Antlr v3.2 http://www.antlr.org http://www.antlr.org/license.html
jlfgr v1.0 http://java.sun.com/developer/techDocs/hi/repository/ Included in archive
commons io v1.4 http://commons.apache.org/io/ http://commons.apache.org/io/license.html
jcommon v1.0.16 http://www.jfree.org/jcommon/ http://www.gnu.org/licenses/lgpl.html
jfreechart v1.0.13 http://www.jfree.org/jfreechart/ http://www.gnu.org/licenses/lgpl.html
EasyMock v3.0 http://easymock.org/ http://easymock.org/License.html
CgLib v2.2 http://cglib.sourceforge.net/ http://www.apache.org/foundation/licence-FAQ.html
Objenesis v1.2 http://objenesis.googlecode.com/svn/docs/index.html http://objenesis.googlecode.com/svn/docs/license.html
ASM v3.3.1 http://asm.ow2.org/index.html http://asm.ow2.org/license.html
12 changes: 12 additions & 0 deletions python/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
PREFIX=/usr/local

build_py:
cd .. ; make
python2.7 setup.py build

test: build_py
python2.7 -m unittest tests

install: build_py
python2.7 setup.py install --prefix=$(PREFIX)

54 changes: 54 additions & 0 deletions python/NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
Steps to distribute SpatialKappa python package
===============================================

Testing in Test PyPi repository
-------------------------------

1. Test package
```
python2 setup.py test
```

2. Build package
```
rm -Rf build/*
rm -Rf dist/*
python setup.py sdist bdist_wheel
```

3. Upload to the Test PyPi repository
```
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
```

4. Create virtual environment https://packaging.python.org/tutorials/installing-packages/#creating-virtual-environments
```
virtualenv SpatialKappa
source SpatialKappa/bin/activate
PYTHONPATH=
```

5. Test in virtual environment
```
python -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url=https://pypi.org/simple/ SpatialKappa==2.1.5
python -m unittest SpatialKappa.tests

```

Distributing in main PyPi repository
------------------------------------

1. Change `POSTFIX` in `setup.py` to `.rc1` (say)

2. Test and rebuild

```
python2 setup.py test
rm -f dist/*
python setup.py sdist bdist_wheel
```

3. Upload
```
twine upload dist/*
```
29 changes: 29 additions & 0 deletions python/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
SpatialKappa
============

14 September 2012

Copyright © 2012 DemonSoft.org [http://www.demonsoft.org/](http://www.demonsoft.org)

Copyright © 2014 David C Sterratt <david.c.sterratt@ed.ac.uk>

INTRODUCTION
------------

This project contains an implementation of a syntactic extension of Kappa to allow expression of location and transport in models. A user manual is available [here][manual-link].

Feel free to add bug reports or feature requests [here][bug-link].

ACKNOWLEDGEMENTS
----------------

The development of Spatial Kappa was funded in part by <a href="http://www.csbe.ed.ac.uk/">SynthSys</a>. SynthSys is a Centre for Integrative Systems Biology (CISB) funded by BBSRC and EPSRC, reference BB/D019621/1.

DISCLAIMER
----------

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

[bug-link]: https://github.com/lptolik/SpatialKappa/issues
[manual-link]: https://github.com/lptolik/SpatialKappa/raw/master/docs/manual/SpatialKappaManual-v2.1.0.pdf
[1]: python/INSTALL.md
Loading