CellML Discussion List

Text archives Help


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


Chronological Thread 
  • From: Matthias König <konigmatt AT googlemail.com>
  • To: cellml-discussion AT cellml.org
  • Subject: Re: [cellml-discussion] CellML model not rendered in OpenCOR
  • Date: Wed, 6 Jul 2022 11:09:43 +0200
  • Arc-authentication-results: i=1; relay.mimecast.com; dkim=pass header.d=googlemail.com header.s=20210112 header.b=Za0yHIYd; dmarc=pass (policy=quarantine) header.from=googlemail.com; spf=pass (relay.mimecast.com: domain of konigmatt AT googlemail.com designates 209.85.221.170 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=1657098603; 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=5sro6f9mjuE31TSnUCpC2ui1wrkPLRe2q3os7Iok0wI=; b=d2Fi93zydhOl/+rvWtialzFfLoRAjIrHl2uebiZsKwu2ahJYe9gDRgI+R1af7iqNp0M0nD GTEl0/i1wuIgR216jorVnfgO9WILyQ+FkZBH2J+N0Xz6bBH+q5J0b1Rbsm5jrdaMREYLT7 w7a3ejwhdkkgoEPpLKETzEDC84Ecsej3yRVibtocr33/tv5Y0zNWKR1gr6BqaUjGAvnwDw FgMDQW3bQH6wVc4wJUAGVA80O5lvIcf+qqWQZkVWXsdZfchQCkLay0eGOa9FCW+jnxQsuL 1kdWxQb16EXh+CTDBqwrv/Wmpow/9tPUF1ggdLtxsxwuWq3Ia+4nop7Gzfz4+g==
  • Arc-seal: i=1; s=201903; d=dkim.mimecast.com; t=1657098603; a=rsa-sha256; cv=none; b=LfNIRV06vnh0sJ/ifa04ULkgQO+I4USJOy9S4RxkLhdWZVWwLOsK6p3QB1WcqimaG9fJyt bLeLNtyVwhLI6Wq9jCnOHfRV5B095QTZEZSQzf9vhUb1n6ly0C0v2BbydKjTPzUcuaSbr3 98NUFIFwWTbeUojvomYcf9pILlk3vv307IFIz7YYNnLkerIOg600oBhRvpg4dIdY7NgtBM iB+lunWIkEMc03DBK+u3QpjWpaVeJkBGsDHioSvREV8IMIqC1sYe/iyEJve5TXaUcdGXhe /3Hj3IB4PNor5f9wctaQ4sTLdaXy2qtpXuHN3u34Xv8og7gKRNZFO31i+rTRug==
  • Authentication-results: relay.mimecast.com; dkim=pass header.d=googlemail.com header.s=20210112 header.b=Za0yHIYd; dmarc=pass (policy=quarantine) header.from=googlemail.com; spf=pass (relay.mimecast.com: domain of konigmatt AT googlemail.com designates 209.85.221.170 as permitted sender) smtp.mailfrom=konigmatt AT googlemail.com

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/Lx3yCGv0kQtGj8ljIKWOb-?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_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/3XG-CJyBn7I50nz0uGAcbc?domain=livermetabolism.com
> konigmatt AT googlemail.com
> https://protect-au.mimecast.com/s/PrmnCK1Do5Hm31w3T3xRDf?domain=twitter.com
> https://protect-au.mimecast.com/s/N76jCL7Ep5F4E3OEUmRwVk?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/3XG-CJyBn7I50nz0uGAcbc?domain=livermetabolism.com
konigmatt AT googlemail.com
https://protect-au.mimecast.com/s/PrmnCK1Do5Hm31w3T3xRDf?domain=twitter.com
https://protect-au.mimecast.com/s/N76jCL7Ep5F4E3OEUmRwVk?domain=github.com



Archive powered by MHonArc 2.6.18.

Top of page