sys-bio / simplesbml Goto Github PK
View Code? Open in Web Editor NEWPython package for building SBML models without needing to use libSBML.
Home Page: http://simplesbml.readthedocs.io/en/latest/
License: MIT License
Python package for building SBML models without needing to use libSBML.
Home Page: http://simplesbml.readthedocs.io/en/latest/
License: MIT License
To help users who use intellisense, add the method:
str = enzyme.toSBML()
to your class.
If an SBML uses to composition packages, call the flattening method in libsbml first.
To specify concentrations use the syntax:
enzyme.addSpecies ('[ATP]', 1.0)
To set amounts use:
enzyme.addSpecies ('ATP', 1.0)
Hello,
I am using simplesbml to create a rather large reaction network (hundreds of species and reactions). In principle this works fine. However I always get warnings about unexpected units for my reactions. Here is a minimum example to reproduce:
import simplesbml
m = simplesbml.sbmlModel()
m.addSpecies('S1', 1)
m.addSpecies('S2', 0)
m.addParameter('k', 0.1)
m.addReaction(['S1'], ['S2'], 'k * S1')
sbml = m.toSBML()
This would be some simple reaction in the form: S1 -> S2 with rate constant k
The snippet will lead to the following warning:
Warning : The units of the 'math' formula in a definition are expected to be the equivalent of substance per time.
Reference: L3V1 Sections 4.11.7, 4.2.4 AND 4.9.4
In level 3 the expected units are extent_per_time. Expected units are mole (exponent = 1, multiplier = 1, scale = 0), second (exponent = -1, multiplier = 1, scale = 0) but the units returned by the expression in the (from the with id 'v1') are second (exponent = -1, multiplier = 1, scale = 0), mole (exponent = 1, multiplier = 1, scale = 0), litre (exponent = -1, multiplier = 1, scale = 0).
This seems to happen to happen because SBML expects the overall unit to be mole/sec but the model has mole/(sec*litre). The litre now actually comes from the default compartment.
These warnings are very annoying for me because they appear hundreds of times and will bury any possible useful warnings.
Now I have a few questions:
m.getCompartment('c1').setUnits('dimensionless')
But I am not sure whether I am "allowed" to do that or if it could hurt my model.
Add some installation help to the github page. Explain to a user how to install simplesbml. Indicate to users that they must first install libSBML python, provide a link to the libSBML page.
It looks like the package python-libsbml works as replacement for tesbml, which is listed as a requirement.
python-libsbml can be installed via pip on python 3.7 while tesbml is unavailable. Would it make sense to swap python-libsbml for tesbml in the setup.py / requirements.txt ? Thanks.
Add a reference to the paper you wrote in the readme.md file so that people can easily get access to the paper.
When loading an SBML file make sure you check first whether it is a valid sbml or not. Issue error is file is not a valid sbml file.
Breaks many simulators
Currently, simplesbml has no examples.
A simple example showing how to add compartments, species, reactions, and translating it into SBML string might be helpful.
When a user loads an sbml file, issue warning for features you find that you don't support, eg algebraic rules and math astoichiometry
Move delay argument to end of list for addEvent.
Add a example to the readme.md file so that people can see straight away how to use the library
The instructions tell users to: "In the command line, move into the 'simplesbml/' folder." Why do they have to do that, can installation be made simpler?
Hello,
Pip install gives me version 1.2.2 on Ubuntu 18.04. The very helpful docs refer to version 2.0.0.
pip install "simplesbml==2.0.0" does not find the recent version, either.
Thank you,
Upi Bhalla
The instructions tell users to:
"This folder should also contain a file called 'setup.py'. Type 'python setup.py install"
What happens if this doesn't work, eg Python isn't on the path? What do they do?
Current implementation of adding reaction does not produce a valid SBML file. Will push an updated version that solve this issue temporarily.
Hello,
I have a fresh install, using python 3.8, tellurium and simplesbml (installed with pip), and tried to use your examples but I have the following error:
Traceback (most recent call last):
File ~/.miniconda3/envs/new/lib/python3.8/site-packages/spyder_kernels/py3compat.py:356 in compat_exec
exec(code, globals, locals)
File ~/untitled0.py:20
code = simplesbml.writeCodeFromString(model.toSBML())
AttributeError: module 'simplesbml' has no attribute 'writeCodeFromString'
Thanks.
Just wanted to suggest the addition of the 'sbml' topic tag for this GitHub repository.
readme.md says that libSBML is a dependency. However many people may now know what that means, what is libSBML how do they install libSBML on their system? Add these details to the readme.md file.
The following code causes warnings to be emitted by the print
(statment I think) inside the simplesbml
model. These warnings should be emitted by the Python warnings module.
import roadrunner
import simplesbml
model = simplesbml.sbmlModel();
model.addSpecies('X', 3.0);
model.addSpecies('Y', 3);
model.addSpecies('$A', 0.5);
model.addSpecies('$B', 3.0);
model.addSpecies('$E', 3.0);
model.addParameter ('k1', 1.12298)
model.addParameter ('k2', 0.633134)
model.addParameter ('k3', 0.767529)
model.addParameter ('k4', 1.02339)
model.addReaction(['A'], ['X'], 'k1*A', rxn_id='J1');
model.addReaction(['2 X', 'Y'], ['3 X'], 'k2*X^2*Y', rxn_id='J2');
model.addReaction(['X', 'B'], ['Y'], 'k3*X*B', rxn_id='J3');
model.addReaction(['X'], ['E'], 'k4*X', rxn_id='J4');
print(model)
Set default volume to 1 L rather than 1E-15
Just before you write out the SBML or writeCode, call the libSBML validator to confirm that the generated SBML is valid. If it is not valid, write any error or warning messages to the IPython Console in Tellurium.
Add a method to allow users to set the level and version for SBML export.. Import should automatically recognize what level the sbml is.
Let users specify stoichiometries in addReaction, eg to specify:
2 A + B -> 3C
enzyme.addReaction ([2 A, B], [3 C], 'v')
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.