CellML Discussion List

Text archives Help


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


Chronological Thread 
  • From: Alan Garny <a.garny AT auckland.ac.nz>
  • To: "cellml-discussion AT cellml.org" <cellml-discussion AT cellml.org>
  • Subject: Re: [cellml-discussion] CellML model not rendered in OpenCOR
  • Date: Tue, 5 Jul 2022 20:55:25 +0000
  • Accept-language: en-NZ, en-GB, en-US
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=auckland.ac.nz
  • Suggested_attachment_session_id: 6a413163-2687-3acf-5e43-7f03ebb13595

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="http://www.cellml.org/cellml/2.0#<http://www.cellml.org/cellml/2.0#>"
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://livermetabolism.com<https://livermetabolism.com>
konigmatt AT googlemail.com<mailto:konigmatt AT googlemail.com>
https://twitter.com/konigmatt<https://twitter.com/konigmatt>
https://github.com/matthiaskoenig<https://github.com/matthiaskoenig>



Archive powered by MHonArc 2.6.18.

Top of page