CellML Discussion List

Text archives Help


Re: [cellml-discussion] CellML model not rendered in OpenCOR


Chronological Thread 
  • From: Michael Clerx <work AT michaelclerx.com>
  • To: cellml-discussion AT lists.cellml.org
  • Subject: Re: [cellml-discussion] CellML model not rendered in OpenCOR
  • Date: Wed, 6 Jul 2022 11:11:27 +0100
  • Arc-authentication-results: i=1; relay.mimecast.com; dkim=fail ("body hash did not verify") header.d=michaelclerx.com header.s=default header.b=jKdCfjsK; dkim=fail ("body hash did not verify") header.d=michaelclerx.com header.s=default header.b="x/4laCse"; dmarc=pass (policy=none) header.from=michaelclerx.com; spf=pass (relay.mimecast.com: domain of work AT michaelclerx.com designates 136.144.244.199 as permitted sender) smtp.mailfrom=work AT michaelclerx.com
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=dkim.mimecast.com; s=201903; t=1657102295; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:dkim-signature; bh=2qf8r8O5VhI7AahhDgH+vFxXJhi6SZO31AjR+y2YP/A=; b=JlT/Yfzn1V5eEMLacezlIMJXdQoND1Kyz1G86pJPHd7OtKkdV9+m4tgDpdWJp+BnuLsKrw Z6x6zuFJstvQiPQw//xEiQPdUzajuvJkBPWvjwgEMX8Xmb044s1wd2saDwupvMF8NrdARF foFZr5y8dzLEM4Xus5xsqHIXClRM5GMVrs3Vu+ynNL8XW/Gs73ynxlpsUJ7ABuJxeGZ4jY ivlJsUdQhcDwPDj7fmevZ4HsZYz+H7EjDrDOXdn2f+XhyXfT7CPBGtJnKBAZ3uHzF9Ulxi 09RYaDcAjXd7HD7bRsecH8FyHK9uhZnT0jCrdiszA3Yy+WgQVTpoYApjWlFmMA==
  • Arc-seal: i=1; s=201903; d=dkim.mimecast.com; t=1657102295; a=rsa-sha256; cv=none; b=J8QV0W08Kt6RmVUyNI811viEVHBY9MkCtRKK+fWgQUGer0RX7u/Xl4XhXqN//2jnEVEoSE GRGzDrDAzae04PaB9OcJt8IMnrJqdnXyAnythmuFBUPFu2DGQ8lQZL54NJqOqbTaRKLwno 0vrpZVwVJVzavTA/q4T7HrAtWiYLwO6jTbniFpt7UuqxL5BzcBDMPXQMert7SOeBSzjVxI CL6Y+eFbASmdb8vaoZJNzwGREtIVSLPWjalPP7tezaCGagXwAZfZW88TXeeCeDJZQVG6Jx ppLc0Asu0u4a/c4+OQKw/IunA47lnj5HRxkB8gPFFfhJof60Kt9AB6/9QD9KIQ==
  • Authentication-results: relay.mimecast.com; dkim=fail ("body hash did not verify") header.d=michaelclerx.com header.s=default header.b=jKdCfjsK; dkim=fail ("body hash did not verify") header.d=michaelclerx.com header.s=default header.b="x/4laCse"; dmarc=pass (policy=none) header.from=michaelclerx.com; spf=pass (relay.mimecast.com: domain of work AT michaelclerx.com designates 136.144.244.199 as permitted sender) smtp.mailfrom=work AT michaelclerx.com

On 7/6/22 10:09, Matthias König wrote:

Is there a python library with which I can generate CellML 1.0/1.1?

Hi Matthias,

Myokit is a Python library that can import and export CellML 1.0 and 1.1 (with exceptions, see here: https://protect-au.mimecast.com/s/TNtTCk81xOH1mD19S2181g?domain=github.com, the main one being imports)

Since April 2020 it can also import and export CellML 2.0 (without imports or resets)

It can import SBML (with some serious improvements in support in the last 2 years: it is now being used for PKPD modelling with SBML models)

It can export to C with euler or CVODES, matlab, html, latex and python, and various formats specifically for cardiac cell modelling (EasyML, OpenCL and CUDA multi-cell simulations, plus import of ephys data from ABF and WCP)

So yeah it's called "import" and "export" and there's an intermediate representation which users can read (like OpenCOR has too) so some structure & names won't get carried over, but apart from those cosmetic issues... You can definitely import SBML and export CellML 1.0, 1.1, or 2.0 with Myokit :D

Myokit's main goal is to simulate stuff with CVODES, so you can do that too.

Cheers,
  Michael






On 7/6/22 10:09, Matthias König wrote:
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.

Top of page