PyCml - CellML Tools in Python
This page is about PyCml, a project developing some CellML processing tools using the Python programming language. These tools
will also be made available and further developed as part of the Chaste project, primarily by Jonathan
Cooper.
As of Chaste version 1.1, PyCml is fully integrated into the main Chaste
code, and the most up-to-date version of the software can be obtained with
Chaste.
Validation
The first component of PyCml is a validator for CellML 1.0. It uses the RELAX NG and Schematron validation languages where
appropriate.
Main features
The various schema documents, and the full validation program, are
available to download below. There is also a web interface to the
validator, enabling you to validate your documents from this site.
The tools and files are made available under the
LGPL
licence as part of
Chaste.
Web-based validation
Known limitations
- Metadata validation does not assert anything about the content of
<rdf:RDF> elements.
- Units checking will try to evaluate the <degree> qualifier and the
exponent of an application of <power>, and will generate a warning if
it is unable to do so. Generally it only supports the CellML subset of MathML.
- User-defined relationship types are not well supported.
- The specification doesn't require models to be dimensionally consistent. By default this validator will declare inconsistent models to be invalid, however. There is an option to demote units errors to warnings, which is more consistent with the specification.
- Queries on the specification:
- Rule 2.5.2 conflicts with the standard interpretation of attribute
namespaces. Attributes without an explicit namespace are considered to be
in the null (local) namespace, not the namespace of the parent element.
- Paragraph 3 of section 4.2.1 is misleading, and conflicts with
section 7.2. In particular, “These expressions may make use of any
variable declared in the current component but must only modify the value of
the variable referenced by the ancestor <cellml:variable_ref>
element” implies the opposite of “In all other cases, the
equations relate an intermediate variable used in the rate calculation to
the variable referenced by the containing <variable_ref> element. For
instance, it would be appropriate to calculate an effective concentration of
a catalyst inside the <role> element contained by the
<variable_ref> element that references the variable representing the
actual concentration of the catalyst.” I go with the latter.
- Equation (14) in appendix C.3.4 appears to be missing
"o1 +"
- Appendix C.3.5 step 1 suggests that the algorithm of C.3.4
performs simplification, whereas it is the algorithm of C.3.1 that is
described as simplifying units, and that algorithm is not appropriate for
use in a units conversion context as it discards multipliers. This could
perhaps be made clearer.
- The operand of <exp> is required to have units of
dimensionless
, but many ionic models have membrane potentials
as operands. This software follows the spec at present, and will likely
continue to do so.
- The specification of units checking doesn't mention the
<piecewise> element. I require all the cases to have dimensionally
equivalent units, and the tests to have units of
cellml:boolean
.
Transformation
The original purpose of the validator was to provide sufficiently
draconian validation as a basis for transforming CellML. The tools
available for download below perform the transformations described in the
paper
J. Cooper, S. McKeever
and A. Garny, “On the application of partial evaluation to the optimisation
of cardiac electrophysiological simulations”, Proceedings PEPM
2006,
p12-20
and in Jonathan's D.Phil. thesis.
The transformation code is not as user-friendly as the validator, but is
usable especially to generate code compatible with Chaste.
Some extra documentation is also available to aid
understanding of the code.
Files available for download