Is there a python library with which I can generate CellML 1.0/1.1?
Hi Alan,
thanks for the answer.
So do I understand correctly,
- the main library libcellml (corresponding to the python package libcellml) only generates cellml 2.0
- the main simulator OpenCOR only supports CellML version 1.0/1.1
This seems like a major bottleneck in CellML support at the moment.
Is there a python library with which I can generate CellML 1.0/1.1?
As part of a google summer of code project we working on a showcase of the COMBINE standards with jupyter notebooks. Currently we are working on the CellML repressilator model, i.e. we want to create & simulate the model using CellML python libraries.
Is there a simple workflow to create and simulate CellML with python (preferable using OpenCOR)?
Are there any good converters? I know of antimony which uses the old cellml library. Is there anything else for CellML -> SBML or other ODE format (e.g. writing CVODE code or similar things).
As I understand cellml most of the things should be convertable to SBML with exception of models not using time as a dependent variable and likely some strange event syntax? Is this true or are there other conversion issues?
Best Matthias
On Wed, Jul 6, 2022 at 1:09 AM Alan Garny
<a.garny AT auckland.ac.nz>
wrote:
No, only from CellML 1.0/1.1 to CellML 2.0.
We use XSLT for that conversion and I am not sure we could do
something similar for CellML 2.0 to CellML 1.0/1.1. Indeed, in
CellML 2.0, connections don't hold any directionality information.
So, to convert CellML 2.0 to CellML 1.0/1.1 would require
analysing the model to determine that directionality information.
So, yes, it wouldn't be as straightforward as converting from
CellML 1.0/1.1 to CellML 2.0.
Alan
------------------------------------------------------------------------
*From:*
cellml-discussion-request AT lists.cellml.org
<cellml-discussion-request AT lists.cellml.org>
on behalf of Lucian
Smith
<lucianoelsmitho AT gmail.com>
*Sent:* Wednesday, 6 July 2022 9:15 am
*To:* CellML Discussion List
<cellml-discussion AT cellml.org>
*Subject:* Re: [cellml-discussion] CellML model not rendered in
OpenCOR
Is there a converter from CellML 2.0 to 1.1?
On Tue, Jul 5, 2022 at 1:55 PM Alan Garny
<a.garny AT auckland.ac.nz>
wrote:
Hi Matthias,
Sorry, but libCellML generates CellML 2.0 models while OpenCOR
"only" supports CellML 1.0/1.1 at this stage. So, yes, using
OpenCOR, you won't be able to edit/run any model generated by
libCellML.
Support for CellML 2.0 in OpenCOR is planned, but it is still
some time away. This will be done through libOpenCOR,
OpenCOR's new backend which will be using libCellML rather
than the original CellML API. (The reason for going the
libOpenCOR route is that libOpenCOR will greatly improve our
Python bindings.)
Hopefully, I will have more information to share at COMBINE in
October.
Alan
------------------------------------------------------------------------
*From:*
cellml-discussion-request AT lists.cellml.org
<cellml-discussion-request AT lists.cellml.org>
on behalf of
Matthias König
<konigmatt AT googlemail.com>
*Sent:* Wednesday, 6 July 2022 3:17 am
*To:*
cellml-discussion AT lists.cellml.org
<cellml-discussion AT lists.cellml.org>
*Subject:* [cellml-discussion] CellML model not rendered in
OpenCOR
Hi all,
I am trying to create the repressilator in CellML as part of a
project via the python binding.
Unfortunately, the created models (cellml v2.0) are not
rendered in OpenCOR. I.e. normally I see nice CellML Text in
the editor, but for the attached model nothing is displayed.
```
<?xml version="1.0" encoding="UTF-8"?>
<model
xmlns="https://protect-au.mimecast.com/s/Pre5Clx1yMUpgWpxh9-a_h?domain=cellml.org"
name="repressilator">
<component name="parameters">
<variable name="n" units="dimensionless" initial_value="2"/>
</component>
</model>
```
Model was created using libcellml via
```
import libcellml
from cellml_utilitiesimport print_model
def create_model(cellml_path: Path) -> libcellml.Model:
"""Create CellML repressilator and save to Path.""" model =
libcellml.Model()
model.setName("repressilator")
comp_parameters = libcellml.Component()
comp_parameters.setName("parameters")
model.addComponent(comp_parameters)
# var n: dimensionless {init: 2, pub: out}; var_n =
libcellml.Variable()
var_n.setName("n")
var_n.setInitialValue(2.0)
var_n.setUnits("dimensionless")
# var_n.setInterfaceType() comp_parameters.addVariable(var_n)
# Checking that it worked print_model(model)
# Save model printer = libcellml.Printer()
serialised_model:str = printer.printModel(model)
with open(cellml_path, "w")as f_cellml:
f_cellml.write(serialised_model)
return model
```
How can I create models with python libcellml which I can
use/edit/view in OpenCOR?
Best Matthias
-- Matthias König, PhD.
Junior Group Leader Systems Medicine of the Liver Lab
Humboldt-Universität zu Berlin,
Institute of Biology, Institute for Theoretical Biology
Philippstraße 13, Haus 20, 10115 Berlin
Tel: +49 30 2093 98435
https://protect-au.mimecast.com/s/d12mCmO5zMuDEVDzTBt4sF?domain=livermetabolism.com
konigmatt AT googlemail.com
https://protect-au.mimecast.com/s/JJ4DCnx1ANUjM4jvFZcHZu?domain=twitter.com
<https://protect-au.mimecast.com/s/JJ4DCnx1ANUjM4jvFZcHZu?domain=twitter.com>
https://protect-au.mimecast.com/s/SJ_kCoV1B6fZxAZESOmnid?domain=github.com
<https://protect-au.mimecast.com/s/SJ_kCoV1B6fZxAZESOmnid?domain=github.com>
--
Matthias König, PhD.
Junior Group Leader Systems Medicine of the Liver Lab
Humboldt-Universität zu Berlin,
Institute of Biology, Institute for Theoretical Biology
Philippstraße 13, Haus 20, 10115 Berlin
Tel: +49 30 2093 98435
https://protect-au.mimecast.com/s/d12mCmO5zMuDEVDzTBt4sF?domain=livermetabolism.com
konigmatt AT googlemail.com
https://protect-au.mimecast.com/s/JJ4DCnx1ANUjM4jvFZcHZu?domain=twitter.com
<https://protect-au.mimecast.com/s/JJ4DCnx1ANUjM4jvFZcHZu?domain=twitter.com>
https://protect-au.mimecast.com/s/SJ_kCoV1B6fZxAZESOmnid?domain=github.com
<https://protect-au.mimecast.com/s/SJ_kCoV1B6fZxAZESOmnid?domain=github.com>
Archive powered by MHonArc 2.6.18.