Comments (8)
from biosimulators_copasi.
@shoops thanks for the quick reply.
Here's a more complete example where the time series doesn't include non-constant parameters set via event assignments. Here's the example model: model.xml.zip (BIOMD0000000806). The time series doesn't include d_u
, d_m1
or H
. I'm using COPASI 4.30.240.
What parameter do I need to set or function do I need to execute to retrieve the values of these parameters? I tried looking through the COPASI examples and documentation; the required syntax wasn't obvious to me.
import COPASI
import libsbml
filename = 'model.xml'
data_model = COPASI.CRootContainer.addDatamodel()
data_model.importSBML(filename)
task = data_model.getTask('Time-Course')
task.setMethodType(COPASI.CTaskEnum.Method_deterministic)
task.setScheduled(True)
model = data_model.getModel()
problem = task.getProblem()
model.setInitialTime(0.)
problem.setOutputStartTime(0.)
problem.setDuration(10.)
problem.setStepNumber(10)
problem.setTimeSeriesRequested(True)
problem.setAutomaticStepSize(False)
problem.setOutputEvent(False)
result = task.process(True)
time_series = task.getTimeSeries()
# get SBML ids of recorded variables
variable_sbml_ids = []
for i_variable in range(time_series.getNumVariables()):
variable_sbml_ids.append(time_series.getSBMLId(i_variable, data_model))
# print SBML ids of recorded variables
print(variable_sbml_ids)
# check if non-constant SBML parameters were recorded
non_constant_parameter_sbml_ids = set(['d_u', 'd_m1', 'H'])
non_constant_parameter_sbml_ids.intersection(variable_sbml_ids)
# verify that the non-constant SBML parameters are part of the model
sbml_doc = libsbml.readSBMLFromFile(filename)
sbml_model = sbml_doc.getModel()
for sbml_id in non_constant_parameter_sbml_ids:
sbml_parameter = sbml_model.getParameter(sbml_id)
assert sbml_parameter is not None
assert not sbml_parameter.getConstant()
from biosimulators_copasi.
Hello Jonathan,
You cannot use the time_series to get those values as they are not state variables of the system. You will have to create a report which contains the observables and variables required from SED-ML file. An exampleson how to proceed can be found at:
https://github.com/copasi/COPASI/blob/develop/copasi/bindings/python/examples/custom_output.py
Stefan
from biosimulators_copasi.
Perfect! I would never have been able to guess this myself. I should be able to figure out the rest.
from biosimulators_copasi.
Helllo Jonathan,
I think a better approach would be to let COPASI read the SED-ML directly. The problem I see is that if SED-ML asks for plot and you are running CopasiSE tor any language bindings he plot will not be generated. I think I have an idea on how to circumvent that. I will talk with @fbergmann about it.
Stefan
from biosimulators_copasi.
I started a new issue for the discussion that @shoops started. See #48.
from biosimulators_copasi.
This repository will never be obsolete since it provides functionality which is not part of COPASI's core. However making data specified by SED-ML plots and reports available to the calling process is a general feature desirable for language bindings.
from biosimulators_copasi.
Done in 4b9c03a.
from biosimulators_copasi.
Related Issues (20)
- COPASI or wrapper should support KISAO terms for algorithms and algorithm parameters HOT 1
- Apply new KISAO terms for algorithms and parameters HOT 2
- Add citation for Stochastic Runge-Kutta Method HOT 1
- What are the user-configurable parameters of the hybrid LSODA algorithm? HOT 1
- Support hybrid RK45 method HOT 2
- Improve messages for COPASI errors HOT 2
- Expose static and steady-state analyses through SED-ML HOT 1
- Mark Steady State Simulations / Scan as supported HOT 3
- Internalize functionality into COPASI itself (obviating the need for this repository) HOT 7
- Setup cron job to pull COPASI releases from PyPi HOT 1
- Substitute algorithm when Radau5 requested for model with events HOT 1
- Substitute hybrid runge kutta and LSODA methods to hybrid RK-45 for models with events HOT 1
- copasi_model_obj_common_name needs to be a string HOT 4
- biosimulators no longer working on macOS HOT 4
- Lowering Cognitive complexity as per SonarCloud
- Docker run command returning "is not a file" error on omex path HOT 1
- Documentation discrepancies between repo and website. HOT 1
- Incorrectly raised Exception regarding number of time points HOT 1
- Biosimulators copasi gives incorrect results that normal copasi doesn't HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from biosimulators_copasi.