- From: Matthias König <konigmatt AT googlemail.com>
- To: cellml-discussion AT cellml.org
- Cc: cellml-discussion AT lists.cellml.org
- Subject: Re: [cellml-discussion] CellML model not rendered in OpenCOR
- Date: Wed, 6 Jul 2022 16:46:23 +0200
- Arc-authentication-results: i=1; relay.mimecast.com; dkim=pass header.d=googlemail.com header.s=20210112 header.b=hsnW1Bhl; dmarc=pass (policy=quarantine) header.from=googlemail.com; spf=pass (relay.mimecast.com: domain of konigmatt AT googlemail.com designates 209.85.217.54 as permitted sender) smtp.mailfrom=konigmatt AT googlemail.com
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=dkim.mimecast.com; s=201903; t=1657118801; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references:dkim-signature; bh=aC+Rt6mvUdK+v7coTKYG4l9VCZexQHBCJ90E4Hru6zY=; b=lCBmY6iM09XmknWWugn2H7gsMz9o8923pjvRuLz4ueoD9Vbn7QPB+MyTu2eYvGbQHw0bH1 K3IOK+EPOtB3su/Uya8ggHGst4p4Vr0Rgt6A/Rd8xIbSwKpVwgV7h8pJ5X9bWiCjKhMb42 h2QquuBz4jTCMseUJXAOrdOTc6Z95TCuCMG+r3XmeOqEB3zXYf3ges4rh65y+srSIsxCps 96q9ti5Km2e/C/CUv9qL0hbKn3wIhpQfzXzLfemrKAT8474p0RccEwQEi70o1jluQkNv86 2BlifiiobNgwWazZ8shN/Yxs8LRqCjwMVrODDczGs02tyWfV7rdKoH7r/JXk1A==
- Arc-seal: i=1; s=201903; d=dkim.mimecast.com; t=1657118801; a=rsa-sha256; cv=none; b=IOkPh/Y9NkVkwo/aQxQTFVahMElV6YMkZNttFSofWNqrClaRNm2iJ0FcYWSCZau2QMeO6S z68JCwnufG8DBrRLkCXCRl29aauMXw8LB1Tx4iHjUO4bFlrKC5ig2421vMoYqURJnZNdiY glmAr8pD1lpi6p9P4+6QSTaALv1HXe4f1HpMXMDpoT2rmbXLoX+ShiggDrbZ4z2RdNhUU9 v5CgG8fMgnohR/4ItqEP7P6zVo5Hz/HWvhhwjZP30qxKdLwp/ZWVPmwCrGUZKvCAtzFIHd TbtKGNIQbSo9d13awqQPd0BRvIINajNuslVxVjtpySPBuhrwG7CA2v7iYCoAQw==
- Authentication-results: relay.mimecast.com; dkim=pass header.d=googlemail.com header.s=20210112 header.b=hsnW1Bhl; dmarc=pass (policy=quarantine) header.from=googlemail.com; spf=pass (relay.mimecast.com: domain of konigmatt AT googlemail.com designates 209.85.217.54 as permitted sender) smtp.mailfrom=konigmatt AT googlemail.com
Hi Michael,
thanks. This looks great and exactly what I was looking for.
I will give it a try.
Best Matthias
On Wed, Jul 6, 2022 at 12:11 PM Michael Clerx
<work AT michaelclerx.com>
wrote:
>
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/FbW1CANpL9H27XOGFG1Ki5?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/6XxTCBNqMRHBErKzT6BuFo?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 libcellmlfrom cellml_utilities import 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/LjtwCD1vOJH0gzADTAESHv?domain=livermetabolism.com
>
> konigmatt AT googlemail.com
>
> https://protect-au.mimecast.com/s/eK_vCE8wg6HMR2xkuPpvJd?domain=twitter.com
>
> https://protect-au.mimecast.com/s/22BlCGv0kQtGjR42Fk3BB6?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/LjtwCD1vOJH0gzADTAESHv?domain=livermetabolism.com
>
konigmatt AT googlemail.com
>
https://protect-au.mimecast.com/s/eK_vCE8wg6HMR2xkuPpvJd?domain=twitter.com
>
https://protect-au.mimecast.com/s/22BlCGv0kQtGjR42Fk3BB6?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/LjtwCD1vOJH0gzADTAESHv?domain=livermetabolism.com
konigmatt AT googlemail.com
https://protect-au.mimecast.com/s/eK_vCE8wg6HMR2xkuPpvJd?domain=twitter.com
https://protect-au.mimecast.com/s/22BlCGv0kQtGjR42Fk3BB6?domain=github.com
Archive powered by MHonArc 2.6.18.