# This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.5
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2, 6, 0):
def swig_import_helper():
from os.path import dirname
import imp
fp = None
try:
fp, pathname, description = imp.find_module('_libsbml', [dirname(__file__)])
except ImportError:
import _libsbml
return _libsbml
if fp is not None:
try:
_mod = imp.load_module('_libsbml', fp, pathname, description)
finally:
fp.close()
return _mod
_libsbml = swig_import_helper()
del swig_import_helper
else:
import _libsbml
del version_info
try:
_swig_property = property
except NameError:
pass # Python < 2.2 doesn't have 'property'.
def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
if (name == "thisown"):
return self.this.own(value)
if (name == "this"):
if type(value).__name__ == 'SwigPyObject':
self.__dict__[name] = value
return
method = class_type.__swig_setmethods__.get(name, None)
if method:
return method(self, value)
if (not static):
if _newclass:
object.__setattr__(self, name, value)
else:
self.__dict__[name] = value
else:
raise AttributeError("You cannot add attributes to %s" % self)
def _swig_setattr(self, class_type, name, value):
return _swig_setattr_nondynamic(self, class_type, name, value, 0)
def _swig_getattr_nondynamic(self, class_type, name, static=1):
if (name == "thisown"):
return self.this.own()
method = class_type.__swig_getmethods__.get(name, None)
if method:
return method(self)
if (not static):
return object.__getattr__(self, name)
else:
raise AttributeError(name)
def _swig_getattr(self, class_type, name):
return _swig_getattr_nondynamic(self, class_type, name, 0)
def _swig_repr(self):
try:
strthis = "proxy of " + self.this.__repr__()
except:
strthis = ""
return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
try:
_object = object
_newclass = 1
except AttributeError:
class _object:
pass
_newclass = 0
try:
import weakref
weakref_proxy = weakref.proxy
except:
weakref_proxy = lambda x: x
class ModelCreatorList(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, ModelCreatorList, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, ModelCreatorList, name)
__repr__ = _swig_repr
def __init__(self):
this = _libsbml.new_ModelCreatorList()
try:
self.this.append(this)
except:
self.this = this
__swig_destroy__ = _libsbml.delete_ModelCreatorList
__del__ = lambda self: None
def add(self, item):
return _libsbml.ModelCreatorList_add(self, item)
def get(self, n):
return _libsbml.ModelCreatorList_get(self, n)
def prepend(self, item):
return _libsbml.ModelCreatorList_prepend(self, item)
def remove(self, n):
return _libsbml.ModelCreatorList_remove(self, n)
def getSize(self):
return _libsbml.ModelCreatorList_getSize(self)
ModelCreatorList_swigregister = _libsbml.ModelCreatorList_swigregister
ModelCreatorList_swigregister(ModelCreatorList)
class DateList(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, DateList, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, DateList, name)
__repr__ = _swig_repr
def __init__(self):
this = _libsbml.new_DateList()
try:
self.this.append(this)
except:
self.this = this
__swig_destroy__ = _libsbml.delete_DateList
__del__ = lambda self: None
def add(self, item):
return _libsbml.DateList_add(self, item)
def get(self, n):
return _libsbml.DateList_get(self, n)
def prepend(self, item):
return _libsbml.DateList_prepend(self, item)
def remove(self, n):
return _libsbml.DateList_remove(self, n)
def getSize(self):
return _libsbml.DateList_getSize(self)
DateList_swigregister = _libsbml.DateList_swigregister
DateList_swigregister(DateList)
class CVTermList(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, CVTermList, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, CVTermList, name)
__repr__ = _swig_repr
def __init__(self):
this = _libsbml.new_CVTermList()
try:
self.this.append(this)
except:
self.this = this
__swig_destroy__ = _libsbml.delete_CVTermList
__del__ = lambda self: None
def add(self, item):
return _libsbml.CVTermList_add(self, item)
def get(self, n):
return _libsbml.CVTermList_get(self, n)
def prepend(self, item):
return _libsbml.CVTermList_prepend(self, item)
def remove(self, n):
return _libsbml.CVTermList_remove(self, n)
def getSize(self):
return _libsbml.CVTermList_getSize(self)
CVTermList_swigregister = _libsbml.CVTermList_swigregister
CVTermList_swigregister(CVTermList)
class ASTNodeList(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, ASTNodeList, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, ASTNodeList, name)
__repr__ = _swig_repr
def __init__(self):
this = _libsbml.new_ASTNodeList()
try:
self.this.append(this)
except:
self.this = this
__swig_destroy__ = _libsbml.delete_ASTNodeList
__del__ = lambda self: None
def add(self, item):
return _libsbml.ASTNodeList_add(self, item)
def get(self, n):
return _libsbml.ASTNodeList_get(self, n)
def prepend(self, item):
return _libsbml.ASTNodeList_prepend(self, item)
def remove(self, n):
return _libsbml.ASTNodeList_remove(self, n)
def getSize(self):
return _libsbml.ASTNodeList_getSize(self)
ASTNodeList_swigregister = _libsbml.ASTNodeList_swigregister
ASTNodeList_swigregister(ASTNodeList)
class SBMLNamespacesList(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, SBMLNamespacesList, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, SBMLNamespacesList, name)
__repr__ = _swig_repr
def __init__(self):
this = _libsbml.new_SBMLNamespacesList()
try:
self.this.append(this)
except:
self.this = this
__swig_destroy__ = _libsbml.delete_SBMLNamespacesList
__del__ = lambda self: None
def add(self, item):
return _libsbml.SBMLNamespacesList_add(self, item)
def get(self, n):
return _libsbml.SBMLNamespacesList_get(self, n)
def prepend(self, item):
return _libsbml.SBMLNamespacesList_prepend(self, item)
def remove(self, n):
return _libsbml.SBMLNamespacesList_remove(self, n)
def getSize(self):
return _libsbml.SBMLNamespacesList_getSize(self)
SBMLNamespacesList_swigregister = _libsbml.SBMLNamespacesList_swigregister
SBMLNamespacesList_swigregister(SBMLNamespacesList)
class SBaseList(_object):
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, SBaseList, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, SBaseList, name)
__repr__ = _swig_repr
def __init__(self):
this = _libsbml.new_SBaseList()
try:
self.this.append(this)
except:
self.this = this
__swig_destroy__ = _libsbml.delete_SBaseList
__del__ = lambda self: None
def add(self, item):
return _libsbml.SBaseList_add(self, item)
def get(self, n):
return _libsbml.SBaseList_get(self, n)
def prepend(self, item):
return _libsbml.SBaseList_prepend(self, item)
def remove(self, n):
return _libsbml.SBaseList_remove(self, n)
def getSize(self):
return _libsbml.SBaseList_getSize(self)
SBaseList_swigregister = _libsbml.SBaseList_swigregister
SBaseList_swigregister(SBaseList)
class AutoProperty(type):
"""
Auto-detect Python class getX/setX methods.
This class is attached to SBase and automatically applies for all classes
which inherit from it. Its purpose is to make libSBML more convenient to
use from Python. It works by analyzing classes at class creation time
(not at instantiation) and adding corresponding properties (directly
calling C methods where possible) to the class dictionary.
@note The code should work for python 2.6 upwards, however for python 3 it
needs to be attached via constructors.
"""
def __new__(cls, classname, bases, classdict):
"""
Iterate over the items in the classdict looking for get/set pairs
and declaring them as properties.
"""
import re
import keyword
import inspect
re_mangle = re.compile(r'[A-Za-z][a-z]+|[A-Z]+(?=$|[A-Z0-9])|\d+')
re_id = re.compile(r'^[A-Za-z_][A-Za-z0-9_]*$')
re_getdoc = re.compile(r'^\s*[A-Za-z_][A-Za-z0-9_]*\(self\)')
re_setdoc = re.compile(r'^\s*[A-Za-z_][A-Za-z0-9_]*\(self,[^,)]+\)')
#convert ACapitalCasedStringXYZ123 -> a_capital_cased_string_xyz_123
mangle_name = lambda x: ('_'.join(re_mangle.findall(x))).lower()
get_methods = set()
set_methods = set()
swig_setter = classdict.get('__swig_setmethods__', {})
allowed_methods = [
'Annotation',
'AnnotationString',
'Notes',
'NotesString',
]
#only search for get/set methods
#we assume that any unset method also has either get or set
#a small number of set without get cases exist so we can't only
#search for get methods
for k, v in classdict.items():
name = k[3:]
prefix = k[:3]
mangled = mangle_name(name)
if name:
if callable(v):
if re_id.match(mangled) and mangled not in keyword.kwlist:
if prefix == 'get':
get_methods.add(name)
elif prefix == 'set':
set_methods.add(name)
for name in get_methods | set_methods:
mangled = mangle_name(name)
#ListOfFoobars -> foobars
if mangled.startswith('list_of_'):
mangled = mangled[8:]
getter = setter = deleter = None
if name in get_methods:
getter = classdict['get'+name]
#this is a very dirty way of checking if the get method
#requires extra arguments (and hence cannot be a property)
#it should be possible to do this properly in SWIG?
try:
argspec = inspect.getargspec(getter)
numargs = len(argspec.args)
if numargs > 1 or (numargs == 1 and argspec.args[0] != 'self') \
or (argspec.varargs!=None and name not in allowed_methods and not name.startswith('ListOf') ):
continue
except:
continue
#use the c-level get function if the python function
#only consists of a call to it
cname = classname + '_get' + name
#test if function is "return _libsbml.CLASS_getNAME(__args__)"
try:
if getter.func_code.co_names == ('_libsbml', cname):
getter = getattr(_libsbml, cname)
except:
if getter.__code__.co_names == ('_libsbml', cname):
getter = getattr(_libsbml, cname)
if name in set_methods:
setter = classdict['set'+name]
try:
argspec = inspect.getargspec(getter)
numargs = len(argspec.args)
if numargs > 1 and argspec.args[0] == 'self':
cname = classname + '_set' + name
try:
if setter.func_code.co_names == ('_libsbml', cname):
setter = getattr(_libsbml, cname)
except:
if setter.__code__.co_names == ('_libsbml', cname):
setter = getattr(_libsbml, cname)
#property fget does not get intercepted by __getattr__
#but fset does, so we implement property setting via
#the __swig_setmethods__ dict
swig_setter[mangled] = setter
continue
except:
pass
if 'unset' + name in classdict:
deleter = classdict['unset'+name]
try:
argspec = inspect.getargspec(getter)
numargs = len(argspec.args)
if numargs == 1 and argspec.args[0] == 'self' and \
(argspec.varargs==None or name in allowed_methods):
cname = classname + '_unset' + name
try:
if deleter.func_code.co_names == ('_libsbml', cname):
deleter = getattr(_libsbml, cname)
except:
if deleter.__code__.co_names == ('_libsbml', cname):
deleter = getattr(_libsbml, cname)
except:
pass
if getter or setter or deleter:
#fset is technically redundant since the method is dispatched
#via _swig_setattr rather than through the property due to that
#function not delegating to object.__setattr__ which properly
#handles properties
classdict[mangled] = property(fget=getter, fset=setter, fdel=deleter)
def __repr__(self):
desc = self.__class__.__name__
if hasattr(self, '__len__'):
desc += '[%s]' % self.__len__()
if hasattr(self, 'id') and self.id:
desc += ' %s' % self.id
if hasattr(self, 'name') and self.name:
desc += ' "%s"' % self.name
return '<' + desc + '>'
if classdict.get('__repr__', None) in (_swig_repr, None):
classdict['__repr__'] = __repr__
return type.__new__(cls, classname, bases, classdict)
class SwigPyIterator(_object):
"""Proxy of C++ swig::SwigPyIterator class"""
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, SwigPyIterator, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, SwigPyIterator, name)
def __init__(self, *args, **kwargs):
raise AttributeError("No constructor defined - class is abstract")
__repr__ = _swig_repr
__swig_destroy__ = _libsbml.delete_SwigPyIterator
__del__ = lambda self: None
def value(self):
"""value(SwigPyIterator self) -> PyObject *"""
return _libsbml.SwigPyIterator_value(self)
def incr(self, n=1):
"""
incr(SwigPyIterator self, size_t n=1) -> SwigPyIterator
incr(SwigPyIterator self) -> SwigPyIterator
"""
return _libsbml.SwigPyIterator_incr(self, n)
def decr(self, n=1):
"""
decr(SwigPyIterator self, size_t n=1) -> SwigPyIterator
decr(SwigPyIterator self) -> SwigPyIterator
"""
return _libsbml.SwigPyIterator_decr(self, n)
def distance(self, x):
"""distance(SwigPyIterator self, SwigPyIterator x) -> ptrdiff_t"""
return _libsbml.SwigPyIterator_distance(self, x)
def equal(self, x):
"""equal(SwigPyIterator self, SwigPyIterator x) -> bool"""
return _libsbml.SwigPyIterator_equal(self, x)
def copy(self):
"""copy(SwigPyIterator self) -> SwigPyIterator"""
return _libsbml.SwigPyIterator_copy(self)
def next(self):
"""next(SwigPyIterator self) -> PyObject *"""
return _libsbml.SwigPyIterator_next(self)
def __next__(self):
"""__next__(SwigPyIterator self) -> PyObject *"""
return _libsbml.SwigPyIterator___next__(self)
def previous(self):
"""previous(SwigPyIterator self) -> PyObject *"""
return _libsbml.SwigPyIterator_previous(self)
def advance(self, n):
"""advance(SwigPyIterator self, ptrdiff_t n) -> SwigPyIterator"""
return _libsbml.SwigPyIterator_advance(self, n)
def __eq__(self, x):
"""__eq__(SwigPyIterator self, SwigPyIterator x) -> bool"""
return _libsbml.SwigPyIterator___eq__(self, x)
def __ne__(self, x):
"""__ne__(SwigPyIterator self, SwigPyIterator x) -> bool"""
return _libsbml.SwigPyIterator___ne__(self, x)
def __iadd__(self, n):
"""__iadd__(SwigPyIterator self, ptrdiff_t n) -> SwigPyIterator"""
return _libsbml.SwigPyIterator___iadd__(self, n)
def __isub__(self, n):
"""__isub__(SwigPyIterator self, ptrdiff_t n) -> SwigPyIterator"""
return _libsbml.SwigPyIterator___isub__(self, n)
def __add__(self, n):
"""__add__(SwigPyIterator self, ptrdiff_t n) -> SwigPyIterator"""
return _libsbml.SwigPyIterator___add__(self, n)
def __sub__(self, *args):
"""
__sub__(SwigPyIterator self, ptrdiff_t n) -> SwigPyIterator
__sub__(SwigPyIterator self, SwigPyIterator x) -> ptrdiff_t
"""
return _libsbml.SwigPyIterator___sub__(self, *args)
def __iter__(self):
return self
SwigPyIterator_swigregister = _libsbml.SwigPyIterator_swigregister
SwigPyIterator_swigregister(SwigPyIterator)
class string(_object):
"""Proxy of C++ std::basic_string<(char)> class"""
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, string, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, string, name)
__repr__ = _swig_repr
def length(self):
"""length(string self) -> std::basic_string< char >::size_type"""
return _libsbml.string_length(self)
def max_size(self):
"""max_size(string self) -> std::basic_string< char >::size_type"""
return _libsbml.string_max_size(self)
def copy(self, __s, __n, __pos=0):
"""
copy(string self, char * __s, std::basic_string< char >::size_type __n, std::basic_string< char >::size_type __pos=0) -> std::basic_string< char >::size_type
copy(string self, char * __s, std::basic_string< char >::size_type __n) -> std::basic_string< char >::size_type
"""
return _libsbml.string_copy(self, __s, __n, __pos)
def c_str(self):
"""c_str(string self) -> char const *"""
return _libsbml.string_c_str(self)
def find(self, *args):
"""
find(string self, char const * __s, std::basic_string< char >::size_type __pos, std::basic_string< char >::size_type __n) -> std::basic_string< char >::size_type
find(string self, string __str, std::basic_string< char >::size_type __pos=0) -> std::basic_string< char >::size_type
find(string self, string __str) -> std::basic_string< char >::size_type
find(string self, char __c, std::basic_string< char >::size_type __pos=0) -> std::basic_string< char >::size_type
find(string self, char __c) -> std::basic_string< char >::size_type
"""
return _libsbml.string_find(self, *args)
def rfind(self, *args):
"""
rfind(string self, string __str, std::basic_string< char >::size_type __pos) -> std::basic_string< char >::size_type
rfind(string self, string __str) -> std::basic_string< char >::size_type
rfind(string self, char const * __s, std::basic_string< char >::size_type __pos, std::basic_string< char >::size_type __n) -> std::basic_string< char >::size_type
rfind(string self, char __c, std::basic_string< char >::size_type __pos) -> std::basic_string< char >::size_type
rfind(string self, char __c) -> std::basic_string< char >::size_type
"""
return _libsbml.string_rfind(self, *args)
def find_first_of(self, *args):
"""
find_first_of(string self, string __str, std::basic_string< char >::size_type __pos=0) -> std::basic_string< char >::size_type
find_first_of(string self, string __str) -> std::basic_string< char >::size_type
find_first_of(string self, char const * __s, std::basic_string< char >::size_type __pos, std::basic_string< char >::size_type __n) -> std::basic_string< char >::size_type
find_first_of(string self, char __c, std::basic_string< char >::size_type __pos=0) -> std::basic_string< char >::size_type
find_first_of(string self, char __c) -> std::basic_string< char >::size_type
"""
return _libsbml.string_find_first_of(self, *args)
def find_last_of(self, *args):
"""
find_last_of(string self, string __str, std::basic_string< char >::size_type __pos) -> std::basic_string< char >::size_type
find_last_of(string self, string __str) -> std::basic_string< char >::size_type
find_last_of(string self, char const * __s, std::basic_string< char >::size_type __pos, std::basic_string< char >::size_type __n) -> std::basic_string< char >::size_type
find_last_of(string self, char __c, std::basic_string< char >::size_type __pos) -> std::basic_string< char >::size_type
find_last_of(string self, char __c) -> std::basic_string< char >::size_type
"""
return _libsbml.string_find_last_of(self, *args)
def find_first_not_of(self, *args):
"""
find_first_not_of(string self, string __str, std::basic_string< char >::size_type __pos=0) -> std::basic_string< char >::size_type
find_first_not_of(string self, string __str) -> std::basic_string< char >::size_type
find_first_not_of(string self, char const * __s, std::basic_string< char >::size_type __pos, std::basic_string< char >::size_type __n) -> std::basic_string< char >::size_type
find_first_not_of(string self, char __c, std::basic_string< char >::size_type __pos=0) -> std::basic_string< char >::size_type
find_first_not_of(string self, char __c) -> std::basic_string< char >::size_type
"""
return _libsbml.string_find_first_not_of(self, *args)
def find_last_not_of(self, *args):
"""
find_last_not_of(string self, string __str, std::basic_string< char >::size_type __pos) -> std::basic_string< char >::size_type
find_last_not_of(string self, string __str) -> std::basic_string< char >::size_type
find_last_not_of(string self, char const * __s, std::basic_string< char >::size_type __pos, std::basic_string< char >::size_type __n) -> std::basic_string< char >::size_type
find_last_not_of(string self, char __c, std::basic_string< char >::size_type __pos) -> std::basic_string< char >::size_type
find_last_not_of(string self, char __c) -> std::basic_string< char >::size_type
"""
return _libsbml.string_find_last_not_of(self, *args)
def substr(self, *args):
"""
substr(string self, std::basic_string< char >::size_type __pos=0, std::basic_string< char >::size_type __n) -> string
substr(string self, std::basic_string< char >::size_type __pos=0) -> string
substr(string self) -> string
"""
return _libsbml.string_substr(self, *args)
def empty(self):
"""empty(string self) -> bool"""
return _libsbml.string_empty(self)
def size(self):
"""size(string self) -> std::basic_string< char >::size_type"""
return _libsbml.string_size(self)
def swap(self, v):
"""swap(string self, string v)"""
return _libsbml.string_swap(self, v)
def erase(self, *args):
"""
erase(string self, std::basic_string< char >::size_type __pos=0, std::basic_string< char >::size_type __n) -> string
erase(string self, std::basic_string< char >::size_type __pos=0) -> string
erase(string self) -> string
erase(string self, std::basic_string< char >::iterator pos) -> std::basic_string< char >::iterator
erase(string self, std::basic_string< char >::iterator first, std::basic_string< char >::iterator last) -> std::basic_string< char >::iterator
"""
return _libsbml.string_erase(self, *args)
def __init__(self, *args):
"""
__init__(std::basic_string<(char)> self, char const * __s, std::basic_string< char >::size_type __n) -> string
__init__(std::basic_string<(char)> self) -> string
__init__(std::basic_string<(char)> self, string arg2) -> string
__init__(std::basic_string<(char)> self, std::basic_string< char >::size_type size, std::basic_string< char >::value_type value) -> string
"""
this = _libsbml.new_string(*args)
try:
self.this.append(this)
except:
self.this = this
def assign(self, *args):
"""
assign(string self, string __str) -> string
assign(string self, string __str, std::basic_string< char >::size_type __pos, std::basic_string< char >::size_type __n) -> string
assign(string self, char const * __s, std::basic_string< char >::size_type __n) -> string
assign(string self, std::basic_string< char >::size_type n, std::basic_string< char >::value_type x)
"""
return _libsbml.string_assign(self, *args)
def resize(self, *args):
"""
resize(string self, std::basic_string< char >::size_type new_size)
resize(string self, std::basic_string< char >::size_type new_size, std::basic_string< char >::value_type x)
"""
return _libsbml.string_resize(self, *args)
def iterator(self):
"""iterator(string self) -> SwigPyIterator"""
return _libsbml.string_iterator(self)
def __iter__(self):
return self.iterator()
def __nonzero__(self):
"""__nonzero__(string self) -> bool"""
return _libsbml.string___nonzero__(self)
def __bool__(self):
"""__bool__(string self) -> bool"""
return _libsbml.string___bool__(self)
def __len__(self):
"""__len__(string self) -> std::basic_string< char >::size_type"""
return _libsbml.string___len__(self)
def __getslice__(self, i, j):
"""__getslice__(string self, std::basic_string< char >::difference_type i, std::basic_string< char >::difference_type j) -> string"""
return _libsbml.string___getslice__(self, i, j)
def __setslice__(self, *args):
"""
__setslice__(string self, std::basic_string< char >::difference_type i, std::basic_string< char >::difference_type j, string v)
__setslice__(string self, std::basic_string< char >::difference_type i, std::basic_string< char >::difference_type j)
"""
return _libsbml.string___setslice__(self, *args)
def __delslice__(self, i, j):
"""__delslice__(string self, std::basic_string< char >::difference_type i, std::basic_string< char >::difference_type j)"""
return _libsbml.string___delslice__(self, i, j)
def __delitem__(self, *args):
"""
__delitem__(string self, std::basic_string< char >::difference_type i)
__delitem__(string self, PySliceObject * slice)
"""
return _libsbml.string___delitem__(self, *args)
def __getitem__(self, *args):
"""
__getitem__(string self, PySliceObject * slice) -> string
__getitem__(string self, std::basic_string< char >::difference_type i) -> std::basic_string< char >::value_type
"""
return _libsbml.string___getitem__(self, *args)
def __setitem__(self, *args):
"""
__setitem__(string self, PySliceObject * slice, string v)
__setitem__(string self, PySliceObject * slice)
__setitem__(string self, std::basic_string< char >::difference_type i, std::basic_string< char >::value_type x)
"""
return _libsbml.string___setitem__(self, *args)
def insert(self, *args):
"""
insert(string self, std::basic_string< char >::size_type __pos1, string __str) -> string
insert(string self, std::basic_string< char >::size_type __pos1, string __str, std::basic_string< char >::size_type __pos2, std::basic_string< char >::size_type __n) -> string
insert(string self, std::basic_string< char >::size_type __pos, char const * __s, std::basic_string< char >::size_type __n) -> string
insert(string self, std::basic_string< char >::size_type __pos, std::basic_string< char >::size_type __n, char __c) -> string
insert(string self, std::basic_string< char >::iterator pos, std::basic_string< char >::value_type x) -> std::basic_string< char >::iterator
insert(string self, std::basic_string< char >::iterator pos, std::basic_string< char >::size_type n, std::basic_string< char >::value_type x)
insert(string self, std::basic_string< char >::iterator __p, std::basic_string< char >::size_type __n, char __c)
"""
return _libsbml.string_insert(self, *args)
def replace(self, *args):
"""
replace(string self, std::basic_string< char >::size_type __pos, std::basic_string< char >::size_type __n, string __str) -> string
replace(string self, std::basic_string< char >::size_type __pos1, std::basic_string< char >::size_type __n1, string __str, std::basic_string< char >::size_type __pos2, std::basic_string< char >::size_type __n2) -> string
replace(string self, std::basic_string< char >::size_type __pos, std::basic_string< char >::size_type __n1, char const * __s, std::basic_string< char >::size_type __n2) -> string
replace(string self, std::basic_string< char >::size_type __pos, std::basic_string< char >::size_type __n1, std::basic_string< char >::size_type __n2, char __c) -> string
replace(string self, std::basic_string< char >::iterator __i1, std::basic_string< char >::iterator __i2, string __str) -> string
replace(string self, std::basic_string< char >::iterator __i1, std::basic_string< char >::iterator __i2, char const * __s, std::basic_string< char >::size_type __n) -> string
replace(string self, std::basic_string< char >::iterator __i1, std::basic_string< char >::iterator __i2, std::basic_string< char >::size_type __n, char __c) -> string
replace(string self, std::basic_string< char >::iterator __i1, std::basic_string< char >::iterator __i2, char const * __k1, char const * __k2) -> string
replace(string self, std::basic_string< char >::iterator __i1, std::basic_string< char >::iterator __i2, std::basic_string< char >::const_iterator __k1, std::basic_string< char >::const_iterator __k2) -> string
"""
return _libsbml.string_replace(self, *args)
def __iadd__(self, v):
"""__iadd__(string self, string v) -> string"""
return _libsbml.string___iadd__(self, v)
def __add__(self, v):
"""__add__(string self, string v) -> string"""
return _libsbml.string___add__(self, v)
def __radd__(self, v):
"""__radd__(string self, string v) -> string"""
return _libsbml.string___radd__(self, v)
def __str__(self):
"""__str__(string self) -> string"""
return _libsbml.string___str__(self)
def __rlshift__(self, out):
"""__rlshift__(string self, ostream out) -> ostream"""
return _libsbml.string___rlshift__(self, out)
def __eq__(self, v):
"""__eq__(string self, string v) -> bool"""
return _libsbml.string___eq__(self, v)
def __ne__(self, v):
"""__ne__(string self, string v) -> bool"""
return _libsbml.string___ne__(self, v)
def __gt__(self, v):
"""__gt__(string self, string v) -> bool"""
return _libsbml.string___gt__(self, v)
def __lt__(self, v):
"""__lt__(string self, string v) -> bool"""
return _libsbml.string___lt__(self, v)
def __ge__(self, v):
"""__ge__(string self, string v) -> bool"""
return _libsbml.string___ge__(self, v)
def __le__(self, v):
"""__le__(string self, string v) -> bool"""
return _libsbml.string___le__(self, v)
__swig_destroy__ = _libsbml.delete_string
__del__ = lambda self: None
string_swigregister = _libsbml.string_swigregister
string_swigregister(string)
cvar = _libsbml.cvar
string.npos = _libsbml.cvar.string_npos
class ostream(_object):
"""Proxy of C++ std::basic_ostream<(char)> class"""
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, ostream, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, ostream, name)
__repr__ = _swig_repr
def __init__(self, __sb):
"""__init__(std::basic_ostream<(char)> self, std::basic_streambuf< char,std::char_traits< char > > * __sb) -> ostream"""
this = _libsbml.new_ostream(__sb)
try:
self.this.append(this)
except:
self.this = this
__swig_destroy__ = _libsbml.delete_ostream
__del__ = lambda self: None
ostream_swigregister = _libsbml.ostream_swigregister
ostream_swigregister(ostream)
class ostringstream(ostream):
"""Proxy of C++ std::basic_ostringstream<(char)> class"""
__swig_setmethods__ = {}
for _s in [ostream]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, ostringstream, name, value)
__swig_getmethods__ = {}
for _s in [ostream]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, ostringstream, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(std::basic_ostringstream<(char)> self, std::ios_base::openmode __mode) -> ostringstream
__init__(std::basic_ostringstream<(char)> self) -> ostringstream
"""
this = _libsbml.new_ostringstream(*args)
try:
self.this.append(this)
except:
self.this = this
__swig_destroy__ = _libsbml.delete_ostringstream
__del__ = lambda self: None
def str(self, *args):
"""
str(ostringstream self) -> string
str(ostringstream self, string __s)
"""
return _libsbml.ostringstream_str(self, *args)
ostringstream_swigregister = _libsbml.ostringstream_swigregister
ostringstream_swigregister(ostringstream)
def endl(arg1):
"""endl(ostream arg1) -> ostream"""
return _libsbml.endl(arg1)
def flush(arg1):
"""flush(ostream arg1) -> ostream"""
return _libsbml.flush(arg1)
import sys
import os.path
# @cond doxygenLibsbmlInternal
def conditional_abspath (filename):
"""conditional_abspath (filename) -> filename
Returns filename with an absolute path prepended, if necessary.
Some combinations of platforms and underlying XML parsers *require*
an absolute path to a filename while others do not. This function
encapsulates the appropriate logic. It is used by readSBML() and
SBMLReader.readSBML().
"""
if sys.platform.find('cygwin') != -1:
return filename
else:
return os.path.abspath(filename)
# @endcond
def readSBML(*args):
"""
readSBML(self, string filename) -> SBMLDocument
Reads an SBML document from a file.
This method is identical to readSBMLFromFile().
If the file named 'filename' does not exist or its content is not
valid SBML, one or more errors will be logged with the SBMLDocument
object returned by this method. Callers can use the methods on
SBMLDocument such as SBMLDocument.getNumErrors() and
SBMLDocument.getError() to get the errors. The object returned by
SBMLDocument.getError() is an SBMLError object, and it has methods to
get the error code, category, and severity level of the problem, as
well as a textual description of the problem. The possible severity
levels range from informational messages to fatal errors; see the
documentation for SBMLError for more information.
If the file 'filename' could not be read, the file-reading error will
appear first. The error code can provide a clue about what happened.
For example, a file might be unreadable (either because it does not
actually exist or because the user does not have the necessary access
priviledges to read it) or some sort of file operation error may have
been reported by the underlying operating system. Callers can check
for these situations using a program fragment such as the following:
reader = SBMLReader()
doc = reader.readSBML(filename)
if doc.getNumErrors() > 0:
if doc.getError(0).getErrorId() == libsbml.XMLFileUnreadable:
# Handle case of unreadable file here.
elif doc.getError(0).getErrorId() == libsbml.XMLFileOperationError:
# Handle case of other file error here.
else:
# Handle other error cases here.
If the given filename ends with the suffix \".gz\" (for example,
\"myfile.xml.gz\"), the file is assumed to be compressed in gzip format
and will be automatically decompressed upon reading. Similarly, if the
given filename ends with \".zip\" or \".bz2\", the file is assumed to be
compressed in zip or bzip2 format (respectively). Files whose names
lack these suffixes will be read uncompressed. Note that if the file
is in zip format but the archive contains more than one file, only the
first file in the archive will be read and the rest ignored.
To read a gzip/zip file, libSBML needs to be configured and linked with
the zlib library at compile time. It also needs to be linked with the
bzip2 library to read files in bzip2 format. (Both of these are the
default configurations for libSBML.) Errors about unreadable files
will be logged if a compressed filename is given and libSBML was not
linked with the corresponding required library.
Parameter 'filename is the name or full pathname of the file to be
read.
Returns a pointer to the SBMLDocument created from the SBML content.
See also SBMLError.
Note:
LibSBML versions 2.x and later versions behave differently in
error handling in several respects. One difference is how early some
errors are caught and whether libSBML continues processing a file in
the face of some early errors. In general, libSBML versions after 2.x
stop parsing SBML inputs sooner than libSBML version 2.x in the face
of XML errors, because the errors may invalidate any further SBML
content. For example, a missing XML declaration at the beginning of
the file was ignored by libSBML 2.x but in version 3.x and later, it
will cause libSBML to stop parsing the rest of the input altogether.
While this behavior may seem more severe and intolerant, it was
necessary in order to provide uniform behavior regardless of which
underlying XML parser (Expat, Xerces, libxml2) is being used by
libSBML. The XML parsers themselves behave differently in their error
reporting, and sometimes libSBML has to resort to the lowest common
denominator.
"""
reader = SBMLReader()
return reader.readSBML(args[0])
_libsbml.LIBSBML_DOTTED_VERSION_swigconstant(_libsbml)
LIBSBML_DOTTED_VERSION = _libsbml.LIBSBML_DOTTED_VERSION
_libsbml.LIBSBML_VERSION_swigconstant(_libsbml)
LIBSBML_VERSION = _libsbml.LIBSBML_VERSION
_libsbml.LIBSBML_VERSION_STRING_swigconstant(_libsbml)
LIBSBML_VERSION_STRING = _libsbml.LIBSBML_VERSION_STRING
def getLibSBMLVersion():
"""
getLibSBMLVersion() -> int
Returns the version number of this copy of libSBML as an integer.
Returns the libSBML version as an integer; version 1.2.3 becomes
10203.
"""
return _libsbml.getLibSBMLVersion()
def getLibSBMLDottedVersion():
"""
getLibSBMLDottedVersion() -> char const *
Returns the version number of this copy of libSBML as a string.
Returns the libSBML version as a string; version 1.2.3 becomes
'1.2.3'.
See also getLibSBMLVersionString().
"""
return _libsbml.getLibSBMLDottedVersion()
def getLibSBMLVersionString():
"""
getLibSBMLVersionString() -> char const *
Returns the version number of this copy of libSBML as a string without
periods.
Returns the libSBML version as a string: version 1.2.3 becomes
'10203'.
See also getLibSBMLDottedVersion().
"""
return _libsbml.getLibSBMLVersionString()
def isLibSBMLCompiledWith(option):
"""
isLibSBMLCompiledWith(char const * option) -> int
Returns an indication whether libSBML has been compiled with against a
specific library.
Parameter 'option' is the library to test against, this can be one of
'expat', 'libxml', 'xerces-c', 'bzip2', 'zip'
Returns 0 in case the libSBML has not been compiled against that
library and non-zero otherwise (for libraries that define an integer
version number that number will be returned).
See also getLibSBMLDependencyVersionOf().
"""
return _libsbml.isLibSBMLCompiledWith(option)
def getLibSBMLDependencyVersionOf(option):
"""
getLibSBMLDependencyVersionOf(char const * option) -> char const *
Returns the version string for the dependency library used.
Parameter 'option' is the library for which the version should be
retrieved, this can be one of 'expat', 'libxml', 'xerces-c', 'bzip2',
'zip'
Returns None in case libSBML has not been compiled against that
library and a version string otherwise.
See also isLibSBMLCompiledWith().
"""
return _libsbml.getLibSBMLDependencyVersionOf(option)
_libsbml.LIBSBML_OPERATION_SUCCESS_swigconstant(_libsbml)
LIBSBML_OPERATION_SUCCESS = _libsbml.LIBSBML_OPERATION_SUCCESS
_libsbml.LIBSBML_INDEX_EXCEEDS_SIZE_swigconstant(_libsbml)
LIBSBML_INDEX_EXCEEDS_SIZE = _libsbml.LIBSBML_INDEX_EXCEEDS_SIZE
_libsbml.LIBSBML_UNEXPECTED_ATTRIBUTE_swigconstant(_libsbml)
LIBSBML_UNEXPECTED_ATTRIBUTE = _libsbml.LIBSBML_UNEXPECTED_ATTRIBUTE
_libsbml.LIBSBML_OPERATION_FAILED_swigconstant(_libsbml)
LIBSBML_OPERATION_FAILED = _libsbml.LIBSBML_OPERATION_FAILED
_libsbml.LIBSBML_INVALID_ATTRIBUTE_VALUE_swigconstant(_libsbml)
LIBSBML_INVALID_ATTRIBUTE_VALUE = _libsbml.LIBSBML_INVALID_ATTRIBUTE_VALUE
_libsbml.LIBSBML_INVALID_OBJECT_swigconstant(_libsbml)
LIBSBML_INVALID_OBJECT = _libsbml.LIBSBML_INVALID_OBJECT
_libsbml.LIBSBML_DUPLICATE_OBJECT_ID_swigconstant(_libsbml)
LIBSBML_DUPLICATE_OBJECT_ID = _libsbml.LIBSBML_DUPLICATE_OBJECT_ID
_libsbml.LIBSBML_LEVEL_MISMATCH_swigconstant(_libsbml)
LIBSBML_LEVEL_MISMATCH = _libsbml.LIBSBML_LEVEL_MISMATCH
_libsbml.LIBSBML_VERSION_MISMATCH_swigconstant(_libsbml)
LIBSBML_VERSION_MISMATCH = _libsbml.LIBSBML_VERSION_MISMATCH
_libsbml.LIBSBML_INVALID_XML_OPERATION_swigconstant(_libsbml)
LIBSBML_INVALID_XML_OPERATION = _libsbml.LIBSBML_INVALID_XML_OPERATION
_libsbml.LIBSBML_NAMESPACES_MISMATCH_swigconstant(_libsbml)
LIBSBML_NAMESPACES_MISMATCH = _libsbml.LIBSBML_NAMESPACES_MISMATCH
_libsbml.LIBSBML_DUPLICATE_ANNOTATION_NS_swigconstant(_libsbml)
LIBSBML_DUPLICATE_ANNOTATION_NS = _libsbml.LIBSBML_DUPLICATE_ANNOTATION_NS
_libsbml.LIBSBML_ANNOTATION_NAME_NOT_FOUND_swigconstant(_libsbml)
LIBSBML_ANNOTATION_NAME_NOT_FOUND = _libsbml.LIBSBML_ANNOTATION_NAME_NOT_FOUND
_libsbml.LIBSBML_ANNOTATION_NS_NOT_FOUND_swigconstant(_libsbml)
LIBSBML_ANNOTATION_NS_NOT_FOUND = _libsbml.LIBSBML_ANNOTATION_NS_NOT_FOUND
_libsbml.LIBSBML_PKG_VERSION_MISMATCH_swigconstant(_libsbml)
LIBSBML_PKG_VERSION_MISMATCH = _libsbml.LIBSBML_PKG_VERSION_MISMATCH
_libsbml.LIBSBML_PKG_UNKNOWN_swigconstant(_libsbml)
LIBSBML_PKG_UNKNOWN = _libsbml.LIBSBML_PKG_UNKNOWN
_libsbml.LIBSBML_PKG_UNKNOWN_VERSION_swigconstant(_libsbml)
LIBSBML_PKG_UNKNOWN_VERSION = _libsbml.LIBSBML_PKG_UNKNOWN_VERSION
_libsbml.LIBSBML_PKG_DISABLED_swigconstant(_libsbml)
LIBSBML_PKG_DISABLED = _libsbml.LIBSBML_PKG_DISABLED
_libsbml.LIBSBML_PKG_CONFLICTED_VERSION_swigconstant(_libsbml)
LIBSBML_PKG_CONFLICTED_VERSION = _libsbml.LIBSBML_PKG_CONFLICTED_VERSION
_libsbml.LIBSBML_PKG_CONFLICT_swigconstant(_libsbml)
LIBSBML_PKG_CONFLICT = _libsbml.LIBSBML_PKG_CONFLICT
_libsbml.LIBSBML_CONV_INVALID_TARGET_NAMESPACE_swigconstant(_libsbml)
LIBSBML_CONV_INVALID_TARGET_NAMESPACE = _libsbml.LIBSBML_CONV_INVALID_TARGET_NAMESPACE
_libsbml.LIBSBML_CONV_PKG_CONVERSION_NOT_AVAILABLE_swigconstant(_libsbml)
LIBSBML_CONV_PKG_CONVERSION_NOT_AVAILABLE = _libsbml.LIBSBML_CONV_PKG_CONVERSION_NOT_AVAILABLE
_libsbml.LIBSBML_CONV_INVALID_SRC_DOCUMENT_swigconstant(_libsbml)
LIBSBML_CONV_INVALID_SRC_DOCUMENT = _libsbml.LIBSBML_CONV_INVALID_SRC_DOCUMENT
_libsbml.LIBSBML_CONV_CONVERSION_NOT_AVAILABLE_swigconstant(_libsbml)
LIBSBML_CONV_CONVERSION_NOT_AVAILABLE = _libsbml.LIBSBML_CONV_CONVERSION_NOT_AVAILABLE
_libsbml.LIBSBML_CONV_PKG_CONSIDERED_UNKNOWN_swigconstant(_libsbml)
LIBSBML_CONV_PKG_CONSIDERED_UNKNOWN = _libsbml.LIBSBML_CONV_PKG_CONSIDERED_UNKNOWN
def OperationReturnValue_toString(returnValue):
"""
OperationReturnValue_toString(int returnValue) -> char const *
This method takes an SBML operation return value and returns a string
representing the code.
Parameter 'returnValue' is the operation return value to convert to a
string
Returns a human readable name for the given operation return value .
Note:
The caller does not own the returned string and is therefore not
allowed to modify it.
"""
return _libsbml.OperationReturnValue_toString(returnValue)
class IdList(_object):
"""
Internal implementation method.
"""
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, IdList, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, IdList, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(IdList self) -> IdList
__init__(IdList self, string commaSeparated) -> IdList
Internal implementation method.
"""
this = _libsbml.new_IdList(*args)
try:
self.this.append(this)
except:
self.this = this
def append(self, id):
"""
append(IdList self, string id)
Internal implementation method.
"""
return _libsbml.IdList_append(self, id)
def contains(self, id):
"""
contains(IdList self, string id) -> bool
Internal implementation method.
"""
return _libsbml.IdList_contains(self, id)
def removeIdsBefore(self, id):
"""
removeIdsBefore(IdList self, string id)
Internal implementation method.
"""
return _libsbml.IdList_removeIdsBefore(self, id)
def size(self):
"""
size(IdList self) -> unsigned int
Internal implementation method.
"""
return _libsbml.IdList_size(self)
def clear(self):
"""clear(IdList self)"""
return _libsbml.IdList_clear(self)
def at(self, n):
"""at(IdList self, int n) -> string"""
return _libsbml.IdList_at(self, n)
__swig_destroy__ = _libsbml.delete_IdList
__del__ = lambda self: None
IdList_swigregister = _libsbml.IdList_swigregister
IdList_swigregister(IdList)
cout = cvar.cout
cerr = cvar.cerr
clog = cvar.clog
class IdentifierTransformer(_object):
"""
Internal implementation method.
"""
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, IdentifierTransformer, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, IdentifierTransformer, name)
__repr__ = _swig_repr
def __init__(self):
"""
__init__(IdentifierTransformer self) -> IdentifierTransformer
Internal implementation method.
"""
if self.__class__ == IdentifierTransformer:
_self = None
else:
_self = self
this = _libsbml.new_IdentifierTransformer(_self, )
try:
self.this.append(this)
except:
self.this = this
__swig_destroy__ = _libsbml.delete_IdentifierTransformer
__del__ = lambda self: None
def transform(self, element):
"""transform(IdentifierTransformer self, SBase element) -> int"""
return _libsbml.IdentifierTransformer_transform(self, element)
def __disown__(self):
self.this.disown()
_libsbml.disown_IdentifierTransformer(self)
return weakref_proxy(self)
IdentifierTransformer_swigregister = _libsbml.IdentifierTransformer_swigregister
IdentifierTransformer_swigregister(IdentifierTransformer)
class ElementFilter(_object):
"""
Base class for filter functions.
Some libSBML objects provide the ability to return lists of
components. To provide callers with greater control over exactly what
is returned, these methods take optional arguments in the form of
filters. The ElementFilter class is the parent class for these
filters.
"""
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, ElementFilter, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, ElementFilter, name)
__repr__ = _swig_repr
def __init__(self):
"""
__init__(ElementFilter self) -> ElementFilter
Creates a new ElementFilter object.
"""
if self.__class__ == ElementFilter:
_self = None
else:
_self = self
this = _libsbml.new_ElementFilter(_self, )
try:
self.this.append(this)
except:
self.this = this
__swig_destroy__ = _libsbml.delete_ElementFilter
__del__ = lambda self: None
def filter(self, element):
"""
filter(ElementFilter self, SBase element) -> bool
Predicate to test elements.
This is the central predicate of the ElementFilter class. In
subclasses of ElementFilter, callers should implement this method such
that it returns True for 'element' arguments that are 'desirable' and
False for those that are 'undesirable' in whatever filtering context
the ElementFilter subclass is designed to be used.
Parameter 'element' is the element to be tested.
Returns True if the 'element' is desirable or should be kept, False
otherwise.
"""
return _libsbml.ElementFilter_filter(self, element)
def __disown__(self):
self.this.disown()
_libsbml.disown_ElementFilter(self)
return weakref_proxy(self)
ElementFilter_swigregister = _libsbml.ElementFilter_swigregister
ElementFilter_swigregister(ElementFilter)
class SBMLReader(_object):
"""
File and text-string SBML reader.
The SBMLReader class provides the main interface for reading SBML
content from files and strings. The methods for reading SBML all
return an SBMLDocument object representing the results. In the case
of failures (such as if the SBML contains errors or a file cannot be
read), the errors will be recorded with the SBMLErrorLog object kept
in the SBMLDocument returned by SBMLReader. Consequently, immediately
after calling a method on SBMLReader, callers should always check for
errors and warnings using the methods for this purpose provided by
SBMLDocument.
For convenience as well as easy access from other languages besides
C++, this file also defines two global functions, readSBML() and
readSBMLFromString(). They are equivalent to creating an SBMLReader
object and then calling the SBMLReader.readSBML() and
SBMLReader.readSBMLFromString() methods, respectively.
Support for reading compressed files
======================================================================
LibSBML provides support for reading (as well as writing) compressed
SBML files. The process is transparent to the calling application---
the application does not need to do anything deliberate to invoke the
functionality. If a given SBML filename ends with an extension for
the gzip, zip or bzip2 compression formats (respectively, .gz, .zip,
or .bz2), then the methods SBMLReader.readSBML() and
SBMLWriter.writeSBML() will automatically decompress and compress the
file while reading and writing it. If the filename has no such
extension, it will be read and written uncompressed as normal.
The compression feature requires that the zlib (for gzip and zip
formats) and/or bzip2 (for bzip2 format) be available on the system
running libSBML, and that libSBML was configured with their support
compiled-in. Please see the libSBML installation instructions for
more information about this. The methods hasZlib() and hasBzip2() can
be used by an application to query at run-time whether support for the
compression libraries is available in the present copy of libSBML.
Support for compression is not mandated by the SBML standard, but
applications may find it helpful, particularly when large SBML models
are being communicated across data links of limited bandwidth.
"""
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, SBMLReader, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, SBMLReader, name)
__repr__ = _swig_repr
def __init__(self):
"""
__init__(SBMLReader self) -> SBMLReader
Creates a new SBMLReader object and returns it.
The libSBML SBMLReader object offers methods for reading SBML in XML
form from files and text strings.
"""
this = _libsbml.new_SBMLReader()
try:
self.this.append(this)
except:
self.this = this
__swig_destroy__ = _libsbml.delete_SBMLReader
__del__ = lambda self: None
def readSBML(*args):
"""
readSBML(self, string filename) -> SBMLDocument
Reads an SBML document from a file.
This method is identical to readSBMLFromFile().
If the file named 'filename' does not exist or its content is not
valid SBML, one or more errors will be logged with the SBMLDocument
object returned by this method. Callers can use the methods on
SBMLDocument such as SBMLDocument.getNumErrors() and
SBMLDocument.getError() to get the errors. The object returned by
SBMLDocument.getError() is an SBMLError object, and it has methods to
get the error code, category, and severity level of the problem, as
well as a textual description of the problem. The possible severity
levels range from informational messages to fatal errors; see the
documentation for SBMLError for more information.
If the file 'filename' could not be read, the file-reading error will
appear first. The error code can provide a clue about what happened.
For example, a file might be unreadable (either because it does not
actually exist or because the user does not have the necessary access
priviledges to read it) or some sort of file operation error may have
been reported by the underlying operating system. Callers can check
for these situations using a program fragment such as the following:
reader = SBMLReader()
doc = reader.readSBML(filename)
if doc.getNumErrors() > 0:
if doc.getError(0).getErrorId() == libsbml.XMLFileUnreadable:
# Handle case of unreadable file here.
elif doc.getError(0).getErrorId() == libsbml.XMLFileOperationError:
# Handle case of other file error here.
else:
# Handle other error cases here.
If the given filename ends with the suffix \".gz\" (for example,
\"myfile.xml.gz\"), the file is assumed to be compressed in gzip format
and will be automatically decompressed upon reading. Similarly, if the
given filename ends with \".zip\" or \".bz2\", the file is assumed to be
compressed in zip or bzip2 format (respectively). Files whose names
lack these suffixes will be read uncompressed. Note that if the file
is in zip format but the archive contains more than one file, only the
first file in the archive will be read and the rest ignored.
To read a gzip/zip file, libSBML needs to be configured and linked with
the zlib library at compile time. It also needs to be linked with the
bzip2 library to read files in bzip2 format. (Both of these are the
default configurations for libSBML.) Errors about unreadable files
will be logged if a compressed filename is given and libSBML was not
linked with the corresponding required library.
Parameter 'filename is the name or full pathname of the file to be
read.
Returns a pointer to the SBMLDocument created from the SBML content.
See also SBMLError.
Note:
LibSBML versions 2.x and later versions behave differently in
error handling in several respects. One difference is how early some
errors are caught and whether libSBML continues processing a file in
the face of some early errors. In general, libSBML versions after 2.x
stop parsing SBML inputs sooner than libSBML version 2.x in the face
of XML errors, because the errors may invalidate any further SBML
content. For example, a missing XML declaration at the beginning of
the file was ignored by libSBML 2.x but in version 3.x and later, it
will cause libSBML to stop parsing the rest of the input altogether.
While this behavior may seem more severe and intolerant, it was
necessary in order to provide uniform behavior regardless of which
underlying XML parser (Expat, Xerces, libxml2) is being used by
libSBML. The XML parsers themselves behave differently in their error
reporting, and sometimes libSBML has to resort to the lowest common
denominator.
"""
args_copy = list(args)
args_copy[1] = conditional_abspath(args[1])
return _libsbml.SBMLReader_readSBML(*args_copy)
def readSBMLFromFile(*args):
"""
Reads an SBML document from the given file.
If the file named 'filename' does not exist or its content is not
valid SBML, one or more errors will be logged with the SBMLDocument
object returned by this method. Callers can use the methods on
SBMLDocument such as SBMLDocument.getNumErrors() and
SBMLDocument.getError() to get the errors. The object returned by
SBMLDocument.getError() is an SBMLError object, and it has methods to
get the error code, category, and severity level of the problem, as
well as a textual description of the problem. The possible severity
levels range from informational messages to fatal errors; see the
documentation for SBMLError for more information.
If the file 'filename' could not be read, the file-reading error will
appear first. The error code can provide a clue about what happened.
For example, a file might be unreadable (either because it does not
actually exist or because the user does not have the necessary access
priviledges to read it) or some sort of file operation error may have
been reported by the underlying operating system. Callers can check
for these situations using a program fragment such as the following:
reader = SBMLReader()
if reader == None:
# Handle the truly exceptional case of no object created here.
doc = reader.readSBMLFromFile(filename)
if doc.getNumErrors() > 0:
if doc.getError(0).getErrorId() == XMLFileUnreadable:
# Handle case of unreadable file here.
elif doc.getError(0).getErrorId() == XMLFileOperationError:
# Handle case of other file error here.
else:
# Handle other error cases here.
If the given filename ends with the suffix '.gz' (for example,
'myfile.xml.gz'), the file is assumed to be compressed in gzip format
and will be automatically decompressed upon reading. Similarly, if the
given filename ends with '.zip' or '.bz2', the file is assumed to be
compressed in zip or bzip2 format (respectively). Files whose names
lack these suffixes will be read uncompressed. Note that if the file
is in zip format but the archive contains more than one file, only the
first file in the archive will be read and the rest ignored.
To read a gzip/zip file, libSBML needs to be configured and linked
with the zlib library at compile time. It also needs to be linked
with the bzip2 library to read files in bzip2 format. (Both of these
are the default configurations for libSBML.) Errors about unreadable
files will be logged if a compressed filename is given and libSBML was
not linked with the corresponding required library.
Parameter 'filename' is the name or full pathname of the file to be
read.
Returns a pointer to the SBMLDocument structure created from the SBML
content in 'filename'.
"""
args_copy = list(args)
args_copy[1] = conditional_abspath(args[1])
return _libsbml.SBMLReader_readSBML(*args_copy)
def readSBMLFromString(self, xml):
"""
readSBMLFromString(SBMLReader self, string xml) -> SBMLDocument
Reads an SBML document from a text string.
This method is flexible with respect to the presence of an XML
declaration at the beginning of the string. In particular, if the
string in 'xml' does not begin with the XML declaration
then this method will automatically prepend the declaration to 'xml'.
This method will log a fatal error if the content given in the
parameter 'xml' is not in SBML format. See the method documentation
for SBMLReader.readSBML() for an example of code for testing the
returned error code.
Parameter 'xml' is a string containing a full SBML model
Returns a pointer to the SBMLDocument created from the SBML content,
or a null pointer if 'xml' is null.
Note:
When using this method to read an SBMLDocument that uses the SBML
Level 3 Hierarchical Model Composition package (comp) the document
location cannot be set automatically. Thus, if the model contains
references to ExternalModelDefinition objects, it will be necessary to
manually set the document URI location (SBMLDocument.setLocationURI()
in order to facilitate resolving these models.
See also SBMLReader.readSBML().
"""
return _libsbml.SBMLReader_readSBMLFromString(self, xml)
def hasZlib():
"""
hasZlib() -> bool
Static method; returns True if this copy of libSBML supports gzip and
zip format compression.
Returns True if libSBML has been linked with the zlib library, False
otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
See also SBMLReader.hasBzip2().
"""
return _libsbml.SBMLReader_hasZlib()
if _newclass:
hasZlib = staticmethod(hasZlib)
__swig_getmethods__["hasZlib"] = lambda x: hasZlib
def hasBzip2():
"""
hasBzip2() -> bool
Static method; returns True if this copy of libSBML supports bzip2
format compression.
Returns True if libSBML is linked with the bzip2 libraries, False
otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
See also SBMLReader.hasZlib().
"""
return _libsbml.SBMLReader_hasBzip2()
if _newclass:
hasBzip2 = staticmethod(hasBzip2)
__swig_getmethods__["hasBzip2"] = lambda x: hasBzip2
def __eq__(self, rhs):
if ((self is None) and (rhs is None)): return True
if ((self is None) or (rhs is None)): return False
if (hasattr(self, 'this') and hasattr(rhs, 'this')):
if (self.this == rhs.this): return True
return False
def __ne__(self, rhs):
if ((self is None) and (rhs is None)): return False
if ((self is None) or (rhs is None)): return True
if (hasattr(self, 'this') and hasattr(rhs, 'this')):
if (self.this == rhs.this): return False
return True
SBMLReader_swigregister = _libsbml.SBMLReader_swigregister
SBMLReader_swigregister(SBMLReader)
def SBMLReader_hasZlib():
"""
SBMLReader_hasZlib() -> bool
Static method; returns True if this copy of libSBML supports gzip and
zip format compression.
Returns True if libSBML has been linked with the zlib library, False
otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
See also SBMLReader.hasBzip2().
"""
return _libsbml.SBMLReader_hasZlib()
def SBMLReader_hasBzip2():
"""
SBMLReader_hasBzip2() -> bool
Static method; returns True if this copy of libSBML supports bzip2
format compression.
Returns True if libSBML is linked with the bzip2 libraries, False
otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
See also SBMLReader.hasZlib().
"""
return _libsbml.SBMLReader_hasBzip2()
def readSBMLFromFile(filename):
"""
readSBMLFromFile(char const * filename) -> SBMLDocument
Reads an SBML document from the given file.
If the file named 'filename' does not exist or its content is not
valid SBML, one or more errors will be logged with the SBMLDocument
object returned by this method. Callers can use the methods on
SBMLDocument such as SBMLDocument.getNumErrors() and
SBMLDocument.getError() to get the errors. The object returned by
SBMLDocument.getError() is an SBMLError object, and it has methods to
get the error code, category, and severity level of the problem, as
well as a textual description of the problem. The possible severity
levels range from informational messages to fatal errors; see the
documentation for SBMLError for more information.
If the file 'filename' could not be read, the file-reading error will
appear first. The error code can provide a clue about what happened.
For example, a file might be unreadable (either because it does not
actually exist or because the user does not have the necessary access
priviledges to read it) or some sort of file operation error may have
been reported by the underlying operating system. Callers can check
for these situations using a program fragment such as the following:
reader = SBMLReader()
if reader == None:
# Handle the truly exceptional case of no object created here.
doc = reader.readSBMLFromFile(filename)
if doc.getNumErrors() > 0:
if doc.getError(0).getErrorId() == XMLFileUnreadable:
# Handle case of unreadable file here.
elif doc.getError(0).getErrorId() == XMLFileOperationError:
# Handle case of other file error here.
else:
# Handle other error cases here.
If the given filename ends with the suffix '.gz' (for example,
'myfile.xml.gz'), the file is assumed to be compressed in gzip format
and will be automatically decompressed upon reading. Similarly, if the
given filename ends with '.zip' or '.bz2', the file is assumed to be
compressed in zip or bzip2 format (respectively). Files whose names
lack these suffixes will be read uncompressed. Note that if the file
is in zip format but the archive contains more than one file, only the
first file in the archive will be read and the rest ignored.
To read a gzip/zip file, libSBML needs to be configured and linked
with the zlib library at compile time. It also needs to be linked
with the bzip2 library to read files in bzip2 format. (Both of these
are the default configurations for libSBML.) Errors about unreadable
files will be logged if a compressed filename is given and libSBML was
not linked with the corresponding required library.
Parameter 'filename' is the name or full pathname of the file to be
read.
Returns a pointer to the SBMLDocument structure created from the SBML
content in 'filename'.
"""
return _libsbml.readSBMLFromFile(filename)
def readSBMLFromString(xml):
"""
readSBMLFromString(char const * xml) -> SBMLDocument
Reads an SBML document from a text string.
This method is flexible with respect to the presence of an XML
declaration at the beginning of the string. In particular, if the
string in 'xml' does not begin with the XML declaration
then this method will automatically prepend the declaration to 'xml'.
This method will log a fatal error if the content given in the
parameter 'xml' is not in SBML format. See the method documentation
for SBMLReader.readSBML() for an example of code for testing the
returned error code.
Parameter 'xml' is a string containing a full SBML model
Returns a pointer to the SBMLDocument structure created from the SBML
content in 'xml'.
Note:
When using this method to read an SBMLDocument that uses the SBML
Level 3 Hierarchical Model Composition package (comp) the document
location cannot be set automatically. Thus, if the model contains
references to ExternalModelDefinition objects, it will be necessary to
manually set the document URI location (SBMLDocument.setLocationURI()
in order to facilitate resolving these models.
"""
return _libsbml.readSBMLFromString(xml)
class SBMLWriter(_object):
"""
File and text-string SBML writer.
The SBMLWriter class is the converse of SBMLReader, and provides the
main interface for serializing SBML models into XML and writing the
result to an output stream or to files and text strings. The methods
for writing SBML all take an SBMLDocument object and a destination.
They return a boolean or integer value to indicate success or failure.
Support for writing compressed files
======================================================================
LibSBML provides support for writing (as well as reading) compressed
SBML files. The process is transparent to the calling application---
the application does not need to do anything deliberate to invoke the
functionality. If a given SBML filename ends with an extension for
the gzip, zip or bzip2 compression formats (respectively, ".gz",
".zip", or ".bz2"), then the methods SBMLWriter.writeSBML() and
SBMLReader.readSBML() will automatically compress and decompress the
file while writing and reading it. If the filename has no such
extension, it will be written and read uncompressed as normal.
The compression feature requires that the zlib (for gzip and zip
formats) and/or bzip2 (for bzip2 format) be available on the system
running libSBML, and that libSBML was configured with their support
compiled-in. Please see the libSBML installation instructions for
more information about this. The methods SBMLWriter.hasZlib() and
SBMLWriter.hasBzip2() can be used by an application to query at run-
time whether support for the compression libraries is available in the
present copy of libSBML.
Support for compression is not mandated by the SBML standard, but
applications may find it helpful, particularly when large SBML models
are being communicated across data links of limited bandwidth.
"""
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, SBMLWriter, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, SBMLWriter, name)
__repr__ = _swig_repr
def __init__(self):
"""
__init__(SBMLWriter self) -> SBMLWriter
Creates a new SBMLWriter.
The libSBML SBMLWriter objects offer methods for writing SBML in XML
form to files and text strings.
"""
this = _libsbml.new_SBMLWriter()
try:
self.this.append(this)
except:
self.this = this
__swig_destroy__ = _libsbml.delete_SBMLWriter
__del__ = lambda self: None
def setProgramName(self, name):
"""
setProgramName(SBMLWriter self, string name) -> int
Sets the name of this program, i.e., the program that is about to
write out the SBMLDocument.
If the program name and version are set (see
SBMLWriter.setProgramVersion()), the following XML comment, intended
for human consumption, will be written at the beginning of the XML
document:
If the program name and version are not set at some point before
calling the writeSBML() methods, no such comment is written out.
Parameter 'name' is the name of this program (where 'this program'
refers to program in which libSBML is embedded, not libSBML itself!)
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
See also setProgramVersion().
"""
return _libsbml.SBMLWriter_setProgramName(self, name)
def setProgramVersion(self, version):
"""
setProgramVersion(SBMLWriter self, string version) -> int
Sets the version of this program, i.e., the program that is about to
write out the SBMLDocument.
If the program version and name are set (see
SBMLWriter.setProgramName()), the following XML comment, intended for
human consumption, will be written at the beginning of the document:
If the program version and name are not set at some point before
calling the writeSBML() methods, no such comment is written out.
Parameter 'version' is the version of this program (where 'this
program' refers to program in which libSBML is embedded, not libSBML
itself!)
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
See also setProgramName().
"""
return _libsbml.SBMLWriter_setProgramVersion(self, version)
def writeSBML(self, *args):
"""
writeSBML(SBMLWriter self, SBMLDocument d, string filename) -> bool
writeSBML(SBMLWriter self, SBMLDocument d, ostream stream) -> bool
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
writeSBML(SBMLDocument d, string filename)
Writes the given SBML document to filename.
Parameter 'd' is the SBML document to be written
Parameter 'filename' is the name or full pathname of the file where
the SBML is to be written.
Returns True on success and False if the filename could not be opened
for writing.
Note:
See also setProgramVersion(), setProgramName(), setProgramVersion(),
setProgramName().
"""
return _libsbml.SBMLWriter_writeSBML(self, *args)
def writeToString(self, d):
"""
writeToString(SBMLWriter self, SBMLDocument d) -> char *
Internal implementation method.
"""
return _libsbml.SBMLWriter_writeToString(self, d)
def writeSBMLToFile(self, d, filename):
"""
writeSBMLToFile(SBMLWriter self, SBMLDocument d, string filename) -> bool
Writes the given SBML document to filename.
Parameter 'd' is the SBML document to be written
Parameter 'filename' is the name or full pathname of the file where
the SBML is to be written.
Returns True on success and False if the filename could not be opened
for writing.
Note:
See also setProgramVersion(), setProgramName().
"""
return _libsbml.SBMLWriter_writeSBMLToFile(self, d, filename)
def writeSBMLToString(self, d):
"""
writeSBMLToString(SBMLWriter self, SBMLDocument d) -> char *
Writes the given SBML document to an in-memory string and returns a
pointer to it.
The string is owned by the caller and should be freed (with free())
when no longer needed.
Parameter 'd' is the SBML document to be written
Returns the string on success and 0 if one of the underlying parser
components fail.
See also setProgramVersion(), setProgramName().
"""
return _libsbml.SBMLWriter_writeSBMLToString(self, d)
def hasZlib():
"""
hasZlib() -> bool
Predicate returning True if this copy of libSBML has been linked with
the zlib library.
LibSBML supports reading and writing files compressed with either
bzip2 or zip/gzip compression. The facility depends on libSBML having
been compiled with the necessary support libraries. This method
allows a calling program to inquire whether that is the case for the
copy of libSBML it is using.
Returns True if libSBML is linked with zlib, False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
See also SBMLWriter.hasBzip2() .
"""
return _libsbml.SBMLWriter_hasZlib()
if _newclass:
hasZlib = staticmethod(hasZlib)
__swig_getmethods__["hasZlib"] = lambda x: hasZlib
def hasBzip2():
"""
hasBzip2() -> bool
Predicate returning True if this copy of libSBML has been linked with
the bzip2 library.
LibSBML supports reading and writing files compressed with either
bzip2 or zip/gzip compression. The facility depends on libSBML having
been compiled with the necessary support libraries. This method
allows a calling program to inquire whether that is the case for the
copy of libSBML it is using.
Returns True if libSBML is linked with bzip2, False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
See also SBMLWriter.hasZlib() .
"""
return _libsbml.SBMLWriter_hasBzip2()
if _newclass:
hasBzip2 = staticmethod(hasBzip2)
__swig_getmethods__["hasBzip2"] = lambda x: hasBzip2
def __eq__(self, rhs):
if ((self is None) and (rhs is None)): return True
if ((self is None) or (rhs is None)): return False
if (hasattr(self, 'this') and hasattr(rhs, 'this')):
if (self.this == rhs.this): return True
return False
def __ne__(self, rhs):
if ((self is None) and (rhs is None)): return False
if ((self is None) or (rhs is None)): return True
if (hasattr(self, 'this') and hasattr(rhs, 'this')):
if (self.this == rhs.this): return False
return True
SBMLWriter_swigregister = _libsbml.SBMLWriter_swigregister
SBMLWriter_swigregister(SBMLWriter)
def SBMLWriter_hasZlib():
"""
SBMLWriter_hasZlib() -> bool
Predicate returning True if this copy of libSBML has been linked with
the zlib library.
LibSBML supports reading and writing files compressed with either
bzip2 or zip/gzip compression. The facility depends on libSBML having
been compiled with the necessary support libraries. This method
allows a calling program to inquire whether that is the case for the
copy of libSBML it is using.
Returns True if libSBML is linked with zlib, False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
See also SBMLWriter.hasBzip2() .
"""
return _libsbml.SBMLWriter_hasZlib()
def SBMLWriter_hasBzip2():
"""
SBMLWriter_hasBzip2() -> bool
Predicate returning True if this copy of libSBML has been linked with
the bzip2 library.
LibSBML supports reading and writing files compressed with either
bzip2 or zip/gzip compression. The facility depends on libSBML having
been compiled with the necessary support libraries. This method
allows a calling program to inquire whether that is the case for the
copy of libSBML it is using.
Returns True if libSBML is linked with bzip2, False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
See also SBMLWriter.hasZlib() .
"""
return _libsbml.SBMLWriter_hasBzip2()
def writeSBML(d, filename):
"""
writeSBML(SBMLDocument d, char const * filename) -> int
Writes the given SBML document 'd' to the file named by 'filename'.
This convenience function is functionally equivalent to:
SBMLWriter_writeSBML(SBMLWriter_create(), d, filename);
Parameter 'd' is the SBMLDocument object to be written out in XML
format
Parameter 'filename' is a string giving the path to a file where the
XML content is to be written.
Returns 1 on success and 0 (zero) if 'filename' could not be written.
Some possible reasons for failure include (a) being unable to open the
file, and (b) using a filename that indicates a compressed SBML file
(i.e., a filename ending in ".zip" or similar) when the compression
functionality has not been enabled in the underlying copy of libSBML.
See also SBMLWriter.hasZlib(), SBMLWriter.hasBzip2().
"""
return _libsbml.writeSBML(d, filename)
def writeSBMLToString(d):
"""
writeSBMLToString(SBMLDocument d) -> char *
Writes the given SBML document 'd' to an in-memory string and returns
a pointer to it. The string is owned by the caller and should be
freed (with free()) when no longer needed. This convenience function
is functionally equivalent to:
SBMLWriter_writeSBMLToString(SBMLWriter_create(), d);
but does not require the caller to create an SBMLWriter object first.
Parameter 'd' is an SBMLDocument object to be written out in XML
format
Returns the string on success and None if one of the underlying parser
components fail.
"""
return _libsbml.writeSBMLToString(d)
def writeSBMLToFile(d, filename):
"""
writeSBMLToFile(SBMLDocument d, char const * filename) -> int
Writes the given SBML document 'd' to the file 'filename'. This
convenience function is functionally equivalent to:
SBMLWriter_writeSBMLToFile(SBMLWriter_create(), d, filename);
but that does not require the caller to create an SBMLWriter object
first.
Parameter 'd' is an SBMLDocument object to be written out in XML
format
Parameter 'filename' is a string giving the path to a file where the
XML content is to be written.
Returns 1 on success and 0 (zero) if 'filename' could not be written.
Some possible reasons for failure include (a) being unable to open the
file, and (b) using a filename that indicates a compressed SBML file
(i.e., a filename ending in ".zip" or similar) when the compression
functionality has not been enabled in the underlying copy of libSBML.
See also SBMLWriter.hasZlib(), SBMLWriter.hasBzip2().
"""
return _libsbml.writeSBMLToFile(d, filename)
_libsbml.SBML_UNKNOWN_swigconstant(_libsbml)
SBML_UNKNOWN = _libsbml.SBML_UNKNOWN
_libsbml.SBML_COMPARTMENT_swigconstant(_libsbml)
SBML_COMPARTMENT = _libsbml.SBML_COMPARTMENT
_libsbml.SBML_COMPARTMENT_TYPE_swigconstant(_libsbml)
SBML_COMPARTMENT_TYPE = _libsbml.SBML_COMPARTMENT_TYPE
_libsbml.SBML_CONSTRAINT_swigconstant(_libsbml)
SBML_CONSTRAINT = _libsbml.SBML_CONSTRAINT
_libsbml.SBML_DOCUMENT_swigconstant(_libsbml)
SBML_DOCUMENT = _libsbml.SBML_DOCUMENT
_libsbml.SBML_EVENT_swigconstant(_libsbml)
SBML_EVENT = _libsbml.SBML_EVENT
_libsbml.SBML_EVENT_ASSIGNMENT_swigconstant(_libsbml)
SBML_EVENT_ASSIGNMENT = _libsbml.SBML_EVENT_ASSIGNMENT
_libsbml.SBML_FUNCTION_DEFINITION_swigconstant(_libsbml)
SBML_FUNCTION_DEFINITION = _libsbml.SBML_FUNCTION_DEFINITION
_libsbml.SBML_INITIAL_ASSIGNMENT_swigconstant(_libsbml)
SBML_INITIAL_ASSIGNMENT = _libsbml.SBML_INITIAL_ASSIGNMENT
_libsbml.SBML_KINETIC_LAW_swigconstant(_libsbml)
SBML_KINETIC_LAW = _libsbml.SBML_KINETIC_LAW
_libsbml.SBML_LIST_OF_swigconstant(_libsbml)
SBML_LIST_OF = _libsbml.SBML_LIST_OF
_libsbml.SBML_MODEL_swigconstant(_libsbml)
SBML_MODEL = _libsbml.SBML_MODEL
_libsbml.SBML_PARAMETER_swigconstant(_libsbml)
SBML_PARAMETER = _libsbml.SBML_PARAMETER
_libsbml.SBML_REACTION_swigconstant(_libsbml)
SBML_REACTION = _libsbml.SBML_REACTION
_libsbml.SBML_RULE_swigconstant(_libsbml)
SBML_RULE = _libsbml.SBML_RULE
_libsbml.SBML_SPECIES_swigconstant(_libsbml)
SBML_SPECIES = _libsbml.SBML_SPECIES
_libsbml.SBML_SPECIES_REFERENCE_swigconstant(_libsbml)
SBML_SPECIES_REFERENCE = _libsbml.SBML_SPECIES_REFERENCE
_libsbml.SBML_SPECIES_TYPE_swigconstant(_libsbml)
SBML_SPECIES_TYPE = _libsbml.SBML_SPECIES_TYPE
_libsbml.SBML_MODIFIER_SPECIES_REFERENCE_swigconstant(_libsbml)
SBML_MODIFIER_SPECIES_REFERENCE = _libsbml.SBML_MODIFIER_SPECIES_REFERENCE
_libsbml.SBML_UNIT_DEFINITION_swigconstant(_libsbml)
SBML_UNIT_DEFINITION = _libsbml.SBML_UNIT_DEFINITION
_libsbml.SBML_UNIT_swigconstant(_libsbml)
SBML_UNIT = _libsbml.SBML_UNIT
_libsbml.SBML_ALGEBRAIC_RULE_swigconstant(_libsbml)
SBML_ALGEBRAIC_RULE = _libsbml.SBML_ALGEBRAIC_RULE
_libsbml.SBML_ASSIGNMENT_RULE_swigconstant(_libsbml)
SBML_ASSIGNMENT_RULE = _libsbml.SBML_ASSIGNMENT_RULE
_libsbml.SBML_RATE_RULE_swigconstant(_libsbml)
SBML_RATE_RULE = _libsbml.SBML_RATE_RULE
_libsbml.SBML_SPECIES_CONCENTRATION_RULE_swigconstant(_libsbml)
SBML_SPECIES_CONCENTRATION_RULE = _libsbml.SBML_SPECIES_CONCENTRATION_RULE
_libsbml.SBML_COMPARTMENT_VOLUME_RULE_swigconstant(_libsbml)
SBML_COMPARTMENT_VOLUME_RULE = _libsbml.SBML_COMPARTMENT_VOLUME_RULE
_libsbml.SBML_PARAMETER_RULE_swigconstant(_libsbml)
SBML_PARAMETER_RULE = _libsbml.SBML_PARAMETER_RULE
_libsbml.SBML_TRIGGER_swigconstant(_libsbml)
SBML_TRIGGER = _libsbml.SBML_TRIGGER
_libsbml.SBML_DELAY_swigconstant(_libsbml)
SBML_DELAY = _libsbml.SBML_DELAY
_libsbml.SBML_STOICHIOMETRY_MATH_swigconstant(_libsbml)
SBML_STOICHIOMETRY_MATH = _libsbml.SBML_STOICHIOMETRY_MATH
_libsbml.SBML_LOCAL_PARAMETER_swigconstant(_libsbml)
SBML_LOCAL_PARAMETER = _libsbml.SBML_LOCAL_PARAMETER
_libsbml.SBML_PRIORITY_swigconstant(_libsbml)
SBML_PRIORITY = _libsbml.SBML_PRIORITY
_libsbml.SBML_GENERIC_SBASE_swigconstant(_libsbml)
SBML_GENERIC_SBASE = _libsbml.SBML_GENERIC_SBASE
def SBMLTypeCode_toString(tc, pkgName):
"""
SBMLTypeCode_toString(int tc, char const * pkgName) -> char const *
This method takes an SBML type code and returns a string representing
the code.
LibSBML attaches an identifying code to every kind of SBML object.
These are known as SBML type codes. In the Python language interface
for libSBML, the type codes are defined as static integer constants in
the interface class 'libsbml'. The names of the type codes all begin
with the characters SBML_.
Returns a human readable name for the given SBML type code.
Note:
The caller does not own the returned string and is therefore not
allowed to modify it.
"""
return _libsbml.SBMLTypeCode_toString(tc, pkgName)
class SBase(_object):
"""
SBML's SBase class, base class of most SBML objects.
Most components in SBML are derived from a single abstract base type,
SBase. In addition to serving as the parent class for most other
classes of objects in SBML, this base type is designed to allow a
modeler or a software package to attach arbitrary information to each
major element or list in an SBML model.
SBase has an optional subelement called 'notes'. It is intended to
serve as a place for storing optional information intended to be seen
by humans. An example use of the 'notes' element would be to contain
formatted user comments about the model element in which the 'notes'
element is enclosed. There are certain conditions on the XHTML
content permitted inside the 'notes' element; please consult the SBML
specification document corresponding to the SBML Level and Version of
your model for more information about the requirements for 'notes'
content.
SBase has another optional subelement called 'annotation'. Whereas
the 'notes' element described above is a container for content to be
shown directly to humans, the 'annotation' element is a container for
optional software-generated content not meant to be shown to humans.
The element's content type is XML type 'any', allowing essentially
arbitrary data content. SBML places only a few restrictions on the
organization of the content; these are intended to help software tools
read and write the data as well as help reduce conflicts between
annotations added by different tools. As is the case with 'notes', it
is important to refer to the SBML specification document corresponding
to the SBML Level and Version of your model for more information about
the requirements for 'annotation' content.
It is worth pointing out that the 'annotation' element in the
definition of SBase exists in order that software developers may
attach optional application-specific data to the elements in an SBML
model. However, it is important that this facility not be misused.
In particular, it is critical that data essential to a model
definition or that can be encoded in existing SBML elements is not
stored in 'annotation'. Parameter values, functional dependencies
between model elements, etc., should not be recorded as annotations.
It is crucial to keep in mind the fact that data placed in annotations
can be freely ignored by software applications. If such data affects
the interpretation of a model, then software interoperability is
greatly impeded.
SBML Level 2 introduced an optional SBase attribute named 'metaid' for
supporting metadata annotations using RDF (Resource Description
Format). The attribute value has the data type XML ID, the XML
identifier type, which means each 'metaid' value must be globally
unique within an SBML file. (Importantly, this uniqueness criterion
applies across any attribute with type XML ID, not just the 'metaid'
attribute used by SBML---something to be aware of if your application-
specific XML content inside the 'annotation' subelement happens to use
XML ID.) The 'metaid' value serves to identify a model component for
purposes such as referencing that component from metadata placed
within 'annotation' subelements.
Beginning with SBML Level 2 Version 3, SBase also has an optional
attribute named 'sboTerm' for supporting the use of the Systems
Biology Ontology. In SBML proper, the data type of the attribute is a
string of the form 'SBO:NNNNNNN', where 'NNNNNNN' is a seven digit
integer number; libSBML simplifies the representation by only storing
the 'NNNNNNN' integer portion. Thus, in libSBML, the 'sboTerm'
attribute on SBase has data type int, and SBO identifiers are stored
simply as integers. (For convenience, SBase offers methods for
returning both the integer form and a text-string form of the SBO
identifier.) SBO terms are a type of optional annotation, and each
different class of SBML object derived from SBase imposes its own
requirements about the values permitted for 'sboTerm'. Please consult
the SBML Level 2 Version 4 specification for more information about
the use of SBO and the 'sboTerm' attribute.
Finally, note that, in the list of methods on SBase, there is no
public constructor because SBase is an abstract class. The
constructors reside in the subclasses derived from SBase.
Standard format for annotations linking data resources
======================================================================
SBML Level 2 Versions 2, 3 and 4, and Level 3, define a proposed
regular format for encoding two particular categories of annotations:
(a) references to controlled vocabulary terms and database identifiers
which define and describe biological and biochemical entities in a
model; and (b) descriptions of the provenance of a model, including
its author(s) and modification history.
"""
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, SBase, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, SBase, name)
def __init__(self, *args, **kwargs):
raise AttributeError("No constructor defined - class is abstract")
__repr__ = _swig_repr
__swig_destroy__ = _libsbml.delete_SBase
__del__ = lambda self: None
def clone(self):
"""
clone(SBase self) -> SBase
Creates and returns a deep copy of this SBase object.
Returns the (deep) copy of this SBase object.
"""
return _libsbml.SBase_clone(self)
def getElementBySId(self, id):
"""
getElementBySId(SBase self, string id) -> SBase
Returns the first child element found that has the given 'id' in the
model-wide SId namespace, or None if no such object is found.
Parameter 'id' is string representing the 'id' attribute value of the
object to find.
Returns pointer to the first element found with the given identifier.
"""
return _libsbml.SBase_getElementBySId(self, id)
def getElementByMetaId(self, metaid):
"""
getElementByMetaId(SBase self, string metaid) -> SBase
Returns the first child element it can find with a specific 'metaid'
attribute value, or None if no such object is found.
The optional attribute named 'metaid', present on every major SBML
component type, is for supporting metadata annotations using RDF
(Resource Description Format). The attribute value has the data type
XML ID, the XML identifier type, which means each 'metaid' value must
be globally unique within an SBML file. The latter point is
important, because the uniqueness criterion applies across any
attribute with type ID anywhere in the file, not just the 'metaid'
attribute used by SBML---something to be aware of if your application-
specific XML content inside the 'annotation' subelement happens to use
the XML ID type. Although SBML itself specifies the use of XML ID
only for the 'metaid' attribute, SBML-compatible applications should
be careful if they use XML ID's in XML portions of a model that are
not defined by SBML, such as in the application-specific content of
the 'annotation' subelement. Finally, note that LibSBML does not
provide an explicit XML ID data type; it uses ordinary character
strings, which is easier for applications to support.
Parameter 'metaid' is string representing the 'metaid' attribute value
of the object to find.
Returns pointer to the first element found with the given meta-
identifier.
"""
return _libsbml.SBase_getElementByMetaId(self, metaid)
def renameSIdRefs(self, oldid, newid):
"""
renameSIdRefs(SBase self, string oldid, string newid)
Replaces all uses of a given SIdRef type attribute value with another
value.
In SBML, object identifiers are of a data type called SId. In SBML
Level 3, an explicit data type called SIdRef was introduced for
attribute values that refer to SId values; in previous Levels of SBML,
this data type did not exist and attributes were simply described to
as 'referring to an identifier', but the effective data type was the
same as SIdRefin Level 3. These and other methods of libSBML refer to
the type SIdRef for all Levels of SBML, even if the corresponding SBML
specification did not explicitly name the data type.
This method works by looking at all attributes and (if appropriate)
mathematical formulas in MathML content, comparing the referenced
identifiers to the value of 'oldid'. If any matches are found, the
matching values are replaced with 'newid'. The method does not
descend into child elements.
Parameter 'oldid' is the old identifier Parameter 'newid' is the new
identifier
"""
return _libsbml.SBase_renameSIdRefs(self, oldid, newid)
def renameMetaIdRefs(self, oldid, newid):
"""
renameMetaIdRefs(SBase self, string oldid, string newid)
Replaces all uses of a given meta identifier attribute value with
another value.
In SBML, object 'meta' identifiers are of the XML data type ID; the
SBML object attribute itself is typically named metaid. All
attributes that hold values referring to values of type ID are of the
XML data type IDREF. They are also sometimes informally referred to
as 'metaid refs', in analogy to the SBML-defined type SIdRef.
This method works by looking at all meta-identifier attribute values,
comparing the identifiers to the value of 'oldid'. If any matches are
found, the matching identifiers are replaced with 'newid'. The method
does not descend into child elements.
Parameter 'oldid' is the old identifier Parameter 'newid' is the new
identifier
"""
return _libsbml.SBase_renameMetaIdRefs(self, oldid, newid)
def renameUnitSIdRefs(self, oldid, newid):
"""
renameUnitSIdRefs(SBase self, string oldid, string newid)
Replaces all uses of a given UnitSIdRef type attribute value with
another value.
In SBML, unit definitions have identifiers of type UnitSId. In SBML
Level 3, an explicit data type called UnitSIdRef was introduced for
attribute values that refer to UnitSId values; in previous Levels of
SBML, this data type did not exist and attributes were simply
described to as 'referring to a unit identifier', but the effective
data type was the same as UnitSIdRef in Level 3. These and other
methods of libSBML refer to the type UnitSIdRef for all Levels of
SBML, even if the corresponding SBML specification did not explicitly
name the data type.
This method works by looking at all unit identifier attribute values
(including, if appropriate, inside mathematical formulas), comparing
the referenced unit identifiers to the value of 'oldid'. If any
matches are found, the matching values are replaced with 'newid'. The
method does not descend into child elements.
Parameter 'oldid' is the old identifier Parameter 'newid' is the new
identifier
"""
return _libsbml.SBase_renameUnitSIdRefs(self, oldid, newid)
def replaceSIDWithFunction(self, id, function):
"""
replaceSIDWithFunction(SBase self, string id, ASTNode function)
Internal implementation method.
"""
return _libsbml.SBase_replaceSIDWithFunction(self, id, function)
def divideAssignmentsToSIdByFunction(self, id, function):
"""
divideAssignmentsToSIdByFunction(SBase self, string id, ASTNode function)
Internal implementation method.
"""
return _libsbml.SBase_divideAssignmentsToSIdByFunction(self, id, function)
def multiplyAssignmentsToSIdByFunction(self, id, function):
"""
multiplyAssignmentsToSIdByFunction(SBase self, string id, ASTNode function)
Internal implementation method.
"""
return _libsbml.SBase_multiplyAssignmentsToSIdByFunction(self, id, function)
def getElementFromPluginsBySId(self, id):
"""
getElementFromPluginsBySId(SBase self, string id) -> SBase
Internal implementation method.
"""
return _libsbml.SBase_getElementFromPluginsBySId(self, id)
def getElementFromPluginsByMetaId(self, metaid):
"""
getElementFromPluginsByMetaId(SBase self, string metaid) -> SBase
Internal implementation method.
"""
return _libsbml.SBase_getElementFromPluginsByMetaId(self, metaid)
def hasNonstandardIdentifierBeginningWith(self, prefix):
"""
hasNonstandardIdentifierBeginningWith(SBase self, string prefix) -> bool
Internal implementation method.
"""
return _libsbml.SBase_hasNonstandardIdentifierBeginningWith(self, prefix)
def prependStringToAllIdentifiers(self, prefix):
"""
prependStringToAllIdentifiers(SBase self, string prefix) -> int
Internal implementation method.
"""
return _libsbml.SBase_prependStringToAllIdentifiers(self, prefix)
def transformIdentifiers(self, idTransformer):
"""
transformIdentifiers(SBase self, IdentifierTransformer idTransformer) -> int
Internal implementation method.
"""
return _libsbml.SBase_transformIdentifiers(self, idTransformer)
def getMetaId(self):
"""
getMetaId(SBase self) -> string
Returns the value of the 'metaid' attribute of this object.
The optional attribute named 'metaid', present on every major SBML
component type, is for supporting metadata annotations using RDF
(Resource Description Format). The attribute value has the data type
XML ID, the XML identifier type, which means each 'metaid' value must
be globally unique within an SBML file. The latter point is
important, because the uniqueness criterion applies across any
attribute with type ID anywhere in the file, not just the 'metaid'
attribute used by SBML---something to be aware of if your application-
specific XML content inside the 'annotation' subelement happens to use
the XML ID type. Although SBML itself specifies the use of XML ID
only for the 'metaid' attribute, SBML-compatible applications should
be careful if they use XML ID's in XML portions of a model that are
not defined by SBML, such as in the application-specific content of
the 'annotation' subelement. Finally, note that LibSBML does not
provide an explicit XML ID data type; it uses ordinary character
strings, which is easier for applications to support.
Returns the meta-identifier of this SBML object.
See also isSetMetaId(), setMetaId().
"""
return _libsbml.SBase_getMetaId(self)
def getId(self):
"""
getId(SBase self) -> string
Internal implementation method.
"""
return _libsbml.SBase_getId(self)
def getName(self):
"""
getName(SBase self) -> string
Internal implementation method.
"""
return _libsbml.SBase_getName(self)
def getNotes(self, *args):
"""
getNotes(SBase self) -> XMLNode
getNotes(SBase self) -> XMLNode
Returns the content of the 'notes' subelement of this object as a tree
of XMLNode objects.
The optional SBML element named 'notes', present on every major SBML
component type (and in SBML Level 3, the 'message' subelement of
Constraint), is intended as a place for storing optional information
intended to be seen by humans. An example use of the 'notes' element
would be to contain formatted user comments about the model element in
which the 'notes' element is enclosed. Every object derived directly
or indirectly from type SBase can have a separate value for 'notes',
allowing users considerable freedom when adding comments to their
models.
The format of 'notes' elements conform to the definition of XHTML 1.0.
However, the content cannot be entirely free-form; it must satisfy
certain requirements defined in the SBML specifications for specific
SBML Levels. To help verify the formatting of 'notes' content,
libSBML provides the static utility method
SyntaxChecker.hasExpectedXHTMLSyntax(); this method implements a
verification process that lets callers check whether the content of a
given XMLNode object conforms to the SBML requirements for 'notes' and
'message' structure. Developers are urged to consult the appropriate
SBML specification document for the Level and Version of their model
for more in-depth explanations of using 'notes' in SBML. The SBML
Level 2 and 3 specifications have considerable detail about how
'notes' element content must be structured.
The 'notes' element content returned by this method will be in XML
form, but libSBML does not provide an object model specifically for
the content of notes. Callers will need to traverse the XML tree
structure using the facilities available on XMLNode and related
objects. For an alternative method of accessing the notes, see
getNotesString().
Returns the content of the 'notes' subelement of this SBML object as a
tree structure composed of XMLNode objects.
See also getNotesString(), isSetNotes(), setNotes(), setNotes(),
appendNotes(), appendNotes(), unsetNotes(),
SyntaxChecker.hasExpectedXHTMLSyntax().
"""
return _libsbml.SBase_getNotes(self, *args)
def getNotesString(self, *args):
"""
getNotesString(SBase self) -> string
getNotesString(SBase self) -> string
Returns the content of the 'notes' subelement of this object as a
string.
The optional SBML element named 'notes', present on every major SBML
component type (and in SBML Level 3, the 'message' subelement of
Constraint), is intended as a place for storing optional information
intended to be seen by humans. An example use of the 'notes' element
would be to contain formatted user comments about the model element in
which the 'notes' element is enclosed. Every object derived directly
or indirectly from type SBase can have a separate value for 'notes',
allowing users considerable freedom when adding comments to their
models.
The format of 'notes' elements conform to the definition of XHTML 1.0.
However, the content cannot be entirely free-form; it must satisfy
certain requirements defined in the SBML specifications for specific
SBML Levels. To help verify the formatting of 'notes' content,
libSBML provides the static utility method
SyntaxChecker.hasExpectedXHTMLSyntax(); this method implements a
verification process that lets callers check whether the content of a
given XMLNode object conforms to the SBML requirements for 'notes' and
'message' structure. Developers are urged to consult the appropriate
SBML specification document for the Level and Version of their model
for more in-depth explanations of using 'notes' in SBML. The SBML
Level 2 and 3 specifications have considerable detail about how
'notes' element content must be structured.
For an alternative method of accessing the notes, see getNotes(),
which returns the content as an XMLNode tree structure. Depending on
an application's needs, one or the other method may be more
convenient.
Returns the content of the 'notes' subelement of this SBML object as a
string.
See also getNotes(), isSetNotes(), setNotes(), setNotes(),
appendNotes(), appendNotes(), unsetNotes(),
SyntaxChecker.hasExpectedXHTMLSyntax().
"""
return _libsbml.SBase_getNotesString(self, *args)
def getAnnotation(self, *args):
"""
getAnnotation(SBase self) -> XMLNode
getAnnotation(SBase self) -> XMLNode
Returns the content of the 'annotation' subelement of this object as a
tree of XMLNode objects.
Whereas the SBML 'notes' subelement is a container for content to be
shown directly to humans, the 'annotation' element is a container for
optional software-generated content not meant to be shown to humans.
Every object derived from SBase can have its own value for
'annotation'. The element's content type is XML type 'any', allowing
essentially arbitrary well-formed XML data content.
SBML places a few restrictions on the organization of the content of
annotations; these are intended to help software tools read and write
the data as well as help reduce conflicts between annotations added by
different tools. Please see the SBML specifications for more details.
The annotations returned by this method will be in XML form. LibSBML
provides an object model and related interfaces for certain specific
kinds of annotations, namely model history information and RDF
content. See the ModelHistory, CVTerm and RDFAnnotationParser classes
for more information about the facilities available.
Returns the annotation of this SBML object as a tree of XMLNode
objects.
See also getAnnotationString(), isSetAnnotation(), setAnnotation(),
setAnnotation(), appendAnnotation(), appendAnnotation(),
unsetAnnotation().
"""
return _libsbml.SBase_getAnnotation(self, *args)
def getAnnotationString(self, *args):
"""
getAnnotationString(SBase self) -> string
getAnnotationString(SBase self) -> string
Returns the content of the 'annotation' subelement of this object as a
character string.
Whereas the SBML 'notes' subelement is a container for content to be
shown directly to humans, the 'annotation' element is a container for
optional software-generated content not meant to be shown to humans.
Every object derived from SBase can have its own value for
'annotation'. The element's content type is XML type 'any', allowing
essentially arbitrary well-formed XML data content.
SBML places a few restrictions on the organization of the content of
annotations; these are intended to help software tools read and write
the data as well as help reduce conflicts between annotations added by
different tools. Please see the SBML specifications for more details.
The annotations returned by this method will be in string form. See
the method getAnnotation() for a version that returns annotations in
XML form.
Returns the annotation of this SBML object as a character string.
See also getAnnotation(), isSetAnnotation(), setAnnotation(),
setAnnotation(), appendAnnotation(), appendAnnotation(),
unsetAnnotation().
"""
return _libsbml.SBase_getAnnotationString(self, *args)
def getNamespaces(self):
"""
getNamespaces(SBase self) -> XMLNamespaces
Returns a list of the XML Namespaces declared on the SBML document
owning this object.
The SBMLNamespaces object encapsulates SBML Level/Version/namespaces
information. It is used to communicate the SBML Level, Version, and
(in Level 3) packages used in addition to SBML Level 3 Core.
Returns the XML Namespaces associated with this SBML object, or None
in certain very usual circumstances where a namespace is not set.
See also getLevel(), getVersion().
"""
return _libsbml.SBase_getNamespaces(self)
def getSBMLDocument(self, *args):
"""
getSBMLDocument(SBase self) -> SBMLDocument
getSBMLDocument(SBase self) -> SBMLDocument
Returns the SBMLDocument object containing this object instance.
LibSBML uses the class SBMLDocument as a top-level container for
storing SBML content and data associated with it (such as warnings and
error messages). An SBML model in libSBML is contained inside an
SBMLDocument object. SBMLDocument corresponds roughly to the class
SBML defined in the SBML Level 3 and Level 2 specifications, but it
does not have a direct correspondence in SBML Level 1. (But, it is
created by libSBML no matter whether the model is Level 1, Level 2 or
Level 3.)
This method allows the caller to obtain the SBMLDocument for the
current object.
Returns the parent SBMLDocument object of this SBML object.
See also getParentSBMLObject(), getModel().
"""
return _libsbml.SBase_getSBMLDocument(self, *args)
def getParentSBMLObject(self, *args):
"""
getParentSBMLObject(SBase self) -> SBase
getParentSBMLObject(SBase self) -> SBase
Returns the parent SBML object containing this object.
This returns the immediately-containing object. This method is
convenient when holding an object nested inside other objects in an
SBML model.
Returns the parent SBML object of this SBML object.
See also getSBMLDocument(), getModel().
"""
return _libsbml.SBase_getParentSBMLObject(self, *args)
def getAncestorOfType(self, *args):
"""
getAncestorOfType(SBase self, int type, string pkgName) -> SBase
getAncestorOfType(SBase self, int type) -> SBase
getAncestorOfType(SBase self, int type, string pkgName) -> SBase
getAncestorOfType(SBase self, int type) -> SBase
Returns the first ancestor object that has the given SBML type code
from the given package.
LibSBML attaches an identifying code to every kind of SBML object.
These are known as SBML type codes. In the Python language interface
for libSBML, the type codes are defined as static integer constants in
the interface class 'libsbml'. The names of the type codes all begin
with the characters SBML_.
This method searches the tree of objects that are parents of this
object, and returns the first one that has the given SBML type code
from the given 'pkgName'.
Parameter 'type' is the SBML type code of the object sought
Parameter 'pkgName' is (optional) the short name of an SBML Level 3
package to which the sought-after object must belong
Returns the ancestor SBML object of this SBML object that corresponds
to the given SBML object type code, or None if no ancestor exists.
WARNING:
The optional argument 'pkgName' must be used for all type codes from
SBML Level 3 packages. Otherwise, the function will search the
'core' namespace alone, not find any corresponding elements, and
return None.
"""
return _libsbml.SBase_getAncestorOfType(self, *args)
def getSBOTerm(self):
"""
getSBOTerm(SBase self) -> int
Returns the integer portion of the value of the 'sboTerm' attribute of
this object.
Beginning with SBML Level 2 Version 3, objects derived from SBase have
an optional attribute named 'sboTerm' for supporting the use of the
Systems Biology Ontology. In SBML proper, the data type of the
attribute is a string of the form 'SBO:NNNNNNN', where 'NNNNNNN' is a
seven digit integer number; libSBML simplifies the representation by
only storing the 'NNNNNNN' integer portion. Thus, in libSBML, the
'sboTerm' attribute on SBase has data type int, and SBO identifiers
are stored simply as integers. (For convenience, libSBML offers
methods for returning both the integer form and a text-string form of
the SBO identifier.)
SBO terms are a type of optional annotation, and each different class
of SBML object derived from SBase imposes its own requirements about
the values permitted for 'sboTerm'. Please consult the SBML Level 2
Version 4 specification for more information about the use of SBO and
the 'sboTerm' attribute.
Returns the value of the 'sboTerm' attribute as an integer, or -1 if
the value is not set.
"""
return _libsbml.SBase_getSBOTerm(self)
def getSBOTermID(self):
"""
getSBOTermID(SBase self) -> string
Returns the string representation of the 'sboTerm' attribute of this
object.
Beginning with SBML Level 2 Version 3, objects derived from SBase have
an optional attribute named 'sboTerm' for supporting the use of the
Systems Biology Ontology. In SBML proper, the data type of the
attribute is a string of the form 'SBO:NNNNNNN', where 'NNNNNNN' is a
seven digit integer number; libSBML simplifies the representation by
only storing the 'NNNNNNN' integer portion. Thus, in libSBML, the
'sboTerm' attribute on SBase has data type int, and SBO identifiers
are stored simply as integers. This method returns the entire SBO
identifier as a text string in the form 'SBO:NNNNNNN'.
SBO terms are a type of optional annotation, and each different class
of SBML object derived from SBase imposes its own requirements about
the values permitted for 'sboTerm'. Please consult the SBML Level 2
Version 4 specification for more information about the use of SBO and
the 'sboTerm' attribute.
Returns the value of the 'sboTerm' attribute as a string (its value
will be of the form 'SBO:NNNNNNN'), or an empty string if the value is
not set.
"""
return _libsbml.SBase_getSBOTermID(self)
def getSBOTermAsURL(self):
"""
getSBOTermAsURL(SBase self) -> string
Returns the URL representation of the 'sboTerm' attribute of this
object.
This method returns the entire SBO identifier as a text string in the
form http://identifiers.org/biomodels.sbo/SBO:NNNNNNN'.
SBO terms are a type of optional annotation, and each different class
of SBML object derived from SBase imposes its own requirements about
the values permitted for 'sboTerm'. Please consult the SBML Level 2
Version 4 specification for more information about the use of SBO and
the 'sboTerm' attribute.
Returns the value of the 'sboTerm' attribute as an identifiers.org
URL, or an empty string if the value is not set.
"""
return _libsbml.SBase_getSBOTermAsURL(self)
def getLine(self):
"""
getLine(SBase self) -> unsigned int
Returns the line number on which this object first appears in the XML
representation of the SBML document.
Returns the line number of this SBML object.
Note:
The line number for each construct in an SBML model is set upon
reading the model. The accuracy of the line number depends on the
correctness of the XML representation of the model, and on the
particular XML parser library being used. The former limitation
relates to the following problem: if the model is actually invalid
XML, then the parser may not be able to interpret the data correctly
and consequently may not be able to establish the real line number.
The latter limitation is simply that different parsers seem to have
their own accuracy limitations, and out of all the parsers supported
by libSBML, none have been 100 accurate in all situations. (At this
time, libSBML supports the use of libxml2, Expat and Xerces.)
See also getColumn().
"""
return _libsbml.SBase_getLine(self)
def getColumn(self):
"""
getColumn(SBase self) -> unsigned int
Returns the column number on which this object first appears in the
XML representation of the SBML document.
Returns the column number of this SBML object.
Note:
The column number for each construct in an SBML model is set upon
reading the model. The accuracy of the column number depends on the
correctness of the XML representation of the model, and on the
particular XML parser library being used. The former limitation
relates to the following problem: if the model is actually invalid
XML, then the parser may not be able to interpret the data correctly
and consequently may not be able to establish the real column number.
The latter limitation is simply that different parsers seem to have
their own accuracy limitations, and out of all the parsers supported
by libSBML, none have been 100 accurate in all situations. (At this
time, libSBML supports the use of libxml2, Expat and Xerces.)
See also getLine().
"""
return _libsbml.SBase_getColumn(self)
def getModelHistory(self, *args):
"""
getModelHistory(SBase self) -> ModelHistory
getModelHistory(SBase self) -> ModelHistory
Returns the ModelHistory object, if any, attached to this object.
Returns the ModelHistory object attached to this object, or None if
none exist.
Note:
In SBML Level 2, model history annotations were only permitted on the
Model element. In SBML Level 3, they are permitted on all SBML
components derived from SBase.
"""
return _libsbml.SBase_getModelHistory(self, *args)
def isSetMetaId(self):
"""
isSetMetaId(SBase self) -> bool
Predicate returning True if this object's 'metaid' attribute is set.
The optional attribute named 'metaid', present on every major SBML
component type, is for supporting metadata annotations using RDF
(Resource Description Format). The attribute value has the data type
XML ID, the XML identifier type, which means each 'metaid' value must
be globally unique within an SBML file. The latter point is
important, because the uniqueness criterion applies across any
attribute with type ID anywhere in the file, not just the 'metaid'
attribute used by SBML---something to be aware of if your application-
specific XML content inside the 'annotation' subelement happens to use
the XML ID type. Although SBML itself specifies the use of XML ID
only for the 'metaid' attribute, SBML-compatible applications should
be careful if they use XML ID's in XML portions of a model that are
not defined by SBML, such as in the application-specific content of
the 'annotation' subelement. Finally, note that LibSBML does not
provide an explicit XML ID data type; it uses ordinary character
strings, which is easier for applications to support.
Returns True if the 'metaid' attribute of this SBML object is set,
False otherwise.
See also getMetaId(), setMetaId().
"""
return _libsbml.SBase_isSetMetaId(self)
def isSetId(self):
"""
isSetId(SBase self) -> bool
Internal implementation method.
"""
return _libsbml.SBase_isSetId(self)
def isSetName(self):
"""
isSetName(SBase self) -> bool
Internal implementation method.
"""
return _libsbml.SBase_isSetName(self)
def isSetNotes(self):
"""
isSetNotes(SBase self) -> bool
Predicate returning True if this object's 'notes' subelement exists
and has content.
The optional SBML element named 'notes', present on every major SBML
component type, is intended as a place for storing optional
information intended to be seen by humans. An example use of the
'notes' element would be to contain formatted user comments about the
model element in which the 'notes' element is enclosed. Every object
derived directly or indirectly from type SBase can have a separate
value for 'notes', allowing users considerable freedom when adding
comments to their models.
The format of 'notes' elements must be XHTML 1.0. To help verify the
formatting of 'notes' content, libSBML provides the static utility
method SyntaxChecker.hasExpectedXHTMLSyntax(); however, readers are
urged to consult the appropriate SBML specification document for the
Level and Version of their model for more in-depth explanations. The
SBML Level 2 and 3 specifications have considerable detail about how
'notes' element content must be structured.
Returns True if a 'notes' subelement exists, False otherwise.
See also getNotes(), getNotesString(), setNotes(), setNotes(),
appendNotes(), appendNotes(), unsetNotes(),
SyntaxChecker.hasExpectedXHTMLSyntax().
"""
return _libsbml.SBase_isSetNotes(self)
def isSetAnnotation(self):
"""
isSetAnnotation(SBase self) -> bool
Predicate returning True if this object's 'annotation' subelement
exists and has content.
Whereas the SBase 'notes' subelement is a container for content to be
shown directly to humans, the 'annotation' element is a container for
optional software-generated content not meant to be shown to humans.
Every object derived from SBase can have its own value for
'annotation'. The element's content type is XML type 'any', allowing
essentially arbitrary well-formed XML data content.
SBML places a few restrictions on the organization of the content of
annotations; these are intended to help software tools read and write
the data as well as help reduce conflicts between annotations added by
different tools. Please see the SBML specifications for more details.
Returns True if a 'annotation' subelement exists, False otherwise.
See also getAnnotation(), getAnnotationString(), setAnnotation(),
setAnnotation(), appendAnnotation(), appendAnnotation(),
unsetAnnotation().
"""
return _libsbml.SBase_isSetAnnotation(self)
def isSetSBOTerm(self):
"""
isSetSBOTerm(SBase self) -> bool
Predicate returning True if this object's 'sboTerm' attribute is set.
Returns True if the 'sboTerm' attribute of this SBML object is set,
False otherwise.
"""
return _libsbml.SBase_isSetSBOTerm(self)
def setMetaId(self, metaid):
"""
setMetaId(SBase self, string metaid) -> int
Sets the value of the meta-identifier attribute of this object.
The optional attribute named 'metaid', present on every major SBML
component type, is for supporting metadata annotations using RDF
(Resource Description Format). The attribute value has the data type
XML ID, the XML identifier type, which means each 'metaid' value must
be globally unique within an SBML file. The latter point is
important, because the uniqueness criterion applies across any
attribute with type ID anywhere in the file, not just the 'metaid'
attribute used by SBML---something to be aware of if your application-
specific XML content inside the 'annotation' subelement happens to use
the XML ID type. Although SBML itself specifies the use of XML ID
only for the 'metaid' attribute, SBML-compatible applications should
be careful if they use XML ID's in XML portions of a model that are
not defined by SBML, such as in the application-specific content of
the 'annotation' subelement. Finally, note that LibSBML does not
provide an explicit XML ID data type; it uses ordinary character
strings, which is easier for applications to support.
The string 'metaid' is copied.
Parameter 'metaid' is the identifier string to use as the value of the
'metaid' attribute
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
* LIBSBML_UNEXPECTED_ATTRIBUTE
See also getMetaId(), isSetMetaId().
"""
return _libsbml.SBase_setMetaId(self, metaid)
def isSetModelHistory(self):
"""
isSetModelHistory(SBase self) -> bool
Predicate returning True if this object has a ModelHistory object
attached to it.
Returns True if the ModelHistory of this object is set, False
otherwise.
Note:
In SBML Level 2, model history annotations were only permitted on the
Model element. In SBML Level 3, they are permitted on all SBML
components derived from SBase.
"""
return _libsbml.SBase_isSetModelHistory(self)
def setId(self, sid):
"""
setId(SBase self, string sid) -> int
Internal implementation method.
"""
return _libsbml.SBase_setId(self, sid)
def setName(self, name):
"""
setName(SBase self, string name) -> int
Internal implementation method.
"""
return _libsbml.SBase_setName(self, name)
def setAnnotation(self, *args):
"""
setAnnotation(SBase self, XMLNode annotation) -> int
setAnnotation(SBase self, string annotation) -> int
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
setAnnotation(XMLNode annotation)
Sets the value of the 'annotation' subelement of this SBML object.
The content of 'annotation' is copied, and any previous content of
this object's 'annotation' subelement is deleted.
Whereas the SBase 'notes' subelement is a container for content to be
shown directly to humans, the 'annotation' element is a container for
optional software-generated content not meant to be shown to humans.
Every object derived from SBase can have its own value for
'annotation'. The element's content type is XML type 'any', allowing
essentially arbitrary well-formed XML data content.
SBML places a few restrictions on the organization of the content of
annotations; these are intended to help software tools read and write
the data as well as help reduce conflicts between annotations added by
different tools. Please see the SBML specifications for more details.
Call this method will result in any existing content of the
'annotation' subelement to be discarded. Unless you have taken steps
to first copy and reconstitute any existing annotations into the
'annotation' that is about to be assigned, it is likely that
performing such wholesale replacement is unfriendly towards other
software applications whose annotations are discarded. An alternative
may be to use SBase.appendAnnotation() or SBase.appendAnnotation().
Parameter 'annotation' is an XML structure that is to be used as the
new content of the 'annotation' subelement of this object
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
See also getAnnotationString(), isSetAnnotation(), setAnnotation(),
appendAnnotation(), appendAnnotation(), unsetAnnotation(),
getAnnotationString(), isSetAnnotation(), setAnnotation(),
appendAnnotation(), appendAnnotation(), unsetAnnotation().
"""
return _libsbml.SBase_setAnnotation(self, *args)
def appendAnnotation(self, *args):
"""
appendAnnotation(SBase self, XMLNode annotation) -> int
appendAnnotation(SBase self, string annotation) -> int
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
appendAnnotation(XMLNode annotation)
Appends the given 'annotation' to the 'annotation' subelement of this
object.
Whereas the SBase 'notes' subelement is a container for content to be
shown directly to humans, the 'annotation' element is a container for
optional software-generated content not meant to be shown to humans.
Every object derived from SBase can have its own value for
'annotation'. The element's content type is XML type 'any', allowing
essentially arbitrary well-formed XML data content.
SBML places a few restrictions on the organization of the content of
annotations; these are intended to help software tools read and write
the data as well as help reduce conflicts between annotations added by
different tools. Please see the SBML specifications for more details.
Unlike SBase.setAnnotation() or SBase.setAnnotation(), this method
allows other annotations to be preserved when an application adds its
own data.
Parameter 'annotation' is an XML structure that is to be copied and
appended to the content of the 'annotation' subelement of this object
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
* LIBSBML_UNEXPECTED_ATTRIBUTE
* LIBSBML_DUPLICATE_ANNOTATION_NS With 'unexpected attribute'
returned if the parent element does not have the 'metaid' attribute
set, and 'duplicate annotation' set if the parent was already
annotated with the annotation in question.
See also getAnnotationString(), isSetAnnotation(), setAnnotation(),
setAnnotation(), appendAnnotation(), unsetAnnotation(),
getAnnotationString(), isSetAnnotation(), setAnnotation(),
setAnnotation(), appendAnnotation(), unsetAnnotation().
"""
return _libsbml.SBase_appendAnnotation(self, *args)
def removeTopLevelAnnotationElement(self, *args):
"""
removeTopLevelAnnotationElement(SBase self, string elementName, string elementURI, bool removeEmpty=True) -> int
removeTopLevelAnnotationElement(SBase self, string elementName, string elementURI) -> int
removeTopLevelAnnotationElement(SBase self, string elementName) -> int
Removes the top-level element within the 'annotation' subelement of
this SBML object with the given name and optional URI.
SBML places a few restrictions on the organization of the content of
annotations; these are intended to help software tools read and write
the data as well as help reduce conflicts between annotations added by
different tools. Please see the SBML specifications for more details.
Calling this method allows a particular annotation element to be
removed whilst the remaining annotations remain intact.
Parameter 'elementName' is a string representing the name of the top
level annotation element that is to be removed Parameter 'elementURI'
is an optional string that is used to check both the name and URI of
the top level element to be removed Parameter 'removeEmpty' is if
after removing of the element, the annotation is empty, and the
removeEmpty argument is true, the annotation node will be deleted
(default).
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
* LIBSBML_ANNOTATION_NAME_NOT_FOUND
* LIBSBML_ANNOTATION_NS_NOT_FOUND
See also replaceTopLevelAnnotationElement(),
replaceTopLevelAnnotationElement().
"""
return _libsbml.SBase_removeTopLevelAnnotationElement(self, *args)
def replaceTopLevelAnnotationElement(self, *args):
"""
replaceTopLevelAnnotationElement(SBase self, XMLNode annotation) -> int
replaceTopLevelAnnotationElement(SBase self, string annotation) -> int
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
replaceTopLevelAnnotationElement(XMLNode annotation)
Replaces the given top-level element within the 'annotation'
subelement of this SBML object and with the annotation element
supplied.
SBML places a few restrictions on the organization of the content of
annotations; these are intended to help software tools read and write
the data as well as help reduce conflicts between annotations added by
different tools. Please see the SBML specifications for more details.
This method determines the name of the element to be replaced from the
annotation argument. Functionally it is equivalent to calling
removeTopLevelAnnotationElement(name) followed by calling
appendAnnotation(annotation_with_name), with the exception that the
placement of the annotation element remains the same.
Parameter 'annotation' is XMLNode representing the replacement top
level annotation
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
* LIBSBML_INVALID_OBJECT
See also removeTopLevelAnnotationElement(),
replaceTopLevelAnnotationElement(), removeTopLevelAnnotationElement(),
replaceTopLevelAnnotationElement().
"""
return _libsbml.SBase_replaceTopLevelAnnotationElement(self, *args)
def setNotes(self, *args):
"""
setNotes(SBase self, XMLNode notes) -> int
setNotes(SBase self, string notes, bool addXHTMLMarkup=False) -> int
setNotes(SBase self, string notes) -> int
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
setNotes(XMLNode notes)
Sets the value of the 'notes' subelement of this SBML object.
The content of 'notes' is copied, and any existing content of this
object's 'notes' subelement is deleted.
The optional SBML element named 'notes', present on every major SBML
component type, is intended as a place for storing optional
information intended to be seen by humans. An example use of the
'notes' element would be to contain formatted user comments about the
model element in which the 'notes' element is enclosed. Every object
derived directly or indirectly from type SBase can have a separate
value for 'notes', allowing users considerable freedom when adding
comments to their models.
The format of 'notes' elements must be XHTML 1.0. To help verify the
formatting of 'notes' content, libSBML provides the static utility
method SyntaxChecker.hasExpectedXHTMLSyntax(); however, readers are
urged to consult the appropriate SBML specification document for the
Level and Version of their model for more in-depth explanations. The
SBML Level 2 and 3 specifications have considerable detail about how
'notes' element content must be structured.
Parameter 'notes' is an XML structure that is to be used as the
content of the 'notes' subelement of this object
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_OBJECT
See also getNotesString(), isSetNotes(), setNotes(), appendNotes(),
appendNotes(), unsetNotes(), SyntaxChecker.hasExpectedXHTMLSyntax(),
getNotesString(), isSetNotes(), setNotes(), appendNotes(),
appendNotes(), unsetNotes(), SyntaxChecker.hasExpectedXHTMLSyntax().
"""
return _libsbml.SBase_setNotes(self, *args)
def appendNotes(self, *args):
"""
appendNotes(SBase self, XMLNode notes) -> int
appendNotes(SBase self, string notes) -> int
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
appendNotes(XMLNode notes)
Appends the given 'notes' to the 'notes' subelement of this object.
The content of 'notes' is copied.
The optional SBML element named 'notes', present on every major SBML
component type, is intended as a place for storing optional
information intended to be seen by humans. An example use of the
'notes' element would be to contain formatted user comments about the
model element in which the 'notes' element is enclosed. Every object
derived directly or indirectly from type SBase can have a separate
value for 'notes', allowing users considerable freedom when adding
comments to their models.
The format of 'notes' elements must be XHTML 1.0. To help verify the
formatting of 'notes' content, libSBML provides the static utility
method SyntaxChecker.hasExpectedXHTMLSyntax(); however, readers are
urged to consult the appropriate SBML specification document for the
Level and Version of their model for more in-depth explanations. The
SBML Level 2 and 3 specifications have considerable detail about how
'notes' element content must be structured.
Parameter 'notes' is an XML node structure that is to appended to the
content of the 'notes' subelement of this object
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_OBJECT
* LIBSBML_OPERATION_FAILED
See also getNotesString(), isSetNotes(), setNotes(), setNotes(),
appendNotes(), unsetNotes(), SyntaxChecker.hasExpectedXHTMLSyntax(),
getNotesString(), isSetNotes(), setNotes(), setNotes(), appendNotes(),
unsetNotes(), SyntaxChecker.hasExpectedXHTMLSyntax().
"""
return _libsbml.SBase_appendNotes(self, *args)
def setModelHistory(self, history):
"""
setModelHistory(SBase self, ModelHistory history) -> int
Sets the ModelHistory of this object.
The content of 'history' is copied, and this object's existing model
history content is deleted.
Parameter 'history' is ModelHistory of this object.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_UNEXPECTED_ATTRIBUTE
* LIBSBML_INVALID_OBJECT
Note:
In SBML Level 2, model history annotations were only permitted on the
Model element. In SBML Level 3, they are permitted on all SBML
components derived from SBase.
"""
return _libsbml.SBase_setModelHistory(self, history)
def connectToParent(self, parent):
"""
connectToParent(SBase self, SBase parent)
Internal implementation method.
"""
return _libsbml.SBase_connectToParent(self, parent)
def connectToChild(self):
"""connectToChild(SBase self)"""
return _libsbml.SBase_connectToChild(self)
def setSBOTerm(self, *args):
"""
setSBOTerm(SBase self, int value) -> int
setSBOTerm(SBase self, string sboid) -> int
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
setSBOTerm(string &sboid)
Sets the value of the 'sboTerm' attribute by string.
Beginning with SBML Level 2 Version 3, objects derived from SBase have
an optional attribute named 'sboTerm' for supporting the use of the
Systems Biology Ontology. In SBML proper, the data type of the
attribute is a string of the form 'SBO:NNNNNNN', where 'NNNNNNN' is a
seven digit integer number; libSBML simplifies the representation by
only storing the 'NNNNNNN' integer portion. Thus, in libSBML, the
'sboTerm' attribute on SBase has data type int, and SBO identifiers
are stored simply as integers. This method lets you set the value of
'sboTerm' as a complete string of the form 'SBO:NNNNNNN', whereas
setSBOTerm(int value) allows you to set it using the integer form.
SBO terms are a type of optional annotation, and each different class
of SBML object derived from SBase imposes its own requirements about
the values permitted for 'sboTerm'. Please consult the SBML Level 2
Version 4 specification for more information about the use of SBO and
the 'sboTerm' attribute.
Parameter 'sboid' is the SBO identifier string of the form
'SBO:NNNNNNN'
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
* LIBSBML_UNEXPECTED_ATTRIBUTE
See also setSBOTerm(), setSBOTerm().
"""
return _libsbml.SBase_setSBOTerm(self, *args)
def setNamespaces(self, xmlns):
"""
setNamespaces(SBase self, XMLNamespaces xmlns) -> int
Sets the namespaces relevant of this SBML object.
The content of 'xmlns' is copied, and this object's existing namespace
content is deleted.
The SBMLNamespaces object encapsulates SBML Level/Version/namespaces
information. It is used to communicate the SBML Level, Version, and
(in Level 3) packages used in addition to SBML Level 3 Core.
Parameter 'xmlns' is the namespaces to set
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
"""
return _libsbml.SBase_setNamespaces(self, xmlns)
def unsetMetaId(self):
"""
unsetMetaId(SBase self) -> int
Unsets the value of the 'metaid' attribute of this SBML object.
The optional attribute named 'metaid', present on every major SBML
component type, is for supporting metadata annotations using RDF
(Resource Description Format). The attribute value has the data type
XML ID, the XML identifier type, which means each 'metaid' value must
be globally unique within an SBML file. The latter point is
important, because the uniqueness criterion applies across any
attribute with type ID anywhere in the file, not just the 'metaid'
attribute used by SBML---something to be aware of if your application-
specific XML content inside the 'annotation' subelement happens to use
the XML ID type. Although SBML itself specifies the use of XML ID
only for the 'metaid' attribute, SBML-compatible applications should
be careful if they use XML ID's in XML portions of a model that are
not defined by SBML, such as in the application-specific content of
the 'annotation' subelement. Finally, note that LibSBML does not
provide an explicit XML ID data type; it uses ordinary character
strings, which is easier for applications to support.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_UNEXPECTED_ATTRIBUTE
* LIBSBML_OPERATION_FAILED
"""
return _libsbml.SBase_unsetMetaId(self)
def unsetId(self):
"""
unsetId(SBase self) -> int
Unsets the value of the 'id' attribute of this SBML object.
Most (but not all) objects in SBML include two common attributes: 'id'
and 'name'. The identifier given by an object's 'id' attribute value
is used to identify the object within the SBML model definition. Other
objects can refer to the component using this identifier.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
"""
return _libsbml.SBase_unsetId(self)
def unsetName(self):
"""
unsetName(SBase self) -> int
Unsets the value of the 'name' attribute of this SBML object.
Most (but not all) objects in SBML include two common attributes: 'id'
and 'name'. In contrast to the 'id' attribute, the 'name' attribute
is optional and is not intended to be used for cross-referencing
purposes within a model. Its purpose instead is to provide a human-
readable label for the component. The data type of 'name' is the type
string defined in XML Schema. SBML imposes no restrictions as to the
content of 'name' attributes beyond those restrictions defined by the
string type in XML Schema.
The recommended practice for handling 'name' is as follows. If a
software tool has the capability for displaying the content of 'name'
attributes, it should display this content to the user as a
component's label instead of the component's 'id'. If the user
interface does not have this capability (e.g., because it cannot
display or use special characters in symbol names), or if the 'name'
attribute is missing on a given component, then the user interface
should display the value of the 'id' attribute instead. (Script
language interpreters are especially likely to display 'id' instead of
'name'.)
As a consequence of the above, authors of systems that automatically
generate the values of 'id' attributes should be aware some systems
may display the 'id''s to the user. Authors therefore may wish to
take some care to have their software create 'id' values that are: (a)
reasonably easy for humans to type and read; and (b) likely to be
meaningful, for example by making the 'id' attribute be an abbreviated
form of the name attribute value.
An additional point worth mentioning is although there are
restrictions on the uniqueness of 'id' values, there are no
restrictions on the uniqueness of 'name' values in a model. This
allows software applications leeway in assigning component
identifiers.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
"""
return _libsbml.SBase_unsetName(self)
def unsetNotes(self):
"""
unsetNotes(SBase self) -> int
Unsets the value of the 'notes' subelement of this SBML object.
The optional SBML element named 'notes', present on every major SBML
component type, is intended as a place for storing optional
information intended to be seen by humans. An example use of the
'notes' element would be to contain formatted user comments about the
model element in which the 'notes' element is enclosed. Every object
derived directly or indirectly from type SBase can have a separate
value for 'notes', allowing users considerable freedom when adding
comments to their models.
The format of 'notes' elements must be XHTML 1.0. To help verify the
formatting of 'notes' content, libSBML provides the static utility
method SyntaxChecker.hasExpectedXHTMLSyntax(); however, readers are
urged to consult the appropriate SBML specification document for the
Level and Version of their model for more in-depth explanations. The
SBML Level 2 and 3 specifications have considerable detail about how
'notes' element content must be structured.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
See also getNotesString(), isSetNotes(), setNotes(), setNotes(),
appendNotes(), appendNotes(), SyntaxChecker.hasExpectedXHTMLSyntax().
"""
return _libsbml.SBase_unsetNotes(self)
def unsetAnnotation(self):
"""
unsetAnnotation(SBase self) -> int
Unsets the value of the 'annotation' subelement of this SBML object.
Whereas the SBase 'notes' subelement is a container for content to be
shown directly to humans, the 'annotation' element is a container for
optional software-generated content not meant to be shown to humans.
Every object derived from SBase can have its own value for
'annotation'. The element's content type is XML type 'any', allowing
essentially arbitrary well-formed XML data content.
SBML places a few restrictions on the organization of the content of
annotations; these are intended to help software tools read and write
the data as well as help reduce conflicts between annotations added by
different tools. Please see the SBML specifications for more details.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
See also getAnnotation(), getAnnotationString(), isSetAnnotation(),
setAnnotation(), setAnnotation(), appendAnnotation(),
appendAnnotation().
"""
return _libsbml.SBase_unsetAnnotation(self)
def unsetSBOTerm(self):
"""
unsetSBOTerm(SBase self) -> int
Unsets the value of the 'sboTerm' attribute of this SBML object.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_UNEXPECTED_ATTRIBUTE
"""
return _libsbml.SBase_unsetSBOTerm(self)
def addCVTerm(self, term, newBag=False):
"""
addCVTerm(SBase self, CVTerm term, bool newBag=False) -> int
addCVTerm(SBase self, CVTerm term) -> int
Adds a copy of the given CVTerm object to this SBML object.
Parameter 'term' is the CVTerm to assign.
Parameter 'newBag' is if True, creates a new RDF bag with the same
identifier as a previous bag, and if False, adds the term to an
existing RDF bag with the same type of qualifier as the term being
added.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
* LIBSBML_UNEXPECTED_ATTRIBUTE, if this object lacks a 'metaid'
attribute
* LIBSBML_INVALID_OBJECT
Note:
Since the CV Term uses the 'metaid' attribute of the object as a
reference, if the object has no 'metaid' attribute value set, then the
CVTerm will not be added.
Note:
This method should be used with some caution. The fact that this
method copies the object passed to it means that the caller will be
left holding a physically different object instance than the one
contained inside this object. Changes made to the original object
instance (such as resetting attribute values) will not affect the
instance in this object. In addition, the caller should make sure to
free the original object if it is no longer being used, or else a
memory leak will result. Please see other methods on this class
(particularly a corresponding method whose name begins with the word
create) for alternatives that do not lead to these issues.
"""
return _libsbml.SBase_addCVTerm(self, term, newBag)
def getCVTerms(self):
"""
getCVTerms(self) -> CVTermList
Get the CVTermList of CVTerm objects in this SBase.
Returns the CVTermList for this SBase.
"""
return _libsbml.SBase_getCVTerms(self)
def getNumCVTerms(self):
"""
getNumCVTerms(SBase self) -> unsigned int
Returns the number of CVTerm objects in the annotations of this SBML
object.
Returns the number of CVTerms for this SBML object.
"""
return _libsbml.SBase_getNumCVTerms(self)
def getCVTerm(self, n):
"""
getCVTerm(SBase self, unsigned int n) -> CVTerm
Returns the nth CVTerm in the list of CVTerms of this SBML object.
Parameter 'n' is long the index of the CVTerm to retrieve
Returns the nth CVTerm in the list of CVTerms for this SBML object.
"""
return _libsbml.SBase_getCVTerm(self, n)
def unsetCVTerms(self):
"""
unsetCVTerms(SBase self) -> int
Clears the list of CVTerm objects attached to this SBML object.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
"""
return _libsbml.SBase_unsetCVTerms(self)
def unsetModelHistory(self):
"""
unsetModelHistory(SBase self) -> int
Unsets the ModelHistory object attached to this object.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_UNEXPECTED_ATTRIBUTE
* LIBSBML_OPERATION_FAILED
Note:
In SBML Level 2, model history annotations were only permitted on the
Model element. In SBML Level 3, they are permitted on all SBML
components derived from SBase.
"""
return _libsbml.SBase_unsetModelHistory(self)
def getResourceBiologicalQualifier(self, resource):
"""
getResourceBiologicalQualifier(SBase self, string resource) -> BiolQualifierType_t
Returns the MIRIAM biological qualifier associated with the given
resource.
In MIRIAM, qualifiers are an optional means of indicating the
relationship between a model component and its annotations. There are
two broad kinds of annotations: model and biological. The latter kind
is used to qualify the relationship between a model component and a
biological entity which it represents. Examples of relationships
include 'is' and 'has part', but many others are possible. MIRIAM
defines numerous relationship qualifiers to enable different software
tools to qualify biological annotations in the same standardized way.
In libSBML, the MIRIAM controlled-vocabulary annotations on an SBML
model element are represented using lists of CVTerm objects, and the
the MIRIAM biological qualifiers are represented using values whose
names begin with BQB_ in the interface class libsbml.
This method searches the controlled-vocabulary annotations (i.e., the
list of CVTerm objects) on the present object, then out of those that
have biological qualifiers, looks for an annotation to the given
'resource'. If such an annotation is found, it returns the type of
biological qualifier associated with that resource as a value whose
name begins with BQB_ from the interface class libsbml.
Parameter 'resource' is string representing the resource; e.g.,
'http://www.geneontology.org/#GO:0005892'.
Returns the qualifier associated with the resource, or BQB_UNKNOWN if
the resource does not exist.
Note:
The set of MIRIAM biological qualifiers grows over time, although
relatively slowly. The values are up to date with MIRIAM at the time
of a given libSBML release. The set of values in list of BQB_
constants defined in libsbml may be expanded in later libSBML
releases, to match the values defined by MIRIAM at that later time.
"""
return _libsbml.SBase_getResourceBiologicalQualifier(self, resource)
def getResourceModelQualifier(self, resource):
"""
getResourceModelQualifier(SBase self, string resource) -> ModelQualifierType_t
Returns the MIRIAM model qualifier associated with the given resource.
In MIRIAM, qualifiers are an optional means of indicating the
relationship between a model component and its annotations. There are
two broad kinds of annotations: model and biological. The former kind
is used to qualify the relationship between a model component and
another modeling object. An example qualifier is 'isDerivedFrom', to
indicate that a given component of the model is derived from the
modeling object represented by the referenced resource. MIRIAM
defines numerous relationship qualifiers to enable different software
tools to qualify model annotations in the same standardized way. In
libSBML, the MIRIAM controlled-vocabulary annotations on an SBML model
element are represented using lists of CVTerm objects, and the the
MIRIAM model qualifiers are represented using values whose names begin
with BQM_ in the interface class libsbml.
This method method searches the controlled-vocabulary annotations
(i.e., the list of CVTerm objects) on the present object, then out of
those that have model qualifiers, looks for an annotation to the given
'resource'. If such an annotation is found, it returns the type of
type of model qualifier associated with that resource as a value
whose name begins with BQM_ from the interface class libsbml.
Parameter 'resource' is string representing the resource; e.g.,
'http://www.geneontology.org/#GO:0005892'.
Returns the model qualifier type associated with the resource, or
BQM_UNKNOWN if the resource does not exist.
Note:
The set of MIRIAM model qualifiers grows over time, although
relatively slowly. The values are up to date with MIRIAM at the time
of a given libSBML release. The set of values in list of BQM_
constants defined in libsbml may be expanded in later libSBML
releases, to match the values defined by MIRIAM at that later time.
"""
return _libsbml.SBase_getResourceModelQualifier(self, resource)
def getModel(self):
"""
getModel(SBase self) -> Model
Returns the Model object for the SBML Document in which the current
object is located.
Returns the Model object for the SBML Document of this SBML object.
See also getParentSBMLObject(), getSBMLDocument().
"""
return _libsbml.SBase_getModel(self)
def getLevel(self):
"""
getLevel(SBase self) -> unsigned int
Returns the SBML Level of the SBMLDocument object containing this
object.
LibSBML uses the class SBMLDocument as a top-level container for
storing SBML content and data associated with it (such as warnings and
error messages). An SBML model in libSBML is contained inside an
SBMLDocument object. SBMLDocument corresponds roughly to the class
SBML defined in the SBML Level 3 and Level 2 specifications, but it
does not have a direct correspondence in SBML Level 1. (But, it is
created by libSBML no matter whether the model is Level 1, Level 2 or
Level 3.)
Returns the SBML level of this SBML object.
See also getVersion(), getNamespaces(), getPackageVersion().
"""
return _libsbml.SBase_getLevel(self)
def getVersion(self):
"""
getVersion(SBase self) -> unsigned int
Returns the Version within the SBML Level of the SBMLDocument object
containing this object.
LibSBML uses the class SBMLDocument as a top-level container for
storing SBML content and data associated with it (such as warnings and
error messages). An SBML model in libSBML is contained inside an
SBMLDocument object. SBMLDocument corresponds roughly to the class
SBML defined in the SBML Level 3 and Level 2 specifications, but it
does not have a direct correspondence in SBML Level 1. (But, it is
created by libSBML no matter whether the model is Level 1, Level 2 or
Level 3.)
Returns the SBML version of this SBML object.
See also getLevel(), getNamespaces().
"""
return _libsbml.SBase_getVersion(self)
def getPackageVersion(self):
"""
getPackageVersion(SBase self) -> unsigned int
Returns the Version of the SBML Level 3 package to which this element
belongs to.
Returns the version of the SBML Level 3 package to which this element
belongs. The value 0 will be returned if this element belongs to the
SBML Level 3 Core package.
See also getLevel(), getVersion().
"""
return _libsbml.SBase_getPackageVersion(self)
def getPackageName(self):
"""
getPackageName(SBase self) -> string
Returns the name of the SBML Level 3 package in which this element is
defined.
Returns the name of the SBML package in which this element is defined.
The string "core" will be returned if this element is defined in
SBML Level 3 Core. The string "unknown" will be returned if this
element is not defined in any SBML package.
"""
return _libsbml.SBase_getPackageName(self)
def getTypeCode(self):
"""
getTypeCode(SBase self) -> int
Returns the libSBML type code for this object.
LibSBML attaches an identifying code to every kind of SBML object.
These are integer constants known as SBML type codes. The names of
all the codes begin with the characters SBML_. In the Python language
interface for libSBML, the type codes are defined as static integer
constants in the interface class 'libsbml'. Note that different Level
3 package plug-ins may use overlapping type codes; to identify the
package to which a given object belongs, call the getPackageName()
method on the object.
Here follow some additional general information about libSBML type
codes:
* The codes are the possible return values (integers) for the
following functions:
* SBase.getTypeCode()
* ListOf.getItemTypeCode() (Compatibility note: in libSBML 5, the
type of return values of these functions changed from an enumeration
to an integer for extensibility in the face of different programming
languages.)
* Each package extension must define similar sets of values for
each SBase subclass (e.g. SBMLLayoutTypeCode_t for the SBML Level 3
Layout extension, SBMLFbcTypeCode_t for the SBML Level 3 Flux Balance
Constraints extension, etc.).
* The value of each package-specific type code can be duplicated
between those of different packages. (This is necessary because the
development of libSBML extensions for different SBML packages may be
undertaken by different developers at different times; requiring the
developers to coordinate their use of type codes would be nettlesome
and probably doomed to failure.)
* To distinguish between the type codes of different packages,
both the return value of SBase.getTypeCode() and
SBase.getPackageName() must be checked. This is particularly
important for functions that take an SBML type code as an argument,
such as SBase.getAncestorOfType(), which by default assumes you are
handing it a core type, and will return None if the value you give it
is actually from a package.
The following example code illustrates the combined use of
SBase.getPackageName() and SBase.getTypeCode():
def example(item):
pkg_name = item.getPackageName()
type_code = item.getTypeCode()
if pkg_name == 'core':
print('Got a ' + SBMLTypeCode_toString(type_code, 'core') + ' object')
if type_code == SBML_MODEL:
print('This is a very, very nice model')
# Do whatever the application wants to do with the model.
elif type_code == SBML_COMPARTMENT:
print('This is a very, very nice compartment')
# Do whatever the application wants to do with the compartment.
elif type_code == SBML_SPECIES:
print('This is a very, very nice species')
# Do whatever the application wants to do with the species.
elif ...
...
elif pkg_name == 'layout':
print('Got a ' + SBMLTypeCode_toString(type_code, 'layout') + ' object')
if type_code == SBML_LAYOUT_POINT:
print('This is a very, very nice layout point')
# Do whatever the application wants to do with the layout point.
elif type_code == SBML_LAYOUT_BOUNDINGBOX:
print('This is a very, very nice layout bounding box')
# Do whatever the application wants to do with the layout bounding box.
elif ...
...
elif pkg_name == 'unknown':
print('Something went wrong -- libSBML did not recognize the object type')
# Handle errors
Returns the SBML object type code of this SBML object, or
SBML_UNKNOWN (the default). The latter is possible because subclasses
of SBase are not required to implement this method to return a type
code.
WARNING:
The specific integer values of the possible type codes may be reused
by different Level 3 package plug-ins. Thus, to identifiy the correct
code, it is necessary to invoke both getTypeCode() and
getPackageName().
See also getPackageName(), getElementName().
"""
return _libsbml.SBase_getTypeCode(self)
def hasValidLevelVersionNamespaceCombination(self):
"""
hasValidLevelVersionNamespaceCombination(SBase self) -> bool
Predicate returning @c true if this object's level/version and namespace
values correspond to a valid SBML specification.
The valid combinations of SBML Level, Version and Namespace as of this
release of libSBML are the following:
Level 1 Version 2: http
://www.sbml.org/sbml/level1
Level 2 Version 1: http
://www.sbml.org/sbml/level2
Level 2 Version 2: http
://www.sbml.org/sbml/level2/version2
Level 2 Version 3: http
://www.sbml.org/sbml/level2/version3
Level 2 Version 4: http
://www.sbml.org/sbml/level2/version4
Level 3 Version 1 Core: http
://www.sbml.org/sbml/level3/version1/core
@return @c true if the level, version and namespace values of this
SBML object correspond to a valid set of values, @c false otherwise.
"""
return _libsbml.SBase_hasValidLevelVersionNamespaceCombination(self)
def getElementName(self):
"""
getElementName(SBase self) -> string
Returns the XML element name of this object.
This is overridden by subclasses to return a string appropriate to the
SBML component. For example, Model defines it as returning 'model',
CompartmentType defines it as returning 'compartmentType', and so on.
"""
return _libsbml.SBase_getElementName(self)
def toSBML(self):
"""
toSBML(SBase self) -> char *
Returns a string consisting of a partial SBML corresponding to just
this object.
Returns the partial SBML that describes this SBML object.
WARNING:
This is primarily provided for testing and debugging purposes. It may
be removed in a future version of libSBML.
"""
return _libsbml.SBase_toSBML(self)
def toXMLNode(self):
"""
toXMLNode(SBase self) -> XMLNode
Returns this element as an XMLNode.
Returns this element as an XMLNode.
WARNING:
This operation is computationally expensive, because the element has
to be fully serialized to a string and then parsed into the XMLNode
structure. Attempting to convert a large tree structure (e.g., a
large Model) may consume significant computer memory and time.
"""
return _libsbml.SBase_toXMLNode(self)
def getPlugin(self, *args):
"""
getPlugin(SBase self, string package) -> SBasePlugin
getPlugin(SBase self, string package) -> SBasePlugin
getPlugin(SBase self, unsigned int n) -> SBasePlugin
getPlugin(SBase self, unsigned int n) -> SBasePlugin
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
getPlugin(long n)
Returns the nth plug-in object (extension interface) for an SBML Level
3 package extension.
SBML Level 3 consists of a Core definition that can be extended via
optional SBML Level 3 packages. A given model may indicate that it
uses one or more SBML packages, and likewise, a software tool may be
able to support one or more packages. LibSBML does not come
preconfigured with all possible packages included and enabled, in part
because not all package specifications have been finalized. To
support the ability for software systems to enable support for the
Level 3 packages they choose, libSBML features a plug-in mechanism.
Each SBML Level 3 package is implemented in a separate code plug-in
that can be enabled by the application to support working with that
SBML package. A given SBML model may thus contain not only objects
defined by SBML Level 3 Core, but also objects created by libSBML
plug-ins supporting additional Level 3 packages.
Parameter 'n' is the index of the plug-in to return
Returns the nth plug-in object (the libSBML extension interface) of a
package extension.
See also getNumPlugins(), getPlugin(), getPlugin().
"""
return _libsbml.SBase_getPlugin(self, *args)
def getDisabledPlugin(self, *args):
"""
getDisabledPlugin(SBase self, unsigned int n) -> SBasePlugin
getDisabledPlugin(SBase self, unsigned int n) -> SBasePlugin
Returns the nth disabled plug-in object (extension interface) for an
SBML Level 3 package extension.
SBML Level 3 consists of a Core definition that can be extended via
optional SBML Level 3 packages. A given model may indicate that it
uses one or more SBML packages, and likewise, a software tool may be
able to support one or more packages. LibSBML does not come
preconfigured with all possible packages included and enabled, in part
because not all package specifications have been finalized. To
support the ability for software systems to enable support for the
Level 3 packages they choose, libSBML features a plug-in mechanism.
Each SBML Level 3 package is implemented in a separate code plug-in
that can be enabled by the application to support working with that
SBML package. A given SBML model may thus contain not only objects
defined by SBML Level 3 Core, but also objects created by libSBML
plug-ins supporting additional Level 3 packages.
Parameter 'n' is the index of the disabled plug-in to return
Returns the nth disabled plug-in object (the libSBML extension
interface) of a package extension.
See also getNumDisabledPlugins(), getPlugin().
"""
return _libsbml.SBase_getDisabledPlugin(self, *args)
def getNumPlugins(self):
"""
getNumPlugins(SBase self) -> unsigned int
Returns the number of plug-in objects (extenstion interfaces) for SBML
Level 3 package extensions known.
SBML Level 3 consists of a Core definition that can be extended via
optional SBML Level 3 packages. A given model may indicate that it
uses one or more SBML packages, and likewise, a software tool may be
able to support one or more packages. LibSBML does not come
preconfigured with all possible packages included and enabled, in part
because not all package specifications have been finalized. To
support the ability for software systems to enable support for the
Level 3 packages they choose, libSBML features a plug-in mechanism.
Each SBML Level 3 package is implemented in a separate code plug-in
that can be enabled by the application to support working with that
SBML package. A given SBML model may thus contain not only objects
defined by SBML Level 3 Core, but also objects created by libSBML
plug-ins supporting additional Level 3 packages.
Returns the number of plug-in objects (extension interfaces) of
package extensions known by this instance of libSBML.
See also getPlugin().
"""
return _libsbml.SBase_getNumPlugins(self)
def getNumDisabledPlugins(self):
"""
getNumDisabledPlugins(SBase self) -> unsigned int
Returns the number of disabled plug-in objects (extenstion interfaces)
for SBML Level 3 package extensions known.
SBML Level 3 consists of a Core definition that can be extended via
optional SBML Level 3 packages. A given model may indicate that it
uses one or more SBML packages, and likewise, a software tool may be
able to support one or more packages. LibSBML does not come
preconfigured with all possible packages included and enabled, in part
because not all package specifications have been finalized. To
support the ability for software systems to enable support for the
Level 3 packages they choose, libSBML features a plug-in mechanism.
Each SBML Level 3 package is implemented in a separate code plug-in
that can be enabled by the application to support working with that
SBML package. A given SBML model may thus contain not only objects
defined by SBML Level 3 Core, but also objects created by libSBML
plug-ins supporting additional Level 3 packages.
Returns the number of disabled plug-in objects (extension interfaces)
of package extensions known by this instance of libSBML.
"""
return _libsbml.SBase_getNumDisabledPlugins(self)
def deleteDisabledPlugins(self, recursive=True):
"""
deleteDisabledPlugins(SBase self, bool recursive=True)
deleteDisabledPlugins(SBase self)
Deletes all information stored in disabled plugins.
Parameter 'recursive' is if True, the disabled information will be
deleted also from all child elements, otherwise only from this SBase
element.
See also getNumDisabledPlugins().
"""
return _libsbml.SBase_deleteDisabledPlugins(self, recursive)
def enablePackage(self, pkgURI, pkgPrefix, flag):
"""
enablePackage(SBase self, string pkgURI, string pkgPrefix, bool flag) -> int
Enables or disables the given SBML Level 3 package on this object.
This method enables the specified package on this object and other
objects connected by child-parent links in the same SBMLDocument
object. This method is the converse of SBase.disablePackage().
Parameter 'pkgURI' is the URI of the package.
Parameter 'pkgPrefix' is the XML prefix of the package
Parameter 'flag' is whether to enable (True) or disable (False) the
package
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_PKG_UNKNOWN
* LIBSBML_PKG_VERSION_MISMATCH
* LIBSBML_PKG_CONFLICTED_VERSION
See also disablePackage().
"""
return _libsbml.SBase_enablePackage(self, pkgURI, pkgPrefix, flag)
def disablePackage(self, pkgURI, pkgPrefix):
"""
disablePackage(SBase self, string pkgURI, string pkgPrefix) -> int
Disables the given SBML Level 3 package on this object.
This method disables the specified package on this object and other
objects connected by child-parent links in the same SBMLDocument
object.
An example of when this may be useful is during construction of model
components when mixing existing and new models. Suppose your
application read an SBML document containing a model that used the
SBML Hierarchical Model Composition ("comp") package, and extracted
parts of that model in order to construct a new model in memory. The
new, in-memory model will not accept a component drawn from an other
SBMLDocument with different package namespace declarations. You could
reconstruct the same namespaces in the in-memory model first, but as a
shortcut, you could also disable the package namespace on the object
being added. Here is a code example to help clarify this:
import sys
import os.path
from libsbml import *
# We read an SBML L3V1 model that uses the 'comp' package.
doc = readSBML('sbml-file-with-comp-elements.xml');
if doc.getNumErrors() > 0:
print('readSBML encountered errors while reading the file.')
doc.printErrors()
sys.exit(1)
# We extract one of the species from the model.
model = doc.getModel()
if model == None:
print('Unable to retrieve Model object')
sys.exit(1)
s1 = model.getSpecies(0)
if s1 == None:
print('Unable to retrieve Species object')
sys.exit(1)
# We construct a new model.
# This model does not use the 'comp' package.
try:
newDoc = SBMLDocument(3, 1)
except ValueError:
print('Could not create SBMLDocument object')
sys.exit(1)
newModel = newDoc.createModel()
if newModel == None:
print('Unable to create new Model object')
sys.exit(1)
# The following would normally fail with an error, because
# addSpecies() would first check that the parent of the given
# object has namespaces declared, and will discover that s1
# does but newModel does not.
# newModel.addSpecies(s1)
# However, if we disable the 'comp' package on s1, then the
# call to addSpecies will work.
compNS = 'http://www.sbml.org/sbml/level3/version1/comp/version1'
status = s1.disablePackage(compNS, 'comp')
if status != LIBSBML_OPERATION_SUCCESS:
print('Unable to disable package.')
sys.exit(1)
newSpecies = newModel.addSpecies(s1) # This will work now.
if newSpecies == None:
print('Could not add Species') # (This will not happen,
sys.exit(1) # but always check errors.)
Parameter 'pkgURI' is the URI of the package
Parameter 'pkgPrefix' is the XML prefix of the package
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_PKG_UNKNOWN
* LIBSBML_PKG_VERSION_MISMATCH
* LIBSBML_PKG_CONFLICTED_VERSION
See also enablePackage().
"""
return _libsbml.SBase_disablePackage(self, pkgURI, pkgPrefix)
def enablePackageInternal(self, pkgURI, pkgPrefix, flag):
"""
enablePackageInternal(SBase self, string pkgURI, string pkgPrefix, bool flag)
Internal implementation method.
"""
return _libsbml.SBase_enablePackageInternal(self, pkgURI, pkgPrefix, flag)
def isPackageURIEnabled(self, pkgURI):
"""
isPackageURIEnabled(SBase self, string pkgURI) -> bool
Predicate returning True if an SBML Level 3 package with the given URI
is enabled with this object.
Parameter 'pkgURI' is the URI of the package
Returns True if the given package is enabled within this object, False
otherwise.
See also isPackageEnabled().
"""
return _libsbml.SBase_isPackageURIEnabled(self, pkgURI)
def isPackageEnabled(self, pkgName):
"""
isPackageEnabled(SBase self, string pkgName) -> bool
Predicate returning True if the given SBML Level 3 package is enabled
with this object.
The search ignores the package version.
Parameter 'pkgName' is the name of the package
Returns True if the given package is enabled within this object, False
otherwise.
See also isPackageURIEnabled().
"""
return _libsbml.SBase_isPackageEnabled(self, pkgName)
def isPkgURIEnabled(self, pkgURI):
"""
isPkgURIEnabled(SBase self, string pkgURI) -> bool
Predicate returning True if an SBML Level 3 package with the given URI
is enabled with this object.
Parameter 'pkgURI' is the URI of the package
Returns True if the given package is enabled within this object, False
otherwise.
DEPRECATED. Replaced in libSBML 5.2.0 by SBase.isPackageURIEnabled().
See also isPkgEnabled().
"""
return _libsbml.SBase_isPkgURIEnabled(self, pkgURI)
def isPkgEnabled(self, pkgName):
"""
isPkgEnabled(SBase self, string pkgName) -> bool
Predicate returning True if the given SBML Level 3 package is enabled
with this object.
The search ignores the package version.
Parameter 'pkgName' is the name of the package
Returns True if the given package is enabled within this object, False
otherwise.
DEPRECATED. Replaced in libSBML 5.2.0 by SBase.isPackageEnabled().
See also isPkgURIEnabled().
"""
return _libsbml.SBase_isPkgEnabled(self, pkgName)
def writeExtensionElements(self, stream):
"""
writeExtensionElements(SBase self, XMLOutputStream stream)
Internal implementation method.
"""
return _libsbml.SBase_writeExtensionElements(self, stream)
def hasRequiredAttributes(self):
"""
hasRequiredAttributes(SBase self) -> bool
Internal implementation method.
"""
return _libsbml.SBase_hasRequiredAttributes(self)
def hasRequiredElements(self):
"""
hasRequiredElements(SBase self) -> bool
Internal implementation method.
"""
return _libsbml.SBase_hasRequiredElements(self)
def checkCompatibility(self, object):
"""
checkCompatibility(SBase self, SBase object) -> int
Internal implementation method.
"""
return _libsbml.SBase_checkCompatibility(self, object)
def setSBMLNamespacesAndOwn(self, sbmlns):
"""
setSBMLNamespacesAndOwn(SBase self, SBMLNamespaces sbmlns)
Internal implementation method.
"""
return _libsbml.SBase_setSBMLNamespacesAndOwn(self, sbmlns)
def getSBMLNamespaces(self):
"""
getSBMLNamespaces(SBase self) -> SBMLNamespaces
Internal implementation method.
"""
return _libsbml.SBase_getSBMLNamespaces(self)
def checkMathMLNamespace(self, elem):
"""
checkMathMLNamespace(SBase self, XMLToken elem) -> string
Internal implementation method.
"""
return _libsbml.SBase_checkMathMLNamespace(self, elem)
def getDerivedUnitDefinition(self):
"""
getDerivedUnitDefinition(SBase self) -> UnitDefinition
Internal implementation method.
"""
return _libsbml.SBase_getDerivedUnitDefinition(self)
def containsUndeclaredUnits(self):
"""
containsUndeclaredUnits(SBase self) -> bool
Internal implementation method.
"""
return _libsbml.SBase_containsUndeclaredUnits(self)
def removeFromParentAndDelete(self):
"""
removeFromParentAndDelete(SBase self) -> int
Removes this object from its parent.
If the parent was storing this object as a pointer, it is deleted. If
not, it is simply cleared (as in ListOf objects). This is a pure
virtual method, as every SBase element has different parents, and
therefore different methods of removing itself. Will fail (and not
delete itself) if it has no parent object. This function is designed
to be overridden, but for all objects whose parent is of the class
ListOf, the default implementation will work.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
"""
return _libsbml.SBase_removeFromParentAndDelete(self)
def matchesSBMLNamespaces(self, *args):
"""
matchesSBMLNamespaces(SBase self, SBase sb) -> bool
matchesSBMLNamespaces(SBase self, SBase sb) -> bool
Returns True if this object's set of XML namespaces are the same as
the given object's XML namespaces.
The SBMLNamespaces object encapsulates SBML Level/Version/namespaces
information. It is used to communicate the SBML Level, Version, and
(in Level 3) packages used in addition to SBML Level 3 Core. A common
approach to using libSBML's SBMLNamespaces facilities is to create an
SBMLNamespaces object somewhere in a program once, then hand that
object as needed to object constructors that accept SBMLNamespaces as
arguments.
Parameter 'sb' is an object to compare with respect to namespaces
Returns boolean, True if this object's collection of namespaces is the
same as 'sb's', False otherwise.
"""
return _libsbml.SBase_matchesSBMLNamespaces(self, *args)
def matchesRequiredSBMLNamespacesForAddition(self, *args):
"""
matchesRequiredSBMLNamespacesForAddition(SBase self, SBase sb) -> bool
matchesRequiredSBMLNamespacesForAddition(SBase self, SBase sb) -> bool
Returns True if this object's set of XML namespaces are a subset of
the given object's XML namespaces.
The SBMLNamespaces object encapsulates SBML Level/Version/namespaces
information. It is used to communicate the SBML Level, Version, and
(in Level 3) packages used in addition to SBML Level 3 Core. A common
approach to using libSBML's SBMLNamespaces facilities is to create an
SBMLNamespaces object somewhere in a program once, then hand that
object as needed to object constructors that accept SBMLNamespaces as
arguments.
Parameter 'sb' is an object to compare with respect to namespaces
Returns boolean, True if this object's collection of namespaces is a
subset of 'sb's', False otherwise.
"""
return _libsbml.SBase_matchesRequiredSBMLNamespacesForAddition(self, *args)
def getURI(self):
"""
getURI(SBase self) -> string
Gets the namespace URI to which this element belongs to.
For example, all elements that belong to SBML Level 3 Version 1 Core
must would have the URI
'http://www.sbml.org/sbml/level3/version1/core'; all elements that
belong to Layout Extension Version 1 for SBML Level 3 Version 1 Core
must would have the URI
'http://www.sbml.org/sbml/level3/version1/layout/version1'.
This function first returns the URI for this element by looking into
the SBMLNamespaces object of the document with the its package name.
If not found, it will return the XML namespace to which this element
belongs.
Returns the URI of this element
See also getSBMLDocument(), getPackageName().
"""
return _libsbml.SBase_getURI(self)
def getPrefix(self):
"""
getPrefix(SBase self) -> string
Returns the namespace prefix of this element.
"""
return _libsbml.SBase_getPrefix(self)
__metaclass__ = AutoProperty
def __eq__(self, rhs):
if ((self is None) and (rhs is None)): return True
if ((self is None) or (rhs is None)): return False
if (hasattr(self, 'this') and hasattr(rhs, 'this')):
if (self.this == rhs.this): return True
return False
def __ne__(self, rhs):
if ((self is None) and (rhs is None)): return False
if ((self is None) or (rhs is None)): return True
if (hasattr(self, 'this') and hasattr(rhs, 'this')):
if (self.this == rhs.this): return False
return True
def getListOfAllElements(self, filter=None):
"""
getListOfAllElements(SBase self, ElementFilter filter=None) -> SBaseList
getListOfAllElements(SBase self) -> SBaseList
Returns an SBaseList of all child SBase objects, including those
nested to an arbitrary depth.
@return a list of all objects that are children of this object.
"""
return _libsbml.SBase_getListOfAllElements(self, filter)
def getListOfAllElementsFromPlugins(self, filter=None):
"""
getListOfAllElementsFromPlugins(SBase self, ElementFilter filter=None) -> SBaseList
getListOfAllElementsFromPlugins(SBase self) -> SBaseList
Returns a List of all child SBase objects contained in SBML package
plug-ins.
@copydetails doc_what_are_plugins
This method walks down the list of all SBML Level 3 packages used
by this object and returns all child objects defined by those packages.
@return a pointer to a List of pointers to all children objects from
plug-ins.
@ifnot hasDefaultArgs @htmlinclude warn-default-args-in-docs.html @endif@~
"""
return _libsbml.SBase_getListOfAllElementsFromPlugins(self, filter)
SBase_swigregister = _libsbml.SBase_swigregister
SBase_swigregister(SBase)
class ListOf(SBase):
"""
Parent class for libSBML's 'ListOfXYZ' classes.
The ListOf class in libSBML is a utility class that serves as the
parent class for implementing the ListOf__ classes. It provides
methods for working generically with the various SBML lists of objects
in a program. LibSBML uses this separate list class rather than
ordinary Python lists, so that it can provide the methods and features
associated with SBase.
The various ListOf___ classes in SBML are merely containers used for
organizing the main components of an SBML model. In libSBML's
implementation, ListOf___ classes are derived from the intermediate
utility class ListOf, which is not defined by the SBML specifications
but serves as a useful programmatic construct. ListOf is itself is in
turn derived from SBase, which provides all of the various ListOf___
classes with common features defined by the SBML specification, such
as 'metaid' attributes and annotations.
The relationship between the lists and the rest of an SBML model is
illustrated by the following (for SBML Level 2 Version 4):
...
...
...
...
...
...
... elements of subclasses of Rule ...
...
...
...
Readers may wonder about the motivations for using the ListOf___
containers in SBML. A simpler approach in XML might be to place the
components all directly at the top level of the model definition. The
choice made in SBML is to group them within XML elements named after
ListOfClassname, in part because it helps organize the components.
More importantly, the fact that the container classes are derived from
SBase means that software tools can add information about the lists
themselves into each list container's 'annotation'.
See also ListOfFunctionDefinitions, ListOfUnitDefinitions,
ListOfCompartmentTypes, ListOfSpeciesTypes, ListOfCompartments,
ListOfSpecies, ListOfParameters, ListOfInitialAssignments,
ListOfRules, ListOfConstraints, ListOfReactions, ListOfEvents.
"""
__swig_setmethods__ = {}
for _s in [SBase]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, ListOf, name, value)
__swig_getmethods__ = {}
for _s in [SBase]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, ListOf, name)
__repr__ = _swig_repr
__swig_destroy__ = _libsbml.delete_ListOf
__del__ = lambda self: None
def __init__(self, *args):
"""
__init__(ListOf self, unsigned int level, unsigned int version) -> ListOf
__init__(ListOf self, unsigned int level) -> ListOf
__init__(ListOf self) -> ListOf
__init__(ListOf self, SBMLNamespaces sbmlns) -> ListOf
__init__(ListOf self, ListOf orig) -> ListOf
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
ListOf(SBMLNamespaces sbmlns)
Creates a new ListOf with a given SBMLNamespaces object.
Parameter 'sbmlns' is the set of SBML namespaces that this ListOf
should contain.
Note:
Bare ListOf objects are impossible to add to SBML models. The ListOf
class is simply the base of other classes in libSBML. Calling
programs are not intended to create bare ListOf objects themselves.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
______________________________________________________________________
Method variant with the following signature:
ListOf(ListOf orig)
Copy constructor; creates a copy of this ListOf.
Parameter 'orig' is the ListOf instance to copy.
______________________________________________________________________
Method variant with the following signature:
ListOf(long level = SBML_DEFAULT_LEVEL, long version =
SBML_DEFAULT_VERSION)
Creates a new ListOf object.
Parameter 'level' is the SBML Level; if not assigned, defaults to the
value of SBMLDocument.getDefaultLevel().
Parameter 'version' is the Version within the SBML Level; if not
assigned, defaults to the value of SBMLDocument.getDefaultVersion().
Note:
Bare ListOf objects are impossible to add to SBML models. The ListOf
class is simply the base of other classes in libSBML. Calling
programs are not intended to create bare ListOf objects themselves.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
"""
this = _libsbml.new_ListOf(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(ListOf self) -> ListOf
Creates and returns a deep copy of this ListOf object.
Returns the (deep) copy of this ListOf object.
"""
return _libsbml.ListOf_clone(self)
def append(self, item):
"""
append(ListOf self, SBase item) -> int
Adds an item to the end of this ListOf's list of items.
This method makes a clone of the 'item' handed to it. This means that
when the ListOf object is destroyed, the original items will not be
destroyed. For a method with an alternative ownership behavior, see
the ListOf.appendAndOwn() method.
Parameter 'item' is the item to be added to the list.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_OBJECT
See also appendAndOwn(), appendFrom().
"""
return _libsbml.ListOf_append(self, item)
def appendAndOwn(self, item):
"""
appendAndOwn(ListOf self, SBase item) -> int
Adds an item to the end of this ListOf's list of items.
This method does not clone the 'item' handed to it; instead, it
assumes ownership of it. This means that when the ListOf is
destroyed, the item will be destroyed along with it. For a method
with an alternative ownership behavior, see the ListOf.append()
method.
Parameter 'item' is the item to be added to the list.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_OBJECT
See also append(), appendFrom().
"""
if args[0] is not None: args[0].thisown = 0
return _libsbml.ListOf_appendAndOwn(self, item)
def appendFrom(self, list):
"""
appendFrom(ListOf self, ListOf list) -> int
Adds a clone of a list of items to this ListOf's list.
Note that because this clones the objects handed to it, the original
items will not be destroyed when this ListOf object is destroyed.
Parameter 'list' is a list of items to be added.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_OBJECT
See also append(), appendAndOwn().
"""
return _libsbml.ListOf_appendFrom(self, list)
def insert(self, location, item):
"""
insert(ListOf self, int location, SBase item) -> int
Inserts an item at a given position in this ListOf's list of items.
This variant of the method makes a clone of the 'item' handed to it.
This means that when the ListOf is destroyed, the original 'item' will
not be destroyed.
Parameter 'location' is the location in the list where to insert the
item. Parameter 'item' is the item to be inserted to the list.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_OBJECT
See also insertAndOwn().
"""
return _libsbml.ListOf_insert(self, location, item)
def insertAndOwn(self, location, item):
"""
insertAndOwn(ListOf self, int location, SBase item) -> int
Inserts an item at a given position in this ListOf's list of items.
This variant of the method makes a clone of the 'item' handed to it.
This means that when the ListOf is destroyed, the original 'item' will
be destroyed.
Parameter 'location' is the location where to insert the item
Parameter 'item' is the item to be inserted to the list
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_OBJECT
See also insert().
"""
return _libsbml.ListOf_insertAndOwn(self, location, item)
def get(self, *args):
"""
get(ListOf self, unsigned int n) -> SBase
get(ListOf self, unsigned int n) -> SBase
Get an item from the list.
Parameter 'n' is the index number of the item to get.
Returns the nth item in this ListOf items, or a null pointer if the
index number 'n' refers to a nonexistent position in this list.
See also size().
"""
return _libsbml.ListOf_get(self, *args)
def getElementBySId(self, id):
"""
getElementBySId(ListOf self, string id) -> SBase
Returns the first child element found that has the given identifier.
This method searches this ListOf's list of items for SBML objects
based on their 'id' attribute value in the model-wide SId identifier
namespace.
Parameter 'id' is string representing the id of the object to find.
Returns the first element found with the given 'id', or None if no
such object is found.
"""
return _libsbml.ListOf_getElementBySId(self, id)
def getElementByMetaId(self, metaid):
"""
getElementByMetaId(ListOf self, string metaid) -> SBase
Returns the first child element found with the given meta-identifier.
Parameter 'metaid' is string representing the 'metaid' attribute of
the object to find.
Returns the first element found with the given 'metaid', or None if no
such object is found.
"""
return _libsbml.ListOf_getElementByMetaId(self, metaid)
def clear(self, doDelete=True):
"""
clear(ListOf self, bool doDelete=True)
clear(ListOf self)
Removes all items in this ListOf object.
If parameter 'doDelete' is True (default), all items in this ListOf
object are deleted and cleared, and thus the caller doesn't have to
delete those items. Otherwise, all items are cleared only from this
ListOf object; the caller is still responsible for deleting the actual
items. (In the latter case, callers are advised to store pointers to
all items elsewhere before calling this function.)
Parameter 'doDelete' is if True (default), all items are deleted and
cleared. Otherwise, all items are just cleared and not deleted.
"""
return _libsbml.ListOf_clear(self, doDelete)
def removeFromParentAndDelete(self):
"""
removeFromParentAndDelete(ListOf self) -> int
Removes all items in this ListOf object and deletes its properties
too.
This performs a call to clear() with an argument of True (thus
removing all the child objects in the list), followed by calls to
various libSBML unsetFoo methods to delete everything else: CVTerm
objects, model history objects, etc.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
"""
return _libsbml.ListOf_removeFromParentAndDelete(self)
def remove(self, n):
"""
remove(ListOf self, unsigned int n) -> SBase
Removes the nth item from this ListOf list of items and returns it.
The caller owns the returned item and is responsible for deleting it.
Parameter 'n' is the index of the item to remove
See also size().
"""
return _libsbml.ListOf_remove(self, n)
def size(self):
"""
size(ListOf self) -> unsigned int
Returns number of items in this ListOf list.
Returns the number of items in this ListOf items.
"""
return _libsbml.ListOf_size(self)
def connectToChild(self):
"""connectToChild(ListOf self)"""
return _libsbml.ListOf_connectToChild(self)
def getTypeCode(self):
"""
getTypeCode(ListOf self) -> int
Returns the libSBML type code for this object, namely, SBML_LIST_OF.
LibSBML attaches an identifying code to every kind of SBML object.
These are integer constants known as SBML type codes. The names of
all the codes begin with the characters SBML_. In the Python language
interface for libSBML, the type codes are defined as static integer
constants in the interface class 'libsbml'. Note that different Level
3 package plug-ins may use overlapping type codes; to identify the
package to which a given object belongs, call the getPackageName()
method on the object.
Returns the SBML type code for this object: SBML_LIST_OF (default).
Note:
The various ListOf classes mostly differ from each other in what they
contain. Hence, one must call getItemTypeCode() to fully determine
the class of this SBML object.
WARNING:
The specific integer values of the possible type codes may be reused
by different Level 3 package plug-ins. Thus, to identifiy the correct
code, it is necessary to invoke both getTypeCode() and
getPackageName().
See also getItemTypeCode(), getElementName(), getPackageName().
"""
return _libsbml.ListOf_getTypeCode(self)
def getItemTypeCode(self):
"""
getItemTypeCode(ListOf self) -> int
Get the type code of the objects contained in this ListOf.
LibSBML attaches an identifying code to every kind of SBML object.
These are integer constants known as SBML type codes. The names of
all the codes begin with the characters SBML_. In the Python language
interface for libSBML, the type codes are defined as static integer
constants in the interface class 'libsbml'. Note that different Level
3 package plug-ins may use overlapping type codes; to identify the
package to which a given object belongs, call the getPackageName()
method on the object.
Classes that inherit from the ListOf class should override this method
to return the SBML type code for the objects contained in this ListOf.
If they do not, this method will return SBML_UNKNOWN
Returns The ListOf base class contains no SBML objects, and therefore
this method returns SBML_UNKNOWN.
See also getElementName(), getPackageName().
"""
return _libsbml.ListOf_getItemTypeCode(self)
def getElementName(self):
"""
getElementName(ListOf self) -> string
Returns the XML element name of this object, which for ListOf, is
always 'listOf'.
Returns the XML name of this element.
"""
return _libsbml.ListOf_getElementName(self)
def enablePackageInternal(self, pkgURI, pkgPrefix, flag):
"""
enablePackageInternal(ListOf self, string pkgURI, string pkgPrefix, bool flag)
Internal implementation method.
"""
return _libsbml.ListOf_enablePackageInternal(self, pkgURI, pkgPrefix, flag)
def __len__(self):
"""__len__(ListOf self) -> int"""
return _libsbml.ListOf___len__(self)
def __getitem__(self, key):
try:
keyIsSlice = isinstance(key, slice)
except:
keyIsSlice = 0
if keyIsSlice:
start = key.start
if start is None:
start = 0
stop = key.stop
if stop is None:
stop = self.size()
return [self[i] for i in range(
self._fixNegativeIndex(start), self._fixNegativeIndex(stop)
)]
key = self._fixNegativeIndex(key)
if key < 0 or key >= self.size():
raise IndexError(key)
return self.get(key)
def _fixNegativeIndex(self, index):
if index < 0:
return index + self.size()
else:
return index
def __iter__(self):
for i in range(self.size()):
yield self[i]
def __repr__(self):
return "[" + ", ".join([repr(self[i]) for i in range(len(self))]) + "]"
def __str__(self):
return repr(self)
ListOf_swigregister = _libsbml.ListOf_swigregister
ListOf_swigregister(ListOf)
class Model(SBase):
"""
An SBML model.
In an SBML model definition, a single object of class Model serves as
the overall container for the lists of the various model components.
All of the lists are optional, but if a given list container is
present within the model, the list must not be empty; that is, it must
have length one or more. The following are the components and lists
permitted in different Levels and Versions of SBML in version of
libSBML:
* In SBML Level 1, the components are: UnitDefinition, Compartment,
Species, Parameter, Rule, and Reaction. Instances of the classes are
placed inside instances of classes ListOfUnitDefinitions,
ListOfCompartments, ListOfSpecies, ListOfParameters, ListOfRules, and
ListOfReactions.
* In SBML Level 2 Version 1, the components are: FunctionDefinition,
UnitDefinition, Compartment, Species, Parameter, Rule, Reaction and
Event. Instances of the classes are placed inside instances of
classes ListOfFunctionDefinitions, ListOfUnitDefinitions,
ListOfCompartments, ListOfSpecies, ListOfParameters, ListOfRules,
ListOfReactions, and ListOfEvents.
* In SBML Level 2 Versions 2, 3 and 4, the components are:
FunctionDefinition, UnitDefinition, CompartmentType, SpeciesType,
Compartment, Species, Parameter, InitialAssignment, Rule, Constraint,
Reaction and Event. Instances of the classes are placed inside
instances of classes ListOfFunctionDefinitions, ListOfUnitDefinitions,
ListOfCompartmentTypes, ListOfSpeciesTypes, ListOfCompartments,
ListOfSpecies, ListOfParameters, ListOfInitialAssignments,
ListOfRules, ListOfConstraints, ListOfReactions, and ListOfEvents.
* In SBML Level 3 Version 1, the components are: FunctionDefinition,
UnitDefinition, Compartment, Species, Parameter, InitialAssignment,
Rule, Constraint, Reaction and Event. Instances of the classes are
placed inside instances of classes ListOfFunctionDefinitions,
ListOfUnitDefinitions, ListOfCompartments, ListOfSpecies,
ListOfParameters, ListOfInitialAssignments, ListOfRules,
ListOfConstraints, ListOfReactions, and ListOfEvents. Although all
the lists are optional, there are dependencies between SBML components
such that defining some components requires defining others. An
example is that defining a species requires defining a compartment,
and defining a reaction requires defining a species. The dependencies
are explained in more detail in the SBML specifications.
In addition to the above lists and attributes, the Model class in both
SBML Level 2 and Level 3 has the usual two attributes of 'id' and
'name', and both are optional. As is the case for other SBML
components with 'id' and 'name' attributes, they must be used
according to the guidelines described in the SBML specifications.
(Within the frameworks of SBML Level 2 and Level 3 Version 1 Core, a
Model object identifier has no assigned meaning, but extension
packages planned for SBML Level 3 are likely to make use of this
identifier.)
Finally, SBML Level 3 has introduced a number of additional Model
attributes. They are discussed in a separate section below.
Approaches to creating objects using the libSBML API
======================================================================
LibSBML provides two main mechanisms for creating objects: class
constructors (e.g., Species.Species() ), and createObject() methods
(such as Model.createSpecies()) provided by certain Object classes
such as Model. These multiple mechanisms are provided by libSBML for
flexibility and to support different use-cases, but they also have
different implications for the overall model structure.
In general, the recommended approach is to use the createObject()
methods. These methods both create an object and link it to the
parent in one step. Here is an example:
# Create an SBMLDocument object in Level 3 Version 1 format.
# Make sure to check for possible failures.
try:
sbmlDoc = SBMLDocument(3, 1)
except ValueError:
print('Could not create SBMLDocument object')
sys.exit(1)
# Create a Model object inside the SBMLDocument object and set its
# identifier, checking the returned values. The call to setId() returns a
# status code to indicate whether the assignment was successful.
model = sbmlDoc.createModel()
if model == None:
# Do something to handle the error here.
print('Unable to create Model object.')
sys.exit(1)
status = model.setId('BestModelEver')
if status != LIBSBML_OPERATION_SUCCESS:
# Do something to handle the error here.
print('Unable to set identifier on the Model object')
sys.exit(1)
# Create a Species object inside the Model and set its identifier.
# Again, the setId() returns a status code to indicate whether the
# assignment was successful.
sp = model.createSpecies()
if sp == None:
# Do something to handle the error here.
print('Unable to create Species object.')
sys.exit(1)
status = sp.setId('BestSpeciesEver')
if status != LIBSBML_OPERATION_SUCCESS:
# Do something to handle the error here.
print('Unable to set identifier on the Species object')
sys.exit(1)
The createObject() methods return a pointer to the object created,
but they also add the object to the relevant list of object instances
contained in the parent. (These lists become the
elements in the finished XML rendition of SBML.) In the example
above, Model.createSpecies() adds the created species directly to the
Model
__init__(Model self, SBMLNamespaces sbmlns) -> Model
__init__(Model self, Model orig) -> Model
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
Model(SBMLNamespaces sbmlns)
Creates a new Model using the given SBMLNamespaces object 'sbmlns'.
The SBMLNamespaces object encapsulates SBML Level/Version/namespaces
information. It is used to communicate the SBML Level, Version, and
(in Level 3) packages used in addition to SBML Level 3 Core. A common
approach to using libSBML's SBMLNamespaces facilities is to create an
SBMLNamespaces object somewhere in a program once, then hand that
object as needed to object constructors that accept SBMLNamespaces as
arguments.
Parameter 'sbmlns' is an SBMLNamespaces object.
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
______________________________________________________________________
Method variant with the following signature:
Model(long level, long version)
Creates a new Model using the given SBML 'level' and 'version' values.
Parameter 'level' is a long integer, the SBML Level to assign to this
Model
Parameter 'version' is a long integer, the SBML Version to assign to
this Model
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
______________________________________________________________________
Method variant with the following signature:
Model(Model orig)
Copy constructor; creates a (deep) copy of the given Model object.
Parameter 'orig' is the object to copy.
Throws SBMLConstructorException: Thrown if the argument 'orig' is
None.
"""
this = _libsbml.new_Model(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(Model self) -> Model
Creates and returns a deep copy of this Model object.
Returns the (deep) copy of this Model object.
"""
return _libsbml.Model_clone(self)
def getElementBySId(self, id):
"""
getElementBySId(Model self, string id) -> SBase
Returns the first child element found that has the given 'id'.
This operation searches the model-wide SId identifier type namespace
Parameter 'id' is string representing the id of the object to find.
Returns pointer to the first element found with the given 'id', or
None if no such object is found.
"""
return _libsbml.Model_getElementBySId(self, id)
def getElementByMetaId(self, metaid):
"""
getElementByMetaId(Model self, string metaid) -> SBase
Returns the first child element it can find with the given 'metaid'.
Parameter 'metaid' is string representing the meta-identifier of the
object to find.
Returns pointer to the first element found with the given 'metaid', or
None if no such object is found.
"""
return _libsbml.Model_getElementByMetaId(self, metaid)
def getId(self):
"""
getId(Model self) -> string
Returns the value of the 'id' attribute of this Model.
Returns the id of this Model.
"""
return _libsbml.Model_getId(self)
def getName(self):
"""
getName(Model self) -> string
Returns the value of the 'name' attribute of this Model.
Returns the name of this Model.
"""
return _libsbml.Model_getName(self)
def getSubstanceUnits(self):
"""
getSubstanceUnits(Model self) -> string
Returns the value of the 'substanceUnits' attribute of this Model.
Returns the substanceUnits of this Model.
Note:
The 'substanceUnits' attribute is available in SBML Level 3 but is not
present on Model in lower Levels of SBML.
"""
return _libsbml.Model_getSubstanceUnits(self)
def getTimeUnits(self):
"""
getTimeUnits(Model self) -> string
Returns the value of the 'timeUnits' attribute of this Model.
Returns the timeUnits of this Model.
Note:
The 'timeUnits' attribute is available in SBML Level 3 but is not
present on Model in lower Levels of SBML.
"""
return _libsbml.Model_getTimeUnits(self)
def getVolumeUnits(self):
"""
getVolumeUnits(Model self) -> string
Returns the value of the 'volumeUnits' attribute of this Model.
Returns the volumeUnits of this Model.
Note:
The 'volumeUnits' attribute is available in SBML Level 3 but is not
present on Model in lower Levels of SBML.
"""
return _libsbml.Model_getVolumeUnits(self)
def getAreaUnits(self):
"""
getAreaUnits(Model self) -> string
Returns the value of the 'areaUnits' attribute of this Model.
Returns the areaUnits of this Model.
Note:
The 'areaUnits' attribute is available in SBML Level 3 but is not
present on Model in lower Levels of SBML.
"""
return _libsbml.Model_getAreaUnits(self)
def getLengthUnits(self):
"""
getLengthUnits(Model self) -> string
Returns the value of the 'lengthUnits' attribute of this Model.
Returns the lengthUnits of this Model.
Note:
The 'lengthUnits' attribute is available in SBML Level 3 but is not
present on Model in lower Levels of SBML.
"""
return _libsbml.Model_getLengthUnits(self)
def getExtentUnits(self):
"""
getExtentUnits(Model self) -> string
Returns the value of the 'extentUnits' attribute of this Model.
Returns the extentUnits of this Model.
Note:
The 'extentUnits' attribute is available in SBML Level 3 but is not
present on Model in lower Levels of SBML.
"""
return _libsbml.Model_getExtentUnits(self)
def getConversionFactor(self):
"""
getConversionFactor(Model self) -> string
Returns the value of the 'conversionFactor' attribute of this Model.
Returns the conversionFactor of this Model.
Note:
The 'conversionFactor' attribute is available in SBML Level 3 but is
not present on Model in lower Levels of SBML.
"""
return _libsbml.Model_getConversionFactor(self)
def isSetId(self):
"""
isSetId(Model self) -> bool
Predicate returning True if this Model's 'id' attribute is set.
Returns True if the 'id' attribute of this Model is set, False
otherwise.
"""
return _libsbml.Model_isSetId(self)
def isSetName(self):
"""
isSetName(Model self) -> bool
Predicate returning True if this Model's 'name' attribute is set.
Returns True if the 'name' attribute of this Model is set, False
otherwise.
"""
return _libsbml.Model_isSetName(self)
def isSetSubstanceUnits(self):
"""
isSetSubstanceUnits(Model self) -> bool
Predicate returning True if this Model's 'substanceUnits' attribute is
set.
Returns True if the 'substanceUnits' attribute of this Model is set,
False otherwise.
Note:
The 'substanceUnits' attribute is available in SBML Level 3 but is
not present on Model in lower Levels of SBML.
"""
return _libsbml.Model_isSetSubstanceUnits(self)
def isSetTimeUnits(self):
"""
isSetTimeUnits(Model self) -> bool
Predicate returning True if this Model's 'timeUnits' attribute is set.
Returns True if the 'timeUnits' attribute of this Model is set, False
otherwise.
Note:
The 'substanceUnits' attribute is available in SBML Level 3 but is
not present on Model in lower Levels of SBML.
"""
return _libsbml.Model_isSetTimeUnits(self)
def isSetVolumeUnits(self):
"""
isSetVolumeUnits(Model self) -> bool
Predicate returning True if this Model's 'volumeUnits' attribute is
set.
Returns True if the 'volumeUnits' attribute of this Model is set,
False otherwise.
Note:
The 'volumeUnits' attribute is available in SBML Level 3 but is not
present on Model in lower Levels of SBML.
"""
return _libsbml.Model_isSetVolumeUnits(self)
def isSetAreaUnits(self):
"""
isSetAreaUnits(Model self) -> bool
Predicate returning True if this Model's 'areaUnits' attribute is set.
Returns True if the 'areaUnits' attribute of this Model is set, False
otherwise.
Note:
The 'areaUnits' attribute is available in SBML Level 3 but is not
present on Model in lower Levels of SBML.
"""
return _libsbml.Model_isSetAreaUnits(self)
def isSetLengthUnits(self):
"""
isSetLengthUnits(Model self) -> bool
Predicate returning True if this Model's 'lengthUnits' attribute is
set.
Returns True if the 'lengthUnits' attribute of this Model is set,
False otherwise.
Note:
The 'lengthUnits' attribute is available in SBML Level 3 but is not
present on Model in lower Levels of SBML.
"""
return _libsbml.Model_isSetLengthUnits(self)
def isSetExtentUnits(self):
"""
isSetExtentUnits(Model self) -> bool
Predicate returning True if this Model's 'extentUnits' attribute is
set.
Returns True if the 'extentUnits' attribute of this Model is set,
False otherwise.
Note:
The 'extentUnits' attribute is available in SBML Level 3 but is not
present on Model in lower Levels of SBML.
"""
return _libsbml.Model_isSetExtentUnits(self)
def isSetConversionFactor(self):
"""
isSetConversionFactor(Model self) -> bool
Predicate returning True if this Model's 'conversionFactor' attribute
is set.
Returns True if the 'conversionFactor' attribute of this Model is set,
False otherwise.
Note:
The 'conversionFactor' attribute is available in SBML Level 3 but is
not present on Model in lower Levels of SBML.
"""
return _libsbml.Model_isSetConversionFactor(self)
def setId(self, sid):
"""
setId(Model self, string sid) -> int
Sets the value of the 'id' attribute of this Model.
The string 'sid' is copied.
SBML has strict requirements for the syntax of identifiers, that is,
the values of the 'id' attribute present on most types of SBML
objects. The following is a summary of the definition of the SBML
identifier type SId, which defines the permitted syntax of
identifiers. We express the syntax using an extended form of BNF
notation:
letter ::= 'a'..'z','A'..'Z'
digit ::= '0'..'9'
idChar ::= letter | digit | '_'
SId ::= ( letter | '_' ) idChar*
The characters ( and ) are used for grouping, the character * 'zero or
more times', and the character | indicates logical 'or'. The equality
of SBML identifiers is determined by an exact character sequence
match; i.e., comparisons must be performed in a case-sensitive manner.
In addition, there are a few conditions for the uniqueness of
identifiers in an SBML model. Please consult the SBML specifications
for the exact details of the uniqueness requirements.
Parameter 'sid' is the string to use as the identifier of this Model
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
"""
return _libsbml.Model_setId(self, sid)
def setName(self, name):
"""
setName(Model self, string name) -> int
Sets the value of the 'name' attribute of this Model.
The string in 'name' is copied.
Parameter 'name' is the new name for the Model
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
"""
return _libsbml.Model_setName(self, name)
def setSubstanceUnits(self, units):
"""
setSubstanceUnits(Model self, string units) -> int
Sets the value of the 'substanceUnits' attribute of this Model.
The string in 'units' is copied.
Parameter 'units' is the new substanceUnits for the Model
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_UNEXPECTED_ATTRIBUTE
* LIBSBML_INVALID_ATTRIBUTE_VALUE
Note:
The 'substanceUnits' attribute is available in SBML Level 3 but is
not present on Model in lower Levels of SBML.
"""
return _libsbml.Model_setSubstanceUnits(self, units)
def setTimeUnits(self, units):
"""
setTimeUnits(Model self, string units) -> int
Sets the value of the 'timeUnits' attribute of this Model.
The string in 'units' is copied.
Parameter 'units' is the new timeUnits for the Model
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_UNEXPECTED_ATTRIBUTE
* LIBSBML_INVALID_ATTRIBUTE_VALUE
Note:
The 'timeUnits' attribute is available in SBML Level 3 but is not
present on Model in lower Levels of SBML.
"""
return _libsbml.Model_setTimeUnits(self, units)
def setVolumeUnits(self, units):
"""
setVolumeUnits(Model self, string units) -> int
Sets the value of the 'volumeUnits' attribute of this Model.
The string in 'units' is copied.
Parameter 'units' is the new volumeUnits for the Model
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_UNEXPECTED_ATTRIBUTE
* LIBSBML_INVALID_ATTRIBUTE_VALUE
Note:
The 'volumeUnits' attribute is available in SBML Level 3 but is not
present on Model in lower Levels of SBML.
"""
return _libsbml.Model_setVolumeUnits(self, units)
def setAreaUnits(self, units):
"""
setAreaUnits(Model self, string units) -> int
Sets the value of the 'areaUnits' attribute of this Model.
The string in 'units' is copied.
Parameter 'units' is the new areaUnits for the Model
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_UNEXPECTED_ATTRIBUTE
* LIBSBML_INVALID_ATTRIBUTE_VALUE
Note:
The 'areaUnits' attribute is available in SBML Level 3 but is not
present on Model in lower Levels of SBML.
"""
return _libsbml.Model_setAreaUnits(self, units)
def setLengthUnits(self, units):
"""
setLengthUnits(Model self, string units) -> int
Sets the value of the 'lengthUnits' attribute of this Model.
The string in 'units' is copied.
Parameter 'units' is the new lengthUnits for the Model
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_UNEXPECTED_ATTRIBUTE
* LIBSBML_INVALID_ATTRIBUTE_VALUE
Note:
The 'lengthUnits' attribute is available in SBML Level 3 but is not
present on Model in lower Levels of SBML.
"""
return _libsbml.Model_setLengthUnits(self, units)
def setExtentUnits(self, units):
"""
setExtentUnits(Model self, string units) -> int
Sets the value of the 'extentUnits' attribute of this Model.
The string in 'units' is copied.
Parameter 'units' is the new extentUnits for the Model
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_UNEXPECTED_ATTRIBUTE
* LIBSBML_INVALID_ATTRIBUTE_VALUE
Note:
The 'extentUnits' attribute is available in SBML Level 3 but is not
present on Model in lower Levels of SBML.
"""
return _libsbml.Model_setExtentUnits(self, units)
def setConversionFactor(self, units):
"""
setConversionFactor(Model self, string units) -> int
Sets the value of the 'conversionFactor' attribute of this Model.
The string in 'units' is copied.
Parameter 'units' is the new conversionFactor for the Model
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_UNEXPECTED_ATTRIBUTE
* LIBSBML_INVALID_ATTRIBUTE_VALUE
Note:
The 'conversionFactor' attribute is available in SBML Level 3 but is
not present on Model in lower Levels of SBML.
"""
return _libsbml.Model_setConversionFactor(self, units)
def unsetId(self):
"""
unsetId(Model self) -> int
Unsets the value of the 'id' attribute of this Model.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
"""
return _libsbml.Model_unsetId(self)
def unsetName(self):
"""
unsetName(Model self) -> int
Unsets the value of the 'name' attribute of this Model.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
"""
return _libsbml.Model_unsetName(self)
def unsetSubstanceUnits(self):
"""
unsetSubstanceUnits(Model self) -> int
Unsets the value of the 'substanceUnits' attribute of this Model.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
Note:
The 'substanceUnits' attribute is available in SBML Level 3 but is
not present on Model in lower Levels of SBML.
"""
return _libsbml.Model_unsetSubstanceUnits(self)
def unsetTimeUnits(self):
"""
unsetTimeUnits(Model self) -> int
Unsets the value of the 'timeUnits' attribute of this Model.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
Note:
The 'timeUnits' attribute is available in SBML Level 3 but is not
present on Model in lower Levels of SBML.
"""
return _libsbml.Model_unsetTimeUnits(self)
def unsetVolumeUnits(self):
"""
unsetVolumeUnits(Model self) -> int
Unsets the value of the 'volumeUnits' attribute of this Model.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
Note:
The 'volumeUnits' attribute is available in SBML Level 3 but is not
present on Model in lower Levels of SBML.
"""
return _libsbml.Model_unsetVolumeUnits(self)
def unsetAreaUnits(self):
"""
unsetAreaUnits(Model self) -> int
Unsets the value of the 'areaUnits' attribute of this Model.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_UNEXPECTED_ATTRIBUTE
* LIBSBML_OPERATION_FAILED
Note:
The 'areaUnits' attribute is available in SBML Level 3 but is not
present on Model in lower Levels of SBML.
"""
return _libsbml.Model_unsetAreaUnits(self)
def unsetLengthUnits(self):
"""
unsetLengthUnits(Model self) -> int
Unsets the value of the 'lengthUnits' attribute of this Model.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_UNEXPECTED_ATTRIBUTE
* LIBSBML_OPERATION_FAILED
Note:
The 'lengthUnits' attribute is available in SBML Level 3 but is not
present on Model in lower Levels of SBML.
"""
return _libsbml.Model_unsetLengthUnits(self)
def unsetExtentUnits(self):
"""
unsetExtentUnits(Model self) -> int
Unsets the value of the 'extentUnits' attribute of this Model.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_UNEXPECTED_ATTRIBUTE
* LIBSBML_OPERATION_FAILED
Note:
The 'extentUnits' attribute is available in SBML Level 3 but is not
present on Model in lower Levels of SBML.
"""
return _libsbml.Model_unsetExtentUnits(self)
def unsetConversionFactor(self):
"""
unsetConversionFactor(Model self) -> int
Unsets the value of the 'conversionFactor' attribute of this Model.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_UNEXPECTED_ATTRIBUTE
* LIBSBML_OPERATION_FAILED
Note:
The 'conversionFactor' attribute is available in SBML Level 3 but is
not present on Model in lower Levels of SBML.
"""
return _libsbml.Model_unsetConversionFactor(self)
def addFunctionDefinition(self, fd):
"""
addFunctionDefinition(Model self, FunctionDefinition fd) -> int
Adds a copy of the given FunctionDefinition object to this Model.
Parameter 'fd' is the FunctionDefinition to add
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_LEVEL_MISMATCH
* LIBSBML_VERSION_MISMATCH
* LIBSBML_DUPLICATE_OBJECT_ID
* LIBSBML_INVALID_OBJECT
* LIBSBML_OPERATION_FAILED
Note:
This method should be used with some caution. The fact that this
method copies the object passed to it means that the caller will be
left holding a physically different object instance than the one
contained inside this object. Changes made to the original object
instance (such as resetting attribute values) will not affect the
instance in this object. In addition, the caller should make sure to
free the original object if it is no longer being used, or else a
memory leak will result. Please see other methods on this class
(particularly a corresponding method whose name begins with the word
create) for alternatives that do not lead to these issues.
See also createFunctionDefinition().
"""
return _libsbml.Model_addFunctionDefinition(self, fd)
def addUnitDefinition(self, ud):
"""
addUnitDefinition(Model self, UnitDefinition ud) -> int
Adds a copy of the given UnitDefinition object to this Model.
Parameter 'ud' is the UnitDefinition object to add
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_LEVEL_MISMATCH
* LIBSBML_VERSION_MISMATCH
* LIBSBML_DUPLICATE_OBJECT_ID
* LIBSBML_INVALID_OBJECT
* LIBSBML_OPERATION_FAILED
Note:
This method should be used with some caution. The fact that this
method copies the object passed to it means that the caller will be
left holding a physically different object instance than the one
contained inside this object. Changes made to the original object
instance (such as resetting attribute values) will not affect the
instance in this object. In addition, the caller should make sure to
free the original object if it is no longer being used, or else a
memory leak will result. Please see other methods on this class
(particularly a corresponding method whose name begins with the word
create) for alternatives that do not lead to these issues.
See also createUnitDefinition().
"""
return _libsbml.Model_addUnitDefinition(self, ud)
def addCompartmentType(self, ct):
"""
addCompartmentType(Model self, CompartmentType ct) -> int
Adds a copy of the given CompartmentType object to this Model.
Parameter 'ct' is the CompartmentType object to add
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_LEVEL_MISMATCH
* LIBSBML_VERSION_MISMATCH
* LIBSBML_DUPLICATE_OBJECT_ID
* LIBSBML_INVALID_OBJECT
* LIBSBML_OPERATION_FAILED
Note:
This method should be used with some caution. The fact that this
method copies the object passed to it means that the caller will be
left holding a physically different object instance than the one
contained inside this object. Changes made to the original object
instance (such as resetting attribute values) will not affect the
instance in this object. In addition, the caller should make sure to
free the original object if it is no longer being used, or else a
memory leak will result. Please see other methods on this class
(particularly a corresponding method whose name begins with the word
create) for alternatives that do not lead to these issues.
Note:
The CompartmentType object class is only available in SBML Level 2
Versions 2-4. It is not available in Level 1 nor Level 3.
See also createCompartmentType().
"""
return _libsbml.Model_addCompartmentType(self, ct)
def addSpeciesType(self, st):
"""
addSpeciesType(Model self, SpeciesType st) -> int
Adds a copy of the given SpeciesType object to this Model.
Parameter 'st' is the SpeciesType object to add
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_LEVEL_MISMATCH
* LIBSBML_VERSION_MISMATCH
* LIBSBML_DUPLICATE_OBJECT_ID
* LIBSBML_INVALID_OBJECT
* LIBSBML_OPERATION_FAILED
Note:
This method should be used with some caution. The fact that this
method copies the object passed to it means that the caller will be
left holding a physically different object instance than the one
contained inside this object. Changes made to the original object
instance (such as resetting attribute values) will not affect the
instance in this object. In addition, the caller should make sure to
free the original object if it is no longer being used, or else a
memory leak will result. Please see other methods on this class
(particularly a corresponding method whose name begins with the word
create) for alternatives that do not lead to these issues.
Note:
The SpeciesType object class is only available in SBML Level 2
Versions 2-4. It is not available in Level 1 nor Level 3.
See also createSpeciesType().
"""
return _libsbml.Model_addSpeciesType(self, st)
def addCompartment(self, c):
"""
addCompartment(Model self, Compartment c) -> int
Adds a copy of the given Compartment object to this Model.
Parameter 'c' is the Compartment object to add
Returns integer value indicating success/failure of the function. The
possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_LEVEL_MISMATCH
* LIBSBML_VERSION_MISMATCH
* LIBSBML_DUPLICATE_OBJECT_ID
* LIBSBML_INVALID_OBJECT
* LIBSBML_OPERATION_FAILED
Note:
This method should be used with some caution. The fact that this
method copies the object passed to it means that the caller will be
left holding a physically different object instance than the one
contained inside this object. Changes made to the original object
instance (such as resetting attribute values) will not affect the
instance in this object. In addition, the caller should make sure to
free the original object if it is no longer being used, or else a
memory leak will result. Please see other methods on this class
(particularly a corresponding method whose name begins with the word
create) for alternatives that do not lead to these issues.
See also createCompartment().
"""
return _libsbml.Model_addCompartment(self, c)
def addSpecies(self, s):
"""
addSpecies(Model self, Species s) -> int
Adds a copy of the given Species object to this Model.
Parameter 's' is the Species object to add
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_LEVEL_MISMATCH
* LIBSBML_VERSION_MISMATCH
* LIBSBML_DUPLICATE_OBJECT_ID
* LIBSBML_INVALID_OBJECT
* LIBSBML_OPERATION_FAILED
Note:
This method should be used with some caution. The fact that this
method copies the object passed to it means that the caller will be
left holding a physically different object instance than the one
contained inside this object. Changes made to the original object
instance (such as resetting attribute values) will not affect the
instance in this object. In addition, the caller should make sure to
free the original object if it is no longer being used, or else a
memory leak will result. Please see other methods on this class
(particularly a corresponding method whose name begins with the word
create) for alternatives that do not lead to these issues.
See also createSpecies().
"""
return _libsbml.Model_addSpecies(self, s)
def addParameter(self, p):
"""
addParameter(Model self, Parameter p) -> int
Adds a copy of the given Parameter object to this Model.
Parameter 'p' is the Parameter object to add
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_LEVEL_MISMATCH
* LIBSBML_VERSION_MISMATCH
* LIBSBML_DUPLICATE_OBJECT_ID
* LIBSBML_INVALID_OBJECT
* LIBSBML_OPERATION_FAILED
Note:
This method should be used with some caution. The fact that this
method copies the object passed to it means that the caller will be
left holding a physically different object instance than the one
contained inside this object. Changes made to the original object
instance (such as resetting attribute values) will not affect the
instance in this object. In addition, the caller should make sure to
free the original object if it is no longer being used, or else a
memory leak will result. Please see other methods on this class
(particularly a corresponding method whose name begins with the word
create) for alternatives that do not lead to these issues.
See also createParameter().
"""
return _libsbml.Model_addParameter(self, p)
def addInitialAssignment(self, ia):
"""
addInitialAssignment(Model self, InitialAssignment ia) -> int
Adds a copy of the given InitialAssignment object to this Model.
Parameter 'ia' is the InitialAssignment object to add
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_LEVEL_MISMATCH
* LIBSBML_VERSION_MISMATCH
* LIBSBML_DUPLICATE_OBJECT_ID
* LIBSBML_INVALID_OBJECT
* LIBSBML_OPERATION_FAILED
Note:
This method should be used with some caution. The fact that this
method copies the object passed to it means that the caller will be
left holding a physically different object instance than the one
contained inside this object. Changes made to the original object
instance (such as resetting attribute values) will not affect the
instance in this object. In addition, the caller should make sure to
free the original object if it is no longer being used, or else a
memory leak will result. Please see other methods on this class
(particularly a corresponding method whose name begins with the word
create) for alternatives that do not lead to these issues.
See also createInitialAssignment().
"""
return _libsbml.Model_addInitialAssignment(self, ia)
def addRule(self, r):
"""
addRule(Model self, Rule r) -> int
Adds a copy of the given Rule object to this Model.
Parameter 'r' is the Rule object to add
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_LEVEL_MISMATCH
* LIBSBML_VERSION_MISMATCH
* LIBSBML_DUPLICATE_OBJECT_ID
* LIBSBML_INVALID_OBJECT
* LIBSBML_OPERATION_FAILED
Note:
This method should be used with some caution. The fact that this
method copies the object passed to it means that the caller will be
left holding a physically different object instance than the one
contained inside this object. Changes made to the original object
instance (such as resetting attribute values) will not affect the
instance in this object. In addition, the caller should make sure to
free the original object if it is no longer being used, or else a
memory leak will result. Please see other methods on this class
(particularly a corresponding method whose name begins with the word
create) for alternatives that do not lead to these issues.
See also createAlgebraicRule(), createAssignmentRule(),
createRateRule().
"""
return _libsbml.Model_addRule(self, r)
def addConstraint(self, c):
"""
addConstraint(Model self, Constraint c) -> int
Adds a copy of the given Constraint object to this Model.
Parameter 'c' is the Constraint object to add
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_LEVEL_MISMATCH
* LIBSBML_VERSION_MISMATCH
* LIBSBML_INVALID_OBJECT
* LIBSBML_OPERATION_FAILED
Note:
This method should be used with some caution. The fact that this
method copies the object passed to it means that the caller will be
left holding a physically different object instance than the one
contained inside this object. Changes made to the original object
instance (such as resetting attribute values) will not affect the
instance in this object. In addition, the caller should make sure to
free the original object if it is no longer being used, or else a
memory leak will result. Please see other methods on this class
(particularly a corresponding method whose name begins with the word
create) for alternatives that do not lead to these issues.
See also createConstraint().
"""
return _libsbml.Model_addConstraint(self, c)
def addReaction(self, r):
"""
addReaction(Model self, Reaction r) -> int
Adds a copy of the given Reaction object to this Model.
Parameter 'r' is the Reaction object to add
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_LEVEL_MISMATCH
* LIBSBML_VERSION_MISMATCH
* LIBSBML_DUPLICATE_OBJECT_ID
* LIBSBML_INVALID_OBJECT
* LIBSBML_OPERATION_FAILED
Note:
This method should be used with some caution. The fact that this
method copies the object passed to it means that the caller will be
left holding a physically different object instance than the one
contained inside this object. Changes made to the original object
instance (such as resetting attribute values) will not affect the
instance in this object. In addition, the caller should make sure to
free the original object if it is no longer being used, or else a
memory leak will result. Please see other methods on this class
(particularly a corresponding method whose name begins with the word
create) for alternatives that do not lead to these issues.
See also createReaction().
"""
return _libsbml.Model_addReaction(self, r)
def addEvent(self, e):
"""
addEvent(Model self, Event e) -> int
Adds a copy of the given Event object to this Model.
Parameter 'e' is the Event object to add
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_LEVEL_MISMATCH
* LIBSBML_VERSION_MISMATCH
* LIBSBML_DUPLICATE_OBJECT_ID
* LIBSBML_INVALID_OBJECT
* LIBSBML_OPERATION_FAILED
Note:
This method should be used with some caution. The fact that this
method copies the object passed to it means that the caller will be
left holding a physically different object instance than the one
contained inside this object. Changes made to the original object
instance (such as resetting attribute values) will not affect the
instance in this object. In addition, the caller should make sure to
free the original object if it is no longer being used, or else a
memory leak will result. Please see other methods on this class
(particularly a corresponding method whose name begins with the word
create) for alternatives that do not lead to these issues.
See also createEvent().
"""
return _libsbml.Model_addEvent(self, e)
def createFunctionDefinition(self):
"""
createFunctionDefinition(Model self) -> FunctionDefinition
Creates a new FunctionDefinition inside this Model and returns it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this object's
corresponding attributes.
Returns the FunctionDefinition object created
See also addFunctionDefinition().
"""
return _libsbml.Model_createFunctionDefinition(self)
def createUnitDefinition(self):
"""
createUnitDefinition(Model self) -> UnitDefinition
Creates a new UnitDefinition inside this Model and returns it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this object's
corresponding attributes.
Returns the UnitDefinition object created
See also addUnitDefinition().
"""
return _libsbml.Model_createUnitDefinition(self)
def createUnit(self):
"""
createUnit(Model self) -> Unit
Creates a new Unit object within the last UnitDefinition object
created in this model and returns a pointer to it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this object's
corresponding attributes.
The mechanism by which the UnitDefinition was created is not
significant. If a UnitDefinition object does not exist in this model,
a new Unit is not created and None is returned instead.
Returns the Unit object created
See also addUnitDefinition().
"""
return _libsbml.Model_createUnit(self)
def createCompartmentType(self):
"""
createCompartmentType(Model self) -> CompartmentType
Creates a new CompartmentType inside this Model and returns it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this object's
corresponding attributes.
Returns the CompartmentType object created
Note:
The CompartmentType object class is only available in SBML Level 2
Versions 2-4. It is not available in Level 1 nor Level 3.
See also addCompartmentType().
"""
return _libsbml.Model_createCompartmentType(self)
def createSpeciesType(self):
"""
createSpeciesType(Model self) -> SpeciesType
Creates a new SpeciesType inside this Model and returns it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this object's
corresponding attributes.
Returns the SpeciesType object created
Note:
The SpeciesType object class is only available in SBML Level 2
Versions 2-4. It is not available in Level 1 nor Level 3.
See also addSpeciesType().
"""
return _libsbml.Model_createSpeciesType(self)
def createCompartment(self):
"""
createCompartment(Model self) -> Compartment
Creates a new Compartment inside this Model and returns it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this object's
corresponding attributes.
Returns the Compartment object created
See also addCompartment().
"""
return _libsbml.Model_createCompartment(self)
def createSpecies(self):
"""
createSpecies(Model self) -> Species
Creates a new Species inside this Model and returns it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this object's
corresponding attributes.
Returns the Species object created
See also addSpecies().
"""
return _libsbml.Model_createSpecies(self)
def createParameter(self):
"""
createParameter(Model self) -> Parameter
Creates a new Parameter inside this Model and returns it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this object's
corresponding attributes.
Returns the Parameter object created
See also addParameter().
"""
return _libsbml.Model_createParameter(self)
def createInitialAssignment(self):
"""
createInitialAssignment(Model self) -> InitialAssignment
Creates a new InitialAssignment inside this Model and returns it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this object's
corresponding attributes.
Returns the InitialAssignment object created
See also addInitialAssignment().
"""
return _libsbml.Model_createInitialAssignment(self)
def createAlgebraicRule(self):
"""
createAlgebraicRule(Model self) -> AlgebraicRule
Creates a new AlgebraicRule inside this Model and returns it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this object's
corresponding attributes.
Returns the AlgebraicRule object created
See also addRule().
"""
return _libsbml.Model_createAlgebraicRule(self)
def createAssignmentRule(self):
"""
createAssignmentRule(Model self) -> AssignmentRule
Creates a new AssignmentRule inside this Model and returns it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this object's
corresponding attributes.
Returns the AssignmentRule object created
See also addRule().
"""
return _libsbml.Model_createAssignmentRule(self)
def createRateRule(self):
"""
createRateRule(Model self) -> RateRule
Creates a new RateRule inside this Model and returns it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this object's
corresponding attributes.
Returns the RateRule object created
See also addRule().
"""
return _libsbml.Model_createRateRule(self)
def createConstraint(self):
"""
createConstraint(Model self) -> Constraint
Creates a new Constraint inside this Model and returns it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this object's
corresponding attributes.
Returns the Constraint object created
See also addConstraint().
"""
return _libsbml.Model_createConstraint(self)
def createReaction(self):
"""
createReaction(Model self) -> Reaction
Creates a new Reaction inside this Model and returns it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this object's
corresponding attributes.
Returns the Reaction object created
See also addReaction().
"""
return _libsbml.Model_createReaction(self)
def createReactant(self):
"""
createReactant(Model self) -> SpeciesReference
Creates a new SpeciesReference object for a reactant inside the last
Reaction object in this Model, and returns a pointer to it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this object's
corresponding attributes.
The mechanism by which the last Reaction object was created and added
to this Model is not significant. It could have been created in a
variety of ways, for example using createReaction(). If a Reaction
does not exist for this model, a new SpeciesReference is not created
and None is returned instead.
Returns the SpeciesReference object created. If a Reaction does not
exist for this model, a new SpeciesReference is not created and None
is returned.
"""
return _libsbml.Model_createReactant(self)
def createProduct(self):
"""
createProduct(Model self) -> SpeciesReference
Creates a new SpeciesReference object for a product inside the last
Reaction object in this Model, and returns a pointer to it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this object's
corresponding attributes.
The mechanism by which the last Reaction object was created and added
to this Model is not significant. It could have been created in a
variety of ways, for example using createReaction(). If a Reaction
does not exist for this model, a new SpeciesReference is not created
and None is returned instead.
Returns the SpeciesReference object created. If a Reaction does not
exist for this model, a new SpeciesReference is not created and None
is returned.
"""
return _libsbml.Model_createProduct(self)
def createModifier(self):
"""
createModifier(Model self) -> ModifierSpeciesReference
Creates a new ModifierSpeciesReference object for a modifier species
inside the last Reaction object in this Model, and returns a pointer
to it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this object's
corresponding attributes.
The mechanism by which the last Reaction object was created and added
to this Model is not significant. It could have been created in a
variety of ways, for example using createReaction(). If a Reaction
does not exist for this model, a new SpeciesReference is not created
and None is returned instead.
Returns the SpeciesReference object created. If a Reaction does not
exist for this model, a new SpeciesReference is not created and None
is returned.
"""
return _libsbml.Model_createModifier(self)
def createKineticLaw(self):
"""
createKineticLaw(Model self) -> KineticLaw
Creates a new KineticLaw inside the last Reaction object created in
this Model, and returns a pointer to it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this object's
corresponding attributes.
The mechanism by which the last Reaction object was created and added
to this Model is not significant. It could have been created in a
variety of ways, for example using createReaction(). If a Reaction
does not exist for this model, a new SpeciesReference is not created
and None is returned instead.
Returns the KineticLaw object created. If a Reaction does not exist
for this model, or a Reaction does exist but already has a KineticLaw,
a new KineticLaw is not created and None is returned.
"""
return _libsbml.Model_createKineticLaw(self)
def createKineticLawParameter(self):
"""
createKineticLawParameter(Model self) -> Parameter
Creates a new local Parameter inside the KineticLaw object of the last
Reaction created inside this Model, and returns a pointer to it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this object's
corresponding attributes.
The last KineticLaw object in this Model could have been created in a
variety of ways. For example, it could have been added using
createKineticLaw(), or it could be the result of using
Reaction.createKineticLaw() on the Reaction object created by a
createReaction(). If a Reaction does not exist for this model, or the
last Reaction does not contain a KineticLaw object, a new Parameter is
not created and None is returned instead.
Returns the Parameter object created. If a Reaction does not exist
for this model, or a KineticLaw for the Reaction does not exist, a new
Parameter is not created and None is returned.
"""
return _libsbml.Model_createKineticLawParameter(self)
def createKineticLawLocalParameter(self):
"""
createKineticLawLocalParameter(Model self) -> LocalParameter
Creates a new LocalParameter inside the KineticLaw object of the last
Reaction created inside this Model, and returns a pointer to it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this object's
corresponding attributes.
The last KineticLaw object in this Model could have been created in a
variety of ways. For example, it could have been added using
createKineticLaw(), or it could be the result of using
Reaction.createKineticLaw() on the Reaction object created by a
createReaction(). If a Reaction does not exist for this model, or the
last Reaction does not contain a KineticLaw object, a new Parameter is
not created and None is returned instead.
Returns the Parameter object created. If a Reaction does not exist
for this model, or a KineticLaw for the Reaction does not exist, a new
Parameter is not created and None is returned.
"""
return _libsbml.Model_createKineticLawLocalParameter(self)
def createEvent(self):
"""
createEvent(Model self) -> Event
Creates a new Event inside this Model and returns it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this object's
corresponding attributes.
Returns the Event object created
"""
return _libsbml.Model_createEvent(self)
def createEventAssignment(self):
"""
createEventAssignment(Model self) -> EventAssignment
Creates a new EventAssignment inside the last Event object created in
this Model, and returns a pointer to it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this object's
corresponding attributes.
The mechanism by which the last Event object in this model was
created is not significant. It could have been created in a variety
of ways, for example by using createEvent(). If no Event object
exists in this Model object, a new EventAssignment is not created and
None is returned instead.
Returns the EventAssignment object created
"""
return _libsbml.Model_createEventAssignment(self)
def createTrigger(self):
"""
createTrigger(Model self) -> Trigger
Creates a new Trigger inside the last Event object created in this
Model, and returns a pointer to it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this object's
corresponding attributes.
The mechanism by which the last Event object in this model was
created is not significant. It could have been created in a variety
of ways, for example by using createEvent(). If no Event object
exists in this Model object, a new EventAssignment is not created and
None is returned instead.
Returns the Trigger object created
"""
return _libsbml.Model_createTrigger(self)
def createDelay(self):
"""
createDelay(Model self) -> Delay
Creates a new Delay inside the last Event object created in this
Model, and returns a pointer to it.
The SBML Level and Version of the enclosing Model object, as well as
any SBML package namespaces, are used to initialize this object's
corresponding attributes.
The mechanism by which the last Event object in this model was
created is not significant. It could have been created in a variety
of ways, for example by using createEvent(). If no Event object
exists in this Model object, a new EventAssignment is not created and
None is returned instead.
Returns the Delay object created
"""
return _libsbml.Model_createDelay(self)
def setAnnotation(self, *args):
"""
setAnnotation(Model self, XMLNode annotation) -> int
setAnnotation(Model self, string annotation) -> int
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
setAnnotation(XMLNode annotation)
Sets the value of the 'annotation' subelement of this SBML object to a
copy of 'annotation'.
Any existing content of the 'annotation' subelement is discarded.
Unless you have taken steps to first copy and reconstitute any
existing annotations into the 'annotation' that is about to be
assigned, it is likely that performing such wholesale replacement is
unfriendly towards other software applications whose annotations are
discarded. An alternative may be to use appendAnnotation().
Parameter 'annotation' is an XML structure that is to be used as the
content of the 'annotation' subelement of this object
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
See also appendAnnotation(), appendAnnotation().
"""
return _libsbml.Model_setAnnotation(self, *args)
def appendAnnotation(self, *args):
"""
appendAnnotation(Model self, XMLNode annotation) -> int
appendAnnotation(Model self, string annotation) -> int
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
appendAnnotation(XMLNode annotation)
Appends annotation content to any existing content in the 'annotation'
subelement of this object.
The content in 'annotation' is copied. Unlike setAnnotation(), this
method allows other annotations to be preserved when an application
adds its own data.
Parameter 'annotation' is an XML structure that is to be copied and
appended to the content of the 'annotation' subelement of this object
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
See also setAnnotation(), setAnnotation().
"""
return _libsbml.Model_appendAnnotation(self, *args)
def getListOfFunctionDefinitions(self, *args):
"""
getListOfFunctionDefinitions(Model self) -> ListOfFunctionDefinitions
getListOfFunctionDefinitions(Model self) -> ListOfFunctionDefinitions
Get the ListOfFunctionDefinitions object in this Model.
Returns the list of FunctionDefinitions for this Model.
"""
return _libsbml.Model_getListOfFunctionDefinitions(self, *args)
def getListOfUnitDefinitions(self, *args):
"""
getListOfUnitDefinitions(Model self) -> ListOfUnitDefinitions
getListOfUnitDefinitions(Model self) -> ListOfUnitDefinitions
Get the ListOfUnitDefinitions object in this Model.
Returns the list of UnitDefinitions for this Model.
"""
return _libsbml.Model_getListOfUnitDefinitions(self, *args)
def getListOfCompartmentTypes(self, *args):
"""
getListOfCompartmentTypes(Model self) -> ListOfCompartmentTypes
getListOfCompartmentTypes(Model self) -> ListOfCompartmentTypes
Get the ListOfCompartmentTypes object in this Model.
Returns the list of CompartmentTypes for this Model.
Note:
The CompartmentType object class is only available in SBML Level 2
Versions 2-4. It is not available in Level 1 nor Level 3.
"""
return _libsbml.Model_getListOfCompartmentTypes(self, *args)
def getListOfSpeciesTypes(self, *args):
"""
getListOfSpeciesTypes(Model self) -> ListOfSpeciesTypes
getListOfSpeciesTypes(Model self) -> ListOfSpeciesTypes
Get the ListOfSpeciesTypes object in this Model.
Returns the list of SpeciesTypes for this Model.
Note:
The SpeciesType object class is only available in SBML Level 2
Versions 2-4. It is not available in Level 1 nor Level 3.
"""
return _libsbml.Model_getListOfSpeciesTypes(self, *args)
def getListOfCompartments(self, *args):
"""
getListOfCompartments(Model self) -> ListOfCompartments
getListOfCompartments(Model self) -> ListOfCompartments
Get the ListOfCompartments object in this Model.
Returns the list of Compartments for this Model.
"""
return _libsbml.Model_getListOfCompartments(self, *args)
def getListOfSpecies(self, *args):
"""
getListOfSpecies(Model self) -> ListOfSpecies
getListOfSpecies(Model self) -> ListOfSpecies
Get the ListOfSpecies object in this Model.
Returns the list of Species for this Model.
"""
return _libsbml.Model_getListOfSpecies(self, *args)
def getListOfParameters(self, *args):
"""
getListOfParameters(Model self) -> ListOfParameters
getListOfParameters(Model self) -> ListOfParameters
Get the ListOfParameters object in this Model.
Returns the list of Parameters for this Model.
"""
return _libsbml.Model_getListOfParameters(self, *args)
def getListOfInitialAssignments(self, *args):
"""
getListOfInitialAssignments(Model self) -> ListOfInitialAssignments
getListOfInitialAssignments(Model self) -> ListOfInitialAssignments
Get the ListOfInitialAssignments object in this Model.
Returns the list of InitialAssignments for this Model.
"""
return _libsbml.Model_getListOfInitialAssignments(self, *args)
def getListOfRules(self, *args):
"""
getListOfRules(Model self) -> ListOfRules
getListOfRules(Model self) -> ListOfRules
Get the ListOfRules object in this Model.
Returns the list of Rules for this Model.
"""
return _libsbml.Model_getListOfRules(self, *args)
def getListOfConstraints(self, *args):
"""
getListOfConstraints(Model self) -> ListOfConstraints
getListOfConstraints(Model self) -> ListOfConstraints
Get the ListOfConstraints object in this Model.
Returns the list of Constraints for this Model.
"""
return _libsbml.Model_getListOfConstraints(self, *args)
def getListOfReactions(self, *args):
"""
getListOfReactions(Model self) -> ListOfReactions
getListOfReactions(Model self) -> ListOfReactions
Get the ListOfReactions object in this Model.
Returns the list of Reactions for this Model.
"""
return _libsbml.Model_getListOfReactions(self, *args)
def getListOfEvents(self, *args):
"""
getListOfEvents(Model self) -> ListOfEvents
getListOfEvents(Model self) -> ListOfEvents
Get the ListOfEvents object in this Model.
Returns the list of Events for this Model.
"""
return _libsbml.Model_getListOfEvents(self, *args)
def getFunctionDefinition(self, *args):
"""
getFunctionDefinition(Model self, unsigned int n) -> FunctionDefinition
getFunctionDefinition(Model self, unsigned int n) -> FunctionDefinition
getFunctionDefinition(Model self, string sid) -> FunctionDefinition
getFunctionDefinition(Model self, string sid) -> FunctionDefinition
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
getFunctionDefinition(string sid)
Get a FunctionDefinition object based on its identifier.
Parameter 'sid' is the identifier to search for.
Returns the FunctionDefinition in this Model with the identifier 'sid'
or None if no such FunctionDefinition exists.
______________________________________________________________________
Method variant with the following signature:
getFunctionDefinition(long n)
Get the nth FunctionDefinitions object in this Model.
Parameter 'n' is the index of the object to return.
Returns the nth FunctionDefinition of this Model.
"""
return _libsbml.Model_getFunctionDefinition(self, *args)
def getUnitDefinition(self, *args):
"""
getUnitDefinition(Model self, unsigned int n) -> UnitDefinition
getUnitDefinition(Model self, unsigned int n) -> UnitDefinition
getUnitDefinition(Model self, string sid) -> UnitDefinition
getUnitDefinition(Model self, string sid) -> UnitDefinition
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
getUnitDefinition(string sid)
Get a UnitDefinition based on its identifier.
Parameter 'sid' is the identifier to search for.
Returns the UnitDefinition in this Model with the identifier 'sid' or
None if no such UnitDefinition exists.
______________________________________________________________________
Method variant with the following signature:
getUnitDefinition(long n)
Get the nth UnitDefinition object in this Model.
Parameter 'n' is the index of the object to return.
Returns the nth UnitDefinition of this Model.
"""
return _libsbml.Model_getUnitDefinition(self, *args)
def getCompartmentType(self, *args):
"""
getCompartmentType(Model self, unsigned int n) -> CompartmentType
getCompartmentType(Model self, unsigned int n) -> CompartmentType
getCompartmentType(Model self, string sid) -> CompartmentType
getCompartmentType(Model self, string sid) -> CompartmentType
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
getCompartmentType(string sid)
Get a CompartmentType object based on its identifier.
Parameter 'sid' is the identifier to search for.
Returns the CompartmentType in this Model with the identifier 'sid' or
None if no such CompartmentType exists.
Note:
The CompartmentType object class is only available in SBML Level 2
Versions 2-4. It is not available in Level 1 nor Level 3.
______________________________________________________________________
Method variant with the following signature:
getCompartmentType(long n)
Get the nth CompartmentType object in this Model.
Parameter 'n' is the index of the object to return.
Returns the nth CompartmentType of this Model.
Note:
The CompartmentType object class is only available in SBML Level 2
Versions 2-4. It is not available in Level 1 nor Level 3.
"""
return _libsbml.Model_getCompartmentType(self, *args)
def getSpeciesType(self, *args):
"""
getSpeciesType(Model self, unsigned int n) -> SpeciesType
getSpeciesType(Model self, unsigned int n) -> SpeciesType
getSpeciesType(Model self, string sid) -> SpeciesType
getSpeciesType(Model self, string sid) -> SpeciesType
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
getSpeciesType(string sid)
Get a SpeciesType object based on its identifier.
Parameter 'sid' is the identifier to search for.
Returns the SpeciesType in this Model with the identifier 'sid' or
None if no such SpeciesType exists.
Note:
The SpeciesType object class is only available in SBML Level 2
Versions 2-4. It is not available in Level 1 nor Level 3.
______________________________________________________________________
Method variant with the following signature:
getSpeciesType(long n)
Get the nth SpeciesType object in this Model.
Parameter 'n' is the index of the object to return.
Returns the nth SpeciesType of this Model.
Note:
The SpeciesType object class is only available in SBML Level 2
Versions 2-4. It is not available in Level 1 nor Level 3.
"""
return _libsbml.Model_getSpeciesType(self, *args)
def getCompartment(self, *args):
"""
getCompartment(Model self, unsigned int n) -> Compartment
getCompartment(Model self, unsigned int n) -> Compartment
getCompartment(Model self, string sid) -> Compartment
getCompartment(Model self, string sid) -> Compartment
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
getCompartment(string sid)
Get a Compartment object based on its identifier.
Parameter 'sid' is the identifier to search for.
Returns the Compartment in this Model with the identifier 'sid' or
None if no such Compartment exists.
______________________________________________________________________
Method variant with the following signature:
getCompartment(long n)
Get the nth Compartment object in this Model.
Parameter 'n' is the index of the object to return.
Returns the nth Compartment of this Model.
"""
return _libsbml.Model_getCompartment(self, *args)
def getSpecies(self, *args):
"""
getSpecies(Model self, unsigned int n) -> Species
getSpecies(Model self, unsigned int n) -> Species
getSpecies(Model self, string sid) -> Species
getSpecies(Model self, string sid) -> Species
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
getSpecies(string sid)
Get a Species object based on its identifier.
Parameter 'sid' is the identifier to search for.
Returns the Species in this Model with the identifier 'sid' or None if
no such Species exists.
______________________________________________________________________
Method variant with the following signature:
getSpecies(long n)
Get the nth Species object in this Model.
Parameter 'n' is the index of the object to return.
Returns the nth Species of this Model.
"""
return _libsbml.Model_getSpecies(self, *args)
def getParameter(self, *args):
"""
getParameter(Model self, unsigned int n) -> Parameter
getParameter(Model self, unsigned int n) -> Parameter
getParameter(Model self, string sid) -> Parameter
getParameter(Model self, string sid) -> Parameter
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
getParameter(string sid)
Get a Parameter object based on its identifier.
Parameter 'sid' is the identifier to search for.
Returns the Parameter in this Model with the identifier 'sid' or None
if no such Parameter exists.
______________________________________________________________________
Method variant with the following signature:
getParameter(long n)
Get the nth Parameter object in this Model.
Parameter 'n' is the index of the object to return.
Returns the nth Parameter of this Model.
"""
return _libsbml.Model_getParameter(self, *args)
def getInitialAssignment(self, *args):
"""
getInitialAssignment(Model self, unsigned int n) -> InitialAssignment
getInitialAssignment(Model self, unsigned int n) -> InitialAssignment
getInitialAssignment(Model self, string symbol) -> InitialAssignment
getInitialAssignment(Model self, string symbol) -> InitialAssignment
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
getInitialAssignment(string symbol)
Get an InitialAssignment object based on the symbol to which it
assigns a value.
Parameter 'symbol' is the symbol to search for.
Returns the InitialAssignment in this Model with the given 'symbol'
attribute value or None if no such InitialAssignment exists.
______________________________________________________________________
Method variant with the following signature:
getInitialAssignment(long n)
Get the nth InitialAssignment object in this Model.
Parameter 'n' is the index of the object to return.
Returns the nth InitialAssignment of this Model.
"""
return _libsbml.Model_getInitialAssignment(self, *args)
def getInitialAssignmentBySymbol(self, *args):
"""
getInitialAssignmentBySymbol(Model self, string symbol) -> InitialAssignment
getInitialAssignmentBySymbol(Model self, string symbol) -> InitialAssignment
Get an InitialAssignment object based on the symbol to which it
assigns a value.
Parameter 'symbol' is the symbol to search for.
Returns the InitialAssignment in this Model with the given 'symbol'
attribute value or None if no such InitialAssignment exists.
"""
return _libsbml.Model_getInitialAssignmentBySymbol(self, *args)
def getRule(self, *args):
"""
getRule(Model self, unsigned int n) -> Rule
getRule(Model self, unsigned int n) -> Rule
getRule(Model self, string variable) -> Rule
getRule(Model self, string variable) -> Rule
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
getRule(long n)
Get the nth Rule object in this Model.
Parameter 'n' is the index of the object to return.
Returns the nth Rule of this Model.
______________________________________________________________________
Method variant with the following signature:
getRule(string variable)
Get a Rule object based on the variable to which it assigns a value.
Parameter 'variable' is the variable to search for.
Returns the Rule in this Model with the given 'variable' attribute
value or None if no such Rule exists.
"""
return _libsbml.Model_getRule(self, *args)
def getRuleByVariable(self, *args):
"""
getRuleByVariable(Model self, string variable) -> Rule
getRuleByVariable(Model self, string variable) -> Rule
Get a Rule object based on the variable to which it assigns a value.
Parameter 'variable' is the variable to search for.
Returns the Rule in this Model with the given 'variable' attribute
value or None if no such Rule exists.
"""
return _libsbml.Model_getRuleByVariable(self, *args)
def getAssignmentRule(self, *args):
"""
getAssignmentRule(Model self, string variable) -> AssignmentRule
getAssignmentRule(Model self, string variable) -> AssignmentRule
Get a Rule object based on the variable to which it assigns a value.
Parameter 'variable' is the variable to search for.
Returns the Rule in this Model with the given 'variable' attribute
value or None if no such Rule exists.
"""
return _libsbml.Model_getAssignmentRule(self, *args)
def getRateRule(self, *args):
"""
getRateRule(Model self, string variable) -> RateRule
getRateRule(Model self, string variable) -> RateRule
Get a Rule object based on the variable to which it assigns a value.
Parameter 'variable' is the symbol to search for.
Returns the Rule in this Model with the given 'variable' attribute
value or None if no such Rule exists.
"""
return _libsbml.Model_getRateRule(self, *args)
def getAssignmentRuleByVariable(self, *args):
"""
getAssignmentRuleByVariable(Model self, string variable) -> AssignmentRule
getAssignmentRuleByVariable(Model self, string variable) -> AssignmentRule
Get a Rule object based on the variable to which it assigns a value.
Parameter 'variable' is the variable to search for.
Returns the Rule in this Model with the given 'variable' attribute
value or None if no such Rule exists.
"""
return _libsbml.Model_getAssignmentRuleByVariable(self, *args)
def getRateRuleByVariable(self, *args):
"""
getRateRuleByVariable(Model self, string variable) -> RateRule
getRateRuleByVariable(Model self, string variable) -> RateRule
Get a Rule object based on the variable to which it assigns a value.
Parameter 'variable' is the variable to search for.
Returns the Rule in this Model with the given 'variable' attribute
value or None if no such Rule exists.
"""
return _libsbml.Model_getRateRuleByVariable(self, *args)
def getConstraint(self, *args):
"""
getConstraint(Model self, unsigned int n) -> Constraint
getConstraint(Model self, unsigned int n) -> Constraint
Get the nth Constraint object in this Model.
Parameter 'n' is the index of the object to return.
Returns the nth Constraint of this Model.
"""
return _libsbml.Model_getConstraint(self, *args)
def getReaction(self, *args):
"""
getReaction(Model self, unsigned int n) -> Reaction
getReaction(Model self, unsigned int n) -> Reaction
getReaction(Model self, string sid) -> Reaction
getReaction(Model self, string sid) -> Reaction
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
getReaction(string sid)
Get a Reaction object based on its identifier.
Parameter 'sid' is the identifier to search for.
Returns the Reaction in this Model with the identifier 'sid' or None
if no such Reaction exists.
______________________________________________________________________
Method variant with the following signature:
getReaction(long n)
Get the nth Reaction object in this Model.
Parameter 'n' is the index of the object to return.
Returns the nth Reaction of this Model.
"""
return _libsbml.Model_getReaction(self, *args)
def getSpeciesReference(self, *args):
"""
getSpeciesReference(Model self, string sid) -> SpeciesReference
getSpeciesReference(Model self, string sid) -> SpeciesReference
Get a SpeciesReference object based on its identifier.
Parameter 'sid' is the identifier to search for.
Returns the SpeciesReference in this Model with the identifier 'sid'
or None if no such SpeciesReference exists.
"""
return _libsbml.Model_getSpeciesReference(self, *args)
def getModifierSpeciesReference(self, *args):
"""
getModifierSpeciesReference(Model self, string sid) -> ModifierSpeciesReference
getModifierSpeciesReference(Model self, string sid) -> ModifierSpeciesReference
Get a ModifierSpeciesReference object based on its identifier.
Parameter 'sid' is the identifier to search for.
Returns the ModifierSpeciesReference in this Model with the
identifier 'sid' or None if no such ModifierSpeciesReference exists.
"""
return _libsbml.Model_getModifierSpeciesReference(self, *args)
def getEvent(self, *args):
"""
getEvent(Model self, unsigned int n) -> Event
getEvent(Model self, unsigned int n) -> Event
getEvent(Model self, string sid) -> Event
getEvent(Model self, string sid) -> Event
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
getEvent(string sid)
Get an Event object based on its identifier.
Parameter 'sid' is the identifier to search for.
Returns the Event in this Model with the identifier 'sid' or None if
no such Event exists.
______________________________________________________________________
Method variant with the following signature:
getEvent(long n)
Get the nth Event object in this Model.
Parameter 'n' is the index of the object to return.
Returns the nth Event of this Model.
"""
return _libsbml.Model_getEvent(self, *args)
def getNumFunctionDefinitions(self):
"""
getNumFunctionDefinitions(Model self) -> unsigned int
Get the number of FunctionDefinition objects in this Model.
Returns the number of FunctionDefinitions in this Model.
"""
return _libsbml.Model_getNumFunctionDefinitions(self)
def getNumUnitDefinitions(self):
"""
getNumUnitDefinitions(Model self) -> unsigned int
Get the number of UnitDefinition objects in this Model.
Returns the number of UnitDefinitions in this Model.
"""
return _libsbml.Model_getNumUnitDefinitions(self)
def getNumCompartmentTypes(self):
"""
getNumCompartmentTypes(Model self) -> unsigned int
Get the number of CompartmentType objects in this Model.
Returns the number of CompartmentTypes in this Model.
Note:
The CompartmentType object class is only available in SBML Level 2
Versions 2-4. It is not available in Level 1 nor Level 3.
"""
return _libsbml.Model_getNumCompartmentTypes(self)
def getNumSpeciesTypes(self):
"""
getNumSpeciesTypes(Model self) -> unsigned int
Get the number of SpeciesType objects in this Model.
Returns the number of SpeciesTypes in this Model.
Note:
The SpeciesType object class is only available in SBML Level 2
Versions 2-4. It is not available in Level 1 nor Level 3.
"""
return _libsbml.Model_getNumSpeciesTypes(self)
def getNumCompartments(self):
"""
getNumCompartments(Model self) -> unsigned int
Get the number of Compartment objects in this Model.
Returns the number of Compartments in this Model.
"""
return _libsbml.Model_getNumCompartments(self)
def getNumSpecies(self):
"""
getNumSpecies(Model self) -> unsigned int
Get the number of Specie objects in this Model.
Returns the number of Species in this Model.
"""
return _libsbml.Model_getNumSpecies(self)
def getNumSpeciesWithBoundaryCondition(self):
"""
getNumSpeciesWithBoundaryCondition(Model self) -> unsigned int
Get the number of Species in this Model having their
'boundaryCondition' attribute value set to True.
Returns the number of Species in this Model with boundaryCondition set
to true.
"""
return _libsbml.Model_getNumSpeciesWithBoundaryCondition(self)
def getNumParameters(self):
"""
getNumParameters(Model self) -> unsigned int
Get the number of Parameter objects in this Model.
Returns the number of Parameters in this Model. Parameters defined in
KineticLaws are not included.
"""
return _libsbml.Model_getNumParameters(self)
def getNumInitialAssignments(self):
"""
getNumInitialAssignments(Model self) -> unsigned int
Get the number of InitialAssignment objects in this Model.
Returns the number of InitialAssignments in this Model.
"""
return _libsbml.Model_getNumInitialAssignments(self)
def getNumRules(self):
"""
getNumRules(Model self) -> unsigned int
Get the number of Rule objects in this Model.
Returns the number of Rules in this Model.
"""
return _libsbml.Model_getNumRules(self)
def getNumConstraints(self):
"""
getNumConstraints(Model self) -> unsigned int
Get the number of Constraint objects in this Model.
Returns the number of Constraints in this Model.
"""
return _libsbml.Model_getNumConstraints(self)
def getNumReactions(self):
"""
getNumReactions(Model self) -> unsigned int
Get the number of Reaction objects in this Model.
Returns the number of Reactions in this Model.
"""
return _libsbml.Model_getNumReactions(self)
def getNumEvents(self):
"""
getNumEvents(Model self) -> unsigned int
Get the number of Event objects in this Model.
Returns the number of Events in this Model.
"""
return _libsbml.Model_getNumEvents(self)
def removeFromParentAndDelete(self):
"""
removeFromParentAndDelete(Model self) -> int
Remove this Model from its parent SBMLDocument object.
This works by finding this Model's parent SBMLDocument and then
calling setModel(None) on it, indirectly deleting itself. Overridden
from the SBase function since the parent is not a ListOf.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
"""
return _libsbml.Model_removeFromParentAndDelete(self)
def renameAllIds(self, idTransformer, filter=None):
"""
renameAllIds(Model self, IdentifierTransformer idTransformer, ElementFilter filter=None) -> int
renameAllIds(Model self, IdentifierTransformer idTransformer) -> int
Internal implementation method.
"""
return _libsbml.Model_renameAllIds(self, idTransformer, filter)
def renameSIdRefs(self, oldid, newid):
"""
renameSIdRefs(Model self, string oldid, string newid)
Replaces all uses of a given SIdRef type attribute value with another
value.
In SBML, object identifiers are of a data type called SId. In SBML
Level 3, an explicit data type called SIdRef was introduced for
attribute values that refer to SId values; in previous Levels of SBML,
this data type did not exist and attributes were simply described to
as 'referring to an identifier', but the effective data type was the
same as SIdRefin Level 3. These and other methods of libSBML refer to
the type SIdRef for all Levels of SBML, even if the corresponding SBML
specification did not explicitly name the data type.
This method works by looking at all attributes and (if appropriate)
mathematical formulas in MathML content, comparing the referenced
identifiers to the value of 'oldid'. If any matches are found, the
matching values are replaced with 'newid'. The method does not
descend into child elements.
Parameter 'oldid' is the old identifier Parameter 'newid' is the new
identifier
"""
return _libsbml.Model_renameSIdRefs(self, oldid, newid)
def renameUnitSIdRefs(self, oldid, newid):
"""
renameUnitSIdRefs(Model self, string oldid, string newid)
Replaces all uses of a given UnitSIdRef type attribute value with
another value.
In SBML, unit definitions have identifiers of type UnitSId. In SBML
Level 3, an explicit data type called UnitSIdRef was introduced for
attribute values that refer to UnitSId values; in previous Levels of
SBML, this data type did not exist and attributes were simply
described to as 'referring to a unit identifier', but the effective
data type was the same as UnitSIdRef in Level 3. These and other
methods of libSBML refer to the type UnitSIdRef for all Levels of
SBML, even if the corresponding SBML specification did not explicitly
name the data type.
This method works by looking at all unit identifier attribute values
(including, if appropriate, inside mathematical formulas), comparing
the referenced unit identifiers to the value of 'oldid'. If any
matches are found, the matching values are replaced with 'newid'. The
method does not descend into child elements.
Parameter 'oldid' is the old identifier Parameter 'newid' is the new
identifier
"""
return _libsbml.Model_renameUnitSIdRefs(self, oldid, newid)
def convertL1ToL2(self):
"""
convertL1ToL2(Model self)
Internal implementation method.
"""
return _libsbml.Model_convertL1ToL2(self)
def convertL1ToL3(self):
"""
convertL1ToL3(Model self)
Internal implementation method.
"""
return _libsbml.Model_convertL1ToL3(self)
def convertL2ToL3(self):
"""
convertL2ToL3(Model self)
Internal implementation method.
"""
return _libsbml.Model_convertL2ToL3(self)
def convertL2ToL1(self, strict=False):
"""
convertL2ToL1(Model self, bool strict=False)
convertL2ToL1(Model self)
Internal implementation method.
"""
return _libsbml.Model_convertL2ToL1(self, strict)
def convertL3ToL1(self):
"""
convertL3ToL1(Model self)
Internal implementation method.
"""
return _libsbml.Model_convertL3ToL1(self)
def convertL3ToL2(self, strict=False):
"""
convertL3ToL2(Model self, bool strict=False)
convertL3ToL2(Model self)
Internal implementation method.
"""
return _libsbml.Model_convertL3ToL2(self, strict)
def addModifiers(self):
"""
addModifiers(Model self)
Internal implementation method.
"""
return _libsbml.Model_addModifiers(self)
def addConstantAttribute(self):
"""
addConstantAttribute(Model self)
Internal implementation method.
"""
return _libsbml.Model_addConstantAttribute(self)
def setSpatialDimensions(self, dims=3.0):
"""
setSpatialDimensions(Model self, double dims=3.0)
setSpatialDimensions(Model self)
Internal implementation method.
"""
return _libsbml.Model_setSpatialDimensions(self, dims)
def addDefinitionsForDefaultUnits(self):
"""
addDefinitionsForDefaultUnits(Model self)
Internal implementation method.
"""
return _libsbml.Model_addDefinitionsForDefaultUnits(self)
def convertParametersToLocals(self, level, version):
"""
convertParametersToLocals(Model self, unsigned int level, unsigned int version)
Internal implementation method.
"""
return _libsbml.Model_convertParametersToLocals(self, level, version)
def setSpeciesReferenceConstantValueAndStoichiometry(self):
"""
setSpeciesReferenceConstantValueAndStoichiometry(Model self)
Internal implementation method.
"""
return _libsbml.Model_setSpeciesReferenceConstantValueAndStoichiometry(self)
def removeParameterRuleUnits(self, strict):
"""
removeParameterRuleUnits(Model self, bool strict)
Internal implementation method.
"""
return _libsbml.Model_removeParameterRuleUnits(self, strict)
def convertStoichiometryMath(self):
"""
convertStoichiometryMath(Model self)
Internal implementation method.
"""
return _libsbml.Model_convertStoichiometryMath(self)
def assignRequiredValues(self):
"""
assignRequiredValues(Model self)
Internal implementation method.
"""
return _libsbml.Model_assignRequiredValues(self)
def dealWithModelUnits(self):
"""
dealWithModelUnits(Model self)
Internal implementation method.
"""
return _libsbml.Model_dealWithModelUnits(self)
def dealWithStoichiometry(self):
"""
dealWithStoichiometry(Model self)
Internal implementation method.
"""
return _libsbml.Model_dealWithStoichiometry(self)
def dealWithEvents(self, strict):
"""
dealWithEvents(Model self, bool strict)
Internal implementation method.
"""
return _libsbml.Model_dealWithEvents(self, strict)
def connectToChild(self):
"""connectToChild(Model self)"""
return _libsbml.Model_connectToChild(self)
def getTypeCode(self):
"""
getTypeCode(Model self) -> int
Returns the libSBML type code for this SBML object.
LibSBML attaches an identifying code to every kind of SBML object.
These are integer constants known as SBML type codes. The names of
all the codes begin with the characters SBML_. In the Python language
interface for libSBML, the type codes are defined as static integer
constants in the interface class 'libsbml'. Note that different Level
3 package plug-ins may use overlapping type codes; to identify the
package to which a given object belongs, call the getPackageName()
method on the object.
Returns the SBML type code for this object: SBML_MODEL (default).
WARNING:
The specific integer values of the possible type codes may be reused
by different Level 3 package plug-ins. Thus, to identifiy the correct
code, it is necessary to invoke both getTypeCode() and
getPackageName().
See also getElementName(), getPackageName().
"""
return _libsbml.Model_getTypeCode(self)
def getElementName(self):
"""
getElementName(Model self) -> string
Returns the XML element name of this object, which for Model, is
always 'model'.
Returns the name of this element, i.e., 'model'.
"""
return _libsbml.Model_getElementName(self)
def populateListFormulaUnitsData(self):
"""
populateListFormulaUnitsData(Model self)
Populates the internal list of derived units for this Model object.
This method tells libSBML to (re)calculate all units for all
components of the enclosing Model object. The result is stored in an
internal list of unit data. Users can access the resulting data by
calling the method SBase.getDerivedUnitDefinition() available on most
objects. (The name 'formula units data' is drawn from the name of the
internal objects libSBML uses to store the data; note that these
internal objects are not exposed to callers, because callers can
interact with the results using the ordinary SBML unit objects.)
This method is used by libSBML itself in the validator concerned with
unit consistency. The unit consistency validator (like all other
validators in libSBML) is invoked by using
SBMLDocument.checkConsistency(), with the consistency checks for the
category LIBSBML_CAT_UNITS_CONSISTENCY turned on. The method
populateListFormulaUnitsData() does not need to be called prior to
invoking the validator if unit consistency checking has not been
turned off. This method is only provided for cases when callers have
a special need to force the unit data to be recalculated. For
instance, during construction of a model, a caller may want to
interrogate libSBML's inferred units without invoking full-blown model
validation; this is a scenario in which calling
populateListFormulaUnitsData() may be useful.
WARNING:
Computing and inferring units is a time-consuming operation. Callers
may want to call isPopulatedListFormulaUnitsData() to determine
whether the units may already have been computed, to save themselves
the need of invoking unit inference unnecessarily.
See also isPopulatedListFormulaUnitsData().
"""
return _libsbml.Model_populateListFormulaUnitsData(self)
def isPopulatedListFormulaUnitsData(self):
"""
isPopulatedListFormulaUnitsData(Model self) -> bool
Predicate returning True if libSBML has derived units for the
components of this model.
LibSBML can infer the units of measurement associated with different
elements of a model. When libSBML does that, it builds a complex
internal structure during a resource-intensive operation. This is
done automatically only when callers invoke validation (via
SBMLDocument.checkConsistency()) and have not turned off the unit
validation option.
Callers can force units to be recalculated by calling
populateListFormulaUnitsData(). To avoid calling that method
unnecessarily, calling programs may first want to invoke this method
(isPopulatedListFormulaUnitsData()) to determine whether it is even
necessary.
Returns True if the units have already been computed, False otherwise.
"""
return _libsbml.Model_isPopulatedListFormulaUnitsData(self)
def getFormulaUnitsDataForVariable(self, sid):
"""
getFormulaUnitsDataForVariable(Model self, string sid) -> FormulaUnitsData *
Internal implementation method.
"""
return _libsbml.Model_getFormulaUnitsDataForVariable(self, sid)
def getFormulaUnitsDataForAssignment(self, sid):
"""
getFormulaUnitsDataForAssignment(Model self, string sid) -> FormulaUnitsData *
Internal implementation method.
"""
return _libsbml.Model_getFormulaUnitsDataForAssignment(self, sid)
def hasRequiredElements(self):
"""
hasRequiredElements(Model self) -> bool
Predicate returning True if all the required elements for this Model
object have been set.
Returns a boolean value indicating whether all the required elements
for this object have been defined.
"""
return _libsbml.Model_hasRequiredElements(self)
def removeFunctionDefinition(self, *args):
"""
removeFunctionDefinition(Model self, unsigned int n) -> FunctionDefinition
removeFunctionDefinition(Model self, string sid) -> FunctionDefinition
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
removeFunctionDefinition(string sid)
Removes the FunctionDefinition object with the given identifier from
this Model object and returns a pointer to it.
The caller owns the returned object and is responsible for deleting
it.
Parameter 'sid' is the identifier of the FunctionDefinition object to
remove
Returns the FunctionDefinition object removed, or None if no
FunctionDefinition object with the identifier exists in this Model
object.
______________________________________________________________________
Method variant with the following signature:
removeFunctionDefinition(long n)
Removes the nth FunctionDefinition object from this Model object and
returns a pointer to it.
The caller owns the returned object and is responsible for deleting
it.
Parameter 'n' is the index of the FunctionDefinition object to remove
Returns the FunctionDefinition object removed, or None if the given
index is out of range.
"""
return _libsbml.Model_removeFunctionDefinition(self, *args)
def removeUnitDefinition(self, *args):
"""
removeUnitDefinition(Model self, unsigned int n) -> UnitDefinition
removeUnitDefinition(Model self, string sid) -> UnitDefinition
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
removeUnitDefinition(string sid)
Removes the UnitDefinition object with the given identifier from this
Model object and returns a pointer to it.
The caller owns the returned object and is responsible for deleting
it.
Parameter 'sid' is the identifier of the UnitDefinition object to
remove
Returns the UnitDefinition object removed, or None if no
UnitDefinition object with the identifier exists in this Model object.
______________________________________________________________________
Method variant with the following signature:
removeUnitDefinition(long n)
Removes the nth UnitDefinition object from this Model object and
returns a pointer to it.
The caller owns the returned object and is responsible for deleting
it.
Parameter 'n' is the index of the UnitDefinition object to remove
Returns the UnitDefinition object removed., or None if the given index
is out of range.
"""
return _libsbml.Model_removeUnitDefinition(self, *args)
def removeCompartmentType(self, *args):
"""
removeCompartmentType(Model self, unsigned int n) -> CompartmentType
removeCompartmentType(Model self, string sid) -> CompartmentType
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
removeCompartmentType(string sid)
Removes the CompartmentType object with the given identifier from this
Model object and returns a pointer to it.
The caller owns the returned object and is responsible for deleting
it.
Parameter 'sid' is the identifier of the object to remove
Returns the CompartmentType object removed, or None if no
CompartmentType object with the identifier exists in this Model
object.
______________________________________________________________________
Method variant with the following signature:
removeCompartmentType(long n)
Removes the nth CompartmentType object from this Model object and
returns a pointer to it.
The caller owns the returned object and is responsible for deleting
it.
Parameter 'n' is the index of the CompartmentType object to remove
Returns the ComapartmentType object removed, or None if the given
index is out of range.
"""
return _libsbml.Model_removeCompartmentType(self, *args)
def removeSpeciesType(self, *args):
"""
removeSpeciesType(Model self, unsigned int n) -> SpeciesType
removeSpeciesType(Model self, string sid) -> SpeciesType
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
removeSpeciesType(string sid)
Removes the SpeciesType object with the given identifier from this
Model object and returns a pointer to it.
The caller owns the returned object and is responsible for deleting
it.
Parameter 'sid' is the identifier of the SpeciesType object to remove
Returns the SpeciesType object removed, or None if no SpeciesType
object with the identifier exists in this Model object.
______________________________________________________________________
Method variant with the following signature:
removeSpeciesType(long n)
Removes the nth SpeciesType object from this Model object and returns
a pointer to it.
The caller owns the returned object and is responsible for deleting
it.
Parameter 'n' is the index of the SpeciesType object to remove
Returns the SpeciesType object removed, or None if the given index is
out of range.
"""
return _libsbml.Model_removeSpeciesType(self, *args)
def removeCompartment(self, *args):
"""
removeCompartment(Model self, unsigned int n) -> Compartment
removeCompartment(Model self, string sid) -> Compartment
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
removeCompartment(string sid)
Removes the Compartment object with the given identifier from this
Model object and returns a pointer to it.
The caller owns the returned object and is responsible for deleting
it.
Parameter 'sid' is the identifier of the Compartment object to remove
Returns the Compartment object removed, or None if no Compartment
object with the identifier exists in this Model object.
______________________________________________________________________
Method variant with the following signature:
removeCompartment(long n)
Removes the nth Compartment object from this Model object and returns
a pointer to it.
The caller owns the returned object and is responsible for deleting
it.
Parameter 'n' is the index of the Compartment object to remove
Returns the Compartment object removed, or None if the given index is
out of range.
"""
return _libsbml.Model_removeCompartment(self, *args)
def removeSpecies(self, *args):
"""
removeSpecies(Model self, unsigned int n) -> Species
removeSpecies(Model self, string sid) -> Species
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
removeSpecies(string sid)
Removes the Species object with the given identifier from this Model
object and returns a pointer to it.
The caller owns the returned object and is responsible for deleting
it.
Parameter 'sid' is the identifier of the Species object to remove
Returns the Species object removed, or None if no Species object with
the identifier exists in this Model object.
______________________________________________________________________
Method variant with the following signature:
removeSpecies(long n)
Removes the nth Species object from this Model object and returns a
pointer to it.
The caller owns the returned object and is responsible for deleting
it.
Parameter 'n' is the index of the Species object to remove
Returns the Species object removed, or None if the given index is out
of range.
"""
return _libsbml.Model_removeSpecies(self, *args)
def removeParameter(self, *args):
"""
removeParameter(Model self, unsigned int n) -> Parameter
removeParameter(Model self, string sid) -> Parameter
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
removeParameter(string sid)
Removes the Parameter object with the given identifier from this Model
object and returns a pointer to it.
The caller owns the returned object and is responsible for deleting
it.
Parameter 'sid' is the identifier of the Parameter object to remove
Returns the Parameter object removed, or None if no Parameter object
with the identifier exists in this Model object.
______________________________________________________________________
Method variant with the following signature:
removeParameter(long n)
Removes the nth Parameter object from this Model object and returns a
pointer to it.
The caller owns the returned object and is responsible for deleting
it.
Parameter 'n' is the index of the Parameter object to remove
Returns the Parameter object removed, or None if the given index is
out of range.
"""
return _libsbml.Model_removeParameter(self, *args)
def removeInitialAssignment(self, *args):
"""
removeInitialAssignment(Model self, unsigned int n) -> InitialAssignment
removeInitialAssignment(Model self, string symbol) -> InitialAssignment
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
removeInitialAssignment(string symbol)
Removes the InitialAssignment object with the given 'symbol' attribute
from this Model object and returns a pointer to it.
The caller owns the returned object and is responsible for deleting
it.
Parameter 'symbol' is the 'symbol' attribute of the InitialAssignment
object to remove
Returns the InitialAssignment object removed, or None if no
InitialAssignment object with the 'symbol' attribute exists in this
Model object.
______________________________________________________________________
Method variant with the following signature:
removeInitialAssignment(long n)
Removes the nth InitialAssignment object from this Model object and
returns a pointer to it.
The caller owns the returned object and is responsible for deleting
it.
Parameter 'n' is the index of the InitialAssignment object to remove
Returns the InitialAssignment object removed, or None if the given
index is out of range.
"""
return _libsbml.Model_removeInitialAssignment(self, *args)
def removeRule(self, *args):
"""
removeRule(Model self, unsigned int n) -> Rule
removeRule(Model self, string variable) -> Rule
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
removeRule(long n)
Removes the nth Rule object from this Model object and returns a
pointer to it.
The caller owns the returned object and is responsible for deleting
it.
Parameter 'n' is the index of the Rule object to remove
Returns the Rule object removed, or None if the given index is out of
range.
______________________________________________________________________
Method variant with the following signature:
removeRule(string variable)
Removes the Rule object with the given 'variable' attribute from this
Model object and returns a pointer to it.
The caller owns the returned object and is responsible for deleting
it.
Parameter 'variable' is the 'variable' attribute of the Rule object to
remove
Returns the Rule object removed, or None if no Rule object with the
'variable' attribute exists in this Model object.
"""
return _libsbml.Model_removeRule(self, *args)
def removeRuleByVariable(self, variable):
"""
removeRuleByVariable(Model self, string variable) -> Rule
Removes the Rule object with the given 'variable' attribute from this
Model object and returns a pointer to it.
The caller owns the returned object and is responsible for deleting
it.
Parameter 'variable' is the 'variable' attribute of the Rule object to
remove
Returns the Rule object removed, or None if no Rule object with the
'variable' attribute exists in this Model object.
"""
return _libsbml.Model_removeRuleByVariable(self, variable)
def removeConstraint(self, n):
"""
removeConstraint(Model self, unsigned int n) -> Constraint
Removes the nth Constraint object from this Model object and returns a
pointer to it.
The caller owns the returned object and is responsible for deleting
it.
Parameter 'n' is the index of the Constraint object to remove
Returns the Constraint object removed, or None if the given index is
out of range.
"""
return _libsbml.Model_removeConstraint(self, n)
def removeReaction(self, *args):
"""
removeReaction(Model self, unsigned int n) -> Reaction
removeReaction(Model self, string sid) -> Reaction
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
removeReaction(string sid)
Removes the Reaction object with the given identifier from this Model
object and returns a pointer to it.
The caller owns the returned object and is responsible for deleting
it.
Parameter 'sid' is the identifier of the Reaction object to remove
Returns the Reaction object removed, or None if no Reaction object
with the identifier exists in this Model object.
______________________________________________________________________
Method variant with the following signature:
removeReaction(long n)
Removes the nth Reaction object from this Model object and returns a
pointer to it.
The caller owns the returned object and is responsible for deleting
it.
Parameter 'n' is the index of the Reaction object to remove
Returns the Reaction object removed, or None if the given index is out
of range.
"""
return _libsbml.Model_removeReaction(self, *args)
def removeEvent(self, *args):
"""
removeEvent(Model self, unsigned int n) -> Event
removeEvent(Model self, string sid) -> Event
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
removeEvent(string sid)
Removes the Event object with the given identifier from this Model
object and returns a pointer to it.
The caller owns the returned object and is responsible for deleting
it.
Parameter 'sid' is the identifier of the Event object to remove
Returns the Event object removed, or None if no Event object with the
identifier exists in this Model object.
______________________________________________________________________
Method variant with the following signature:
removeEvent(long n)
Removes the nth Event object from this Model object and returns a
pointer to it.
The caller owns the returned object and is responsible for deleting
it.
Parameter 'n' is the index of the Event object to remove
Returns the Event object removed, or None if the given index is out of
range.
"""
return _libsbml.Model_removeEvent(self, *args)
def appendFrom(self, model):
"""
appendFrom(Model self, Model model) -> int
Copies a given Model object's subcomponents and appends the copies to
the appropriate places in this Model.
This method also calls the appendFrom method on all libSBML plug-in
objects.
SBML Level 3 consists of a Core definition that can be extended via
optional SBML Level 3 packages. A given model may indicate that it
uses one or more SBML packages, and likewise, a software tool may be
able to support one or more packages. LibSBML does not come
preconfigured with all possible packages included and enabled, in part
because not all package specifications have been finalized. To
support the ability for software systems to enable support for the
Level 3 packages they choose, libSBML features a plug-in mechanism.
Each SBML Level 3 package is implemented in a separate code plug-in
that can be enabled by the application to support working with that
SBML package. A given SBML model may thus contain not only objects
defined by SBML Level 3 Core, but also objects created by libSBML
plug-ins supporting additional Level 3 packages.
Parameter 'model' is the Model to merge with this one.
"""
return _libsbml.Model_appendFrom(self, model)
def enablePackageInternal(self, pkgURI, pkgPrefix, flag):
"""
enablePackageInternal(Model self, string pkgURI, string pkgPrefix, bool flag)
Internal implementation method.
"""
return _libsbml.Model_enablePackageInternal(self, pkgURI, pkgPrefix, flag)
def renameIDs(self, elements, idTransformer):
"""
renameIDs(Model self, SBaseList elements, IdentifierTransformer idTransformer)
Internal implementation method.
"""
return _libsbml.Model_renameIDs(self, elements, idTransformer)
Model_swigregister = _libsbml.Model_swigregister
Model_swigregister(Model)
_libsbml.IdCheckON_swigconstant(_libsbml)
IdCheckON = _libsbml.IdCheckON
_libsbml.IdCheckOFF_swigconstant(_libsbml)
IdCheckOFF = _libsbml.IdCheckOFF
_libsbml.SBMLCheckON_swigconstant(_libsbml)
SBMLCheckON = _libsbml.SBMLCheckON
_libsbml.SBMLCheckOFF_swigconstant(_libsbml)
SBMLCheckOFF = _libsbml.SBMLCheckOFF
_libsbml.SBOCheckON_swigconstant(_libsbml)
SBOCheckON = _libsbml.SBOCheckON
_libsbml.SBOCheckOFF_swigconstant(_libsbml)
SBOCheckOFF = _libsbml.SBOCheckOFF
_libsbml.MathCheckON_swigconstant(_libsbml)
MathCheckON = _libsbml.MathCheckON
_libsbml.MathCheckOFF_swigconstant(_libsbml)
MathCheckOFF = _libsbml.MathCheckOFF
_libsbml.UnitsCheckON_swigconstant(_libsbml)
UnitsCheckON = _libsbml.UnitsCheckON
_libsbml.UnitsCheckOFF_swigconstant(_libsbml)
UnitsCheckOFF = _libsbml.UnitsCheckOFF
_libsbml.OverdeterCheckON_swigconstant(_libsbml)
OverdeterCheckON = _libsbml.OverdeterCheckON
_libsbml.OverdeterCheckOFF_swigconstant(_libsbml)
OverdeterCheckOFF = _libsbml.OverdeterCheckOFF
_libsbml.PracticeCheckON_swigconstant(_libsbml)
PracticeCheckON = _libsbml.PracticeCheckON
_libsbml.PracticeCheckOFF_swigconstant(_libsbml)
PracticeCheckOFF = _libsbml.PracticeCheckOFF
_libsbml.AllChecksON_swigconstant(_libsbml)
AllChecksON = _libsbml.AllChecksON
class SBMLDocument(SBase):
"""
Overall SBML container object.
LibSBML uses the class SBMLDocument as a top-level container for
storing SBML content and data associated with it (such as warnings and
error messages). The two primary means of reading an SBML model,
SBMLReader.readSBML() and SBMLReader.readSBMLFromString(), both return
a pointer to an SBMLDocument object. From there, callers can inquire
about any errors encountered (e.g., using
SBMLDocument.getNumErrors()), access the Model object, and perform
other actions such as consistency-checking and model translation.
When creating fresh models programmatically, the starting point is
typically the creation of an SBMLDocument object instance. The
SBMLDocument constructor accepts arguments for the SBML Level and
Version of the model to be created. After creating the SBMLDocument
object, calling programs then typically call
SBMLDocument.createModel() almost immediately, and then proceed to
call the methods on the Model object to fill out the model's contents.
SBMLDocument corresponds roughly to the class Sbml defined in the SBML
Level 2 specification and SBML in the Level 3 specification. It does
not have a direct correspondence in SBML Level 1. (However, to make
matters simpler for applications, libSBML creates an SBMLDocument no
matter whether the model is Level 1, Level 2 or Level 3.) In its
barest form, when written out in XML format for (e.g.) SBML Level 2
Version 4, the corresponding structure is the following:
...
SBMLDocument is derived from SBase, and therefore contains the usual
SBase attributes (in SBML Level 2 and Level 3) of 'metaid' and
'sboTerm', as well as the subelements 'notes' and 'annotation'. It
also contains the attributes 'level' and 'version' indicating the
Level and Version of the SBML data structure. These can be accessed
using the methods defined by the SBase class for that purpose.
Checking consistency and adherence to SBML specifications
======================================================================
One of the most important features of libSBML is its ability to
perform SBML validation to ensure that a model adheres to the SBML
specification for whatever Level+Version combination the model uses.
SBMLDocument provides the methods for running consistency-checking and
validation rules on the SBML content.
First, a brief explanation of the rationale is in order. In libSBML
versions up to and including the version 3.3.x series, the individual
methods for creating and setting attributes and other components were
quite lenient, and allowed a caller to compose SBML entities that
might not, in the end, represent valid SBML. This allowed
applications the freedom to do things such as save incomplete models
(which is useful when models are being developed over long periods of
time). In the version 4.x series, libSBML is somewhat stricter, but
still permits structures to be created independently and the results
to be combined in a separate step. In all these cases, it means that
a separate validation step is necessary when a calling program finally
wants to finish a complete SBML document.
The primary interface to this validation facility is SBMLDocument's
SBMLDocument.checkInternalConsistency() and
SBMLDocument.checkConsistency(). The former verifies the basic
internal consistency and syntax of an SBML document, and the latter
implements more elaborate validation rules (both those defined by the
SBML specifications, as well as additional rules offered by libSBML).
The checks performed by SBMLDocument.checkInternalConsistency() are
hardwired and cannot be changed by calling programs, but the
validation performed by SBMLDocument.checkConsistency() is under
program control using the method SBMLDocument.setConsistencyChecks().
Applications can selectively disable specific kinds of checks that
they may not be interested in, by calling
SBMLDocument.setConsistencyChecks() with appropriate parameters.
These methods have slightly different relevance depending on whether
a model is created programmaticaly from scratch, or whether it is read
in from a file or data stream. The following list summarizes the
possible scenarios.
Scenario 1: Creating a model from scratch. Before writing out the
model,
* Call SBMLDocument.checkInternalConsistency(), then inquire about
the results by calling SBMLDocument.getNumErrors()
* Call SBMLDocument.setConsistencyChecks() to configure which
checks will be performed by SBMLDocument.checkConsistency()
* Call SBMLDocument.checkConsistency(), then inquire about the
results by calling SBMLDocument.getNumErrors()
Scenario 2: Reading a model from a file or data stream. After reading
the model,
* Basic consistency checks will have been performed automatically
by libSBML upon reading the content, so you only need to inquire about
the results by using SBMLDocument.getNumErrors()
* Call SBMLDocument.setConsistencyChecks() to configure which
checks are performed by SBMLDocument.checkConsistency()
* Call SBMLDocument.checkConsistency(), then inquire about the
results by calling SBMLDocument.getNumErrors()
Converting documents between Levels and Versions of SBML
======================================================================
LibSBML provides facilities for limited translation of SBML between
Levels and Versions of the SBML specifications. The method for doing
is is setLevelAndVersion() . In general, models can be converted
upward without difficulty (e.g., from SBML Level 1 to Level 2, or from
an earlier Version of Level 2 to the latest Version of Level 2).
Sometimes models can be translated downward as well, if they do not
use constructs specific to more advanced Levels of SBML.
Calling SBMLDocument.setLevelAndVersion() will not necessarily lead
to a successful conversion. The method will return a boolean value to
indicate success or failure. Callers must check the error log (see
next section) attached to the SBMLDocument object after calling
SBMLDocument.setLevelAndVersion() in order to assess whether any
problems arose.
If an application is interested in translating to a lower Level and/or
Version of SBML within a Level, the following methods allow for prior
assessment of whether there is sufficient compatibility to make a
translation possible:
* SBMLDocument.checkL1Compatibility(),
* SBMLDocument.checkL2v1Compatibility(),
* SBMLDocument.checkL2v2Compatibility(),
* SBMLDocument.checkL2v3Compatibility(),
* SBMLDocument.checkL2v4Compatibility(), and
* SBMLDocument.checkL3v1Compatibility().
Some changes between Versions of SBML Level 2 may lead to unexpected
behaviors when attempting conversions in either direction. For
example, SBML Level 2 Version 4 relaxed the requirement for
consistency in units of measurement between expressions annd
quantities in a model. As a result, a model written in Version 4, if
converted to Version 3 with no other changes, may fail validation as a
Version 3 model because Version 3 imposed stricter requirements on
unit consistency.
Other changes between SBML Level 2 and Level 3 make downward
conversions challenging. In some cases, it means that a model
converted to Level 2 from Level 3 will contain attributes that were
not explicitly given in the Level 3 model, because in Level 2 these
attributes may have been optional or have default values.
Error handling
======================================================================
Upon reading a model, SBMLDocument logs any problems encountered while
reading the model from the file or data stream. The log contains
objects that record diagnostic information about any notable issues
that arose. Whether the problems are warnings or errors, they are
both reported through a single common interface involving the object
class SBMLError.
The methods SBMLDocument.getNumErrors(), SBMLDocument.getError() and
SBMLDocument.printErrors() allow callers to interact with the warnings
or errors logged. Alternatively, callers may retrieve the entire log
as an SBMLErrorLog object using the method SBMLDocument.getErrorLog().
The SBMLErrorLog object provides some alternative methods for
interacting with the set of errors and warnings. In either case,
applications typically should first call SBMLDocument.getNumErrors()
to find out if any issues have been logged after specific libSBML
operations such as the ones discussed in the sections above. If they
have, then an application will should proceed to inspect the
individual reports using either the direct interfaces on SBMLDocument
or using the methods on the SBMLErrorLog object.
"""
__swig_setmethods__ = {}
for _s in [SBase]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, SBMLDocument, name, value)
__swig_getmethods__ = {}
for _s in [SBase]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, SBMLDocument, name)
__repr__ = _swig_repr
def getDefaultLevel():
"""
getDefaultLevel() -> unsigned int
The default SBML Level of new SBMLDocument objects.
This 'default Level' corresponds to the most recent SBML
specification Level available at the time libSBML version was
released. The default Level is used by SBMLDocument if no Level is
explicitly specified at the time of the construction of an
SBMLDocument instance.
Returns an integer indicating the most recent SBML specification Level
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
See also SBMLDocument.getDefaultVersion() .
"""
return _libsbml.SBMLDocument_getDefaultLevel()
if _newclass:
getDefaultLevel = staticmethod(getDefaultLevel)
__swig_getmethods__["getDefaultLevel"] = lambda x: getDefaultLevel
def getDefaultVersion():
"""
getDefaultVersion() -> unsigned int
The default Version of new SBMLDocument objects.
This 'default Version' corresponds to the most recent Version within
the most recent Level of SBML available at the time libSBML version
was released. The default Version is used by SBMLDocument if no
Version is explicitly specified at the time of the construction of an
SBMLDocument instance.
Returns an integer indicating the most recent SBML specification
Version
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
See also SBMLDocument.getDefaultLevel() .
"""
return _libsbml.SBMLDocument_getDefaultVersion()
if _newclass:
getDefaultVersion = staticmethod(getDefaultVersion)
__swig_getmethods__["getDefaultVersion"] = lambda x: getDefaultVersion
__swig_destroy__ = _libsbml.delete_SBMLDocument
__del__ = lambda self: None
def __init__(self, *args):
"""
__init__(SBMLDocument self, unsigned int level=0, unsigned int version=0) -> SBMLDocument
__init__(SBMLDocument self, unsigned int level=0) -> SBMLDocument
__init__(SBMLDocument self) -> SBMLDocument
__init__(SBMLDocument self, SBMLNamespaces sbmlns) -> SBMLDocument
__init__(SBMLDocument self, SBMLDocument orig) -> SBMLDocument
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
SBMLDocument(long level = 0, long version = 0)
Creates a new SBMLDocument, optionally with given values for the SBML
Level and Version.
If both the SBML Level and Version attributes are not specified, the
SBML document is treated as having the latest Level and Version of
SBML as determined by SBMLDocument.getDefaultLevel() and
SBMLDocument.getDefaultVersion(); however, the SBMLDocument object is
otherwise left blank. In particular, the blank SBMLDocument object
has no associated XML attributes, including (but not limited to) an
XML namespace declaration. The XML namespace declaration is not added
until the model is written out, or the method
SBMLDocument.setLevelAndVersion() is called. This may be important to
keep in mind if an application needs to add additional XML namespace
declarations on the element. Application writers should either
provide values for 'level' and 'version' on the call to this
constructor, or else call SBMLDocument.setLevelAndVersion() shortly
after creating the SBMLDocument object.
Parameter 'level' is an integer for the SBML Level
Parameter 'version' is an integer for the Version within the SBML
Level
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
See also SBMLDocument.setLevelAndVersion(), getDefaultLevel(),
getDefaultVersion().
______________________________________________________________________
Method variant with the following signature:
SBMLDocument(SBMLNamespaces sbmlns)
Creates a new SBMLDocument using the given SBMLNamespaces object
'sbmlns'.
The SBMLNamespaces object encapsulates SBML Level/Version/namespaces
information. It is used to communicate the SBML Level, Version, and
(in Level 3) packages used in addition to SBML Level 3 Core. A common
approach to using libSBML's SBMLNamespaces facilities is to create an
SBMLNamespaces object somewhere in a program once, then hand that
object as needed to object constructors that accept SBMLNamespaces as
arguments.
Parameter 'sbmlns' is an SBMLNamespaces object.
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
______________________________________________________________________
Method variant with the following signature:
SBMLDocument(SBMLDocument orig)
Copy constructor; creates a copy of this SBMLDocument.
Parameter 'orig' is the object to copy.
Throws SBMLConstructorException: Thrown if the argument 'orig' is
None.
"""
this = _libsbml.new_SBMLDocument(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(SBMLDocument self) -> SBMLDocument
Creates and returns a deep copy of this SBMLDocument object.
Returns the (deep) copy of this SBMLDocument object.
"""
return _libsbml.SBMLDocument_clone(self)
def isSetModel(self):
"""
isSetModel(SBMLDocument self) -> bool
Returns True if the Model object has been set, otherwise returns
False.
Returns True if the Model object has been set
"""
return _libsbml.SBMLDocument_isSetModel(self)
def getModel(self, *args):
"""
getModel(SBMLDocument self) -> Model
getModel(SBMLDocument self) -> Model
Returns the Model object stored in this SBMLDocument.
It is important to note that this method does not create a Model
instance. The model in the SBMLDocument must have been created at
some prior time, for example using SBMLDocument.createModel() or
SBMLDocument.setModel(). This method returns None if a model does not
yet exist.
Returns the Model contained in this SBMLDocument.
See also createModel().
"""
return _libsbml.SBMLDocument_getModel(self, *args)
def getElementBySId(self, id):
"""
getElementBySId(SBMLDocument self, string id) -> SBase
Returns the first child element found that has the given 'id' in the
model-wide SId namespace, or None if no such object is found.
Parameter 'id' is string representing the id of objects to find
Returns pointer to the first element found with the given 'id'.
"""
return _libsbml.SBMLDocument_getElementBySId(self, id)
def getElementByMetaId(self, metaid):
"""
getElementByMetaId(SBMLDocument self, string metaid) -> SBase
Returns the first child element it can find with the given 'metaid',
or itself if it has the given 'metaid', or None if no such object is
found.
Parameter 'metaid' is string representing the metaid of objects to
find
Returns pointer to the first element found with the given 'metaid'.
"""
return _libsbml.SBMLDocument_getElementByMetaId(self, metaid)
def expandFunctionDefinitions(self):
"""
expandFunctionDefinitions(SBMLDocument self) -> bool
Removes FunctionDefinition constructs from the document and expands
any instances of their use within elements.
For example, suppose a Model contains a FunctionDefinition with
identifier 'f' representing the math expression: f(x, y) = x * y.
Suppose further that there is a reaction in which the element
of the KineticLaw object contains f(s, p), where s and p are other
identifiers defined in the model. The outcome of invoking this method
is that the of the KineticLaw now represents the expression s *
p and the model no longer contains any FunctionDefinition objects.
Returns bool True if the transformation was successful, False,
otherwise.
Note:
This function will check the consistency of a model before attemptimg
the transformation. If the model is not valid SBML, the
transformation will not be performed and the function will return
False.
"""
return _libsbml.SBMLDocument_expandFunctionDefinitions(self)
def expandInitialAssignments(self):
"""
expandInitialAssignments(SBMLDocument self) -> bool
Removes InitialAssignment constructs from the document and replaces
them with appropriate values.
For example, suppose a Model contains a InitialAssignment to a symbol
'k' where 'k' is the identifier of a Parameter. The outcome of
invoking this method is that the 'value' attribute of the Parameter
definition is set to the result calculated using the InitialAssignment
object's formula, and the corresponding InitialAssignment is
then removed from the Model.
Returns bool True if the transformation was successful, False,
otherwise.
Note:
This function will check the consistency of a model before attemptimg
the transformation. If the model is not valid SBML, the
transformation will not be performed and the function will return
False. As part of that process, this method will check that it has
values for any components referred to by the elements of
InitialAssignment objects. In cases where not all of the values have
been declared (e.g., if the mathematical expression refers to model
entities that have no declared values), the InitialAssignment in
question will not be removed and this method will return False.
"""
return _libsbml.SBMLDocument_expandInitialAssignments(self)
def setLevelAndVersion(self, level, version, strict=True, ignorePackages=False):
"""
setLevelAndVersion(SBMLDocument self, unsigned int level, unsigned int version, bool strict=True, bool ignorePackages=False) -> bool
setLevelAndVersion(SBMLDocument self, unsigned int level, unsigned int version, bool strict=True) -> bool
setLevelAndVersion(SBMLDocument self, unsigned int level, unsigned int version) -> bool
Sets the SBML Level and Version of this SBMLDocument instance,
attempting to convert the model as needed.
This method is the principal way in libSBML to convert models between
Levels and Versions of SBML. Generally, models can be converted
upward without difficulty (e.g., from SBML Level 1 to Level 2, or from
an earlier Version of Level 2 to the latest Version of Level 2).
Sometimes models can be translated downward as well, if they do not
use constructs specific to more advanced Levels of SBML.
Before calling this method, callers may check compatibility directly
using the methods SBMLDocument.checkL1Compatibility(),
SBMLDocument.checkL2v1Compatibility(),
SBMLDocument.checkL2v2Compatibility(),
SBMLDocument.checkL2v3Compatibility(),
SBMLDocument.checkL2v4Compatibility(), and
SBMLDocument.checkL3v1Compatibility().
The valid combinations of SBML Level and Version as of this release of
libSBML are the following:
* Level 1 Version 2
* Level 2 Version 1
* Level 2 Version 2
* Level 2 Version 3
* Level 2 Version 4
* Level 3 Version 1 Strict conversion applies the additional
criteria that both the source and the target model must be consistent
SBML. Users can control the consistency checks that are applied using
the SBMLDocument.setConsistencyChecksForConversion() method. If
either the source or the potential target model have validation
errors, the conversion is not performed. When a strict conversion is
successful, the underlying SBML object model is altered to reflect the
new level and version. Thus, information that cannot be converted
(e.g. sboTerms) will be lost.
Parameter 'level' is the desired SBML Level
Parameter 'version' is the desired Version within the SBML Level
Parameter 'strict' is boolean indicating whether to check consistency
of both the source and target model when performing conversion
(defaults to true )
Parameter 'ignorePackages' is boolean indicating whether the presence
of packages should be ignored by the conversion routine (defaults to
false )
Returns True if the level and version of the document were
successfully set to the requested values (which may have required
conversion of the model), False otherwise.
Note:
Calling this method will not necessarily lead to a successful
conversion. If the conversion fails, it will be logged in the error
list associated with this SBMLDocument. Callers should consult
getNumErrors() to find out if the conversion succeeded without
problems. For conversions from Level 2 to Level 1, callers can also
check the Level of the model after calling this method to find out
whether it is Level 1. (If the conversion to Level 1 failed, the
Level of this model will be left unchanged.)
See also checkL1Compatibility(), checkL2v1Compatibility(),
checkL2v2Compatibility(), checkL2v3Compatibility(),
checkL2v4Compatibility(), checkL3v1Compatibility(),
checkL3v1Compatibility().
"""
return _libsbml.SBMLDocument_setLevelAndVersion(self, level, version, strict, ignorePackages)
def updateSBMLNamespace(self, package, level, version):
"""
updateSBMLNamespace(SBMLDocument self, string package, unsigned int level, unsigned int version)
Internal implementation method.
"""
return _libsbml.SBMLDocument_updateSBMLNamespace(self, package, level, version)
def setModel(self, m):
"""
setModel(SBMLDocument self, Model m) -> int
Sets the Model for this SBMLDocument to a copy of the given Model.
Parameter 'm' is the new Model to use.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_LEVEL_MISMATCH
* LIBSBML_VERSION_MISMATCH
See also createModel(), getModel().
"""
return _libsbml.SBMLDocument_setModel(self, m)
def createModel(self, *args):
"""
createModel(SBMLDocument self, string sid) -> Model
createModel(SBMLDocument self) -> Model
Creates a new Model inside this SBMLDocument, and returns a pointer to
it.
In SBML Level 2, the use of an identifier on a Model object is
optional. This method takes an optional argument, 'sid', for setting
the identifier. If not supplied, the identifier attribute on the
Model instance is not set.
Parameter 'sid' is the identifier of the new Model to create.
See also getModel(), SBMLDocument.setModel().
"""
return _libsbml.SBMLDocument_createModel(self, *args)
def setLocationURI(self, uri):
"""
setLocationURI(SBMLDocument self, string uri)
Sets the location of this SBMLDocument.
Called automatically when readSBMLFromFile is used, but may be set
manually as well.
"""
return _libsbml.SBMLDocument_setLocationURI(self, uri)
def getLocationURI(self, *args):
"""
getLocationURI(SBMLDocument self) -> string
getLocationURI(SBMLDocument self) -> string
Get the location of this SBMLDocument.
If this document was read from a file or had its location set
manually, that filename or set location will be returned, otherwise,
an empty string is returned.
"""
return _libsbml.SBMLDocument_getLocationURI(self, *args)
def setConsistencyChecks(self, category, apply):
"""
setConsistencyChecks(SBMLDocument self, SBMLErrorCategory_t category, bool apply)
Controls the consistency checks that are performed when
SBMLDocument.checkConsistency() is called.
This method works by adding or subtracting consistency checks from the
set of all possible checks that SBMLDocument.checkConsistency() knows
how to perform. This method may need to be called multiple times in
order to achieve the desired combination of checks. The first
argument ('category') in a call to this method indicates the category
of consistency/error checks that are to be turned on or off, and the
second argument ('apply', a boolean) indicates whether to turn it on
(value of True) or off (value of False).
The possible categories (values to the argument 'category') are the
set of constants whose names begin with the characters LIBSBML_CAT_ in
the interface class libsbml. The following are the possible choices:
* LIBSBML_CAT_GENERAL_CONSISTENCY: Correctness and consistency of
specific SBML language constructs. Performing this set of checks is
highly recommended. With respect to the SBML specification, these
concern failures in applying the validation rules numbered 2xxxx in
the Level 2 Versions 2-4 and Level 3 Version 1 specifications.
* LIBSBML_CAT_IDENTIFIER_CONSISTENCY: Correctness and consistency of
identifiers used for model entities. An example of inconsistency
would be using a species identifier in a reaction rate formula without
first having declared the species. With respect to the SBML
specification, these concern failures in applying the validation rules
numbered 103xx in the Level 2 Versions 2-4 and Level 3 Version 1
specifications.
* LIBSBML_CAT_UNITS_CONSISTENCY: Consistency of measurement units
associated with quantities in a model. With respect to the SBML
specification, these concern failures in applying the validation rules
numbered 105xx in the Level 2 Versions 2-4 and Level 3 Version 1
specifications.
* LIBSBML_CAT_MATHML_CONSISTENCY: Syntax of MathML constructs. With
respect to the SBML specification, these concern failures in applying
the validation rules numbered 102xx in the Level 2 Versions 2-4 and
Level 3 Version 1 specifications.
* LIBSBML_CAT_SBO_CONSISTENCY: Consistency and validity of SBO
identifiers (if any) used in the model. With respect to the SBML
specification, these concern failures in applying the validation rules
numbered 107xx in the Level 2 Versions 2-4 and Level 3 Version 1
specifications.
* LIBSBML_CAT_OVERDETERMINED_MODEL: Static analysis of whether the
system of equations implied by a model is mathematically
overdetermined. With respect to the SBML specification, this is
validation rule #10601 in the Level 2 Versions 2-4 and Level 3 Version
1 specifications.
* LIBSBML_CAT_MODELING_PRACTICE: Additional checks for recommended
good modeling practice. (These are tests performed by libSBML and do
not have equivalent SBML validation rules.) By default, all
validation checks are applied to the model in an SBMLDocument object
unless SBMLDocument.setConsistencyChecks() is called to indicate that
only a subset should be applied. Further, this default (i.e.,
performing all checks) applies separately to each new SBMLDocument
object created. In other words, each time a model is read using
SBMLReader.readSBML(), SBMLReader.readSBMLFromString(), or the global
functions readSBML() and readSBMLFromString(), a new SBMLDocument is
created and for that document, a call to
SBMLDocument.checkConsistency() will default to applying all possible
checks. Calling programs must invoke
SBMLDocument.setConsistencyChecks() for each such new model if they
wish to change the consistency checks applied.
Parameter 'category' is a value drawn from the set of SBML error
categories indicating the consistency checking/validation to be turned
on or off.
Parameter 'apply' is a boolean indicating whether the checks indicated
by 'category' should be applied or not.
See also SBMLDocument.checkConsistency().
"""
return _libsbml.SBMLDocument_setConsistencyChecks(self, category, apply)
def setConsistencyChecksForConversion(self, category, apply):
"""
setConsistencyChecksForConversion(SBMLDocument self, SBMLErrorCategory_t category, bool apply)
Controls the consistency checks that are performed when
SBMLDocument.setLevelAndVersion() is called.
This method works by adding or subtracting consistency checks from the
set of all possible checks that may be performed to avoid conversion
to or from an invalid document. This method may need to be called
multiple times in order to achieve the desired combination of checks.
The first argument ('category') in a call to this method indicates the
category of consistency/error checks that are to be turned on or off,
and the second argument ('apply', a boolean) indicates whether to turn
it on (value of True) or off (value of False).
The possible categories (values to the argument 'category') are the
set of constants whose names begin with the characters LIBSBML_CAT_ in
the interface class libsbml. The following are the possible choices:
* LIBSBML_CAT_GENERAL_CONSISTENCY: Correctness and consistency of
specific SBML language constructs. Performing this set of checks is
highly recommended. With respect to the SBML specification, these
concern failures in applying the validation rules numbered 2xxxx in
the Level 2 Versions 2-4 and Level 3 Version 1 specifications.
* LIBSBML_CAT_IDENTIFIER_CONSISTENCY: Correctness and consistency of
identifiers used for model entities. An example of inconsistency
would be using a species identifier in a reaction rate formula without
first having declared the species. With respect to the SBML
specification, these concern failures in applying the validation rules
numbered 103xx in the Level 2 Versions 2-4 and Level 3 Version 1
specifications.
* LIBSBML_CAT_UNITS_CONSISTENCY: Consistency of measurement units
associated with quantities in a model. With respect to the SBML
specification, these concern failures in applying the validation rules
numbered 105xx in the Level 2 Versions 2-4 and Level 3 Version 1
specifications.
* LIBSBML_CAT_MATHML_CONSISTENCY: Syntax of MathML constructs. With
respect to the SBML specification, these concern failures in applying
the validation rules numbered 102xx in the Level 2 Versions 2-4 and
Level 3 Version 1 specifications.
* LIBSBML_CAT_SBO_CONSISTENCY: Consistency and validity of SBO
identifiers (if any) used in the model. With respect to the SBML
specification, these concern failures in applying the validation rules
numbered 107xx in the Level 2 Versions 2-4 and Level 3 Version 1
specifications.
* LIBSBML_CAT_OVERDETERMINED_MODEL: Static analysis of whether the
system of equations implied by a model is mathematically
overdetermined. With respect to the SBML specification, this is
validation rule #10601 in the Level 2 Versions 2-4 and Level 3 Version
1 specifications.
* LIBSBML_CAT_MODELING_PRACTICE: Additional checks for recommended
good modeling practice. (These are tests performed by libSBML and do
not have equivalent SBML validation rules.) By default, all validation
checks are applied to the model in an SBMLDocument object unless
SBMLDocument.setConsistencyChecks() is called to indicate that only a
subset should be applied. Further, this default (i.e., performing all
checks) applies separately to each new SBMLDocument object created.
In other words, each time a model is read using SBMLReader.readSBML(),
SBMLReader.readSBMLFromString(), or the global functions readSBML()
and readSBMLFromString(), a new SBMLDocument is created and for that
document, a call to SBMLDocument.checkConsistency() will default to
applying all possible checks. Calling programs must invoke
SBMLDocument.setConsistencyChecks() for each such new model if they
wish to change the consistency checks applied.
Parameter 'category' is a value drawn from the set of SBML error
categories indicating the consistency checking/validation to be turned
on or off.
Parameter 'apply' is a boolean indicating whether the checks indicated
by 'category' should be applied or not.
See also SBMLDocument.setLevelAndVersion().
"""
return _libsbml.SBMLDocument_setConsistencyChecksForConversion(self, category, apply)
def checkConsistency(self):
"""
checkConsistency(SBMLDocument self) -> unsigned int
Performs consistency checking and validation on this SBML document.
If this method returns a nonzero value (meaning, one or more
consistency checks have failed for SBML document), the failures may be
due to warnings or errors. Callers should inspect the severity flag
in the individual SBMLError objects returned by
SBMLDocument.getError() to determine the nature of the failures.
Returns the number of failed checks (errors) encountered.
See also SBMLDocument.checkInternalConsistency().
"""
return _libsbml.SBMLDocument_checkConsistency(self)
def validateSBML(self):
"""
validateSBML(SBMLDocument self) -> unsigned int
Performs consistency checking and validation on this SBML document.
If this method returns a nonzero value (meaning, one or more
consistency checks have failed for SBML document), the failures may be
due to warnings or errors. Callers should inspect the severity flag
in the individual SBMLError objects returned by
SBMLDocument.getError() to determine the nature of the failures.
Note:
unlike checkConsistency this method will write the document in order
to determine all errors for the document. This will also clear the
error log.
Returns the number of failed checks (errors) encountered.
See also SBMLDocument.checkConsistency().
"""
return _libsbml.SBMLDocument_validateSBML(self)
def checkInternalConsistency(self):
"""
checkInternalConsistency(SBMLDocument self) -> unsigned int
Performs consistency checking on libSBML's internal representation of
an SBML Model.
Callers should query the results of the consistency check by calling
SBMLDocument.getError().
Returns the number of failed checks (errors) encountered.
The distinction between this method and
SBMLDocument.checkConsistency() is that this method reports on
fundamental syntactic and structural errors that violate the XML
Schema for SBML; by contrast, SBMLDocument.checkConsistency() performs
more elaborate model verifications and also validation according to
the validation rules written in the appendices of the SBML Level 2
Versions 2-4 specification documents.
See also SBMLDocument.checkConsistency().
"""
return _libsbml.SBMLDocument_checkInternalConsistency(self)
def checkL1Compatibility(self):
"""
checkL1Compatibility(SBMLDocument self) -> unsigned int
Performs a set of consistency checks on the document to establish
whether it is compatible with SBML Level 1 and can be converted to
Level 1.
Callers should query the results of the consistency check by calling
SBMLDocument.getError().
Returns the number of failed checks (errors) encountered.
"""
return _libsbml.SBMLDocument_checkL1Compatibility(self)
def checkL2v1Compatibility(self):
"""
checkL2v1Compatibility(SBMLDocument self) -> unsigned int
Performs a set of consistency checks on the document to establish
whether it is compatible with SBML Level 2 Version 1 and can be
converted to Level 2 Version 1.
Callers should query the results of the consistency check by calling
SBMLDocument.getError().
Returns the number of failed checks (errors) encountered.
"""
return _libsbml.SBMLDocument_checkL2v1Compatibility(self)
def checkL2v2Compatibility(self):
"""
checkL2v2Compatibility(SBMLDocument self) -> unsigned int
Performs a set of consistency checks on the document to establish
whether it is compatible with SBML Level 2 Version 2 and can be
converted to Level 2 Version 2.
Callers should query the results of the consistency check by calling
SBMLDocument.getError().
Returns the number of failed checks (errors) encountered.
"""
return _libsbml.SBMLDocument_checkL2v2Compatibility(self)
def checkL2v3Compatibility(self):
"""
checkL2v3Compatibility(SBMLDocument self) -> unsigned int
Performs a set of consistency checks on the document to establish
whether it is compatible with SBML Level 2 Version 3 and can be
converted to Level 2 Version 3.
Callers should query the results of the consistency check by calling
SBMLDocument.getError().
Returns the number of failed checks (errors) encountered.
"""
return _libsbml.SBMLDocument_checkL2v3Compatibility(self)
def checkL2v4Compatibility(self):
"""
checkL2v4Compatibility(SBMLDocument self) -> unsigned int
Performs a set of consistency checks on the document to establish
whether it is compatible with SBML Level 2 Version 4 and can be
converted to Level 2 Version 4.
Callers should query the results of the consistency check by calling
SBMLDocument.getError().
Returns the number of failed checks (errors) encountered.
"""
return _libsbml.SBMLDocument_checkL2v4Compatibility(self)
def checkL3v1Compatibility(self):
"""
checkL3v1Compatibility(SBMLDocument self) -> unsigned int
Performs a set of consistency checks on the document to establish
whether it is compatible with SBML Level 3 Version 1 and can be
converted to Level 3 Version 1.
Callers should query the results of the consistency check by calling
SBMLDocument.getError().
Returns the number of failed checks (errors) encountered.
"""
return _libsbml.SBMLDocument_checkL3v1Compatibility(self)
def getError(self, n):
"""
getError(SBMLDocument self, unsigned int n) -> SBMLError
Returns the nth error or warning encountered during parsing,
consistency checking, or attempted translation of this model.
Callers can use method XMLError.getSeverity() on the result to assess
the severity of the problem. The possible severity levels range from
informational messages to fatal errors.
Returns the error or warning indexed by integer 'n', or return None if
n > (getNumErrors() - 1).
Parameter 'n' is the integer index of the error sought.
See also SBMLDocument.getNumErrors().
"""
return _libsbml.SBMLDocument_getError(self, n)
def getErrorWithSeverity(self, n, severity):
"""
getErrorWithSeverity(SBMLDocument self, unsigned int n, unsigned int severity) -> SBMLError
Returns the nth error or warning with the given severity encountered
during parsing, consistency checking, or attempted translation of this
model.
Returns the error or warning indexed by integer 'n', or return None if
n > (getNumErrors(severity) - 1).
Parameter 'n' is the integer index of the error sought. Parameter
'severity' is the severity of the error sought.
See also SBMLDocument.getNumErrors().
"""
return _libsbml.SBMLDocument_getErrorWithSeverity(self, n, severity)
def getNumErrors(self, *args):
"""
getNumErrors(SBMLDocument self) -> unsigned int
getNumErrors(SBMLDocument self, unsigned int severity) -> unsigned int
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
getNumErrors()
Returns the number of errors or warnings encountered during parsing,
consistency checking, or attempted translation of this model.
Returns the number of errors or warnings encountered
See also SBMLDocument.getError(), SBMLDocument.getError().
"""
return _libsbml.SBMLDocument_getNumErrors(self, *args)
def printErrors(self, *args):
"""
printErrors(SBMLDocument self, ostream stream)
printErrors(SBMLDocument self)
printErrors(SBMLDocument self, ostream stream, unsigned int severity)
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
printErrors(std::ostream& stream, long severity)
Prints all the errors or warnings with the given severity encountered
trying to parse, check, or translate this SBML document.
It prints the text to the stream given by the parameter 'stream'.
If no errors have occurred, i.e., getNumErrors(severity) == 0, no
output will be sent to the stream.
The format of the output is:
N error(s):
line NNN: (id) message
Parameter 'stream' is the ostream or ostringstream object indicating
where the output should be printed. Parameter 'severity' is of the
errors sought.
See also getNumErrors(), getErrorLog(),
SBMLDocument.getErrorWithSeverity(), getNumErrors(), getErrorLog(),
SBMLDocument.getError().
"""
return _libsbml.SBMLDocument_printErrors(self, *args)
def connectToChild(self):
"""connectToChild(SBMLDocument self)"""
return _libsbml.SBMLDocument_connectToChild(self)
def convert(self, props):
"""
convert(SBMLDocument self, ConversionProperties props) -> int
Converts this document using the converter that best matches the given
conversion properties.
Parameter 'props' is the conversion properties to use
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
* LIBSBML_CONV_CONVERSION_NOT_AVAILABLE
"""
return _libsbml.SBMLDocument_convert(self, props)
def enablePackageInternal(self, pkgURI, pkgPrefix, flag):
"""
enablePackageInternal(SBMLDocument self, string pkgURI, string pkgPrefix, bool flag)
Internal implementation method.
"""
return _libsbml.SBMLDocument_enablePackageInternal(self, pkgURI, pkgPrefix, flag)
def getTypeCode(self):
"""
getTypeCode(SBMLDocument self) -> int
Returns the libSBML type code for this SBML object.
LibSBML attaches an identifying code to every kind of SBML object.
These are integer constants known as SBML type codes. The names of
all the codes begin with the characters SBML_. In the Python language
interface for libSBML, the type codes are defined as static integer
constants in the interface class 'libsbml'. Note that different Level
3 package plug-ins may use overlapping type codes; to identify the
package to which a given object belongs, call the getPackageName()
method on the object.
Returns the SBML type code for this object: SBML_DOCUMENT (default).
WARNING:
The specific integer values of the possible type codes may be reused
by different Level 3 package plug-ins. Thus, to identifiy the correct
code, it is necessary to invoke both getTypeCode() and
getPackageName().
See also SBMLDocument.getElementName(), getPackageName().
"""
return _libsbml.SBMLDocument_getTypeCode(self)
def getElementName(self):
"""
getElementName(SBMLDocument self) -> string
Returns the XML element name of this object, which for SBMLDocument,
is always 'sbml'.
Returns the name of this element, i.e., 'sbml'.
"""
return _libsbml.SBMLDocument_getElementName(self)
def getErrorLog(self, *args):
"""
getErrorLog(SBMLDocument self) -> SBMLErrorLog
getErrorLog(SBMLDocument self) -> SBMLErrorLog
Returns the list of errors or warnings logged during parsing,
consistency checking, or attempted translation of this model.
Returns the SBMLErrorLog used for this SBMLDocument
See also SBMLDocument.getNumErrors().
"""
return _libsbml.SBMLDocument_getErrorLog(self, *args)
def getNamespaces(self):
"""
getNamespaces(SBMLDocument self) -> XMLNamespaces
Returns a list of XML Namespaces associated with the XML content of
this SBML document.
Returns the XML Namespaces associated with this SBML object
"""
return _libsbml.SBMLDocument_getNamespaces(self)
def enableDefaultNS(self, package, flag):
"""
enableDefaultNS(SBMLDocument self, string package, bool flag) -> int
Set/unset default namespace to each top-level element defined in the
given package extension.
This works by adding a xmlns="..." attribute. No prefix will be
written when writing elements defined in the given package extension
if True is given as second argument.
Parameter 'package' is the name or URI of the package extension.
Parameter 'flag' is boolean value to indicate whether to write a
namespace prefix.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_PKG_UNKNOWN_VERSION
"""
return _libsbml.SBMLDocument_enableDefaultNS(self, package, flag)
def isEnabledDefaultNS(self, package):
"""
isEnabledDefaultNS(SBMLDocument self, string package) -> bool
Returns True if a default namespace is added to each top-level element
defined in the given package extension, otherwise returns False.
This basically checks if the attribute xmlns="..." is present.
Parameter 'package' is the name or URI of the package extension.
Returns a boolean
"""
return _libsbml.SBMLDocument_isEnabledDefaultNS(self, package)
def setPackageRequired(self, package, flag):
"""
setPackageRequired(SBMLDocument self, string package, bool flag) -> int
Sets the required attribute value of the given package extension.
Note:
The name of package must not be given if the package is not enabled.
Parameter 'package' is the name or URI of the package extension.
Parameter 'flag' is Boolean value indicating whether the package is
required.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_PKG_UNKNOWN_VERSION
"""
return _libsbml.SBMLDocument_setPackageRequired(self, package, flag)
def getPackageRequired(self, package):
"""
getPackageRequired(SBMLDocument self, string package) -> bool
Returns the required attribute of the given package extension.
Note:
The name of package must not be given if the package is not enabled.
Parameter 'package' is the name or URI of the package extension.
Returns Boolean flag indicating whether the package is flagged as
being required.
"""
return _libsbml.SBMLDocument_getPackageRequired(self, package)
def isSetPackageRequired(self, package):
"""
isSetPackageRequired(SBMLDocument self, string package) -> bool
Returns True if the required attribute of the given package extension
is defined, otherwise returns False.
Note:
The name of package must not be given if the package is not enabled.
Parameter 'package' is the name or URI of the package extension.
Returns a Boolean
"""
return _libsbml.SBMLDocument_isSetPackageRequired(self, package)
def isIgnoredPackage(self, pkgURI):
"""
isIgnoredPackage(SBMLDocument self, string pkgURI) -> bool
Returns True if the given package extension is one of an ignored
packages, otherwise returns False.
An ignored package is one that is defined to be used in this SBML
document, but the package is not enabled in this copy of libSBML.
Parameter 'pkgURI' is the URI of the package extension.
Returns a Boolean, True if the package is being ignored and False
otherwise.
"""
return _libsbml.SBMLDocument_isIgnoredPackage(self, pkgURI)
def isDisabledIgnoredPackage(self, pkgURI):
"""
isDisabledIgnoredPackage(SBMLDocument self, string pkgURI) -> bool
Returns True if the given package extension is one of an ignored
packages that has been disabled, otherwise returns False.
An ignored package is one that is defined to be used in this SBML
document, but the package is not enabled in this copy of libSBML. It
may have been disabled to avoid reproducing the package information
when writing out the file.
Parameter 'pkgURI' is the URI of the package extension.
Returns a Boolean, True if the package is being ignored and False
otherwise.
"""
return _libsbml.SBMLDocument_isDisabledIgnoredPackage(self, pkgURI)
def setPkgRequired(self, package, flag):
"""
setPkgRequired(SBMLDocument self, string package, bool flag) -> int
Sets the value of the required attribute for the given package.
Note:
The name of package must not be given if the package is not enabled.
Parameter 'package' is the name or URI of the package extension.
Parameter 'flag' is a Boolean value.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_PKG_UNKNOWN_VERSION
DEPRECATED. Replaced in libSBML 5.2.0 by setPackageRequired()
"""
return _libsbml.SBMLDocument_setPkgRequired(self, package, flag)
def getPkgRequired(self, package):
"""
getPkgRequired(SBMLDocument self, string package) -> bool
Returns the required attribute of the given package extension.
Note:
The name of package must not be given if the package is not enabled.
Parameter 'package' is the name or URI of the package extension.
Returns a Boolean value indicating whether the package is flagged as
being required in this SBML document.
DEPRECATED. Replaced in libSBML 5.2.0 by getPackageRequired()
"""
return _libsbml.SBMLDocument_getPkgRequired(self, package)
def isSetPkgRequired(self, package):
"""
isSetPkgRequired(SBMLDocument self, string package) -> bool
Returns True if the required attribute of the given package extension
is defined, otherwise returns False.
Note:
The name of package must not be given if the package is not enabled.
Parameter 'package' is the name or URI of the package extension.
Returns a Boolean value.
DEPRECATED. Replaced in libSBML 5.2.0 by isSetPackageRequired()
"""
return _libsbml.SBMLDocument_isSetPkgRequired(self, package)
def isIgnoredPkg(self, pkgURI):
"""
isIgnoredPkg(SBMLDocument self, string pkgURI) -> bool
Returns True if the given package extension is one of ignored
packages, otherwise returns False.
An ignored package is one that is defined to be used in this SBML
document, but the package is not enabled in this copy of libSBML.
Parameter 'pkgURI' is the URI of the package extension.
Returns a boolean
DEPRECATED. Replaced in libSBML 5.2.0 by isIgnoredPackage()
"""
return _libsbml.SBMLDocument_isIgnoredPkg(self, pkgURI)
def getApplicableValidators(self):
"""
getApplicableValidators(SBMLDocument self) -> unsigned char
Internal implementation method.
"""
return _libsbml.SBMLDocument_getApplicableValidators(self)
def getConversionValidators(self):
"""
getConversionValidators(SBMLDocument self) -> unsigned char
Internal implementation method.
"""
return _libsbml.SBMLDocument_getConversionValidators(self)
def setApplicableValidators(self, appl):
"""
setApplicableValidators(SBMLDocument self, unsigned char appl)
Internal implementation method.
"""
return _libsbml.SBMLDocument_setApplicableValidators(self, appl)
def setConversionValidators(self, appl):
"""
setConversionValidators(SBMLDocument self, unsigned char appl)
Internal implementation method.
"""
return _libsbml.SBMLDocument_setConversionValidators(self, appl)
def getNumValidators(self):
"""
getNumValidators(SBMLDocument self) -> unsigned int
Internal implementation method.
"""
return _libsbml.SBMLDocument_getNumValidators(self)
def clearValidators(self):
"""
clearValidators(SBMLDocument self) -> int
Internal implementation method.
"""
return _libsbml.SBMLDocument_clearValidators(self)
def addValidator(self, validator):
"""
addValidator(SBMLDocument self, SBMLValidator validator) -> int
Internal implementation method.
"""
return _libsbml.SBMLDocument_addValidator(self, validator)
def getValidator(self, index):
"""
getValidator(SBMLDocument self, unsigned int index) -> SBMLValidator
Internal implementation method.
"""
return _libsbml.SBMLDocument_getValidator(self, index)
def addUnknownPackageRequired(self, pkgURI, prefix, flag):
"""
addUnknownPackageRequired(SBMLDocument self, string pkgURI, string prefix, bool flag) -> int
Internal implementation method.
"""
return _libsbml.SBMLDocument_addUnknownPackageRequired(self, pkgURI, prefix, flag)
def hasUnknownPackage(self, pkgURI):
"""
hasUnknownPackage(SBMLDocument self, string pkgURI) -> bool
Internal implementation method.
"""
return _libsbml.SBMLDocument_hasUnknownPackage(self, pkgURI)
SBMLDocument_swigregister = _libsbml.SBMLDocument_swigregister
SBMLDocument_swigregister(SBMLDocument)
def SBMLDocument_getDefaultLevel():
"""
SBMLDocument_getDefaultLevel() -> unsigned int
The default SBML Level of new SBMLDocument objects.
This 'default Level' corresponds to the most recent SBML
specification Level available at the time libSBML version was
released. The default Level is used by SBMLDocument if no Level is
explicitly specified at the time of the construction of an
SBMLDocument instance.
Returns an integer indicating the most recent SBML specification Level
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
See also SBMLDocument.getDefaultVersion() .
"""
return _libsbml.SBMLDocument_getDefaultLevel()
def SBMLDocument_getDefaultVersion():
"""
SBMLDocument_getDefaultVersion() -> unsigned int
The default Version of new SBMLDocument objects.
This 'default Version' corresponds to the most recent Version within
the most recent Level of SBML available at the time libSBML version
was released. The default Version is used by SBMLDocument if no
Version is explicitly specified at the time of the construction of an
SBMLDocument instance.
Returns an integer indicating the most recent SBML specification
Version
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
See also SBMLDocument.getDefaultLevel() .
"""
return _libsbml.SBMLDocument_getDefaultVersion()
class FunctionDefinition(SBase):
"""
A user-defined function in an SBML model.
The FunctionDefinition structure associates an identifier with a
function definition. This identifier can then be used as the function
called in subsequent MathML content elsewhere in an SBML model.
FunctionDefinition has one required attribute, 'id', to give the
function a unique identifier by which other parts of an SBML model
definition can refer to it. A FunctionDefinition instance can also
have an optional 'name' attribute of type string. Identifiers and
names must be used according to the guidelines described in the SBML
specification (e.g., Section 3.3 in the Level 2 Version 4
specification).
FunctionDefinition has a required 'math' subelement containing a
MathML expression defining the function body. The content of this
element can only be a MathML 'lambda' element. The 'lambda' element
must begin with zero or more 'bvar' elements, followed by any other of
the elements in the MathML subset allowed in SBML Level 2 except
'lambda' (i.e., a 'lambda' element cannot contain another 'lambda'
element). This is the only place in SBML where a 'lambda' element can
be used. The function defined by a FunctionDefinition is only
available for use in other MathML elements that follow the
FunctionDefinition definition in the model. (These restrictions
prevent recursive and mutually-recursive functions from being
expressed.)
A further restriction on the content of 'math' is that it cannot
contain references to variables other than the variables declared to
the 'lambda' itself. That is, the contents of MathML 'ci' elements
inside the body of the 'lambda' can only be the variables declared by
its 'bvar' elements, or the identifiers of other FunctionDefinition
instances in the model. This means must be written so that all
variables or parameters used in the MathML content are passed to them
via their function parameters. In SBML Level 2, this restriction
applies also to the MathML csymbol elements for time and delay; in
SBML Level 3, it additionally applies to the csymbol element for
avogadro.
Note:
Function definitions (also informally known as user-defined functions)
were introduced in SBML Level 2. They have purposefully limited
capabilities. A function cannot reference parameters or other model
quantities outside of itself; values must be passed as parameters to
the function. Moreover, recursive and mutually-recursive functions
are not permitted. The purpose of these limitations is to balance
power against complexity of implementation. With the restrictions as
they are, function definitions could be implemented as textual
substitutions---they are simply macros. Software implementations
therefore do not need the full function-definition machinery typically
associated with programming languages.
Another important point to note is FunctionDefinition does not have a
separate attribute for defining the units of the value returned by the
function. The units associated with the function's return value, when
the function is called from within MathML expressions elsewhere in
SBML, are simply the overall units of the expression in
FunctionDefinition's 'math' subelement when applied to the arguments
supplied in the call to the function. Ascertaining these units
requires performing dimensional analysis on the expression. (Readers
may wonder why there is no attribute. The reason is that having a
separate attribute for declaring the units would not only be
redundant, but also lead to the potential for having conflicting
information. In the case of a conflict between the declared units and
those of the value actually returned by the function, the only logical
resolution rule would be to assume that the correct units are those of
the expression anyway.)
"""
__swig_setmethods__ = {}
for _s in [SBase]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, FunctionDefinition, name, value)
__swig_getmethods__ = {}
for _s in [SBase]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, FunctionDefinition, name)
__repr__ = _swig_repr
__swig_destroy__ = _libsbml.delete_FunctionDefinition
__del__ = lambda self: None
def __init__(self, *args):
"""
__init__(FunctionDefinition self, unsigned int level, unsigned int version) -> FunctionDefinition
__init__(FunctionDefinition self, SBMLNamespaces sbmlns) -> FunctionDefinition
__init__(FunctionDefinition self, FunctionDefinition orig) -> FunctionDefinition
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
FunctionDefinition(SBMLNamespaces sbmlns)
Creates a new FunctionDefinition using the given SBMLNamespaces object
'sbmlns'.
The SBMLNamespaces object encapsulates SBML Level/Version/namespaces
information. It is used to communicate the SBML Level, Version, and
(in Level 3) packages used in addition to SBML Level 3 Core. A common
approach to using libSBML's SBMLNamespaces facilities is to create an
SBMLNamespaces object somewhere in a program once, then hand that
object as needed to object constructors that accept SBMLNamespaces as
arguments.
Parameter 'sbmlns' is an SBMLNamespaces object.
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
______________________________________________________________________
Method variant with the following signature:
FunctionDefinition(long level, long version)
Creates a new FunctionDefinition using the given SBML 'level' and
'version' values.
Parameter 'level' is a long integer, the SBML Level to assign to this
FunctionDefinition
Parameter 'version' is a long integer, the SBML Version to assign to
this FunctionDefinition
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
______________________________________________________________________
Method variant with the following signature:
FunctionDefinition(FunctionDefinition orig)
Copy constructor; creates a copy of this FunctionDefinition.
Parameter 'orig' is the object to copy.
Throws SBMLConstructorException: Thrown if the argument 'orig' is
None.
"""
this = _libsbml.new_FunctionDefinition(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(FunctionDefinition self) -> FunctionDefinition
Creates and returns a deep copy of this FunctionDefinition object.
Returns the (deep) copy of this FunctionDefinition object.
"""
return _libsbml.FunctionDefinition_clone(self)
def getId(self):
"""
getId(FunctionDefinition self) -> string
Returns the value of the 'id' attribute of this FunctionDefinition.
Returns the id of this FunctionDefinition.
"""
return _libsbml.FunctionDefinition_getId(self)
def getName(self):
"""
getName(FunctionDefinition self) -> string
Returns the value of the 'name' attribute of this FunctionDefinition.
Returns the name of this FunctionDefinition.
"""
return _libsbml.FunctionDefinition_getName(self)
def getMath(self):
"""
getMath(FunctionDefinition self) -> ASTNode
Get the mathematical formula of this FunctionDefinition.
Returns an ASTNode, the value of the 'math' subelement of this
FunctionDefinition
"""
return _libsbml.FunctionDefinition_getMath(self)
def isSetId(self):
"""
isSetId(FunctionDefinition self) -> bool
Predicate returning True if this FunctionDefinition's 'id' attribute
is set.
Returns True if the 'id' attribute of this FunctionDefinition is set,
False otherwise.
"""
return _libsbml.FunctionDefinition_isSetId(self)
def isSetName(self):
"""
isSetName(FunctionDefinition self) -> bool
Predicate returning True if this FunctionDefinition's 'name' attribute
is set.
Returns True if the 'name' attribute of this FunctionDefinition is
set, False otherwise.
"""
return _libsbml.FunctionDefinition_isSetName(self)
def isSetMath(self):
"""
isSetMath(FunctionDefinition self) -> bool
Predicate returning True if this FunctionDefinition's 'math'
subelement contains a value.
Returns True if the 'math' for this FunctionDefinition is set, False
otherwise.
"""
return _libsbml.FunctionDefinition_isSetMath(self)
def setId(self, sid):
"""
setId(FunctionDefinition self, string sid) -> int
Sets the value of the 'id' attribute of this FunctionDefinition.
The string 'sid' is copied.
SBML has strict requirements for the syntax of identifiers, that is,
the values of the 'id' attribute present on most types of SBML
objects. The following is a summary of the definition of the SBML
identifier type SId, which defines the permitted syntax of
identifiers. We express the syntax using an extended form of BNF
notation:
letter ::= 'a'..'z','A'..'Z'
digit ::= '0'..'9'
idChar ::= letter | digit | '_'
SId ::= ( letter | '_' ) idChar*
The characters ( and ) are used for grouping, the character * 'zero or
more times', and the character | indicates logical 'or'. The equality
of SBML identifiers is determined by an exact character sequence
match; i.e., comparisons must be performed in a case-sensitive manner.
In addition, there are a few conditions for the uniqueness of
identifiers in an SBML model. Please consult the SBML specifications
for the exact details of the uniqueness requirements.
Parameter 'sid' is the string to use as the identifier of this
FunctionDefinition
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
"""
return _libsbml.FunctionDefinition_setId(self, sid)
def setName(self, name):
"""
setName(FunctionDefinition self, string name) -> int
Sets the value of the 'name' attribute of this FunctionDefinition.
The string in 'name' is copied.
Parameter 'name' is the new name for the FunctionDefinition
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
"""
return _libsbml.FunctionDefinition_setName(self, name)
def setMath(self, math):
"""
setMath(FunctionDefinition self, ASTNode math) -> int
Sets the 'math' subelement of this FunctionDefinition to the Abstract
Syntax Tree given in 'math'.
Parameter 'math' is an AST containing the mathematical expression to
be used as the formula for this FunctionDefinition.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_OBJECT
"""
return _libsbml.FunctionDefinition_setMath(self, math)
def unsetName(self):
"""
unsetName(FunctionDefinition self) -> int
Unsets the value of the 'name' attribute of this FunctionDefinition.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
"""
return _libsbml.FunctionDefinition_unsetName(self)
def getArgument(self, *args):
"""
getArgument(FunctionDefinition self, unsigned int n) -> ASTNode
getArgument(FunctionDefinition self, string name) -> ASTNode
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
getArgument(string name)
Get the argument named 'name' to this FunctionDefinition.
Parameter 'name' is the exact name (case-sensitive) of the sought-
after argument
Returns the argument (bound variable) having the given name, or None
if no such argument exists.
______________________________________________________________________
Method variant with the following signature:
getArgument(long n)
Get the nth argument to this function.
Callers should first find out the number of arguments to the function
by calling getNumArguments().
Parameter 'n' is an integer index for the argument sought.
Returns the nth argument (bound variable) passed to this
FunctionDefinition.
See also getNumArguments().
"""
return _libsbml.FunctionDefinition_getArgument(self, *args)
def getBody(self, *args):
"""
getBody(FunctionDefinition self) -> ASTNode
getBody(FunctionDefinition self) -> ASTNode
Get the mathematical expression that is the body of this
FunctionDefinition object.
Returns the body of this FunctionDefinition as an Abstract Syntax
Tree, or None if no body is defined.
"""
return _libsbml.FunctionDefinition_getBody(self, *args)
def isSetBody(self):
"""
isSetBody(FunctionDefinition self) -> bool
Predicate returning True if the body of this FunctionDefinition has
set.
Returns True if the body of this FunctionDefinition is set, False
otherwise.
"""
return _libsbml.FunctionDefinition_isSetBody(self)
def getNumArguments(self):
"""
getNumArguments(FunctionDefinition self) -> unsigned int
Get the number of arguments (bound variables) taken by this
FunctionDefinition.
Returns the number of arguments (bound variables) that must be passed
to this FunctionDefinition.
"""
return _libsbml.FunctionDefinition_getNumArguments(self)
def getTypeCode(self):
"""
getTypeCode(FunctionDefinition self) -> int
Returns the libSBML type code for this SBML object.
LibSBML attaches an identifying code to every kind of SBML object.
These are integer constants known as SBML type codes. The names of
all the codes begin with the characters SBML_. In the Python language
interface for libSBML, the type codes are defined as static integer
constants in the interface class 'libsbml'. Note that different Level
3 package plug-ins may use overlapping type codes; to identify the
package to which a given object belongs, call the getPackageName()
method on the object.
Returns the SBML type code for this object: SBML_FUNCTION_DEFINITION
(default).
WARNING:
The specific integer values of the possible type codes may be reused
by different Level 3 package plug-ins. Thus, to identifiy the correct
code, it is necessary to invoke both getTypeCode() and
getPackageName().
See also getElementName(), getPackageName().
"""
return _libsbml.FunctionDefinition_getTypeCode(self)
def getElementName(self):
"""
getElementName(FunctionDefinition self) -> string
Returns the XML element name of this object, which for
FunctionDefinition, is always 'functionDefinition'.
Returns the name of this element, i.e., 'functionDefinition'.
"""
return _libsbml.FunctionDefinition_getElementName(self)
def hasRequiredAttributes(self):
"""
hasRequiredAttributes(FunctionDefinition self) -> bool
Predicate returning True if all the required attributes for this
FunctionDefinition object have been set.
The required attributes for a FunctionDefinition object are:
* 'id'
Returns True if the required attributes have been set, False
otherwise.
"""
return _libsbml.FunctionDefinition_hasRequiredAttributes(self)
def hasRequiredElements(self):
"""
hasRequiredElements(FunctionDefinition self) -> bool
Predicate returning True if all the required elements for this
FunctionDefinition object have been set.
Note:
The required elements for a FunctionDefinition object are:
* 'math'
Returns a boolean value indicating whether all the required elements
for this object have been defined.
"""
return _libsbml.FunctionDefinition_hasRequiredElements(self)
def renameUnitSIdRefs(self, oldid, newid):
"""
renameUnitSIdRefs(FunctionDefinition self, string oldid, string newid)
Renames all the UnitSIdRef attributes on this element.
In SBML, unit definitions have identifiers of type UnitSId. In SBML
Level 3, an explicit data type called UnitSIdRef was introduced for
attribute values that refer to UnitSId values; in previous Levels of
SBML, this data type did not exist and attributes were simply
described to as 'referring to a unit identifier', but the effective
data type was the same as UnitSIdRef in Level 3. These and other
methods of libSBML refer to the type UnitSIdRef for all Levels of
SBML, even if the corresponding SBML specification did not explicitly
name the data type.
This method works by looking at all unit identifier attribute values
(including, if appropriate, inside mathematical formulas), comparing
the unit identifiers to the value of 'oldid'. If any matches are
found, the matching identifiers are replaced with 'newid'. The method
does not descend into child elements.
Parameter 'oldid' is the old identifier Parameter 'newid' is the new
identifier
"""
return _libsbml.FunctionDefinition_renameUnitSIdRefs(self, oldid, newid)
FunctionDefinition_swigregister = _libsbml.FunctionDefinition_swigregister
FunctionDefinition_swigregister(FunctionDefinition)
class ListOfFunctionDefinitions(ListOf):
"""
A list of FunctionDefinition objects.
The various ListOf___ classes in SBML are merely containers used for
organizing the main components of an SBML model. In libSBML's
implementation, ListOf___ classes are derived from the intermediate
utility class ListOf, which is not defined by the SBML specifications
but serves as a useful programmatic construct. ListOf is itself is in
turn derived from SBase, which provides all of the various ListOf___
classes with common features defined by the SBML specification, such
as 'metaid' attributes and annotations.
The relationship between the lists and the rest of an SBML model is
illustrated by the following (for SBML Level 2 Version 4):
...
...
...
...
...
...
... elements of subclasses of Rule ...
...
...
...
Readers may wonder about the motivations for using the ListOf___
containers in SBML. A simpler approach in XML might be to place the
components all directly at the top level of the model definition. The
choice made in SBML is to group them within XML elements named after
ListOfClassname, in part because it helps organize the components.
More importantly, the fact that the container classes are derived from
SBase means that software tools can add information about the lists
themselves into each list container's 'annotation'.
See also ListOfFunctionDefinitions, ListOfUnitDefinitions,
ListOfCompartmentTypes, ListOfSpeciesTypes, ListOfCompartments,
ListOfSpecies, ListOfParameters, ListOfInitialAssignments,
ListOfRules, ListOfConstraints, ListOfReactions, ListOfEvents.
"""
__swig_setmethods__ = {}
for _s in [ListOf]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, ListOfFunctionDefinitions, name, value)
__swig_getmethods__ = {}
for _s in [ListOf]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, ListOfFunctionDefinitions, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(ListOfFunctionDefinitions self, unsigned int level, unsigned int version) -> ListOfFunctionDefinitions
__init__(ListOfFunctionDefinitions self, SBMLNamespaces sbmlns) -> ListOfFunctionDefinitions
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
ListOfFunctionDefinitions(SBMLNamespaces sbmlns)
Creates a new ListOfFunctionDefinitions object.
The object is constructed such that it is valid for the SBML Level and
Version combination determined by the SBMLNamespaces object in
'sbmlns'.
Parameter 'sbmlns' is an SBMLNamespaces object that is used to
determine the characteristics of the ListOfFunctionDefinitions object
to be created.
______________________________________________________________________
Method variant with the following signature:
ListOfFunctionDefinitions(long level, long version)
Creates a new ListOfFunctionDefinitions object.
The object is constructed such that it is valid for the given SBML
Level and Version combination.
Parameter 'level' is the SBML Level
Parameter 'version' is the Version within the SBML Level
"""
this = _libsbml.new_ListOfFunctionDefinitions(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(ListOfFunctionDefinitions self) -> ListOfFunctionDefinitions
Creates and returns a deep copy of this ListOfFunctionDefinitions
object.
Returns the (deep) copy of this ListOfFunctionDefinitions object.
"""
return _libsbml.ListOfFunctionDefinitions_clone(self)
def getItemTypeCode(self):
"""
getItemTypeCode(ListOfFunctionDefinitions self) -> int
Returns the libSBML type code for the objects contained in this ListOf
(i.e., FunctionDefinition objects, if the list is non-empty).
LibSBML attaches an identifying code to every kind of SBML object.
These are integer constants known as SBML type codes. The names of
all the codes begin with the characters SBML_. In the Python language
interface for libSBML, the type codes are defined as static integer
constants in the interface class 'libsbml'. Note that different Level
3 package plug-ins may use overlapping type codes; to identify the
package to which a given object belongs, call the getPackageName()
method on the object.
Returns the SBML type code for the objects contained in this ListOf:
SBML_FUNCTION_DEFINITION (default).
See also getElementName(), getPackageName().
"""
return _libsbml.ListOfFunctionDefinitions_getItemTypeCode(self)
def getElementName(self):
"""
getElementName(ListOfFunctionDefinitions self) -> string
Returns the XML element name of this object.
For ListOfFunctionDefinitions, the XML element name is
'listOfFunctionDefinitions'.
Returns the name of this element, i.e., 'listOfFunctionDefinitions'.
"""
return _libsbml.ListOfFunctionDefinitions_getElementName(self)
def get(self, *args):
"""
get(ListOfFunctionDefinitions self, unsigned int n) -> FunctionDefinition
get(ListOfFunctionDefinitions self, unsigned int n) -> FunctionDefinition
get(ListOfFunctionDefinitions self, string sid) -> FunctionDefinition
get(ListOfFunctionDefinitions self, string sid) -> FunctionDefinition
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
get(string sid)
Get a FunctionDefinition from the ListOfFunctionDefinitions based on
its identifier.
Parameter 'sid' is a string representing the identifier of the
FunctionDefinition to get.
Returns FunctionDefinition in this ListOfFunctionDefinitions with the
given 'sid' or None if no such FunctionDefinition exists.
See also get(), size(), size().
"""
return _libsbml.ListOfFunctionDefinitions_get(self, *args)
def remove(self, *args):
"""
remove(ListOfFunctionDefinitions self, unsigned int n) -> FunctionDefinition
remove(ListOfFunctionDefinitions self, string sid) -> FunctionDefinition
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
remove(string sid)
Removes item in this ListOfFunctionDefinitions items with the given
identifier.
The caller owns the returned item and is responsible for deleting it.
If none of the items in this list have the identifier 'sid', then None
is returned.
Parameter 'sid' is the identifier of the item to remove
Returns the item removed. As mentioned above, the caller owns the
returned item.
______________________________________________________________________
Method variant with the following signature:
remove(long n)
Removes the nth item from this ListOfFunctionDefinitions items and
returns a pointer to it.
The caller owns the returned item and is responsible for deleting it.
Parameter 'n' is the index of the item to remove
See also size().
"""
return _libsbml.ListOfFunctionDefinitions_remove(self, *args)
__swig_destroy__ = _libsbml.delete_ListOfFunctionDefinitions
__del__ = lambda self: None
ListOfFunctionDefinitions_swigregister = _libsbml.ListOfFunctionDefinitions_swigregister
ListOfFunctionDefinitions_swigregister(ListOfFunctionDefinitions)
_libsbml.UNIT_KIND_AMPERE_swigconstant(_libsbml)
UNIT_KIND_AMPERE = _libsbml.UNIT_KIND_AMPERE
_libsbml.UNIT_KIND_AVOGADRO_swigconstant(_libsbml)
UNIT_KIND_AVOGADRO = _libsbml.UNIT_KIND_AVOGADRO
_libsbml.UNIT_KIND_BECQUEREL_swigconstant(_libsbml)
UNIT_KIND_BECQUEREL = _libsbml.UNIT_KIND_BECQUEREL
_libsbml.UNIT_KIND_CANDELA_swigconstant(_libsbml)
UNIT_KIND_CANDELA = _libsbml.UNIT_KIND_CANDELA
_libsbml.UNIT_KIND_CELSIUS_swigconstant(_libsbml)
UNIT_KIND_CELSIUS = _libsbml.UNIT_KIND_CELSIUS
_libsbml.UNIT_KIND_COULOMB_swigconstant(_libsbml)
UNIT_KIND_COULOMB = _libsbml.UNIT_KIND_COULOMB
_libsbml.UNIT_KIND_DIMENSIONLESS_swigconstant(_libsbml)
UNIT_KIND_DIMENSIONLESS = _libsbml.UNIT_KIND_DIMENSIONLESS
_libsbml.UNIT_KIND_FARAD_swigconstant(_libsbml)
UNIT_KIND_FARAD = _libsbml.UNIT_KIND_FARAD
_libsbml.UNIT_KIND_GRAM_swigconstant(_libsbml)
UNIT_KIND_GRAM = _libsbml.UNIT_KIND_GRAM
_libsbml.UNIT_KIND_GRAY_swigconstant(_libsbml)
UNIT_KIND_GRAY = _libsbml.UNIT_KIND_GRAY
_libsbml.UNIT_KIND_HENRY_swigconstant(_libsbml)
UNIT_KIND_HENRY = _libsbml.UNIT_KIND_HENRY
_libsbml.UNIT_KIND_HERTZ_swigconstant(_libsbml)
UNIT_KIND_HERTZ = _libsbml.UNIT_KIND_HERTZ
_libsbml.UNIT_KIND_ITEM_swigconstant(_libsbml)
UNIT_KIND_ITEM = _libsbml.UNIT_KIND_ITEM
_libsbml.UNIT_KIND_JOULE_swigconstant(_libsbml)
UNIT_KIND_JOULE = _libsbml.UNIT_KIND_JOULE
_libsbml.UNIT_KIND_KATAL_swigconstant(_libsbml)
UNIT_KIND_KATAL = _libsbml.UNIT_KIND_KATAL
_libsbml.UNIT_KIND_KELVIN_swigconstant(_libsbml)
UNIT_KIND_KELVIN = _libsbml.UNIT_KIND_KELVIN
_libsbml.UNIT_KIND_KILOGRAM_swigconstant(_libsbml)
UNIT_KIND_KILOGRAM = _libsbml.UNIT_KIND_KILOGRAM
_libsbml.UNIT_KIND_LITER_swigconstant(_libsbml)
UNIT_KIND_LITER = _libsbml.UNIT_KIND_LITER
_libsbml.UNIT_KIND_LITRE_swigconstant(_libsbml)
UNIT_KIND_LITRE = _libsbml.UNIT_KIND_LITRE
_libsbml.UNIT_KIND_LUMEN_swigconstant(_libsbml)
UNIT_KIND_LUMEN = _libsbml.UNIT_KIND_LUMEN
_libsbml.UNIT_KIND_LUX_swigconstant(_libsbml)
UNIT_KIND_LUX = _libsbml.UNIT_KIND_LUX
_libsbml.UNIT_KIND_METER_swigconstant(_libsbml)
UNIT_KIND_METER = _libsbml.UNIT_KIND_METER
_libsbml.UNIT_KIND_METRE_swigconstant(_libsbml)
UNIT_KIND_METRE = _libsbml.UNIT_KIND_METRE
_libsbml.UNIT_KIND_MOLE_swigconstant(_libsbml)
UNIT_KIND_MOLE = _libsbml.UNIT_KIND_MOLE
_libsbml.UNIT_KIND_NEWTON_swigconstant(_libsbml)
UNIT_KIND_NEWTON = _libsbml.UNIT_KIND_NEWTON
_libsbml.UNIT_KIND_OHM_swigconstant(_libsbml)
UNIT_KIND_OHM = _libsbml.UNIT_KIND_OHM
_libsbml.UNIT_KIND_PASCAL_swigconstant(_libsbml)
UNIT_KIND_PASCAL = _libsbml.UNIT_KIND_PASCAL
_libsbml.UNIT_KIND_RADIAN_swigconstant(_libsbml)
UNIT_KIND_RADIAN = _libsbml.UNIT_KIND_RADIAN
_libsbml.UNIT_KIND_SECOND_swigconstant(_libsbml)
UNIT_KIND_SECOND = _libsbml.UNIT_KIND_SECOND
_libsbml.UNIT_KIND_SIEMENS_swigconstant(_libsbml)
UNIT_KIND_SIEMENS = _libsbml.UNIT_KIND_SIEMENS
_libsbml.UNIT_KIND_SIEVERT_swigconstant(_libsbml)
UNIT_KIND_SIEVERT = _libsbml.UNIT_KIND_SIEVERT
_libsbml.UNIT_KIND_STERADIAN_swigconstant(_libsbml)
UNIT_KIND_STERADIAN = _libsbml.UNIT_KIND_STERADIAN
_libsbml.UNIT_KIND_TESLA_swigconstant(_libsbml)
UNIT_KIND_TESLA = _libsbml.UNIT_KIND_TESLA
_libsbml.UNIT_KIND_VOLT_swigconstant(_libsbml)
UNIT_KIND_VOLT = _libsbml.UNIT_KIND_VOLT
_libsbml.UNIT_KIND_WATT_swigconstant(_libsbml)
UNIT_KIND_WATT = _libsbml.UNIT_KIND_WATT
_libsbml.UNIT_KIND_WEBER_swigconstant(_libsbml)
UNIT_KIND_WEBER = _libsbml.UNIT_KIND_WEBER
_libsbml.UNIT_KIND_INVALID_swigconstant(_libsbml)
UNIT_KIND_INVALID = _libsbml.UNIT_KIND_INVALID
def UnitKind_equals(uk1, uk2):
"""
UnitKind_equals(UnitKind_t uk1, UnitKind_t uk2) -> int
Tests for logical equality between two given UNIT_KIND_ code values.
This function behaves exactly like C's == operator, except for the
following two cases:
* UNIT_KIND_LITER == UNIT_KIND_LITRE
* UNIT_KIND_METER == UNIT_KIND_METRE In the two cases above, C
equality comparison would yield False (because each of the above is a
distinct enumeration value), but this function returns True.
Parameter 'uk1' is a UNIT_KIND_ value Parameter 'uk2' is a second
UNIT_KIND_ value to compare to 'uk1'
Returns nonzero (for True) if 'uk1' is logically equivalent to 'uk2',
zero (for False) otherwise.
Note:
For more information about the libSBML unit codes, please refer to the
class documentation for Unit.
"""
return _libsbml.UnitKind_equals(uk1, uk2)
def UnitKind_forName(name):
"""
UnitKind_forName(char const * name) -> UnitKind_t
Converts a text string naming a kind of unit to its corresponding
libSBML UNIT_KIND_ constant/enumeration value.
Parameter 'name' is a string, the name of a predefined base unit in
SBML
Returns a value the set of UNIT_KIND_ codes defined in class libsbml,
corresponding to the string 'name' (determined in a case-insensitive
manner).
Note:
For more information about the libSBML unit codes, please refer to the
class documentation for Unit.
"""
return _libsbml.UnitKind_forName(name)
def UnitKind_toString(uk):
"""
UnitKind_toString(UnitKind_t uk) -> char const *
Converts a unit code to a text string equivalent.
Parameter 'uk' is a value from the set of UNIT_KIND_ codes defined in
the class libsbml
Returns the name corresponding to the given unit code.
Note:
For more information about the libSBML unit codes, please refer to the
class documentation for Unit.
WARNING:
The string returned is a static data value. The caller does not own
the returned string and is therefore not allowed to modify it.
"""
return _libsbml.UnitKind_toString(uk)
def UnitKind_isValidUnitKindString(str, level, version):
"""
UnitKind_isValidUnitKindString(char const * str, unsigned int level, unsigned int version) -> int
Predicate for testing whether a given string corresponds to a
predefined libSBML unit code.
Parameter 'str' is a text string naming a base unit defined by SBML
Parameter 'level' is the Level of SBML Parameter 'version' is the
Version within the Level of SBML
Returns nonzero (for True) if string is the name of a valid UNIT_KIND_
value, zero (for False) otherwise.
Note:
For more information about the libSBML unit codes, please refer to the
class documentation for Unit.
"""
return _libsbml.UnitKind_isValidUnitKindString(str, level, version)
class Unit(SBase):
"""
A single unit referenced in an SBML unit definition.
The SBML unit definition facility uses two classes of objects,
UnitDefinition and Unit. The approach to defining units in SBML is
compositional; for example, meter second^-2 is constructed by
combining a Unit object representing meter with another Unit object
representing second^-2. The combination is wrapped inside a
UnitDefinition, which provides for assigning an identifier and
optional name to the combination. The identifier can then be
referenced from elsewhere in a model. Thus, the UnitDefinition class
is the container, and Unit instances are placed inside UnitDefinition
instances.
A Unit has four attributes named 'kind', 'exponent', 'scale' and
'multiplier'. It represents a (possibly transformed) reference to a
base unit. The attribute 'kind' on Unit indicates the chosen base
unit. Its value must be one of the text strings listed below; this
list corresponds to SBML Level 3 Version 1 Core:
ampere farad joule lux radian volt
avogadro gram katal metre second watt
becquerel gray kelvin mole siemens weber
candela henry kilogram newton sievert
coulomb hertz litre ohm steradian
dimensionless item lumen pascal tesla
A few small differences exist between the Level 3 list of base units
and the list defined in other Level/Version combinations of SBML.
Specifically, Levels of SBML before Level 3 do not define avogadro;
conversely, Level 2 Version 1 defines Celsius, and Level 1 defines
celsius, meter, and liter, none of which are available in Level 3. In
libSBML, each of the predefined base unit names is represented by an
enumeration value whose name begins with the characters UNIT_KIND_,
discussed in a separate section below.
The attribute named 'exponent' on Unit represents an exponent on the
unit. In SBML Level 2, the attribute is optional and has a default
value of 1 (one); in SBML Level 3, the attribute is mandatory and
there is no default value. A Unit also has an attribute called
'scale'; its value must be an integer exponent for a power-of-ten
multiplier used to set the scale of the unit. For example, a unit
having a 'kind' value of gram and a 'scale' value of -3 signifies
10^-3 * gram, or milligrams. In SBML Level 2, the attribute is
optional and has a default value of 0 (zero), because 10^0 = 1; in
SBML Level 3, the attribute is mandatory and has no default value.
Lastly, the attribute named 'multiplier' can be used to multiply the
unit by a real-numbered factor; this enables the definition of units
that are not power-of-ten multiples of SI units. For instance, a
multiplier of 0.3048 could be used to define foot as a measure of
length in terms of a metre. The 'multiplier' attribute is optional in
SBML Level 2, where it has a default value of 1 (one); in SBML Level
3, the attribute is mandatory and has not default value.
Unit identification codes
......................................................................
As discussed above, SBML defines a set of base units which serves as
the starting point for new unit definitions. This set of base units
consists of the SI units and a small number of additional convenience
units.
In SBML Level 2 Versions before Version 3, there existed an
enumeration of units called UnitKind. In Version 3, this enumeration
was removed and the identifier class UnitSId redefined to include the
previous UnitKind values as reserved symbols. This change has no net
effect on permissible models, their representation or their syntax.
The purpose of the change in the SBML specification was simply to
clean up an inconsistency about the contexts in which these values
were usable. However, libSBML maintains UnitKind in the form of of a
set of static integer constants whose names begin with the characters
UNIT_KIND_. These constants are defined in the class libsbml.
As a consequence of the fact that libSBML supports models in all
Levels and Versions of SBML, libSBML's set of UNIT_KIND_ values is a
union of all the possible base unit names defined in the different
SBML specifications. However, not every base unit is allowed in every
Level+Version combination of SBML. Note in particular the following
exceptions:
* The alternate spelling 'meter' is included in addition to the
official SI spelling 'metre'. This spelling is only permitted in SBML
Level 1 models.
* The alternate spelling 'liter' is included in addition to the
official SI spelling 'litre'. This spelling is only permitted in SBML
Level 1 models.
* The unit 'Celsius' is included because of its presence in
specifications of SBML prior to SBML Level 2 Version 3.
* The unit avogadro was introduced in SBML Level 3, and is only
permitted for use in SBML Level 3 models. The table below lists the
unit constants defined in libSBML, and their meanings.
Enumerator Meaning
--------- ---------
UNIT_KIND_AMPERE The ampere unit.
UNIT_KIND_AVOGADRO 'dimensionless' multiplied by the value of Avogadro's constant.
UNIT_KIND_BECQUEREL The becquerel unit.
UNIT_KIND_CANDELA The candela unit.
UNIT_KIND_CELSIUS The Celsius unit.
UNIT_KIND_COULOMB The coulomb unit.
UNIT_KIND_DIMENSIONLESS A pseudo-unit indicating a dimensionless quantity.
UNIT_KIND_FARAD The farad unit.
UNIT_KIND_GRAM The gram unit.
UNIT_KIND_GRAY The gray unit.
UNIT_KIND_HENRY The henry unit.
UNIT_KIND_HERTZ The hertz unit.
UNIT_KIND_ITEM A pseudo-unit representing a single "thing".
UNIT_KIND_JOULE The joule unit.
UNIT_KIND_KATAL The katal unit.
UNIT_KIND_KELVIN The kelvin unit.
UNIT_KIND_KILOGRAM The kilogram unit.
UNIT_KIND_LITER Alternate spelling of litre.
UNIT_KIND_LITRE The litre unit.
UNIT_KIND_LUMEN The lumen unit.
UNIT_KIND_LUX The lux unit.
UNIT_KIND_METER Alternate spelling of metre.
UNIT_KIND_METRE The metre unit.
UNIT_KIND_MOLE The mole unit.
UNIT_KIND_NEWTON The newton unit.
UNIT_KIND_OHM The ohm unit.
UNIT_KIND_PASCAL The pascal unit.
UNIT_KIND_RADIAN The radian unit.
UNIT_KIND_SECOND The second unit.
UNIT_KIND_SIEMENS The siemens unit.
UNIT_KIND_SIEVERT The sievert unit.
UNIT_KIND_STERADIAN The steradian unit.
UNIT_KIND_TESLA The tesla unit.
UNIT_KIND_VOLT The volt unit.
UNIT_KIND_WATT The watt unit.
UNIT_KIND_WEBER The weber unit.
UNIT_KIND_INVALID Marker used by libSBML to indicate an invalid or unset unit.
"""
__swig_setmethods__ = {}
for _s in [SBase]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, Unit, name, value)
__swig_getmethods__ = {}
for _s in [SBase]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, Unit, name)
__repr__ = _swig_repr
__swig_destroy__ = _libsbml.delete_Unit
__del__ = lambda self: None
def __init__(self, *args):
"""
__init__(Unit self, unsigned int level, unsigned int version) -> Unit
__init__(Unit self, SBMLNamespaces sbmlns) -> Unit
__init__(Unit self, Unit orig) -> Unit
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
Unit(SBMLNamespaces sbmlns)
Creates a new Unit using the given SBMLNamespaces object 'sbmlns'.
The SBMLNamespaces object encapsulates SBML Level/Version/namespaces
information. It is used to communicate the SBML Level, Version, and
(in Level 3) packages used in addition to SBML Level 3 Core. A common
approach to using libSBML's SBMLNamespaces facilities is to create an
SBMLNamespaces object somewhere in a program once, then hand that
object as needed to object constructors that accept SBMLNamespaces as
arguments.
Parameter 'sbmlns' is an SBMLNamespaces object.
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
______________________________________________________________________
Method variant with the following signature:
Unit(long level, long version)
Creates a new Unit using the given SBML 'level' and 'version' values.
Parameter 'level' is a long integer, the SBML Level to assign to this
Unit
Parameter 'version' is a long integer, the SBML Version to assign to
this Unit
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
______________________________________________________________________
Method variant with the following signature:
Unit(Unit orig)
Copy constructor; creates a copy of this Unit.
Parameter 'orig' is the object to copy.
Throws SBMLConstructorException: Thrown if the argument 'orig' is
None.
"""
this = _libsbml.new_Unit(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(Unit self) -> Unit
Creates and returns a deep copy of this Unit object.
Returns the (deep) copy of this Unit object.
"""
return _libsbml.Unit_clone(self)
def initDefaults(self):
"""
initDefaults(Unit self)
Initializes the fields of this Unit object to 'typical' default
values.
The SBML Unit component has slightly different aspects and default
attribute values in different SBML Levels and Versions. This method
sets the values to certain common defaults, based mostly on what they
are in SBML Level 2. Specifically:
* Sets attribute 'exponent' to 1
* Sets attribute 'scale' to 0
* Sets attribute 'multiplier' to 1.0 The 'kind' attribute is left
unchanged.
"""
return _libsbml.Unit_initDefaults(self)
def getKind(self):
"""
getKind(Unit self) -> UnitKind_t
Returns the 'kind' of Unit this is.
Returns the value of the 'kind' attribute of this Unit as a value from
the set of constants whose names begin with UNIT_KIND_ defined in the
class libsbml.
"""
return _libsbml.Unit_getKind(self)
def getExponent(self):
"""
getExponent(Unit self) -> int
Returns the value of the 'exponent' attribute of this unit.
Returns the 'exponent' value of this Unit, as an integer.
"""
return _libsbml.Unit_getExponent(self)
def getExponentAsDouble(self):
"""
getExponentAsDouble(Unit self) -> double
Returns the value of the 'exponent' attribute of this unit.
Returns the 'exponent' value of this Unit, as a double.
"""
return _libsbml.Unit_getExponentAsDouble(self)
def getScale(self):
"""
getScale(Unit self) -> int
Returns the value of the 'scale' attribute of this unit.
Returns the 'scale' value of this Unit, as an integer.
"""
return _libsbml.Unit_getScale(self)
def getMultiplier(self):
"""
getMultiplier(Unit self) -> double
Returns the value of the 'multiplier' attribute of this Unit.
Returns the 'multiplier' value of this Unit, as a double.
"""
return _libsbml.Unit_getMultiplier(self)
def getOffset(self):
"""
getOffset(Unit self) -> double
Returns the value of the 'offset' attribute of this Unit.
Returns the 'offset' value of this Unit, as a double.
WARNING:
The 'offset' attribute is only available in SBML Level 2 Version 1.
This attribute is not present in SBML Level 2 Version 2 or above.
When producing SBML models using these later specifications, modelers
and software tools need to account for units with offsets explicitly.
The SBML specification document offers a number of suggestions for how
to achieve this. LibSBML methods such as this one related to 'offset'
are retained for compatibility with earlier versions of SBML Level 2,
but their use is strongly discouraged.
"""
return _libsbml.Unit_getOffset(self)
def isAmpere(self):
"""
isAmpere(Unit self) -> bool
Predicate for testing whether this Unit is of the kind ampere.
Returns True if the kind of this Unit is ampere, False otherwise.
"""
return _libsbml.Unit_isAmpere(self)
def isAvogadro(self):
"""
isAvogadro(Unit self) -> bool
Predicate for testing whether this Unit is of the kind avogadro.
Returns True if the kind of this Unit is avogadro, False otherwise.
Note:
The unit avogadro was introduced in SBML Level 3, and is only
permitted for use in SBML Level 3 models.
"""
return _libsbml.Unit_isAvogadro(self)
def isBecquerel(self):
"""
isBecquerel(Unit self) -> bool
Predicate for testing whether this Unit is of the kind becquerel
Returns True if the kind of this Unit is becquerel, False otherwise.
"""
return _libsbml.Unit_isBecquerel(self)
def isCandela(self):
"""
isCandela(Unit self) -> bool
Predicate for testing whether this Unit is of the kind candela
Returns True if the kind of this Unit is candela, False otherwise.
"""
return _libsbml.Unit_isCandela(self)
def isCelsius(self):
"""
isCelsius(Unit self) -> bool
Predicate for testing whether this Unit is of the kind Celsius
Returns True if the kind of this Unit is Celsius, False otherwise.
WARNING:
The predefined unit Celsius was removed from the list of predefined
units in SBML Level 2 Version 2 at the same time that the 'offset'
attribute was removed from Unit definitions. LibSBML methods such as
this one related to Celsius are retained in order to support SBML
Level 2 Version 1, but their use is strongly discouraged.
"""
return _libsbml.Unit_isCelsius(self)
def isCoulomb(self):
"""
isCoulomb(Unit self) -> bool
Predicate for testing whether this Unit is of the kind coulomb
Returns True if the kind of this Unit is coulomb, False otherwise.
"""
return _libsbml.Unit_isCoulomb(self)
def isDimensionless(self):
"""
isDimensionless(Unit self) -> bool
Predicate for testing whether this Unit is of the kind dimensionless.
Returns True if the kind of this Unit is dimensionless, False
otherwise.
"""
return _libsbml.Unit_isDimensionless(self)
def isFarad(self):
"""
isFarad(Unit self) -> bool
Predicate for testing whether this Unit is of the kind farad
Returns True if the kind of this Unit is farad, False otherwise.
"""
return _libsbml.Unit_isFarad(self)
def isGram(self):
"""
isGram(Unit self) -> bool
Predicate for testing whether this Unit is of the kind gram
Returns True if the kind of this Unit is gram, False otherwise.
"""
return _libsbml.Unit_isGram(self)
def isGray(self):
"""
isGray(Unit self) -> bool
Predicate for testing whether this Unit is of the kind gray
Returns True if the kind of this Unit is gray, False otherwise.
"""
return _libsbml.Unit_isGray(self)
def isHenry(self):
"""
isHenry(Unit self) -> bool
Predicate for testing whether this Unit is of the kind henry
Returns True if the kind of this Unit is henry, False otherwise.
"""
return _libsbml.Unit_isHenry(self)
def isHertz(self):
"""
isHertz(Unit self) -> bool
Predicate for testing whether this Unit is of the kind hertz
Returns True if the kind of this Unit is hertz, False otherwise.
"""
return _libsbml.Unit_isHertz(self)
def isItem(self):
"""
isItem(Unit self) -> bool
Predicate for testing whether this Unit is of the kind item
Returns True if the kind of this Unit is item, False otherwise.
"""
return _libsbml.Unit_isItem(self)
def isJoule(self):
"""
isJoule(Unit self) -> bool
Predicate for testing whether this Unit is of the kind joule
Returns True if the kind of this Unit is joule, False otherwise.
"""
return _libsbml.Unit_isJoule(self)
def isKatal(self):
"""
isKatal(Unit self) -> bool
Predicate for testing whether this Unit is of the kind katal
Returns True if the kind of this Unit is katal, False otherwise.
"""
return _libsbml.Unit_isKatal(self)
def isKelvin(self):
"""
isKelvin(Unit self) -> bool
Predicate for testing whether this Unit is of the kind kelvin
Returns True if the kind of this Unit is kelvin, False otherwise.
"""
return _libsbml.Unit_isKelvin(self)
def isKilogram(self):
"""
isKilogram(Unit self) -> bool
Predicate for testing whether this Unit is of the kind kilogram
Returns True if the kind of this Unit is kilogram, False otherwise.
"""
return _libsbml.Unit_isKilogram(self)
def isLitre(self):
"""
isLitre(Unit self) -> bool
Predicate for testing whether this Unit is of the kind litre
Returns True if the kind of this Unit is litre or 'liter', False
otherwise.
"""
return _libsbml.Unit_isLitre(self)
def isLumen(self):
"""
isLumen(Unit self) -> bool
Predicate for testing whether this Unit is of the kind lumen
Returns True if the kind of this Unit is lumen, False otherwise.
"""
return _libsbml.Unit_isLumen(self)
def isLux(self):
"""
isLux(Unit self) -> bool
Predicate for testing whether this Unit is of the kind lux
Returns True if the kind of this Unit is lux, False otherwise.
"""
return _libsbml.Unit_isLux(self)
def isMetre(self):
"""
isMetre(Unit self) -> bool
Predicate for testing whether this Unit is of the kind metre
Returns True if the kind of this Unit is metre or 'meter', False
otherwise.
"""
return _libsbml.Unit_isMetre(self)
def isMole(self):
"""
isMole(Unit self) -> bool
Predicate for testing whether this Unit is of the kind mole
Returns True if the kind of this Unit is mole, False otherwise.
"""
return _libsbml.Unit_isMole(self)
def isNewton(self):
"""
isNewton(Unit self) -> bool
Predicate for testing whether this Unit is of the kind newton
Returns True if the kind of this Unit is newton, False otherwise.
"""
return _libsbml.Unit_isNewton(self)
def isOhm(self):
"""
isOhm(Unit self) -> bool
Predicate for testing whether this Unit is of the kind ohm
Returns True if the kind of this Unit is ohm, False otherwise.
"""
return _libsbml.Unit_isOhm(self)
def isPascal(self):
"""
isPascal(Unit self) -> bool
Predicate for testing whether this Unit is of the kind pascal
Returns True if the kind of this Unit is pascal, False otherwise.
"""
return _libsbml.Unit_isPascal(self)
def isRadian(self):
"""
isRadian(Unit self) -> bool
Predicate for testing whether this Unit is of the kind radian
Returns True if the kind of this Unit is radian, False otherwise.
"""
return _libsbml.Unit_isRadian(self)
def isSecond(self):
"""
isSecond(Unit self) -> bool
Predicate for testing whether this Unit is of the kind second
Returns True if the kind of this Unit is second, False otherwise.
"""
return _libsbml.Unit_isSecond(self)
def isSiemens(self):
"""
isSiemens(Unit self) -> bool
Predicate for testing whether this Unit is of the kind siemens
Returns True if the kind of this Unit is siemens, False otherwise.
"""
return _libsbml.Unit_isSiemens(self)
def isSievert(self):
"""
isSievert(Unit self) -> bool
Predicate for testing whether this Unit is of the kind sievert
Returns True if the kind of this Unit is sievert, False otherwise.
"""
return _libsbml.Unit_isSievert(self)
def isSteradian(self):
"""
isSteradian(Unit self) -> bool
Predicate for testing whether this Unit is of the kind steradian
Returns True if the kind of this Unit is steradian, False otherwise.
"""
return _libsbml.Unit_isSteradian(self)
def isTesla(self):
"""
isTesla(Unit self) -> bool
Predicate for testing whether this Unit is of the kind tesla
Returns True if the kind of this Unit is tesla, False otherwise.
"""
return _libsbml.Unit_isTesla(self)
def isVolt(self):
"""
isVolt(Unit self) -> bool
Predicate for testing whether this Unit is of the kind volt
Returns True if the kind of this Unit is volt, False otherwise.
"""
return _libsbml.Unit_isVolt(self)
def isWatt(self):
"""
isWatt(Unit self) -> bool
Predicate for testing whether this Unit is of the kind watt
Returns True if the kind of this Unit is watt, False otherwise.
"""
return _libsbml.Unit_isWatt(self)
def isWeber(self):
"""
isWeber(Unit self) -> bool
Predicate for testing whether this Unit is of the kind weber
Returns True if the kind of this Unit is weber, False otherwise.
"""
return _libsbml.Unit_isWeber(self)
def isSetKind(self):
"""
isSetKind(Unit self) -> bool
Predicate to test whether the 'kind' attribute of this Unit is set.
Returns True if the 'kind' attribute of this Unit is set, False
otherwise.
"""
return _libsbml.Unit_isSetKind(self)
def isSetExponent(self):
"""
isSetExponent(Unit self) -> bool
Predicate to test whether the 'exponent' attribute of this Unit is
set.
Returns True if the 'exponent' attribute of this Unit is set, False
otherwise.
"""
return _libsbml.Unit_isSetExponent(self)
def isSetScale(self):
"""
isSetScale(Unit self) -> bool
Predicate to test whether the 'scale' attribute of this Unit is set.
Returns True if the 'scale' attribute of this Unit is set, False
otherwise.
"""
return _libsbml.Unit_isSetScale(self)
def isSetMultiplier(self):
"""
isSetMultiplier(Unit self) -> bool
Predicate to test whether the 'multiplier' attribute of this Unit is
set.
Returns True if the 'multiplier' attribute of this Unit is set, False
otherwise.
"""
return _libsbml.Unit_isSetMultiplier(self)
def setKind(self, kind):
"""
setKind(Unit self, UnitKind_t kind) -> int
Sets the 'kind' attribute value of this Unit.
Parameter 'kind' is a unit identifier chosen from the set of constants
whose names begin with UNIT_KIND_ in libsbml.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
"""
return _libsbml.Unit_setKind(self, kind)
def setExponent(self, *args):
"""
setExponent(Unit self, int value) -> int
setExponent(Unit self, double value) -> int
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
setExponent(double value)
Sets the 'exponent' attribute value of this Unit.
Parameter 'value' is the double to which the attribute 'exponent'
should be set
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
______________________________________________________________________
Method variant with the following signature:
setExponent(int value)
Sets the 'exponent' attribute value of this Unit.
Parameter 'value' is the integer to which the attribute 'exponent'
should be set
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
"""
return _libsbml.Unit_setExponent(self, *args)
def setScale(self, value):
"""
setScale(Unit self, int value) -> int
Sets the 'scale' attribute value of this Unit.
Parameter 'value' is the integer to which the attribute 'scale' should
be set
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
"""
return _libsbml.Unit_setScale(self, value)
def setMultiplier(self, value):
"""
setMultiplier(Unit self, double value) -> int
Sets the 'multipler' attribute value of this Unit.
Parameter 'value' is the floating-point value to which the attribute
'multiplier' should be set
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_UNEXPECTED_ATTRIBUTE
"""
return _libsbml.Unit_setMultiplier(self, value)
def setOffset(self, value):
"""
setOffset(Unit self, double value) -> int
Sets the 'offset' attribute value of this Unit.
Parameter 'value' is the float-point value to which the attribute
'offset' should set
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_UNEXPECTED_ATTRIBUTE
WARNING:
The 'offset' attribute is only available in SBML Level 2 Version 1.
This attribute is not present in SBML Level 2 Version 2 or above.
When producing SBML models using these later specifications, modelers
and software tools need to account for units with offsets explicitly.
The SBML specification document offers a number of suggestions for how
to achieve this. LibSBML methods such as this one related to 'offset'
are retained for compatibility with earlier versions of SBML Level 2,
but their use is strongly discouraged.
"""
return _libsbml.Unit_setOffset(self, value)
def getTypeCode(self):
"""
getTypeCode(Unit self) -> int
Returns the libSBML type code of this object instance.
LibSBML attaches an identifying code to every kind of SBML object.
These are integer constants known as SBML type codes. The names of
all the codes begin with the characters SBML_. In the Python language
interface for libSBML, the type codes are defined as static integer
constants in the interface class 'libsbml'. Note that different Level
3 package plug-ins may use overlapping type codes; to identify the
package to which a given object belongs, call the getPackageName()
method on the object.
Returns the SBML type code for this object: SBML_UNIT (default).
WARNING:
The specific integer values of the possible type codes may be reused
by different Level 3 package plug-ins. Thus, to identifiy the correct
code, it is necessary to invoke both getTypeCode() and
getPackageName().
See also getPackageName(), getElementName().
"""
return _libsbml.Unit_getTypeCode(self)
def getElementName(self):
"""
getElementName(Unit self) -> string
Returns the XML element name of this object, which for Unit, is always
'unit'.
Returns the name of this element, i.e., 'unit'.
"""
return _libsbml.Unit_getElementName(self)
def isBuiltIn(name, level):
"""
isBuiltIn(string name, unsigned int level) -> bool
Predicate to test whether a given string is the name of a predefined
SBML unit.
Parameter 'name' is a string to be tested against the predefined unit
names
Parameter 'level' is the Level of SBML for which the determination
should be made. This is necessary because there are a few small
differences in allowed units between SBML Level 1 and Level 2.
Returns True if 'name' is one of the five SBML predefined unit
identifiers ('substance', 'volume', 'area', 'length' or 'time'), False
otherwise.
Note:
The predefined unit identifiers 'length' and 'area' were added in
Level 2 Version 1.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.Unit_isBuiltIn(name, level)
if _newclass:
isBuiltIn = staticmethod(isBuiltIn)
__swig_getmethods__["isBuiltIn"] = lambda x: isBuiltIn
def isUnitKind(name, level, version):
"""
isUnitKind(string name, unsigned int level, unsigned int version) -> bool
Predicate to test whether a given string is the name of a valid base
unit in SBML (such as 'gram' or 'mole').
This method exists because prior to SBML Level 2 Version 3, an
enumeration called UnitKind was defined by SBML. This enumeration was
removed in SBML Level 2 Version 3 and its values were folded into the
space of values of a type called UnitSId. This method therefore has
less significance in SBML Level 2 Version 3 and Level 2 Version 4, but
remains for backward compatibility and support for reading models in
older Versions of Level 2.
Parameter 'name' is a string to be tested
Parameter 'level' is a long integer representing the SBML
specification Level
Parameter 'version' is a long integer representing the SBML
specification Version
Returns True if name is a valid SBML UnitKind, False otherwise
Note:
The allowed unit names differ between SBML Levels 1 and 2 and again
slightly between Level 2 Versions 1 and 2.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.Unit_isUnitKind(name, level, version)
if _newclass:
isUnitKind = staticmethod(isUnitKind)
__swig_getmethods__["isUnitKind"] = lambda x: isUnitKind
def areIdentical(unit1, unit2):
"""
areIdentical(Unit unit1, Unit unit2) -> bool
Predicate returning True if two Unit objects are identical.
Two Unit objects are considered to be identical if they match in all
attributes. (Contrast this to the method areEquivalent(), which
compares Unit objects only with respect to certain attributes.)
Parameter 'unit1' is the first Unit object to compare Parameter
'unit2' is the second Unit object to compare
Returns True if all the attributes of unit1 are identical to the
attributes of unit2, False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
See also Unit.areEquivalent() .
"""
return _libsbml.Unit_areIdentical(unit1, unit2)
if _newclass:
areIdentical = staticmethod(areIdentical)
__swig_getmethods__["areIdentical"] = lambda x: areIdentical
def areEquivalent(unit1, unit2):
"""
areEquivalent(Unit unit1, Unit unit2) -> bool
Predicate returning True if Unit objects are equivalent.
Two Unit objects are considered to be equivalent either if (1) both
have a 'kind' attribute value of dimensionless, or (2) their 'kind',
'exponent' and (for SBML Level 2 Version 1) 'offset' attribute values
are equal. (Contrast this to the method areIdentical(), which compares
Unit objects with respect to all attributes, not just the 'kind' and
'exponent'.)
Parameter 'unit1' is the first Unit object to compare Parameter
'unit2' is the second Unit object to compare
Returns True if the 'kind' and 'exponent' attributes of unit1 are
identical to the kind and exponent attributes of unit2, False
otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
See also Unit.areIdentical() .
"""
return _libsbml.Unit_areEquivalent(unit1, unit2)
if _newclass:
areEquivalent = staticmethod(areEquivalent)
__swig_getmethods__["areEquivalent"] = lambda x: areEquivalent
def removeScale(unit):
"""
removeScale(Unit unit) -> int
Manipulates the attributes of the Unit to express the unit with the
value of the scale attribute reduced to zero.
For example, 1 millimetre can be expressed as a Unit with kind='metre'
multiplier='1' scale='-3' exponent='1'. It can also be expressed as a
Unit with kind='metre' multiplier='0.001' scale='0' exponent='1'.
Parameter 'unit' is the Unit object to manipulate.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
See also Unit.convertToSI() , Unit.merge() .
"""
return _libsbml.Unit_removeScale(unit)
if _newclass:
removeScale = staticmethod(removeScale)
__swig_getmethods__["removeScale"] = lambda x: removeScale
def merge(unit1, unit2):
"""
merge(Unit unit1, Unit unit2)
Merges two Unit objects with the same 'kind' attribute value into a
single Unit.
For example, the following,
would be merged to become
Parameter 'unit1' is the first Unit object; the result of the
operation is left as a new version of this unit, modified in-place.
Not modified if the two units have different kinds.
Parameter 'unit2' is the second Unit object to merge with the first
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
See also Unit.convertToSI() , Unit.removeScale() .
"""
return _libsbml.Unit_merge(unit1, unit2)
if _newclass:
merge = staticmethod(merge)
__swig_getmethods__["merge"] = lambda x: merge
def convertToSI(unit):
"""
convertToSI(Unit unit) -> UnitDefinition
Returns a UnitDefinition object containing the given 'unit' converted
to the appropriate SI unit.
This method exists because some units can be expressed in terms of
others when the same physical dimension is involved. For example, one
hertz is identical to 1 sec^-1, one litre is equivalent to 1 cubic
decametre, and so on.
Parameter 'unit' is the Unit object to convert to SI
Returns a UnitDefinition object containing the SI unit.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
See also Unit.merge() .
"""
return _libsbml.Unit_convertToSI(unit)
if _newclass:
convertToSI = staticmethod(convertToSI)
__swig_getmethods__["convertToSI"] = lambda x: convertToSI
def hasRequiredAttributes(self):
"""
hasRequiredAttributes(Unit self) -> bool
Predicate returning True if all the required attributes for this Unit
object have been set.
The required attributes for a Unit object are:
* 'kind'
* 'exponent' (required in SBML Level 3; optional in Level 2)
* 'multiplier' (required in SBML Level 3; optional in Level 2)
* 'scale' (required in SBML Level 3; optional in Level 2)
Returns True if the required attributes have been set, False
otherwise.
"""
return _libsbml.Unit_hasRequiredAttributes(self)
Unit_swigregister = _libsbml.Unit_swigregister
Unit_swigregister(Unit)
def Unit_isBuiltIn(name, level):
"""
Unit_isBuiltIn(string name, unsigned int level) -> bool
Predicate to test whether a given string is the name of a predefined
SBML unit.
Parameter 'name' is a string to be tested against the predefined unit
names
Parameter 'level' is the Level of SBML for which the determination
should be made. This is necessary because there are a few small
differences in allowed units between SBML Level 1 and Level 2.
Returns True if 'name' is one of the five SBML predefined unit
identifiers ('substance', 'volume', 'area', 'length' or 'time'), False
otherwise.
Note:
The predefined unit identifiers 'length' and 'area' were added in
Level 2 Version 1.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.Unit_isBuiltIn(name, level)
def Unit_isUnitKind(name, level, version):
"""
Unit_isUnitKind(string name, unsigned int level, unsigned int version) -> bool
Predicate to test whether a given string is the name of a valid base
unit in SBML (such as 'gram' or 'mole').
This method exists because prior to SBML Level 2 Version 3, an
enumeration called UnitKind was defined by SBML. This enumeration was
removed in SBML Level 2 Version 3 and its values were folded into the
space of values of a type called UnitSId. This method therefore has
less significance in SBML Level 2 Version 3 and Level 2 Version 4, but
remains for backward compatibility and support for reading models in
older Versions of Level 2.
Parameter 'name' is a string to be tested
Parameter 'level' is a long integer representing the SBML
specification Level
Parameter 'version' is a long integer representing the SBML
specification Version
Returns True if name is a valid SBML UnitKind, False otherwise
Note:
The allowed unit names differ between SBML Levels 1 and 2 and again
slightly between Level 2 Versions 1 and 2.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.Unit_isUnitKind(name, level, version)
def Unit_areIdentical(unit1, unit2):
"""
Unit_areIdentical(Unit unit1, Unit unit2) -> bool
Predicate returning True if two Unit objects are identical.
Two Unit objects are considered to be identical if they match in all
attributes. (Contrast this to the method areEquivalent(), which
compares Unit objects only with respect to certain attributes.)
Parameter 'unit1' is the first Unit object to compare Parameter
'unit2' is the second Unit object to compare
Returns True if all the attributes of unit1 are identical to the
attributes of unit2, False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
See also Unit.areEquivalent() .
"""
return _libsbml.Unit_areIdentical(unit1, unit2)
def Unit_areEquivalent(unit1, unit2):
"""
Unit_areEquivalent(Unit unit1, Unit unit2) -> bool
Predicate returning True if Unit objects are equivalent.
Two Unit objects are considered to be equivalent either if (1) both
have a 'kind' attribute value of dimensionless, or (2) their 'kind',
'exponent' and (for SBML Level 2 Version 1) 'offset' attribute values
are equal. (Contrast this to the method areIdentical(), which compares
Unit objects with respect to all attributes, not just the 'kind' and
'exponent'.)
Parameter 'unit1' is the first Unit object to compare Parameter
'unit2' is the second Unit object to compare
Returns True if the 'kind' and 'exponent' attributes of unit1 are
identical to the kind and exponent attributes of unit2, False
otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
See also Unit.areIdentical() .
"""
return _libsbml.Unit_areEquivalent(unit1, unit2)
def Unit_removeScale(unit):
"""
Unit_removeScale(Unit unit) -> int
Manipulates the attributes of the Unit to express the unit with the
value of the scale attribute reduced to zero.
For example, 1 millimetre can be expressed as a Unit with kind='metre'
multiplier='1' scale='-3' exponent='1'. It can also be expressed as a
Unit with kind='metre' multiplier='0.001' scale='0' exponent='1'.
Parameter 'unit' is the Unit object to manipulate.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
See also Unit.convertToSI() , Unit.merge() .
"""
return _libsbml.Unit_removeScale(unit)
def Unit_merge(unit1, unit2):
"""
Unit_merge(Unit unit1, Unit unit2)
Merges two Unit objects with the same 'kind' attribute value into a
single Unit.
For example, the following,
would be merged to become
Parameter 'unit1' is the first Unit object; the result of the
operation is left as a new version of this unit, modified in-place.
Not modified if the two units have different kinds.
Parameter 'unit2' is the second Unit object to merge with the first
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
See also Unit.convertToSI() , Unit.removeScale() .
"""
return _libsbml.Unit_merge(unit1, unit2)
def Unit_convertToSI(unit):
"""
Unit_convertToSI(Unit unit) -> UnitDefinition
Returns a UnitDefinition object containing the given 'unit' converted
to the appropriate SI unit.
This method exists because some units can be expressed in terms of
others when the same physical dimension is involved. For example, one
hertz is identical to 1 sec^-1, one litre is equivalent to 1 cubic
decametre, and so on.
Parameter 'unit' is the Unit object to convert to SI
Returns a UnitDefinition object containing the SI unit.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
See also Unit.merge() .
"""
return _libsbml.Unit_convertToSI(unit)
class ListOfUnits(ListOf):
"""
A list of Unit objects.
ListOfUnits is entirely contained within UnitDefinition.
The various ListOf___ classes in SBML are merely containers used for
organizing the main components of an SBML model. In libSBML's
implementation, ListOf___ classes are derived from the intermediate
utility class ListOf, which is not defined by the SBML specifications
but serves as a useful programmatic construct. ListOf is itself is in
turn derived from SBase, which provides all of the various ListOf___
classes with common features defined by the SBML specification, such
as 'metaid' attributes and annotations.
The relationship between the lists and the rest of an SBML model is
illustrated by the following (for SBML Level 2 Version 4):
...
...
...
...
...
...
... elements of subclasses of Rule ...
...
...
...
Readers may wonder about the motivations for using the ListOf___
containers in SBML. A simpler approach in XML might be to place the
components all directly at the top level of the model definition. The
choice made in SBML is to group them within XML elements named after
ListOfClassname, in part because it helps organize the components.
More importantly, the fact that the container classes are derived from
SBase means that software tools can add information about the lists
themselves into each list container's 'annotation'.
See also ListOfFunctionDefinitions, ListOfUnitDefinitions,
ListOfCompartmentTypes, ListOfSpeciesTypes, ListOfCompartments,
ListOfSpecies, ListOfParameters, ListOfInitialAssignments,
ListOfRules, ListOfConstraints, ListOfReactions, ListOfEvents.
"""
__swig_setmethods__ = {}
for _s in [ListOf]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, ListOfUnits, name, value)
__swig_getmethods__ = {}
for _s in [ListOf]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, ListOfUnits, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(ListOfUnits self, unsigned int level, unsigned int version) -> ListOfUnits
__init__(ListOfUnits self, SBMLNamespaces sbmlns) -> ListOfUnits
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
ListOfUnits(SBMLNamespaces sbmlns)
Creates a new ListOfUnits object.
The object is constructed such that it is valid for the SBML Level and
Version combination determined by the SBMLNamespaces object in
'sbmlns'.
Parameter 'sbmlns' is an SBMLNamespaces object that is used to
determine the characteristics of the ListOfUnits object to be created.
______________________________________________________________________
Method variant with the following signature:
ListOfUnits(long level, long version)
Creates a new ListOfUnits object.
The object is constructed such that it is valid for the given SBML
Level and Version combination.
Parameter 'level' is the SBML Level
Parameter 'version' is the Version within the SBML Level
"""
this = _libsbml.new_ListOfUnits(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(ListOfUnits self) -> ListOfUnits
Creates and returns a deep copy of this ListOfUnits object.
Returns the (deep) copy of this ListOfUnits object.
"""
return _libsbml.ListOfUnits_clone(self)
def getItemTypeCode(self):
"""
getItemTypeCode(ListOfUnits self) -> int
Returns the libSBML type code for the objects contained in this ListOf
(i.e., Unit objects, if the list is non-empty).
LibSBML attaches an identifying code to every kind of SBML object.
These are integer constants known as SBML type codes. The names of
all the codes begin with the characters SBML_. In the Python language
interface for libSBML, the type codes are defined as static integer
constants in the interface class 'libsbml'. Note that different Level
3 package plug-ins may use overlapping type codes; to identify the
package to which a given object belongs, call the getPackageName()
method on the object.
Returns the SBML type code for objects contained in this list:
SBML_UNIT (default).
See also getElementName(), getPackageName().
"""
return _libsbml.ListOfUnits_getItemTypeCode(self)
def getElementName(self):
"""
getElementName(ListOfUnits self) -> string
Returns the XML element name of this object.
For ListOfUnits, the XML element name is 'listOfUnits'.
Returns the name of this element, i.e., 'listOfUnits'.
"""
return _libsbml.ListOfUnits_getElementName(self)
def get(self, *args):
"""
get(ListOfUnits self, unsigned int n) -> Unit
get(ListOfUnits self, unsigned int n) -> Unit
Get a Unit from the ListOfUnits.
Parameter 'n' is the index number of the Unit to get.
Returns the nth Unit in this ListOfUnits.
See also size().
"""
return _libsbml.ListOfUnits_get(self, *args)
def remove(self, n):
"""
remove(ListOfUnits self, unsigned int n) -> Unit
Removes the nth item from this ListOfUnits items and returns a pointer
to it.
The caller owns the returned item and is responsible for deleting it.
Parameter 'n' is the index of the item to remove
See also size().
"""
return _libsbml.ListOfUnits_remove(self, n)
__swig_destroy__ = _libsbml.delete_ListOfUnits
__del__ = lambda self: None
ListOfUnits_swigregister = _libsbml.ListOfUnits_swigregister
ListOfUnits_swigregister(ListOfUnits)
class UnitDefinition(SBase):
"""
A definition of a unit used in an SBML model.
Units of measurement may be supplied in a number of contexts in an
SBML model. The SBML unit definition facility uses two classes of
objects, UnitDefinition and Unit. The approach to defining units in
SBML is compositional; for example, meter second^-2 is constructed by
combining a Unit object representing meter with another Unit object
representing second^-2. The combination is wrapped inside a
UnitDefinition, which provides for assigning an identifier and
optional name to the combination. The identifier can then be
referenced from elsewhere in a model. Thus, the UnitDefinition class
is the container, and Unit instances are placed inside UnitDefinition
instances.
Two points are worth discussing in the context of SBML units. First,
unit declarations in SBML models are optional. The consequence of
this is that a model must be numerically self-consistent independently
of unit declarations, for the benefit of software tools that cannot
interpret or manipulate units. Unit declarations in SBML are thus
more akin to a type of annotation; they can indicate intentions, and
can be used by model readers for checking the consistency of the
model, labeling simulation output, etc., but any transformations of
values implied by different units must be incorporated explicitly into
a model.
Second, the vast majority of situations that require new SBML unit
definitions involve simple multiplicative combinations of base units
and factors. An example is moles per litre per second. What
distinguishes these sorts of unit definitions from more complex ones
is that they may be expressed without the use of an additive offset
from a zero point. The use of offsets complicates all unit definition
systems, yet in the domain of SBML, the real-life cases requiring
offsets are few (and in fact, to the best of our knowledge, only
involve temperature). Consequently, the SBML unit system has been
consciously designed to simplify implementation of unit support for
the most common cases in systems biology. The cost of this
simplification is to require units with offsets to be handled
explicitly by the modeler.
Summary of the UnitDefinition construct
======================================================================
UnitDefinition has two attributes and one subelement. The two
attributes are 'id' and 'name', and the subelement is ListOfUnits.
The required attribute 'id' and optional attribute 'name' are both
strings. The 'id' attribute is used to give the defined unit a unique
identifier by which other parts of an SBML model definition can refer
to it. The 'name' attribute is intended to be used for giving the
unit definition an optional human-readable name. Please see the next
section for information about the values permitted for 'id'.
A UnitDefinition must contain exactly one ListOfUnits, and this list
must contain one or more Unit definitions; see the definitions of
these other object classes for more information about them. The
following example illustrates a complete unit definition (when written
in XML) when they all the pieces are combined together. This defines
'mmls' to be millimoles per litre per second.
Special considerations for Unit object identifiers
======================================================================
The attribute 'id' in UnitDefinition cannot be given simply any value,
and the precise details of the values permitted differ slightly
between Levels of SBML:
* The 'id' of a UnitDefinition must not contain a value from the list
of SBML's predefined base unit names (i.e., the strings gram, litre,
etc.). In SBML Level 3, this list consists of the following:
ampere farad joule lux radian volt
avogadro gram katal metre second watt
becquerel gray kelvin mole siemens weber
candela henry kilogram newton sievert
coulomb hertz litre ohm steradian
dimensionless item lumen pascal tesla
This list of predefined base units is nearly identical in SBML Level
2 Version 4, the exception being that Level 2 does not define
avogadro. SBML Level 2 Version 1 (and only this Level+Version
combination) provides an additional predefined unit name, Celsius, not
available in Level 3. Finally, SBML Level 1 Versions 2-3 provide two
more additional predefined unit names, meter and liter. This is
explained in somewhat greater detail in the description of the Unit
class.
* In SBML Level 2 (all Versions), there is an additional set of
reserved identifiers: substance, volume, area, length, and time.
Using one of these values for the attribute 'id' of a UnitDefinition
has the effect of redefining the model-wide default units for the
corresponding quantities. The list of special unit names in SBML
Level 2 is given in the table below: Also, SBML Level 2 imposes two
limitations on redefining the predefined unit substance, volume, area,
length, and time: (1) The UnitDefinition of a predefined SBML unit can
only contain a single Unit object within it. (2) The value of the
'kind' attribute in a Unit instance must be drawn from one of the
values in the second column of the table above.
The special unit names substance, volume, area, length, and time are
not defined by SBML Level 3, which uses a different approach to
setting model-wide inherited units.
Further comments about SBML's unit definition system
======================================================================
The vast majority of modeling situations requiring new SBML unit
definitions involve simple multiplicative combinations of base units
and factors. An example of this might be moles per litre per second.
What distinguishes these sorts of simpler unit definitions from more
complex ones is that they may be expressed without the use of an
additive offset from a zero point. The use of offsets complicates all
unit definition systems, yet in the domain of SBML the real-life cases
requiring offsets are few (and in fact, to the best of our knowledge,
only involve temperature). Consequently, the SBML unit system has
been consciously designed in a way that attempts to simplify
implementation of unit support for the most common cases in systems
biology.
As of SBML Level 2 Version 2, Unit no longer has the attribute called
'offset' introduced in SBML Level 2 Version 1. It turned out that the
general case involving units with offsets was incorrectly defined, and
few (if any) developers even attempted to support offset-based units
in their software. In the development of Level 2 Version 2, a
consensus among SBML developers emerged that a fully generalized unit
scheme is so confusing and complicated that it actually impedes
interoperability. SBML Level 2 Version 2, Version 3 and Version 4
acknowledge this reality by reducing and simplifying the unit system,
specifically by removing the 'offset' attribute on Unit and Celsius as
a pre-defined unit.
The following guidelines suggest methods for handling units that do
require the use of zero offsets for their definitions:
* Handling Celsius. A model in which certain quantities are
temperatures measured in degrees Celsius can be converted
straightforwardly to a model in which those temperatures are in
kelvin. A software tool could do this by performing a straightforward
substitution using the following relationship: T_ kelvin = T_Celsius +
273.15. In every mathematical formula of the model where a quantity
(call it x) in degrees Celsius appears, replace x with x_k+ 273.15,
where x_k is now in kelvin. An alternative approach would be to use
a FunctionDefinition object to define a function encapsulating this
relationship above and then using that in the rest of the model as
needed. Since Celsius is a commonly-used unit, software tools could
help users by providing users with the ability to express temperatures
in Celsius in the tools' interfaces, and making substitutions
automatically when writing out the SBML.
* Other units requiring offsets. One approach to handling other kinds
of units is to use a FunctionDefinition to define a function
encapsulating the necessary mathematical relationship, then
substituting a call to this function wherever the original quantity
appeared in the model. For example, here is a possible definition for
converting Fahrenheit to Celsius degrees:
temp_in_fahrenheit
temp_in_fahrenheit
459.67
1.8
* An alternative approach not requiring the use of function
definitions is to use an AssignmentRule for each variable in
Fahrenheit units. The AssignmentRule could compute the conversion from
Fahrenheit to (say) kelvin, assign its value to a variable (in Kelvin
units), and then that variable could be used elsewhere in the model.
* Still another approach is to rewrite the mathematical formulas of a
model to directly incorporate the conversion formula wherever the
original quantity appeared. Please consult the SBML specifications for
more information about this and other issues involving units.
"""
__swig_setmethods__ = {}
for _s in [SBase]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, UnitDefinition, name, value)
__swig_getmethods__ = {}
for _s in [SBase]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, UnitDefinition, name)
__repr__ = _swig_repr
__swig_destroy__ = _libsbml.delete_UnitDefinition
__del__ = lambda self: None
def __init__(self, *args):
"""
__init__(UnitDefinition self, unsigned int level, unsigned int version) -> UnitDefinition
__init__(UnitDefinition self, SBMLNamespaces sbmlns) -> UnitDefinition
__init__(UnitDefinition self, UnitDefinition orig) -> UnitDefinition
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
UnitDefinition(SBMLNamespaces sbmlns)
Creates a new UnitDefinition using the given SBMLNamespaces object
'sbmlns'.
The SBMLNamespaces object encapsulates SBML Level/Version/namespaces
information. It is used to communicate the SBML Level, Version, and
(in Level 3) packages used in addition to SBML Level 3 Core. A common
approach to using libSBML's SBMLNamespaces facilities is to create an
SBMLNamespaces object somewhere in a program once, then hand that
object as needed to object constructors that accept SBMLNamespaces as
arguments.
Parameter 'sbmlns' is an SBMLNamespaces object.
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
______________________________________________________________________
Method variant with the following signature:
UnitDefinition(long level, long version)
Creates a new UnitDefinition using the given SBML 'level' and
'version' values.
Parameter 'level' is a long integer, the SBML Level to assign to this
UnitDefinition
Parameter 'version' is a long integer, the SBML Version to assign to
this UnitDefinition
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
______________________________________________________________________
Method variant with the following signature:
UnitDefinition(UnitDefinition orig)
Copy constructor; creates a copy of this UnitDefinition.
Parameter 'orig' is the object to copy.
Throws SBMLConstructorException: Thrown if the argument 'orig' is
None.
"""
this = _libsbml.new_UnitDefinition(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(UnitDefinition self) -> UnitDefinition
Creates and returns a deep copy of this UnitDefinition object.
Returns the (deep) copy of this UnitDefinition object.
"""
return _libsbml.UnitDefinition_clone(self)
def getElementBySId(self, id):
"""
getElementBySId(UnitDefinition self, string id) -> SBase
Returns the first child element found that has the given 'id' in the
model-wide SId namespace, or None if no such object is found.
Parameter 'id' is string representing the id of objects to find.
Returns pointer to the first element found with the given 'id'.
"""
return _libsbml.UnitDefinition_getElementBySId(self, id)
def getElementByMetaId(self, metaid):
"""
getElementByMetaId(UnitDefinition self, string metaid) -> SBase
Returns the first child element it can find with the given 'metaid',
or None if no such object is found.
Parameter 'metaid' is string representing the metaid of objects to
find
Returns pointer to the first element found with the given 'metaid'.
"""
return _libsbml.UnitDefinition_getElementByMetaId(self, metaid)
def getId(self):
"""
getId(UnitDefinition self) -> string
Returns the value of the 'id' attribute of this UnitDefinition.
Returns the id of this UnitDefinition.
"""
return _libsbml.UnitDefinition_getId(self)
def getName(self):
"""
getName(UnitDefinition self) -> string
Returns the value of the 'name' attribute of this UnitDefinition.
Returns the name of this UnitDefinition.
"""
return _libsbml.UnitDefinition_getName(self)
def isSetId(self):
"""
isSetId(UnitDefinition self) -> bool
Predicate returning True if this UnitDefinition's 'id' attribute is
set.
Returns True if the 'id' attribute of this UnitDefinition is set,
False otherwise.
"""
return _libsbml.UnitDefinition_isSetId(self)
def isSetName(self):
"""
isSetName(UnitDefinition self) -> bool
Predicate returning True if this UnitDefinition's 'name' attribute is
set.
Returns True if the 'name' attribute of this UnitDefinition is set,
False otherwise.
"""
return _libsbml.UnitDefinition_isSetName(self)
def setId(self, sid):
"""
setId(UnitDefinition self, string sid) -> int
Sets the value of the 'id' attribute of this UnitDefinition.
The string 'sid' is copied.
SBML has strict requirements for the syntax of identifiers, that is,
the values of the 'id' attribute present on most types of SBML
objects. The following is a summary of the definition of the SBML
identifier type SId, which defines the permitted syntax of
identifiers. We express the syntax using an extended form of BNF
notation:
letter ::= 'a'..'z','A'..'Z'
digit ::= '0'..'9'
idChar ::= letter | digit | '_'
SId ::= ( letter | '_' ) idChar*
The characters ( and ) are used for grouping, the character * 'zero or
more times', and the character | indicates logical 'or'. The equality
of SBML identifiers is determined by an exact character sequence
match; i.e., comparisons must be performed in a case-sensitive manner.
In addition, there are a few conditions for the uniqueness of
identifiers in an SBML model. Please consult the SBML specifications
for the exact details of the uniqueness requirements.
Parameter 'sid' is the string to use as the identifier of this
UnitDefinition
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
"""
return _libsbml.UnitDefinition_setId(self, sid)
def setName(self, name):
"""
setName(UnitDefinition self, string name) -> int
Sets the value of the 'name' attribute of this UnitDefinition.
The string in 'name' is copied.
Parameter 'name' is the new name for the UnitDefinition
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
"""
return _libsbml.UnitDefinition_setName(self, name)
def unsetName(self):
"""
unsetName(UnitDefinition self) -> int
Unsets the value of the 'name' attribute of this UnitDefinition.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
"""
return _libsbml.UnitDefinition_unsetName(self)
def isVariantOfArea(self):
"""
isVariantOfArea(UnitDefinition self) -> bool
Convenience function for testing if a given unit definition is a
variant of the predefined unit identifier 'area'.
Returns True if this UnitDefinition is a variant of the predefined
unit area, meaning square metres with only abritrary variations in
scale or multiplier values; False otherwise.
"""
return _libsbml.UnitDefinition_isVariantOfArea(self)
def isVariantOfLength(self):
"""
isVariantOfLength(UnitDefinition self) -> bool
Convenience function for testing if a given unit definition is a
variant of the predefined unit identifier 'length'.
Returns True if this UnitDefinition is a variant of the predefined
unit length, meaning metres with only abritrary variations in scale or
multiplier values; False otherwise.
"""
return _libsbml.UnitDefinition_isVariantOfLength(self)
def isVariantOfSubstance(self):
"""
isVariantOfSubstance(UnitDefinition self) -> bool
Convenience function for testing if a given unit definition is a
variant of the predefined unit identifier 'substance'.
Returns True if this UnitDefinition is a variant of the predefined
unit substance, meaning moles or items (and grams or kilograms from
SBML Level 2 Version 2 onwards) with only abritrary variations in
scale or multiplier values; False otherwise.
"""
return _libsbml.UnitDefinition_isVariantOfSubstance(self)
def isVariantOfTime(self):
"""
isVariantOfTime(UnitDefinition self) -> bool
Convenience function for testing if a given unit definition is a
variant of the predefined unit identifier 'time'.
Returns True if this UnitDefinition is a variant of the predefined
unit time, meaning seconds with only abritrary variations in scale or
multiplier values; False otherwise.
"""
return _libsbml.UnitDefinition_isVariantOfTime(self)
def isVariantOfVolume(self):
"""
isVariantOfVolume(UnitDefinition self) -> bool
Convenience function for testing if a given unit definition is a
variant of the predefined unit identifier 'volume'.
Returns True if this UnitDefinition is a variant of the predefined
unit volume, meaning litre or cubic metre with only abritrary
variations in scale or multiplier values; False otherwise.
"""
return _libsbml.UnitDefinition_isVariantOfVolume(self)
def isVariantOfDimensionless(self):
"""
isVariantOfDimensionless(UnitDefinition self) -> bool
Convenience function for testing if a given unit definition is a
variant of the unit 'dimensionless'.
Returns True if this UnitDefinition is a variant of dimensionless,
meaning dimensionless with only abritrary variations in scale or
multiplier values; False otherwise.
"""
return _libsbml.UnitDefinition_isVariantOfDimensionless(self)
def isVariantOfMass(self):
"""
isVariantOfMass(UnitDefinition self) -> bool
Convenience function for testing if a given unit definition is a
variant of the predefined unit identifier 'mass'.
Returns True if this UnitDefinition is a variant of mass units,
meaning gram or kilogram with only abritrary variations in scale or
multiplier values; False otherwise.
"""
return _libsbml.UnitDefinition_isVariantOfMass(self)
def isVariantOfSubstancePerTime(self):
"""
isVariantOfSubstancePerTime(UnitDefinition self) -> bool
Convenience function for testing if a given unit definition is a
variant of the predefined unit 'substance' divided by the predefined
unit 'time'.
Returns True if this UnitDefinition is a variant of the predefined
unit substance per predefined unit time, meaning it contains two units
one of which is a variant of substance and the other is a variant of
time which an exponent of -1; False otherwise.
"""
return _libsbml.UnitDefinition_isVariantOfSubstancePerTime(self)
def addUnit(self, u):
"""
addUnit(UnitDefinition self, Unit u) -> int
Adds a copy of the given Unit to this UnitDefinition.
Parameter 'u' is the Unit instance to add to this UnitDefinition.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_LEVEL_MISMATCH
* LIBSBML_VERSION_MISMATCH
* LIBSBML_INVALID_OBJECT
* LIBSBML_OPERATION_FAILED
Note:
This method should be used with some caution. The fact that this
method copies the object passed to it means that the caller will be
left holding a physically different object instance than the one
contained inside this object. Changes made to the original object
instance (such as resetting attribute values) will not affect the
instance in this object. In addition, the caller should make sure to
free the original object if it is no longer being used, or else a
memory leak will result. Please see other methods on this class
(particularly a corresponding method whose name begins with the word
create) for alternatives that do not lead to these issues.
See also createUnit().
"""
return _libsbml.UnitDefinition_addUnit(self, u)
def createUnit(self):
"""
createUnit(UnitDefinition self) -> Unit
Creates a new and empty Unit, adds it to this UnitDefinition's list of
units, and returns it.
Returns a newly constructed (and empty) Unit instance.
Note:
It is worth emphasizing that the attribute 'kind' value of a Unit is a
required attribute for a valid Unit definition. The createUnit()
method does not assign a valid kind to the constructed unit (instead,
it sets the 'kind' to UNIT_KIND_INVALID). Callers are cautioned to set
the newly-constructed Unit's kind using Unit.setKind() soon after
calling this method.
See also addUnit().
"""
return _libsbml.UnitDefinition_createUnit(self)
def getListOfUnits(self, *args):
"""
getListOfUnits(UnitDefinition self) -> ListOfUnits
getListOfUnits(UnitDefinition self) -> ListOfUnits
Returns the list of Units for this UnitDefinition instance. Returns
the ListOfUnits value for this UnitDefinition.
"""
return _libsbml.UnitDefinition_getListOfUnits(self, *args)
def getUnit(self, *args):
"""
getUnit(UnitDefinition self, unsigned int n) -> Unit
getUnit(UnitDefinition self, unsigned int n) -> Unit
Returns a specific Unit instance belonging to this UnitDefinition.
Parameter 'n' is an integer, the index of the Unit to be returned.
Returns the nth Unit of this UnitDefinition.
See also getNumUnits().
"""
return _libsbml.UnitDefinition_getUnit(self, *args)
def getNumUnits(self):
"""
getNumUnits(UnitDefinition self) -> unsigned int
Returns the number of Unit objects contained within this
UnitDefinition.
Returns an integer representing the number of Units in this
UnitDefinition.
"""
return _libsbml.UnitDefinition_getNumUnits(self)
def removeUnit(self, n):
"""
removeUnit(UnitDefinition self, unsigned int n) -> Unit
Removes the nth Unit object from this UnitDefinition object and
returns a pointer to it.
The caller owns the returned object and is responsible for deleting
it.
Parameter 'n' is the index of the Unit object to remove
Returns the Unit object removed, or None if the given index is out of
range.
"""
return _libsbml.UnitDefinition_removeUnit(self, n)
def connectToChild(self):
"""connectToChild(UnitDefinition self)"""
return _libsbml.UnitDefinition_connectToChild(self)
def enablePackageInternal(self, pkgURI, pkgPrefix, flag):
"""
enablePackageInternal(UnitDefinition self, string pkgURI, string pkgPrefix, bool flag)
Internal implementation method.
"""
return _libsbml.UnitDefinition_enablePackageInternal(self, pkgURI, pkgPrefix, flag)
def getTypeCode(self):
"""
getTypeCode(UnitDefinition self) -> int
Returns the libSBML type code for this object instance.
LibSBML attaches an identifying code to every kind of SBML object.
These are integer constants known as SBML type codes. The names of
all the codes begin with the characters SBML_. In the Python language
interface for libSBML, the type codes are defined as static integer
constants in the interface class 'libsbml'. Note that different Level
3 package plug-ins may use overlapping type codes; to identify the
package to which a given object belongs, call the getPackageName()
method on the object.
Returns the SBML type code for this object: SBML_UNIT_DEFINITION
(default).
WARNING:
The specific integer values of the possible type codes may be reused
by different Level 3 package plug-ins. Thus, to identifiy the correct
code, it is necessary to invoke both getTypeCode() and
getPackageName().
See also getPackageName(), getElementName().
"""
return _libsbml.UnitDefinition_getTypeCode(self)
def getElementName(self):
"""
getElementName(UnitDefinition self) -> string
Returns the XML element name of this object, which for UnitDefinition,
is always 'unitDefinition'.
Returns the name of this element, i.e., 'unitDefinition'.
"""
return _libsbml.UnitDefinition_getElementName(self)
def simplify(ud):
"""
simplify(UnitDefinition ud)
Simplifies the UnitDefinition such that any given kind of Unit object
occurs only once in the ListOfUnits.
For example, the following definition,
will be simplified to
Parameter 'ud' is the UnitDefinition object to be simplified.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.UnitDefinition_simplify(ud)
if _newclass:
simplify = staticmethod(simplify)
__swig_getmethods__["simplify"] = lambda x: simplify
def reorder(ud):
"""
reorder(UnitDefinition ud)
Alphabetically orders the Unit objects within the ListOfUnits of a
UnitDefinition.
Parameter 'ud' is the UnitDefinition object whose units are to be
reordered.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.UnitDefinition_reorder(ud)
if _newclass:
reorder = staticmethod(reorder)
__swig_getmethods__["reorder"] = lambda x: reorder
def convertToSI(ud):
"""
convertToSI(UnitDefinition ud) -> UnitDefinition
Convert a given UnitDefinition into a new UnitDefinition object that
uses SI units.
Parameter 'ud' is the UnitDefinition object to convert to SI
Returns a new UnitDefinition object representing the results of the
conversion.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.UnitDefinition_convertToSI(ud)
if _newclass:
convertToSI = staticmethod(convertToSI)
__swig_getmethods__["convertToSI"] = lambda x: convertToSI
def areIdentical(ud1, ud2):
"""
areIdentical(UnitDefinition ud1, UnitDefinition ud2) -> bool
Predicate returning True if two UnitDefinition objects are identical.
For the purposes of performing this comparison, two UnitDefinition
objects are considered identical when they contain identical lists of
Unit objects. Pairs of Unit objects in the lists are in turn
considered identical if they satisfy the predicate
Unit.areIdentical(). The predicate compares every attribute of the
Unit objects.
Parameter 'ud1' is the first UnitDefinition object to compare
Parameter 'ud2' is the second UnitDefinition object to compare
Returns True if all the Unit objects in ud1 are identical to the Unit
objects of ud2, False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
See also UnitDefinition.areEquivalent(), Unit.areIdentical().
"""
return _libsbml.UnitDefinition_areIdentical(ud1, ud2)
if _newclass:
areIdentical = staticmethod(areIdentical)
__swig_getmethods__["areIdentical"] = lambda x: areIdentical
def areEquivalent(ud1, ud2):
"""
areEquivalent(UnitDefinition ud1, UnitDefinition ud2) -> bool
Predicate returning True if two UnitDefinition objects are equivalent.
For the purposes of performing this comparison, two UnitDefinition
objects are considered equivalent when they contain equivalent list of
Unit objects. Unit objects are in turn considered equivalent if they
satisfy the predicate Unit.areEquivalent(). The predicate tests a
subset of the objects's attributes.
Parameter 'ud1' is the first UnitDefinition object to compare
Parameter 'ud2' is the second UnitDefinition object to compare
Returns True if all the Unit objects in ud1 are equivalent to the Unit
objects in ud2, False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
See also UnitDefinition.areIdentical(), Unit.areEquivalent().
"""
return _libsbml.UnitDefinition_areEquivalent(ud1, ud2)
if _newclass:
areEquivalent = staticmethod(areEquivalent)
__swig_getmethods__["areEquivalent"] = lambda x: areEquivalent
def combine(ud1, ud2):
"""
combine(UnitDefinition ud1, UnitDefinition ud2) -> UnitDefinition
Combines two UnitDefinition objects into a single UnitDefinition.
This takes UnitDefinition objects 'ud1' and 'ud2', and creates a
UnitDefinition object that expresses the product of the units of 'ud1'
and 'ud2'.
Parameter 'ud1' is the first UnitDefinition object Parameter 'ud2' is
the second UnitDefinition object
Returns a UnitDefinition which represents the product of the units of
the two argument UnitDefinitions.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.UnitDefinition_combine(ud1, ud2)
if _newclass:
combine = staticmethod(combine)
__swig_getmethods__["combine"] = lambda x: combine
def divide(ud1, ud2):
"""
divide(UnitDefinition ud1, UnitDefinition ud2) -> UnitDefinition
Combines two UnitDefinition objects into a single UnitDefinition as a
division.
This takes UnitDefinition objects 'ud1' and 'ud2', and creates a
UnitDefinition object that expresses the division of the units of
'ud1' and 'ud2'.
Parameter 'ud1' is the first UnitDefinition object Parameter 'ud2' is
the second UnitDefinition object
Returns a UnitDefinition which represents the division of the units
of the two argument UnitDefinitions.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.UnitDefinition_divide(ud1, ud2)
if _newclass:
divide = staticmethod(divide)
__swig_getmethods__["divide"] = lambda x: divide
def printUnits(ud, compact=False):
"""
printUnits(UnitDefinition ud, bool compact=False) -> string
printUnits(UnitDefinition ud) -> string
Expresses the given definition in a plain-text form.
For example, UnitDefinition.printUnits() applied to
will return the string 'metre (exponent = 1, multiplier = 1, scale =
0) second (exponent = -2, multiplier = 1, scale = 0)' or, if the
optional parameter 'compact' is given the value True, the string '(1
metre)^1 (1 second)^-2'. This method may be useful for printing unit
information to human users, or in debugging software, or other
situations.
Parameter 'ud' is the UnitDefinition object Parameter 'compact' is
boolean indicating whether the compact form should be used (defaults
to false)
Returns a string expressing the unit definition defined by the given
UnitDefinition object 'ud'.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.UnitDefinition_printUnits(ud, compact)
if _newclass:
printUnits = staticmethod(printUnits)
__swig_getmethods__["printUnits"] = lambda x: printUnits
def hasRequiredAttributes(self):
"""
hasRequiredAttributes(UnitDefinition self) -> bool
Predicate returning True if all the required attributes for this
UnitDefinition object have been set.
The required attributes for a UnitDefinition object are:
* 'id'
Returns True if the required attributes have been set, False
otherwise.
"""
return _libsbml.UnitDefinition_hasRequiredAttributes(self)
def hasRequiredElements(self):
"""
hasRequiredElements(UnitDefinition self) -> bool
Predicate returning True if all the required elements for this
UnitDefinition object have been set.
Note:
The required elements for a Constraint object are:
* 'listOfUnits' (required in SBML Level 2 only, optional in Level
3)
Returns a boolean value indicating whether all the required elements
for this object have been defined.
"""
return _libsbml.UnitDefinition_hasRequiredElements(self)
UnitDefinition_swigregister = _libsbml.UnitDefinition_swigregister
UnitDefinition_swigregister(UnitDefinition)
def UnitDefinition_simplify(ud):
"""
UnitDefinition_simplify(UnitDefinition ud)
Simplifies the UnitDefinition such that any given kind of Unit object
occurs only once in the ListOfUnits.
For example, the following definition,
will be simplified to
Parameter 'ud' is the UnitDefinition object to be simplified.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.UnitDefinition_simplify(ud)
def UnitDefinition_reorder(ud):
"""
UnitDefinition_reorder(UnitDefinition ud)
Alphabetically orders the Unit objects within the ListOfUnits of a
UnitDefinition.
Parameter 'ud' is the UnitDefinition object whose units are to be
reordered.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.UnitDefinition_reorder(ud)
def UnitDefinition_convertToSI(ud):
"""
UnitDefinition_convertToSI(UnitDefinition ud) -> UnitDefinition
Convert a given UnitDefinition into a new UnitDefinition object that
uses SI units.
Parameter 'ud' is the UnitDefinition object to convert to SI
Returns a new UnitDefinition object representing the results of the
conversion.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.UnitDefinition_convertToSI(ud)
def UnitDefinition_areIdentical(ud1, ud2):
"""
UnitDefinition_areIdentical(UnitDefinition ud1, UnitDefinition ud2) -> bool
Predicate returning True if two UnitDefinition objects are identical.
For the purposes of performing this comparison, two UnitDefinition
objects are considered identical when they contain identical lists of
Unit objects. Pairs of Unit objects in the lists are in turn
considered identical if they satisfy the predicate
Unit.areIdentical(). The predicate compares every attribute of the
Unit objects.
Parameter 'ud1' is the first UnitDefinition object to compare
Parameter 'ud2' is the second UnitDefinition object to compare
Returns True if all the Unit objects in ud1 are identical to the Unit
objects of ud2, False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
See also UnitDefinition.areEquivalent(), Unit.areIdentical().
"""
return _libsbml.UnitDefinition_areIdentical(ud1, ud2)
def UnitDefinition_areEquivalent(ud1, ud2):
"""
UnitDefinition_areEquivalent(UnitDefinition ud1, UnitDefinition ud2) -> bool
Predicate returning True if two UnitDefinition objects are equivalent.
For the purposes of performing this comparison, two UnitDefinition
objects are considered equivalent when they contain equivalent list of
Unit objects. Unit objects are in turn considered equivalent if they
satisfy the predicate Unit.areEquivalent(). The predicate tests a
subset of the objects's attributes.
Parameter 'ud1' is the first UnitDefinition object to compare
Parameter 'ud2' is the second UnitDefinition object to compare
Returns True if all the Unit objects in ud1 are equivalent to the Unit
objects in ud2, False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
See also UnitDefinition.areIdentical(), Unit.areEquivalent().
"""
return _libsbml.UnitDefinition_areEquivalent(ud1, ud2)
def UnitDefinition_combine(ud1, ud2):
"""
UnitDefinition_combine(UnitDefinition ud1, UnitDefinition ud2) -> UnitDefinition
Combines two UnitDefinition objects into a single UnitDefinition.
This takes UnitDefinition objects 'ud1' and 'ud2', and creates a
UnitDefinition object that expresses the product of the units of 'ud1'
and 'ud2'.
Parameter 'ud1' is the first UnitDefinition object Parameter 'ud2' is
the second UnitDefinition object
Returns a UnitDefinition which represents the product of the units of
the two argument UnitDefinitions.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.UnitDefinition_combine(ud1, ud2)
def UnitDefinition_divide(ud1, ud2):
"""
UnitDefinition_divide(UnitDefinition ud1, UnitDefinition ud2) -> UnitDefinition
Combines two UnitDefinition objects into a single UnitDefinition as a
division.
This takes UnitDefinition objects 'ud1' and 'ud2', and creates a
UnitDefinition object that expresses the division of the units of
'ud1' and 'ud2'.
Parameter 'ud1' is the first UnitDefinition object Parameter 'ud2' is
the second UnitDefinition object
Returns a UnitDefinition which represents the division of the units
of the two argument UnitDefinitions.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.UnitDefinition_divide(ud1, ud2)
def UnitDefinition_printUnits(ud, compact=False):
"""
printUnits(UnitDefinition ud, bool compact=False) -> string
UnitDefinition_printUnits(UnitDefinition ud) -> string
Expresses the given definition in a plain-text form.
For example, UnitDefinition.printUnits() applied to
will return the string 'metre (exponent = 1, multiplier = 1, scale =
0) second (exponent = -2, multiplier = 1, scale = 0)' or, if the
optional parameter 'compact' is given the value True, the string '(1
metre)^1 (1 second)^-2'. This method may be useful for printing unit
information to human users, or in debugging software, or other
situations.
Parameter 'ud' is the UnitDefinition object Parameter 'compact' is
boolean indicating whether the compact form should be used (defaults
to false)
Returns a string expressing the unit definition defined by the given
UnitDefinition object 'ud'.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.UnitDefinition_printUnits(ud, compact)
class ListOfUnitDefinitions(ListOf):
"""
A list of UnitDefinition objects.
The various ListOf___ classes in SBML are merely containers used for
organizing the main components of an SBML model. In libSBML's
implementation, ListOf___ classes are derived from the intermediate
utility class ListOf, which is not defined by the SBML specifications
but serves as a useful programmatic construct. ListOf is itself is in
turn derived from SBase, which provides all of the various ListOf___
classes with common features defined by the SBML specification, such
as 'metaid' attributes and annotations.
The relationship between the lists and the rest of an SBML model is
illustrated by the following (for SBML Level 2 Version 4):
...
...
...
...
...
...
... elements of subclasses of Rule ...
...
...
...
Readers may wonder about the motivations for using the ListOf___
containers in SBML. A simpler approach in XML might be to place the
components all directly at the top level of the model definition. The
choice made in SBML is to group them within XML elements named after
ListOfClassname, in part because it helps organize the components.
More importantly, the fact that the container classes are derived from
SBase means that software tools can add information about the lists
themselves into each list container's 'annotation'.
See also ListOfFunctionDefinitions, ListOfUnitDefinitions,
ListOfCompartmentTypes, ListOfSpeciesTypes, ListOfCompartments,
ListOfSpecies, ListOfParameters, ListOfInitialAssignments,
ListOfRules, ListOfConstraints, ListOfReactions, ListOfEvents.
"""
__swig_setmethods__ = {}
for _s in [ListOf]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, ListOfUnitDefinitions, name, value)
__swig_getmethods__ = {}
for _s in [ListOf]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, ListOfUnitDefinitions, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(ListOfUnitDefinitions self, unsigned int level, unsigned int version) -> ListOfUnitDefinitions
__init__(ListOfUnitDefinitions self, SBMLNamespaces sbmlns) -> ListOfUnitDefinitions
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
ListOfUnitDefinitions(SBMLNamespaces sbmlns)
Creates a new ListOfUnitDefinitions object.
The object is constructed such that it is valid for the SBML Level and
Version combination determined by the SBMLNamespaces object in
'sbmlns'.
Parameter 'sbmlns' is an SBMLNamespaces object that is used to
determine the characteristics of the ListOfUnitDefinitions object to
be created.
______________________________________________________________________
Method variant with the following signature:
ListOfUnitDefinitions(long level, long version)
Creates a new ListOfUnitDefinitions object.
The object is constructed such that it is valid for the given SBML
Level and Version combination.
Parameter 'level' is the SBML Level
Parameter 'version' is the Version within the SBML Level
"""
this = _libsbml.new_ListOfUnitDefinitions(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(ListOfUnitDefinitions self) -> ListOfUnitDefinitions
Creates and returns a deep copy of this ListOfUnitDefinitions object.
Returns the (deep) copy of this ListOfUnitDefinitions object.
"""
return _libsbml.ListOfUnitDefinitions_clone(self)
def getItemTypeCode(self):
"""
getItemTypeCode(ListOfUnitDefinitions self) -> int
Returns the libSBML type code for the objects contained in this ListOf
(i.e., UnitDefinition objects, if the list is non-empty).
LibSBML attaches an identifying code to every kind of SBML object.
These are integer constants known as SBML type codes. The names of
all the codes begin with the characters SBML_. In the Python language
interface for libSBML, the type codes are defined as static integer
constants in the interface class 'libsbml'. Note that different Level
3 package plug-ins may use overlapping type codes; to identify the
package to which a given object belongs, call the getPackageName()
method on the object.
Returns the SBML type code for objects contained in this list:
SBML_UNIT_DEFINITION (default).
See also getElementName(), getPackageName().
"""
return _libsbml.ListOfUnitDefinitions_getItemTypeCode(self)
def getElementName(self):
"""
getElementName(ListOfUnitDefinitions self) -> string
Returns the XML element name of this object.
For ListOfUnitDefinitions, the XML element name is
'listOfUnitDefinitions'.
Returns the name of this element, i.e., 'listOfUnitDefinitions'.
"""
return _libsbml.ListOfUnitDefinitions_getElementName(self)
def get(self, *args):
"""
get(ListOfUnitDefinitions self, unsigned int n) -> UnitDefinition
get(ListOfUnitDefinitions self, unsigned int n) -> UnitDefinition
get(ListOfUnitDefinitions self, string sid) -> UnitDefinition
get(ListOfUnitDefinitions self, string sid) -> UnitDefinition
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
get(string sid)
Get a UnitDefinition from the ListOfUnitDefinitions based on its
identifier.
Parameter 'sid' is a string representing the identifier of the
UnitDefinition to get.
Returns UnitDefinition in this ListOfUnitDefinitions with the given
'sid' or None if no such UnitDefinition exists.
See also get(), size(), size().
"""
return _libsbml.ListOfUnitDefinitions_get(self, *args)
def getElementBySId(self, id):
"""
getElementBySId(ListOfUnitDefinitions self, string id) -> SBase
Returns the first child element found that has the given 'id' in the
model-wide SId namespace, or None if no such object is found.
Note that UnitDefinitions themselves are in the UnitId namespace, not
the SId namespace, so no UnitDefinition object will be returned from
this function (and is the reason we override the base
ListOf::getElementBySId function here).
Parameter 'id' is string representing the id of objects to find
Returns pointer to the first element found with the given 'id'.
"""
return _libsbml.ListOfUnitDefinitions_getElementBySId(self, id)
def remove(self, *args):
"""
remove(ListOfUnitDefinitions self, unsigned int n) -> UnitDefinition
remove(ListOfUnitDefinitions self, string sid) -> UnitDefinition
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
remove(string sid)
Removes item in this ListOfUnitDefinitions items with the given
identifier.
The caller owns the returned item and is responsible for deleting it.
If none of the items in this list have the identifier 'sid', then None
is returned.
Parameter 'sid' is the identifier of the item to remove
Returns the item removed. As mentioned above, the caller owns the
returned item.
______________________________________________________________________
Method variant with the following signature:
remove(long n)
Removes the nth item from this ListOfUnitDefinitions items and returns
a pointer to it.
The caller owns the returned item and is responsible for deleting it.
Parameter 'n' is the index of the item to remove
See also size().
"""
return _libsbml.ListOfUnitDefinitions_remove(self, *args)
__swig_destroy__ = _libsbml.delete_ListOfUnitDefinitions
__del__ = lambda self: None
ListOfUnitDefinitions_swigregister = _libsbml.ListOfUnitDefinitions_swigregister
ListOfUnitDefinitions_swigregister(ListOfUnitDefinitions)
class CompartmentType(SBase):
"""
A compartment type in SBML Level 2.
SBML Level 2 Versions 2-4 provide the compartment type as a grouping
construct that can be used to establish a relationship between
multiple Compartment objects. A CompartmentType object only has an
identity, and this identity can only be used to indicate that
particular Compartment objects in the model belong to this type. This
may be useful for conveying a modeling intention, such as when a model
contains many similar compartments, either by their biological
function or the reactions they carry. Without a compartment type
construct, it would be impossible within SBML itself to indicate that
all of the compartments share an underlying conceptual relationship
because each SBML compartment must be given a unique and separate
identity. Compartment types have no mathematical meaning in SBML---
they have no effect on a model's mathematical interpretation.
Simulators and other numerical analysis software may ignore
CompartmentType definitions and references to them in a model.
There is no mechanism in SBML Level 2 for representing hierarchies of
compartment types. One CompartmentType instance cannot be the subtype
of another CompartmentType instance; SBML provides no means of
defining such relationships.
As with other major structures in SBML, CompartmentType has a
mandatory attribute, 'id', used to give the compartment type an
identifier. The identifier must be a text string conforming to the
identifer syntax permitted in SBML. CompartmentType also has an
optional 'name' attribute, of type string. The 'id' and 'name' must
be used according to the guidelines described in the SBML
specification (e.g., Section 3.3 in the Level 2 Version 4
specification).
CompartmentType was introduced in SBML Level 2 Version 2. It is not
available in SBML Level 1 nor in Level 3.
See also Compartment, ListOfCompartmentTypes, SpeciesType,
ListOfSpeciesTypes.
"""
__swig_setmethods__ = {}
for _s in [SBase]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, CompartmentType, name, value)
__swig_getmethods__ = {}
for _s in [SBase]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, CompartmentType, name)
__repr__ = _swig_repr
__swig_destroy__ = _libsbml.delete_CompartmentType
__del__ = lambda self: None
def __init__(self, *args):
"""
__init__(CompartmentType self, unsigned int level, unsigned int version) -> CompartmentType
__init__(CompartmentType self, SBMLNamespaces sbmlns) -> CompartmentType
__init__(CompartmentType self, CompartmentType orig) -> CompartmentType
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
CompartmentType(SBMLNamespaces sbmlns)
Creates a new CompartmentType object using the given SBMLNamespaces
object 'sbmlns'.
The SBMLNamespaces object encapsulates SBML Level/Version/namespaces
information. It is used to communicate the SBML Level, Version, and
(in Level 3) packages used in addition to SBML Level 3 Core. A common
approach to using libSBML's SBMLNamespaces facilities is to create an
SBMLNamespaces object somewhere in a program once, then hand that
object as needed to object constructors that accept SBMLNamespaces as
arguments.
It is worth emphasizing that although this constructor does not take
an identifier argument, in SBML Level 2 and beyond, the 'id'
(identifier) attribute of a CompartmentType object is required to have
a value. Thus, callers are cautioned to assign a value after calling
this constructor. Setting the identifier can be accomplished using
the method setId().
Parameter 'sbmlns' is an SBMLNamespaces object.
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
______________________________________________________________________
Method variant with the following signature:
CompartmentType(long level, long version)
Creates a new CompartmentType object using the given SBML 'level' and
'version' values.
Parameter 'level' is a long integer, the SBML Level to assign to this
CompartmentType
Parameter 'version' is a long integer, the SBML Version to assign to
this CompartmentType
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
______________________________________________________________________
Method variant with the following signature:
CompartmentType(CompartmentType orig)
Copy constructor; creates a copy of this CompartmentType object.
Parameter 'orig' is the object to copy.
Throws SBMLConstructorException: Thrown if the argument 'orig' is
None.
"""
this = _libsbml.new_CompartmentType(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(CompartmentType self) -> CompartmentType
Creates and returns a deep copy of this CompartmentType object.
Returns the (deep) copy of this CompartmentType object.
"""
return _libsbml.CompartmentType_clone(self)
def getId(self):
"""
getId(CompartmentType self) -> string
Returns the value of the 'id' attribute of this CompartmentType
object.
Returns the identifier of this CompartmentType object.
See also getName(), setId(), unsetId(), isSetId().
"""
return _libsbml.CompartmentType_getId(self)
def getName(self):
"""
getName(CompartmentType self) -> string
Returns the value of the 'name' attribute of this CompartmentType
object.
Returns the name of this CompartmentType object.
See also getId(), isSetName(), setName(), unsetName().
"""
return _libsbml.CompartmentType_getName(self)
def isSetId(self):
"""
isSetId(CompartmentType self) -> bool
Predicate returning True if this CompartmentType object's 'id'
attribute is set.
Returns True if the 'id' attribute of this CompartmentType object is
set, False otherwise.
See also getId(), unsetId(), setId().
"""
return _libsbml.CompartmentType_isSetId(self)
def isSetName(self):
"""
isSetName(CompartmentType self) -> bool
Predicate returning True if this CompartmentType object's 'name'
attribute is set.
Returns True if the 'name' attribute of this CompartmentType object is
set, False otherwise.
See also getName(), setName(), unsetName().
"""
return _libsbml.CompartmentType_isSetName(self)
def setId(self, sid):
"""
setId(CompartmentType self, string sid) -> int
Sets the value of the 'id' attribute of this CompartmentType object.
The string 'sid' is copied.
SBML has strict requirements for the syntax of identifiers, that is,
the values of the 'id' attribute present on most types of SBML
objects. The following is a summary of the definition of the SBML
identifier type SId, which defines the permitted syntax of
identifiers. We express the syntax using an extended form of BNF
notation:
letter ::= 'a'..'z','A'..'Z'
digit ::= '0'..'9'
idChar ::= letter | digit | '_'
SId ::= ( letter | '_' ) idChar*
The characters ( and ) are used for grouping, the character * 'zero or
more times', and the character | indicates logical 'or'. The equality
of SBML identifiers is determined by an exact character sequence
match; i.e., comparisons must be performed in a case-sensitive manner.
In addition, there are a few conditions for the uniqueness of
identifiers in an SBML model. Please consult the SBML specifications
for the exact details of the uniqueness requirements.
Parameter 'sid' is the string to use as the identifier of this
CompartmentType
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
See also getId(), unsetId(), isSetId().
"""
return _libsbml.CompartmentType_setId(self, sid)
def setName(self, name):
"""
setName(CompartmentType self, string name) -> int
Sets the value of the 'name' attribute of this CompartmentType object.
The string in 'name' is copied.
Parameter 'name' is the new name for the CompartmentType
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
See also getName(), isSetName(), unsetName().
"""
return _libsbml.CompartmentType_setName(self, name)
def unsetName(self):
"""
unsetName(CompartmentType self) -> int
Unsets the value of the 'name' attribute of this CompartmentType
object.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
See also getName(), setName(), isSetName().
"""
return _libsbml.CompartmentType_unsetName(self)
def getTypeCode(self):
"""
getTypeCode(CompartmentType self) -> int
Returns the libSBML type code for this SBML object.
LibSBML attaches an identifying code to every kind of SBML object.
These are integer constants known as SBML type codes. The names of
all the codes begin with the characters SBML_. In the Python language
interface for libSBML, the type codes are defined as static integer
constants in the interface class 'libsbml'. Note that different Level
3 package plug-ins may use overlapping type codes; to identify the
package to which a given object belongs, call the getPackageName()
method on the object.
Returns the SBML type code for this object: SBML_COMPARTMENT_TYPE
(default).
WARNING:
The specific integer values of the possible type codes may be reused
by different Level 3 package plug-ins. Thus, to identifiy the correct
code, it is necessary to invoke both getTypeCode() and
getPackageName().
See also getElementName(), getPackageName().
"""
return _libsbml.CompartmentType_getTypeCode(self)
def getElementName(self):
"""
getElementName(CompartmentType self) -> string
Returns the XML element name of this object
For CompartmentType, the element name is always 'compartmentType'.
Returns the name of this element.
See also getTypeCode(), getPackageName().
"""
return _libsbml.CompartmentType_getElementName(self)
def hasRequiredAttributes(self):
"""
hasRequiredAttributes(CompartmentType self) -> bool
Predicate returning True if all the required attributes for this
CompartmentType object have been set.
The required attributes for a CompartmentType object are:
* 'id'
Returns True if the required attributes have been set, False
otherwise.
"""
return _libsbml.CompartmentType_hasRequiredAttributes(self)
CompartmentType_swigregister = _libsbml.CompartmentType_swigregister
CompartmentType_swigregister(CompartmentType)
class ListOfCompartmentTypes(ListOf):
"""
A list of CompartmentType objects.
The various ListOf___ classes in SBML are merely containers used for
organizing the main components of an SBML model. In libSBML's
implementation, ListOf___ classes are derived from the intermediate
utility class ListOf, which is not defined by the SBML specifications
but serves as a useful programmatic construct. ListOf is itself is in
turn derived from SBase, which provides all of the various ListOf___
classes with common features defined by the SBML specification, such
as 'metaid' attributes and annotations.
The relationship between the lists and the rest of an SBML model is
illustrated by the following (for SBML Level 2 Version 4):
...
...
...
...
...
...
... elements of subclasses of Rule ...
...
...
...
Readers may wonder about the motivations for using the ListOf___
containers in SBML. A simpler approach in XML might be to place the
components all directly at the top level of the model definition. The
choice made in SBML is to group them within XML elements named after
ListOfClassname, in part because it helps organize the components.
More importantly, the fact that the container classes are derived from
SBase means that software tools can add information about the lists
themselves into each list container's 'annotation'.
See also ListOfFunctionDefinitions, ListOfUnitDefinitions,
ListOfCompartmentTypes, ListOfSpeciesTypes, ListOfCompartments,
ListOfSpecies, ListOfParameters, ListOfInitialAssignments,
ListOfRules, ListOfConstraints, ListOfReactions, ListOfEvents.
"""
__swig_setmethods__ = {}
for _s in [ListOf]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, ListOfCompartmentTypes, name, value)
__swig_getmethods__ = {}
for _s in [ListOf]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, ListOfCompartmentTypes, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(ListOfCompartmentTypes self, unsigned int level, unsigned int version) -> ListOfCompartmentTypes
__init__(ListOfCompartmentTypes self, SBMLNamespaces sbmlns) -> ListOfCompartmentTypes
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
ListOfCompartmentTypes(SBMLNamespaces sbmlns)
Creates a new ListOfCompartmentTypes object.
The object is constructed such that it is valid for the SBML Level and
Version combination determined by the SBMLNamespaces object in
'sbmlns'.
Parameter 'sbmlns' is an SBMLNamespaces object that is used to
determine the characteristics of the ListOfCompartmentTypes object to
be created.
______________________________________________________________________
Method variant with the following signature:
ListOfCompartmentTypes(long level, long version)
Creates a new ListOfCompartmentTypes object.
The object is constructed such that it is valid for the given SBML
Level and Version combination.
Parameter 'level' is the SBML Level
Parameter 'version' is the Version within the SBML Level
"""
this = _libsbml.new_ListOfCompartmentTypes(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(ListOfCompartmentTypes self) -> ListOfCompartmentTypes
Creates and returns a deep copy of this ListOfCompartmentTypes object.
Returns the (deep) copy of this ListOfCompartmentTypes object.
"""
return _libsbml.ListOfCompartmentTypes_clone(self)
def getItemTypeCode(self):
"""
getItemTypeCode(ListOfCompartmentTypes self) -> int
Returns the libSBML type code for the objects contained in this ListOf
(i.e., CompartmentType objects, if the list is non-empty).
LibSBML attaches an identifying code to every kind of SBML object.
These are integer constants known as SBML type codes. The names of
all the codes begin with the characters SBML_. In the Python language
interface for libSBML, the type codes are defined as static integer
constants in the interface class 'libsbml'. Note that different Level
3 package plug-ins may use overlapping type codes; to identify the
package to which a given object belongs, call the getPackageName()
method on the object.
Returns the SBML type code for the objects contained in this ListOf
instance: SBML_COMPARTMENT_TYPE (default).
See also getElementName(), getPackageName().
"""
return _libsbml.ListOfCompartmentTypes_getItemTypeCode(self)
def getElementName(self):
"""
getElementName(ListOfCompartmentTypes self) -> string
Returns the XML element name of this object.
For ListOfCompartmentTypes, the XML element name is
'listOfCompartmentTypes'.
Returns the name of this element, i.e., 'listOfCompartmentTypes'.
"""
return _libsbml.ListOfCompartmentTypes_getElementName(self)
def get(self, *args):
"""
get(ListOfCompartmentTypes self, unsigned int n) -> CompartmentType
get(ListOfCompartmentTypes self, unsigned int n) -> CompartmentType
get(ListOfCompartmentTypes self, string sid) -> CompartmentType
get(ListOfCompartmentTypes self, string sid) -> CompartmentType
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
get(string sid)
Get a CompartmentType object from the ListOfCompartmentTypes based on
its identifier.
Parameter 'sid' is a string representing the identifier of the
CompartmentType object to get.
Returns CompartmentType object in this ListOfCompartmentTypes with the
given 'sid' or None if no such CompartmentType object exists.
See also get(), size(), size().
"""
return _libsbml.ListOfCompartmentTypes_get(self, *args)
def remove(self, *args):
"""
remove(ListOfCompartmentTypes self, unsigned int n) -> CompartmentType
remove(ListOfCompartmentTypes self, string sid) -> CompartmentType
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
remove(string sid)
Removes item in this ListOfCompartmentTypes items with the given
identifier.
The caller owns the returned item and is responsible for deleting it.
If none of the items in this list have the identifier 'sid', then None
is returned.
Parameter 'sid' is the identifier of the item to remove
Returns the item removed. As mentioned above, the caller owns the
returned item.
______________________________________________________________________
Method variant with the following signature:
remove(long n)
Removes the nth item from this ListOfCompartmentTypes items and
returns a pointer to it.
The caller owns the returned item and is responsible for deleting it.
Parameter 'n' is the index of the item to remove
See also size().
"""
return _libsbml.ListOfCompartmentTypes_remove(self, *args)
__swig_destroy__ = _libsbml.delete_ListOfCompartmentTypes
__del__ = lambda self: None
ListOfCompartmentTypes_swigregister = _libsbml.ListOfCompartmentTypes_swigregister
ListOfCompartmentTypes_swigregister(ListOfCompartmentTypes)
class SpeciesType(SBase):
"""
A species type in SBML Level 2.
The term species type refers to reacting entities independent of
location. These include simple ions (e.g., protons, calcium), simple
molecules (e.g., glucose, ATP), large molecules (e.g., RNA,
polysaccharides, and proteins), and others.
SBML Level 2 Versions 2-4 provide an explicit SpeciesType class of
object to enable Species objects of the same type to be related
together. SpeciesType is a conceptual construct; the existence of
SpeciesType objects in a model has no effect on the model's numerical
interpretation. Except for the requirement for uniqueness of
species/species type combinations located in compartments, simulators
and other numerical analysis software may ignore SpeciesType
definitions and references to them in a model.
There is no mechanism in SBML Level 2 for representing hierarchies of
species types. One SpeciesType object cannot be the subtype of
another SpeciesType object; SBML provides no means of defining such
relationships.
As with other major structures in SBML, SpeciesType has a mandatory
attribute, 'id', used to give the species type an identifier. The
identifier must be a text string conforming to the identifer syntax
permitted in SBML. SpeciesType also has an optional 'name' attribute,
of type string. The 'id' and 'name' must be used according to the
guidelines described in the SBML specification (e.g., Section 3.3 in
the Level 2 Version 4 specification).
SpeciesType was introduced in SBML Level 2 Version 2. It is not
available in SBML Level 1 nor in Level 3.
See also Species, ListOfSpeciesTypes, CompartmentType,
ListOfCompartmentTypes.
"""
__swig_setmethods__ = {}
for _s in [SBase]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, SpeciesType, name, value)
__swig_getmethods__ = {}
for _s in [SBase]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, SpeciesType, name)
__repr__ = _swig_repr
__swig_destroy__ = _libsbml.delete_SpeciesType
__del__ = lambda self: None
def __init__(self, *args):
"""
__init__(SpeciesType self, unsigned int level, unsigned int version) -> SpeciesType
__init__(SpeciesType self, SBMLNamespaces sbmlns) -> SpeciesType
__init__(SpeciesType self, SpeciesType orig) -> SpeciesType
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
SpeciesType(SBMLNamespaces sbmlns)
Creates a new SpeciesType using the given SBMLNamespaces object
'sbmlns'.
The SBMLNamespaces object encapsulates SBML Level/Version/namespaces
information. It is used to communicate the SBML Level, Version, and
(in Level 3) packages used in addition to SBML Level 3 Core. A common
approach to using libSBML's SBMLNamespaces facilities is to create an
SBMLNamespaces object somewhere in a program once, then hand that
object as needed to object constructors that accept SBMLNamespaces as
arguments.
It is worth emphasizing that although this constructor does not take
an identifier argument, in SBML Level 2 and beyond, the 'id'
(identifier) attribute of a SpeciesType object is required to have a
value. Thus, callers are cautioned to assign a value after calling
this constructor. Setting the identifier can be accomplished using
the method SBase.setId().
Parameter 'sbmlns' is an SBMLNamespaces object.
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
______________________________________________________________________
Method variant with the following signature:
SpeciesType(long level, long version)
Creates a new SpeciesType using the given SBML 'level' and 'version'
values.
Parameter 'level' is a long integer, the SBML Level to assign to this
SpeciesType
Parameter 'version' is a long integer, the SBML Version to assign to
this SpeciesType
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
______________________________________________________________________
Method variant with the following signature:
SpeciesType(SpeciesType orig)
Copy constructor; creates a copy of this SpeciesType.
Parameter 'orig' is the object to copy.
Throws SBMLConstructorException: Thrown if the argument 'orig' is
None.
"""
this = _libsbml.new_SpeciesType(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(SpeciesType self) -> SpeciesType
Creates and returns a deep copy of this SpeciesType object.
Returns the (deep) copy of this SpeciesType object.
"""
return _libsbml.SpeciesType_clone(self)
def getId(self):
"""
getId(SpeciesType self) -> string
Returns the value of the 'id' attribute of this SpeciesType.
Returns the id of this SpeciesType.
"""
return _libsbml.SpeciesType_getId(self)
def getName(self):
"""
getName(SpeciesType self) -> string
Returns the value of the 'name' attribute of this SpeciesType.
Returns the name of this SpeciesType.
"""
return _libsbml.SpeciesType_getName(self)
def isSetId(self):
"""
isSetId(SpeciesType self) -> bool
Predicate returning True if this SpeciesType's 'id' attribute is set.
Returns True if the 'id' attribute of this SpeciesType is set, False
otherwise.
"""
return _libsbml.SpeciesType_isSetId(self)
def isSetName(self):
"""
isSetName(SpeciesType self) -> bool
Predicate returning True if this SpeciesType's 'name' attribute is
set.
Returns True if the 'name' attribute of this SpeciesType is set, False
otherwise.
"""
return _libsbml.SpeciesType_isSetName(self)
def setId(self, sid):
"""
setId(SpeciesType self, string sid) -> int
Sets the value of the 'id' attribute of this SpeciesType.
The string 'sid' is copied.
SBML has strict requirements for the syntax of identifiers, that is,
the values of the 'id' attribute present on most types of SBML
objects. The following is a summary of the definition of the SBML
identifier type SId, which defines the permitted syntax of
identifiers. We express the syntax using an extended form of BNF
notation:
letter ::= 'a'..'z','A'..'Z'
digit ::= '0'..'9'
idChar ::= letter | digit | '_'
SId ::= ( letter | '_' ) idChar*
The characters ( and ) are used for grouping, the character * 'zero or
more times', and the character | indicates logical 'or'. The equality
of SBML identifiers is determined by an exact character sequence
match; i.e., comparisons must be performed in a case-sensitive manner.
In addition, there are a few conditions for the uniqueness of
identifiers in an SBML model. Please consult the SBML specifications
for the exact details of the uniqueness requirements.
Parameter 'sid' is the string to use as the identifier of this
SpeciesType
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
"""
return _libsbml.SpeciesType_setId(self, sid)
def setName(self, name):
"""
setName(SpeciesType self, string name) -> int
Sets the value of the 'name' attribute of this SpeciesType.
The string in 'name' is copied.
Parameter 'name' is the new name for the SpeciesType
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
"""
return _libsbml.SpeciesType_setName(self, name)
def unsetName(self):
"""
unsetName(SpeciesType self) -> int
Unsets the value of the 'name' attribute of this SpeciesType.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
"""
return _libsbml.SpeciesType_unsetName(self)
def getTypeCode(self):
"""
getTypeCode(SpeciesType self) -> int
Returns the libSBML type code for this SBML object.
LibSBML attaches an identifying code to every kind of SBML object.
These are integer constants known as SBML type codes. The names of
all the codes begin with the characters SBML_. In the Python language
interface for libSBML, the type codes are defined as static integer
constants in the interface class 'libsbml'. Note that different Level
3 package plug-ins may use overlapping type codes; to identify the
package to which a given object belongs, call the getPackageName()
method on the object.
Returns the SBML type code for this object: SBML_SPECIES_TYPE
(default).
WARNING:
The specific integer values of the possible type codes may be reused
by different Level 3 package plug-ins. Thus, to identifiy the correct
code, it is necessary to invoke both getTypeCode() and
getPackageName().
See also getElementName(), getPackageName().
"""
return _libsbml.SpeciesType_getTypeCode(self)
def getElementName(self):
"""
getElementName(SpeciesType self) -> string
Returns the XML element name of this object, which for SpeciesType, is
always 'compartmentType'.
Returns the name of this element, i.e., 'compartmentType'.
"""
return _libsbml.SpeciesType_getElementName(self)
def hasRequiredAttributes(self):
"""
hasRequiredAttributes(SpeciesType self) -> bool
Predicate returning True if all the required attributes for this
SpeciesType object have been set.
The required attributes for a SpeciesType object are:
* 'id'
Returns True if the required attributes have been set, False
otherwise.
"""
return _libsbml.SpeciesType_hasRequiredAttributes(self)
SpeciesType_swigregister = _libsbml.SpeciesType_swigregister
SpeciesType_swigregister(SpeciesType)
class ListOfSpeciesTypes(ListOf):
"""
A list of SpeciesType objects.
The various ListOf___ classes in SBML are merely containers used for
organizing the main components of an SBML model. In libSBML's
implementation, ListOf___ classes are derived from the intermediate
utility class ListOf, which is not defined by the SBML specifications
but serves as a useful programmatic construct. ListOf is itself is in
turn derived from SBase, which provides all of the various ListOf___
classes with common features defined by the SBML specification, such
as 'metaid' attributes and annotations.
The relationship between the lists and the rest of an SBML model is
illustrated by the following (for SBML Level 2 Version 4):
...
...
...
...
...
...
... elements of subclasses of Rule ...
...
...
...
Readers may wonder about the motivations for using the ListOf___
containers in SBML. A simpler approach in XML might be to place the
components all directly at the top level of the model definition. The
choice made in SBML is to group them within XML elements named after
ListOfClassname, in part because it helps organize the components.
More importantly, the fact that the container classes are derived from
SBase means that software tools can add information about the lists
themselves into each list container's 'annotation'.
See also ListOfFunctionDefinitions, ListOfUnitDefinitions,
ListOfCompartmentTypes, ListOfSpeciesTypes, ListOfCompartments,
ListOfSpecies, ListOfParameters, ListOfInitialAssignments,
ListOfRules, ListOfConstraints, ListOfReactions, ListOfEvents.
"""
__swig_setmethods__ = {}
for _s in [ListOf]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, ListOfSpeciesTypes, name, value)
__swig_getmethods__ = {}
for _s in [ListOf]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, ListOfSpeciesTypes, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(ListOfSpeciesTypes self, unsigned int level, unsigned int version) -> ListOfSpeciesTypes
__init__(ListOfSpeciesTypes self, SBMLNamespaces sbmlns) -> ListOfSpeciesTypes
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
ListOfSpeciesTypes(SBMLNamespaces sbmlns)
Creates a new ListOfSpeciesTypes object.
The object is constructed such that it is valid for the SBML Level and
Version combination determined by the SBMLNamespaces object in
'sbmlns'.
Parameter 'sbmlns' is an SBMLNamespaces object that is used to
determine the characteristics of the ListOfSpeciesTypes object to be
created.
______________________________________________________________________
Method variant with the following signature:
ListOfSpeciesTypes(long level, long version)
Creates a new ListOfSpeciesTypes object.
The object is constructed such that it is valid for the given SBML
Level and Version combination.
Parameter 'level' is the SBML Level
Parameter 'version' is the Version within the SBML Level
"""
this = _libsbml.new_ListOfSpeciesTypes(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(ListOfSpeciesTypes self) -> ListOfSpeciesTypes
Creates and returns a deep copy of this ListOfSpeciesTypes object.
Returns the (deep) copy of this ListOfSpeciesTypes object.
"""
return _libsbml.ListOfSpeciesTypes_clone(self)
def getItemTypeCode(self):
"""
getItemTypeCode(ListOfSpeciesTypes self) -> int
Returns the libSBML type code for the objects contained in this ListOf
(i.e., SpeciesType objects, if the list is non-empty).
LibSBML attaches an identifying code to every kind of SBML object.
These are integer constants known as SBML type codes. The names of
all the codes begin with the characters SBML_. In the Python language
interface for libSBML, the type codes are defined as static integer
constants in the interface class 'libsbml'. Note that different Level
3 package plug-ins may use overlapping type codes; to identify the
package to which a given object belongs, call the getPackageName()
method on the object.
Returns the SBML type code for objects contained in this list:
SBML_SPECIES_TYPE (default).
See also getElementName(), getPackageName().
"""
return _libsbml.ListOfSpeciesTypes_getItemTypeCode(self)
def getElementName(self):
"""
getElementName(ListOfSpeciesTypes self) -> string
Returns the XML element name of this object.
For ListOfSpeciesTypes, the XML element name is 'listOfSpeciesTypes'.
Returns the name of this element, i.e., 'listOfSpeciesTypes'.
"""
return _libsbml.ListOfSpeciesTypes_getElementName(self)
def get(self, *args):
"""
get(ListOfSpeciesTypes self, unsigned int n) -> SpeciesType
get(ListOfSpeciesTypes self, unsigned int n) -> SpeciesType
get(ListOfSpeciesTypes self, string sid) -> SpeciesType
get(ListOfSpeciesTypes self, string sid) -> SpeciesType
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
get(string sid)
Get a SpeciesType from the ListOfSpeciesTypes based on its identifier.
Parameter 'sid' is a string representing the identifier of the
SpeciesType to get.
Returns SpeciesType in this ListOfSpeciesTypes with the given 'sid' or
None if no such SpeciesType exists.
See also get(), size(), size().
"""
return _libsbml.ListOfSpeciesTypes_get(self, *args)
def remove(self, *args):
"""
remove(ListOfSpeciesTypes self, unsigned int n) -> SpeciesType
remove(ListOfSpeciesTypes self, string sid) -> SpeciesType
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
remove(string sid)
Removes item in this ListOfSpeciesTypes items with the given
identifier.
The caller owns the returned item and is responsible for deleting it.
If none of the items in this list have the identifier 'sid', then None
is returned.
Parameter 'sid' is the identifier of the item to remove
Returns the item removed. As mentioned above, the caller owns the
returned item.
______________________________________________________________________
Method variant with the following signature:
remove(long n)
Removes the nth item from this ListOfSpeciesTypes items and returns a
pointer to it.
The caller owns the returned item and is responsible for deleting it.
Parameter 'n' is the index of the item to remove
See also size().
"""
return _libsbml.ListOfSpeciesTypes_remove(self, *args)
__swig_destroy__ = _libsbml.delete_ListOfSpeciesTypes
__del__ = lambda self: None
ListOfSpeciesTypes_swigregister = _libsbml.ListOfSpeciesTypes_swigregister
ListOfSpeciesTypes_swigregister(ListOfSpeciesTypes)
class Compartment(SBase):
"""
An SBML compartment, where species are located.
A compartment in SBML represents a bounded space in which species are
located. Compartments do not necessarily have to correspond to actual
structures inside or outside of a biological cell.
It is important to note that although compartments are optional in the
overall definition of Model, every species in an SBML model must be
located in a compartment. This in turn means that if a model defines
any species, the model must also define at least one compartment. The
reason is simply that species represent physical things, and therefore
must exist somewhere. Compartments represent the somewhere.
Compartment has one required attribute, 'id', to give the compartment
a unique identifier by which other parts of an SBML model definition
can refer to it. A compartment can also have an optional 'name'
attribute of type string. Identifiers and names must be used
according to the guidelines described in the SBML specifications.
Compartment also has an optional attribute 'spatialDimensions' that is
used to indicate the number of spatial dimensions possessed by the
compartment. Most modeling scenarios involve compartments with
integer values of 'spatialDimensions' of 3 (i.e., a three-dimensional
compartment, which is to say, a volume), or 2 (a two-dimensional
compartment, a surface), or 1 (a one-dimensional compartment, a line).
In SBML Level 3, the type of this attribute is float, there are no
restrictions on the permitted values of the 'spatialDimensions'
attribute, and there are no default values. In SBML Level 2, the
value must be a positive integer, and the default value is 3; the
permissible values in SBML Level 2 are 3, 2, 1, and 0 (for a point).
Another optional attribute on Compartment is 'size', representing the
initial total size of that compartment in the model. The 'size'
attribute must be a floating-point value and may represent a volume
(if the compartment is a three-dimensional one), or an area (if the
compartment is two-dimensional), or a length (if the compartment is
one-dimensional). There is no default value of compartment size in
SBML Level 2 or Level 3. In particular, a missing 'size' value does
not imply that the compartment size is 1. (This is unlike the
definition of compartment 'volume' in SBML Level 1.) When the
compartment's 'spatialDimensions' attribute does not have a value of
0, a missing value of 'size' for a given compartment signifies that
the value either is unknown, or to be obtained from an external
source, or determined by an InitialAssignment, AssignmentRule,
AlgebraicRule or RateRule object elsewhere in the model. In SBML
Level 2, there are additional special requirements on the values of
'size'; we discuss them in a separate section below.
The units associated with a compartment's 'size' attribute value may
be set using the optional attribute 'units'. The rules for setting
and using compartment size units differ between SBML Level 2 and Level
3, and are discussed separately below.
Finally, the optional Compartment attribute named 'constant' is used
to indicate whether the compartment's size stays constant after
simulation begins. A value of True indicates the compartment's 'size'
cannot be changed by any other construct except InitialAssignment; a
value of False indicates the compartment's 'size' can be changed by
other constructs in SBML. In SBML Level 2, there is an additional
explicit restriction that if 'spatialDimensions'='0', the value cannot
be changed by InitialAssignment either. Further, in Level 2,
'constant' has a default value of True. In SBML Level 3, there is no
default value for the 'constant' attribute.
Additional considerations in SBML Level 2
======================================================================
In SBML Level 2, the default units of compartment size, and the kinds
of units allowed as values of the attribute 'units', interact with the
number of spatial dimensions of the compartment. The value of the
'units' attribute of a Compartment object must be one of the base
units (see Unit), or the predefined unit identifiers volume, area,
length or dimensionless, or a new unit defined by a UnitDefinition
object in the enclosing Model, subject to the restrictions detailed in
the following table:
+----------------------------+---------------+----------------+-----------------------------------+----------------------------------+
|Value of spatialDimensions |size allowed? |units allowed? |Allowable kinds of units |Default value of attribute units |
+----------------------------+---------------+----------------+-----------------------------------+----------------------------------+
|3 |yes |yes |units of volume, or dimensionless |volume |
|2 |yes |yes |units of area, or dimensionless |area |
|1 |yes |yes |units of length, or dimensionless |length |
|0 |no |no |(no units allowed) | |
+----------------------------+---------------+----------------+-----------------------------------+----------------------------------+
In SBML Level 2, the units of the compartment size, as defined by
the 'units' attribute or (if 'units' is not set) the default value
listed in the table above, are used in the following ways when the
compartment has a 'spatialDimensions' value greater than 0:
* The value of the 'units' attribute is used as the units of the
compartment identifier when the identifier appears as a numerical
quantity in a mathematical formula expressed in MathML.
* The math element of an AssignmentRule or InitialAssignment referring
to this compartment must have identical units.
* In RateRule objects that set the rate of change of the compartment's
size, the units of the rule's math element must be identical to the
compartment's 'units' attribute divided by the default time units. (In
other words, the units for the rate of change of compartment size are
compartment size/time units.
* When a Species is to be treated in terms of concentrations or
density, the units of the spatial size portion of the concentration
value (i.e., the denominator in the units formula substance/size) are
those indicated by the value of the 'units' attribute on the
compartment in which the species is located. Compartments with
'spatialDimensions'=0 require special treatment in this framework. As
implied above, the 'size' attribute must not have a value on an SBML
Level 2 Compartment object if the 'spatialDimensions' attribute has a
value of 0. An additional related restriction is that the 'constant'
attribute must default to or be set to True if the value of the
'spatialDimensions' attribute is 0, because a zero-dimensional
compartment cannot ever have a size.
If a compartment has no size or dimensional units, how should such a
compartment's identifier be interpreted when it appears in
mathematical formulas? The answer is that such a compartment's
identifier should not appear in mathematical formulas in the first
place---it has no value, and its value cannot change. Note also that
a zero-dimensional compartment is a point, and species located at
points can only be described in terms of amounts, not spatially-
dependent measures such as concentration. Since SBML KineticLaw
formulas are already in terms of substance/time and not (say)
concentration/time, volume or other factors in principle are not
needed for species located in zero-dimensional compartments.
Finally, in SBML Level 2 Versions 2-4, each compartment in a model may
optionally be designated as belonging to a particular compartment
type. The optional attribute 'compartmentType' is used identify the
compartment type represented by the Compartment structure. The
'compartmentType' attribute's value must be the identifier of a
CompartmentType instance defined in the model. If the
'compartmentType' attribute is not present on a particular compartment
definition, a unique virtual compartment type is assumed for that
compartment, and no other compartment can belong to that compartment
type. The values of 'compartmentType' attributes on compartments have
no effect on the numerical interpretation of a model. Simulators and
other numerical analysis software may ignore 'compartmentType'
attributes. The 'compartmentType' attribute and the CompartmentType
class of objects are not present in SBML Level 3 Core nor in SBML
Level 1.
Additional considerations in SBML Level 3
======================================================================
One difference between SBML Level 3 and lower Levels of SBML is that
there are no restrictions on the permissible values of the
'spatialDimensions' attribute, and there is no default value defined
for the attribute. The value of 'spatialDimensions' does not have to
be an integer, either; this is to allow for the possibility of
representing structures with fractal dimensions.
The number of spatial dimensions possessed by a compartment cannot
enter into mathematical formulas, and therefore cannot directly alter
the numerical interpretation of a model. However, the value of
'spatialDimensions' does affect the interpretation of the units
associated with a compartment's size. Specifically, the value of
'spatialDimensions' is used to select among the Model attributes
'volumeUnits', 'areaUnits' and 'lengthUnits' when a Compartment
structure does not define a value for its 'units' attribute.
The 'units' attribute may be left unspecified for a given compartment
in a model; in that case, the compartment inherits the unit of
measurement specified by one of the attributes on the enclosing Model
object instance. The applicable attribute on Model depends on the
value of the compartment's 'spatialDimensions' attribute; the
relationship is shown in the table below. If the Model object does
not define the relevant attribute ('volumeUnits', 'areaUnits' or
'lengthUnits') for a given 'spatialDimensions' value, the unit
associated with that Compartment object's size is undefined. If both
'spatialDimensions' and 'units' are left unset on a given Compartment
object instance, then no unit can be chosen from among the Model's
'volumeUnits', 'areaUnits' or 'lengthUnits' attributes (even if the
Model instance provides values for those attributes), because there is
no basis to select between them and there is no default value of
'spatialDimensions'. Leaving the units of compartments' sizes
undefined in an SBML model does not render the model invalid; however,
as a matter of best practice, we strongly recommend that all models
specify the units of measurement for all compartment sizes.
+----------------------------------------+-------------------------------------------------+-----------------------------------+
|Value of attribute 'spatialDimensions' |Attribute of Model used for inheriting the unit |Recommended candidate units |
+----------------------------------------+-------------------------------------------------+-----------------------------------+
|3 |"volumeUnits" |units of volume, or dimensionless |
|2 |"areaUnits" |units of area, or dimensionless |
|1 |"lengthUnits" |units of length, or dimensionless |
|other |no units inherited |no specific recommendations |
+----------------------------------------+-------------------------------------------------+-----------------------------------+
The unit of measurement associated with a compartment's size, as
defined by the 'units' attribute or (if 'units' is not set) the
inherited value from Model according to the table above, is used in
the following ways:
* When the identifier of the compartment appears as a numerical
quantity in a mathematical formula expressed in MathML, it represents
the size of the compartment, and the unit associated with the size is
the value of the 'units' attribute.
* When a Species is to be treated in terms of concentrations or
density, the unit associated with the spatial size portion of the
concentration value (i.e., the denominator in the formula amount/size)
is specified by the value of the 'units' attribute on the compartment
in which the species is located.
* The 'math' elements of AssignmentRule, InitialAssignment and
EventAssignment objects setting the value of the compartment size
should all have the same units as the unit associated with the
compartment's size.
* In a RateRule object that defines a rate of change for a
compartment's size, the unit of the rule's 'math' element should be
identical to the compartment's 'units' attribute divided by the model-
wide unit of time. (In other words, {unit of compartment size}/{unit
of time}.)
Other aspects of Compartment
======================================================================
In SBML Level 1 and Level 2, Compartment has an optional attribute
named 'outside', whose value can be the identifier of another
Compartment object defined in the enclosing Model object. Doing so
means that the other compartment contains it or is outside of it.
This enables the representation of simple topological relationships
between compartments, for those simulation systems that can make use
of the information (e.g., for drawing simple diagrams of
compartments). It is worth noting that in SBML, there is no
relationship between compartment sizes when compartment positioning is
expressed using the 'outside' attribute. The size of a given
compartment does not in any sense include the sizes of other
compartments having it as the value of their 'outside' attributes. In
other words, if a compartment B has the identifier of compartment A as
its 'outside' attribute value, the size of A does not include the size
of B. The compartment sizes are separate.
In Level 2, there are two restrictions on the 'outside' attribute.
First, because a compartment with 'spatialDimensions' of 0 has no
size, such a compartment cannot act as the container of any other
compartment except compartments that also have 'spatialDimensions'
values of 0. Second, the directed graph formed by representing
Compartment structures as vertexes and the 'outside' attribute values
as edges must be acyclic. The latter condition is imposed to prevent
a compartment from being contained inside itself. In the absence of a
value for 'outside', compartment definitions in SBML Level 2 do not
have any implied spatial relationships between each other.
"""
__swig_setmethods__ = {}
for _s in [SBase]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, Compartment, name, value)
__swig_getmethods__ = {}
for _s in [SBase]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, Compartment, name)
__repr__ = _swig_repr
__swig_destroy__ = _libsbml.delete_Compartment
__del__ = lambda self: None
def __init__(self, *args):
"""
__init__(Compartment self, unsigned int level, unsigned int version) -> Compartment
__init__(Compartment self, SBMLNamespaces sbmlns) -> Compartment
__init__(Compartment self, Compartment orig) -> Compartment
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
Compartment(SBMLNamespaces sbmlns)
Creates a new Compartment object using the given SBMLNamespaces object
'sbmlns'.
The SBMLNamespaces object encapsulates SBML Level/Version/namespaces
information. It is used to communicate the SBML Level, Version, and
(in Level 3) packages used in addition to SBML Level 3 Core. A common
approach to using libSBML's SBMLNamespaces facilities is to create an
SBMLNamespaces object somewhere in a program once, then hand that
object as needed to object constructors that accept SBMLNamespaces as
arguments.
It is worth emphasizing that although this constructor does not take
an identifier argument, in SBML Level 2 and beyond, the 'id'
(identifier) attribute of a Compartment object is required to have a
value. Thus, callers are cautioned to assign a value after calling
this constructor. Setting the identifier can be accomplished using
the method setId().
Parameter 'sbmlns' is an SBMLNamespaces object.
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
______________________________________________________________________
Method variant with the following signature:
Compartment(long level, long version)
Creates a new Compartment object using the given SBML 'level' and
'version' values.
Parameter 'level' is a long integer, the SBML Level to assign to this
Compartment
Parameter 'version' is a long integer, the SBML Version to assign to
this Compartment
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
______________________________________________________________________
Method variant with the following signature:
Compartment(Compartment orig)
Copy constructor.
This creates a copy of a Compartment object.
Parameter 'orig' is the Compartment instance to copy.
Throws SBMLConstructorException: Thrown if the argument 'orig' is
None.
"""
this = _libsbml.new_Compartment(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(Compartment self) -> Compartment
Creates and returns a deep copy of this Compartment object.
Returns the (deep) copy of this Compartment object.
"""
return _libsbml.Compartment_clone(self)
def initDefaults(self):
"""
initDefaults(Compartment self)
Initializes the fields of this Compartment object to 'typical' default
values.
The SBML Compartment component has slightly different aspects and
default attribute values in different SBML Levels and Versions. This
method sets the values to certain common defaults, based mostly on
what they are in SBML Level 2. Specifically:
* Sets attribute 'spatialDimensions' to 3
* Sets attribute 'constant' to True
* (Applies to Level 1 models only) Sets attribute 'volume' to 1.0
* (Applies to Level 3 models only) Sets attribute 'units' to litre
"""
return _libsbml.Compartment_initDefaults(self)
def getId(self):
"""
getId(Compartment self) -> string
Returns the value of the 'id' attribute of this Compartment object.
Returns the identifier of this Compartment object.
See also getName(), setId(), unsetId(), isSetId().
"""
return _libsbml.Compartment_getId(self)
def getName(self):
"""
getName(Compartment self) -> string
Returns the value of the 'name' attribute of this Compartment object.
Returns the name of this Compartment object.
See also getId(), isSetName(), setName(), unsetName().
"""
return _libsbml.Compartment_getName(self)
def getCompartmentType(self):
"""
getCompartmentType(Compartment self) -> string
Get the value of the 'compartmentType' attribute of this Compartment
object.
Returns the value of the 'compartmentType' attribute of this
Compartment object as a string.
Note:
The 'compartmentType' attribute is only available in SBML Level 2
Versions 2-4.
See also isSetCompartmentType(), setCompartmentType(),
unsetCompartmentType().
"""
return _libsbml.Compartment_getCompartmentType(self)
def getSpatialDimensions(self):
"""
getSpatialDimensions(Compartment self) -> unsigned int
Get the number of spatial dimensions of this Compartment object.
Returns the value of the 'spatialDimensions' attribute of this
Compartment object as a long integereger
Note:
In SBML Level 3, the data type of the 'spatialDimensions' attribute is
float, whereas in Level 2, it is integer. To avoid backward
compatibility issues, libSBML provides two separate methods for
obtaining the value as either an integer or a type float, for models
where it is relevant.
See also getSpatialDimensionsAsDouble(), setSpatialDimensions(),
isSetSpatialDimensions(), unsetSpatialDimensions().
"""
return _libsbml.Compartment_getSpatialDimensions(self)
def getSpatialDimensionsAsDouble(self):
"""
getSpatialDimensionsAsDouble(Compartment self) -> double
Get the number of spatial dimensions of this Compartment object, as a
double.
Returns the value of the 'spatialDimensions' attribute of this
Compartment object as a double, or NaN if this model is not in SBML
Level 3 format.
Note:
In SBML Level 3, the data type of the 'spatialDimensions' attribute is
float, whereas in Level 2, it is integer. To avoid backward
compatibility issues, libSBML provides two separate methods for
obtaining the value as either an integer or a type float, for models
where it is relevant.
See also getSpatialDimensions(), setSpatialDimensions(),
isSetSpatialDimensions(), unsetSpatialDimensions().
"""
return _libsbml.Compartment_getSpatialDimensionsAsDouble(self)
def getSize(self):
"""
getSize(Compartment self) -> double
Get the size of this Compartment object.
In SBML Level 1, compartments are always three-dimensional constructs
and only have volumes, whereas in SBML Level 2 and higher,
compartments may be other than three-dimensional, and therefore the
'volume' attribute is named 'size' in Level 2 and above. LibSBML
provides both Compartment.getSize() and Compartment.getVolume() for
easier support of different SBML Levels.
Returns the value of the 'size' attribute ('volume' in Level 1) of
this Compartment object as a floating-point number.
Note:
This method is identical to getVolume().
See also getVolume(), isSetSize(), setSize(), unsetSize().
"""
return _libsbml.Compartment_getSize(self)
def getVolume(self):
"""
getVolume(Compartment self) -> double
Get the volume of this Compartment object.
In SBML Level 1, compartments are always three-dimensional constructs
and only have volumes, whereas in SBML Level 2 and higher,
compartments may be other than three-dimensional, and therefore the
'volume' attribute is named 'size' in Level 2 and above. LibSBML
provides both Compartment.getSize() and Compartment.getVolume() for
easier support of different SBML Levels.
Returns the value of the 'volume' attribute ('size' in Level 2) of
this Compartment object, as a floating-point number.
Note:
The attribute 'volume' only exists by that name in SBML Level 1. In
Level 2 and above, the equivalent attribute is named 'size'. In SBML
Level 1, a compartment's volume has a default value (1.0) and
therefore methods such as Compartment.isSetVolume() will always return
True for a Level 1 model. In Level 2, a compartment's size (the
equivalent of SBML Level 1's 'volume') is optional and has no default
value, and therefore may or may not be set.
Note:
This method is identical to getSize().
See also getSize(), isSetVolume(), setVolume(), unsetVolume().
"""
return _libsbml.Compartment_getVolume(self)
def getUnits(self):
"""
getUnits(Compartment self) -> string
Get the units of this Compartment object's size.
The value of an SBML compartment's 'units' attribute establishes the
unit of measurement associated with the compartment's size.
Returns the value of the 'units' attribute of this Compartment object,
as a string. An empty string indicates that no units have been
assigned to the value of the size.
Note:
There is an important distinction to be made between no units
assigned, and assuming a value without units has any specific unit
such as dimensionless. In SBML, default units are never attributed to
numbers, and numbers without units are not automatically assumed to
have the unit dimensionless. Please consult the relevant SBML
specification document for a more in-depth explanation of this topic
and the SBML unit system.
See also isSetUnits(), setUnits(), unsetUnits().
"""
return _libsbml.Compartment_getUnits(self)
def getOutside(self):
"""
getOutside(Compartment self) -> string
Get the identifier, if any, of the Compartment object that is
designated as being outside of this one.
Returns the value of the 'outside' attribute of this Compartment
object.
Note:
The 'outside' attribute is defined in SBML Level 1 and Level 2, but
does not exist in SBML Level 3 Version 1 Core.
See also isSetOutside(), setOutside(), unsetOutside().
"""
return _libsbml.Compartment_getOutside(self)
def getConstant(self):
"""
getConstant(Compartment self) -> bool
Get the value of the 'constant' attribute of this Compartment object.
Returns True if this Compartment object's size is flagged as being
constant, False otherwise.
See also isSetConstant(), setConstant().
"""
return _libsbml.Compartment_getConstant(self)
def isSetId(self):
"""
isSetId(Compartment self) -> bool
Predicate returning True if this Compartment object's 'id' attribute
is set.
Returns True if the 'id' attribute of this Compartment object is set,
False otherwise.
See also getId(), unsetId(), setId().
"""
return _libsbml.Compartment_isSetId(self)
def isSetName(self):
"""
isSetName(Compartment self) -> bool
Predicate returning True if this Compartment object's 'name' attribute
is set.
Returns True if the 'name' attribute of this Compartment object is
set, False otherwise.
See also getName(), setName(), unsetName().
"""
return _libsbml.Compartment_isSetName(self)
def isSetCompartmentType(self):
"""
isSetCompartmentType(Compartment self) -> bool
Predicate returning True if this Compartment object's
'compartmentType' attribute is set.
Returns True if the 'compartmentType' attribute of this Compartment is
set, False otherwise.
Note:
The 'compartmentType' attribute is only available in SBML Level 2
Versions 2-4.
See also setCompartmentType(), getCompartmentType(),
unsetCompartmentType().
"""
return _libsbml.Compartment_isSetCompartmentType(self)
def isSetSize(self):
"""
isSetSize(Compartment self) -> bool
Predicate returning True if this Compartment object's 'size' attribute
is set.
This method is similar but not identical to isSetVolume(). The latter
should be used in the context of SBML Level 1 models instead of
isSetSize() because isSetVolume() performs extra processing to take
into account the difference in default values between SBML Levels 1
and 2.
Returns True if the 'size' attribute ('volume' in Level 2) of this
Compartment object is set, False otherwise.
See also isSetVolume(), setSize(), getSize(), unsetSize().
"""
return _libsbml.Compartment_isSetSize(self)
def isSetVolume(self):
"""
isSetVolume(Compartment self) -> bool
Predicate returning True if this Compartment object's 'volume'
attribute is set.
This method is similar but not identical to isSetSize(). The latter
should not be used in the context of SBML Level 1 models because the
present method performs extra processing to take into account the
difference in default values between SBML Levels 1 and 2.
Returns True if the 'volume' attribute ('size' in Level 2 and above)
of this Compartment object is set, False otherwise.
Note:
The attribute 'volume' only exists by that name in SBML Level 1. In
Level 2 and above, the equivalent attribute is named 'size'. In SBML
Level 1, a compartment's volume has a default value (1.0) and
therefore methods such as Compartment.isSetVolume() will always return
True for a Level 1 model. In Level 2, a compartment's size (the
equivalent of SBML Level 1's 'volume') is optional and has no default
value, and therefore may or may not be set.
See also isSetSize(), getVolume(), setVolume(), unsetVolume().
"""
return _libsbml.Compartment_isSetVolume(self)
def isSetUnits(self):
"""
isSetUnits(Compartment self) -> bool
Predicate returning True if this Compartment object's 'units'
attribute is set.
Returns True if the 'units' attribute of this Compartment object is
set, False otherwise.
Note:
There is an important distinction to be made between no units
assigned, and assuming a value without units has any specific unit
such as dimensionless. In SBML, default units are never attributed to
numbers, and numbers without units are not automatically assumed to
have the unit dimensionless. Please consult the relevant SBML
specification document for a more in-depth explanation of this topic
and the SBML unit system.
See also setUnits(), getUnits(), unsetUnits().
"""
return _libsbml.Compartment_isSetUnits(self)
def isSetOutside(self):
"""
isSetOutside(Compartment self) -> bool
Predicate returning True if this Compartment object's 'outside'
attribute is set.
Returns True if the 'outside' attribute of this Compartment object is
set, False otherwise.
Note:
The 'outside' attribute is defined in SBML Level 1 and Level 2, but
does not exist in SBML Level 3 Version 1 Core.
See also getOutside(), setOutside(), unsetOutside().
"""
return _libsbml.Compartment_isSetOutside(self)
def isSetSpatialDimensions(self):
"""
isSetSpatialDimensions(Compartment self) -> bool
Predicate returning True if this Compartment object's
'spatialDimensions' attribute is set.
Returns True if the 'spatialDimensions' attribute of this Compartment
object is set, False otherwise.
See also getSpatialDimensions(), setSpatialDimensions(),
unsetSpatialDimensions().
"""
return _libsbml.Compartment_isSetSpatialDimensions(self)
def isSetConstant(self):
"""
isSetConstant(Compartment self) -> bool
Predicate returning True if this Compartment object's 'constant'
attribute is set.
Returns True if the 'constant' attribute of this Compartment object is
set, False otherwise.
See also getConstant(), setConstant().
"""
return _libsbml.Compartment_isSetConstant(self)
def setId(self, sid):
"""
setId(Compartment self, string sid) -> int
Sets the value of the 'id' attribute of this Compartment object.
The string 'sid' is copied.
SBML has strict requirements for the syntax of identifiers, that is,
the values of the 'id' attribute present on most types of SBML
objects. The following is a summary of the definition of the SBML
identifier type SId, which defines the permitted syntax of
identifiers. We express the syntax using an extended form of BNF
notation:
letter ::= 'a'..'z','A'..'Z'
digit ::= '0'..'9'
idChar ::= letter | digit | '_'
SId ::= ( letter | '_' ) idChar*
The characters ( and ) are used for grouping, the character * 'zero or
more times', and the character | indicates logical 'or'. The equality
of SBML identifiers is determined by an exact character sequence
match; i.e., comparisons must be performed in a case-sensitive manner.
In addition, there are a few conditions for the uniqueness of
identifiers in an SBML model. Please consult the SBML specifications
for the exact details of the uniqueness requirements.
Parameter 'sid' is the string to use as the identifier of this
Compartment object. If the string is None, this method will return
LIBSBML_INVALID_ATTRIBUTE_VALUE.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
See also getId(), unsetId(), isSetId().
"""
return _libsbml.Compartment_setId(self, sid)
def setName(self, name):
"""
setName(Compartment self, string name) -> int
Sets the value of the 'name' attribute of this Compartment object.
The string in 'name' is copied.
Parameter 'name' is the new name for the Compartment object. If the
string is None, this method will return
LIBSBML_INVALID_ATTRIBUTE_VALUE.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
See also getName(), isSetName(), unsetName().
"""
return _libsbml.Compartment_setName(self, name)
def setCompartmentType(self, sid):
"""
setCompartmentType(Compartment self, string sid) -> int
Sets the 'compartmentType' attribute of this Compartment object.
Parameter 'sid' is the identifier of a CompartmentType object defined
elsewhere in this Model. If the string is None, this method will
return LIBSBML_INVALID_ATTRIBUTE_VALUE.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
* LIBSBML_UNEXPECTED_ATTRIBUTE
Note:
The 'compartmentType' attribute is only available in SBML Level 2
Versions 2-4.
See also isSetCompartmentType(), getCompartmentType(),
unsetCompartmentType().
"""
return _libsbml.Compartment_setCompartmentType(self, sid)
def setSpatialDimensions(self, *args):
"""
setSpatialDimensions(Compartment self, unsigned int value) -> int
setSpatialDimensions(Compartment self, double value) -> int
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
setSpatialDimensions(double value)
Sets the 'spatialDimensions' attribute of this Compartment object as a
double.
Parameter 'value' is a double indicating the number of dimensions of
this compartment.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
* LIBSBML_UNEXPECTED_ATTRIBUTE
See also getSpatialDimensions(), isSetSpatialDimensions(),
unsetSpatialDimensions(), getSpatialDimensions(),
isSetSpatialDimensions(), unsetSpatialDimensions().
"""
return _libsbml.Compartment_setSpatialDimensions(self, *args)
def setSize(self, value):
"""
setSize(Compartment self, double value) -> int
Sets the 'size' attribute (or 'volume' in SBML Level 1) of this
Compartment object.
Parameter 'value' is a float representing the size of this compartment
instance in whatever units are in effect for the compartment.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
Note:
This method is identical to setVolume().
See also setVolume(), getSize(), isSetSize(), unsetSize().
"""
return _libsbml.Compartment_setSize(self, value)
def setVolume(self, value):
"""
setVolume(Compartment self, double value) -> int
Sets the 'volume' attribute (or 'size' in SBML Level 2) of this
Compartment object.
This method is identical to setSize() and is provided for
compatibility between SBML Level 1 and higher Levels of SBML.
Parameter 'value' is a float representing the volume of this
compartment instance in whatever units are in effect for the
compartment.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
Note:
The attribute 'volume' only exists by that name in SBML Level 1. In
Level 2 and above, the equivalent attribute is named 'size'. In SBML
Level 1, a compartment's volume has a default value (1.0) and
therefore methods such as Compartment.isSetVolume() will always return
True for a Level 1 model. In Level 2, a compartment's size (the
equivalent of SBML Level 1's 'volume') is optional and has no default
value, and therefore may or may not be set.
See also setSize(), getVolume(), isSetVolume(), unsetVolume().
"""
return _libsbml.Compartment_setVolume(self, value)
def setUnits(self, sid):
"""
setUnits(Compartment self, string sid) -> int
Sets the 'units' attribute of this Compartment object.
Parameter 'sid' is the identifier of the defined units to use. If
'sid' is None, then this method will return
LIBSBML_INVALID_ATTRIBUTE_VALUE.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
See also isSetUnits(), getUnits(), unsetUnits().
"""
return _libsbml.Compartment_setUnits(self, sid)
def setOutside(self, sid):
"""
setOutside(Compartment self, string sid) -> int
Sets the 'outside' attribute of this Compartment object.
Parameter 'sid' is the identifier of a compartment that encloses this
one. If 'sid' is None, then this method will return
LIBSBML_INVALID_ATTRIBUTE_VALUE.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
Note:
The 'outside' attribute is defined in SBML Level 1 and Level 2, but
does not exist in SBML Level 3 Version 1 Core.
See also isSetOutside(), getOutside(), unsetOutside().
"""
return _libsbml.Compartment_setOutside(self, sid)
def setConstant(self, value):
"""
setConstant(Compartment self, bool value) -> int
Sets the value of the 'constant' attribute of this Compartment object.
Parameter 'value' is a boolean indicating whether the size/volume of
this compartment should be considered constant (True) or variable
(False).
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_UNEXPECTED_ATTRIBUTE
See also isSetConstant(), getConstant().
"""
return _libsbml.Compartment_setConstant(self, value)
def renameSIdRefs(self, oldid, newid):
"""
renameSIdRefs(Compartment self, string oldid, string newid)
Replaces all uses of a given SIdRef type attribute value with another
value.
In SBML, object identifiers are of a data type called SId. In SBML
Level 3, an explicit data type called SIdRef was introduced for
attribute values that refer to SId values; in previous Levels of SBML,
this data type did not exist and attributes were simply described to
as 'referring to an identifier', but the effective data type was the
same as SIdRefin Level 3. These and other methods of libSBML refer to
the type SIdRef for all Levels of SBML, even if the corresponding SBML
specification did not explicitly name the data type.
This method works by looking at all attributes and (if appropriate)
mathematical formulas in MathML content, comparing the referenced
identifiers to the value of 'oldid'. If any matches are found, the
matching values are replaced with 'newid'. The method does not
descend into child elements.
Parameter 'oldid' is the old identifier Parameter 'newid' is the new
identifier
"""
return _libsbml.Compartment_renameSIdRefs(self, oldid, newid)
def renameUnitSIdRefs(self, oldid, newid):
"""
renameUnitSIdRefs(Compartment self, string oldid, string newid)
Replaces all uses of a given UnitSIdRef type attribute value with
another value.
In SBML, unit definitions have identifiers of type UnitSId. In SBML
Level 3, an explicit data type called UnitSIdRef was introduced for
attribute values that refer to UnitSId values; in previous Levels of
SBML, this data type did not exist and attributes were simply
described to as 'referring to a unit identifier', but the effective
data type was the same as UnitSIdRef in Level 3. These and other
methods of libSBML refer to the type UnitSIdRef for all Levels of
SBML, even if the corresponding SBML specification did not explicitly
name the data type.
This method works by looking at all unit identifier attribute values
(including, if appropriate, inside mathematical formulas), comparing
the referenced unit identifiers to the value of 'oldid'. If any
matches are found, the matching values are replaced with 'newid'. The
method does not descend into child elements.
Parameter 'oldid' is the old identifier Parameter 'newid' is the new
identifier
"""
return _libsbml.Compartment_renameUnitSIdRefs(self, oldid, newid)
def unsetName(self):
"""
unsetName(Compartment self) -> int
Unsets the value of the 'name' attribute of this Compartment object.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
See also getName(), setName(), isSetName().
"""
return _libsbml.Compartment_unsetName(self)
def unsetCompartmentType(self):
"""
unsetCompartmentType(Compartment self) -> int
Unsets the value of the 'compartmentType' attribute of this
Compartment object.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
* LIBSBML_UNEXPECTED_ATTRIBUTE
Note:
The 'compartmentType' attribute is only available in SBML Level 2
Versions 2-4.
See also setCompartmentType(), isSetCompartmentType(),
getCompartmentType().
"""
return _libsbml.Compartment_unsetCompartmentType(self)
def unsetSize(self):
"""
unsetSize(Compartment self) -> int
Unsets the value of the 'size' attribute of this Compartment object.
In SBML Level 1, a compartment's volume has a default value (1.0) and
therefore should always be set. Calling this method on a Level 1
model resets the value to 1.0 rather than actually unsetting it. In
Level 2, a compartment's 'size' is optional with no default value, and
unsetting it will result in the compartment having no defined size.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
Note:
This method is identical to unsetVolume().
See also unsetVolume(), getSize(), isSetSize(), setSize().
"""
return _libsbml.Compartment_unsetSize(self)
def unsetVolume(self):
"""
unsetVolume(Compartment self) -> int
Unsets the value of the 'volume' attribute of this Compartment object.
This method is identical to unsetSize(). Please refer to that
method's documentation for more information about its behavior.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
Note:
The attribute 'volume' only exists by that name in SBML Level 1. In
Level 2 and above, the equivalent attribute is named 'size'. In SBML
Level 1, a compartment's volume has a default value (1.0) and
therefore methods such as Compartment.isSetVolume() will always return
True for a Level 1 model. In Level 2, a compartment's size (the
equivalent of SBML Level 1's 'volume') is optional and has no default
value, and therefore may or may not be set.
See also unsetSize(), getVolume(), setVolume(), isSetVolume().
"""
return _libsbml.Compartment_unsetVolume(self)
def unsetUnits(self):
"""
unsetUnits(Compartment self) -> int
Unsets the value of the 'units' attribute of this Compartment object.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
See also isSetUnits(), setUnits(), getUnits().
"""
return _libsbml.Compartment_unsetUnits(self)
def unsetOutside(self):
"""
unsetOutside(Compartment self) -> int
Unsets the value of the 'outside' attribute of this Compartment
object.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
Note:
The 'outside' attribute is defined in SBML Level 1 and Level 2, but
does not exist in SBML Level 3 Version 1 Core.
See also isSetOutside(), getOutside(), setOutside().
"""
return _libsbml.Compartment_unsetOutside(self)
def unsetSpatialDimensions(self):
"""
unsetSpatialDimensions(Compartment self) -> int
Unsets the value of the 'spatialDimensions' attribute of this
Compartment object.
In SBML Levels prior to Level 3, compartments must always have a value
for the number of dimensions. Consequently, calling this method on a
model of SBML Level 1-2 will result in a return value of
LIBSBML_UNEXPECTED_ATTRIBUTE
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
* LIBSBML_UNEXPECTED_ATTRIBUTE
Note:
This function is only valid for SBML Level 3.
See also getSpatialDimensions(), isSetSpatialDimensions(),
setSpatialDimensions().
"""
return _libsbml.Compartment_unsetSpatialDimensions(self)
def getDerivedUnitDefinition(self, *args):
"""
getDerivedUnitDefinition(Compartment self) -> UnitDefinition
getDerivedUnitDefinition(Compartment self) -> UnitDefinition
Constructs and returns a UnitDefinition that corresponds to the units
of this Compartment object's designated size.
Compartments in SBML have an attribute ('units') for declaring the
units of measurement intended for the value of the compartment's size.
In the absence of a value given for this attribute, the units are
inherited from values either defined on the enclosing Model (in SBML
Level 3) or in defaults (in SBML Level 2). This method returns a
UnitDefinition object based on how this compartment's units are
interpreted according to the relevant SBML guidelines, or it returns
None if no units have been declared and no defaults are defined by the
relevant SBML specification.
Note that unit declarations for Compartment objects are specified in
terms of the identifier of a unit, but this method returns an object ,
not a unit identifier. It does this by constructing an appropriate
UnitDefinition object. For SBML Level 2 models, it will do this even
when the value of the 'units' attribute is one of the special SBML
Level 2 unit identifiers 'substance', 'volume', 'area', 'length' or
'time'. Callers may find this useful in conjunction with the helper
methods provided by the UnitDefinition class for comparing different
UnitDefinition objects.
Returns a UnitDefinition that expresses the units of this Compartment
object, or None if one cannot be constructed.
Note:
The libSBML system for unit analysis depends on the model as a whole.
In cases where the Compartment object has not yet been added to a
model, or the model itself is incomplete, unit analysis is not
possible, and consequently this method will return None.
See also isSetUnits(), getUnits().
"""
return _libsbml.Compartment_getDerivedUnitDefinition(self, *args)
def getTypeCode(self):
"""
getTypeCode(Compartment self) -> int
Returns the libSBML type code for this SBML object.
LibSBML attaches an identifying code to every kind of SBML object.
These are integer constants known as SBML type codes. The names of
all the codes begin with the characters SBML_. In the Python language
interface for libSBML, the type codes are defined as static integer
constants in the interface class 'libsbml'. Note that different Level
3 package plug-ins may use overlapping type codes; to identify the
package to which a given object belongs, call the getPackageName()
method on the object.
Returns the SBML type code for this object: SBML_COMPARTMENT
(default).
WARNING:
The specific integer values of the possible type codes may be reused
by different Level 3 package plug-ins. Thus, to identifiy the correct
code, it is necessary to invoke both getTypeCode() and
getPackageName().
See also getElementName(), getPackageName().
"""
return _libsbml.Compartment_getTypeCode(self)
def getElementName(self):
"""
getElementName(Compartment self) -> string
Returns the XML element name of this object
For Compartment, the XML element name is always 'compartment'.
Returns the name of this element.
"""
return _libsbml.Compartment_getElementName(self)
def hasRequiredAttributes(self):
"""
hasRequiredAttributes(Compartment self) -> bool
Predicate returning True if all the required attributes for this
Compartment object have been set.
The required attributes for a Compartment object are:
* 'id' (or 'name' in SBML Level 1)
* 'constant' (in SBML Level 3 only)
Returns True if the required attributes have been set, False
otherwise.
"""
return _libsbml.Compartment_hasRequiredAttributes(self)
Compartment_swigregister = _libsbml.Compartment_swigregister
Compartment_swigregister(Compartment)
class ListOfCompartments(ListOf):
"""
A list of Compartment objects.
The various ListOf___ classes in SBML are merely containers used for
organizing the main components of an SBML model. In libSBML's
implementation, ListOf___ classes are derived from the intermediate
utility class ListOf, which is not defined by the SBML specifications
but serves as a useful programmatic construct. ListOf is itself is in
turn derived from SBase, which provides all of the various ListOf___
classes with common features defined by the SBML specification, such
as 'metaid' attributes and annotations.
The relationship between the lists and the rest of an SBML model is
illustrated by the following (for SBML Level 2 Version 4):
...
...
...
...
...
...
... elements of subclasses of Rule ...
...
...
...
Readers may wonder about the motivations for using the ListOf___
containers in SBML. A simpler approach in XML might be to place the
components all directly at the top level of the model definition. The
choice made in SBML is to group them within XML elements named after
ListOfClassname, in part because it helps organize the components.
More importantly, the fact that the container classes are derived from
SBase means that software tools can add information about the lists
themselves into each list container's 'annotation'.
See also ListOfFunctionDefinitions, ListOfUnitDefinitions,
ListOfCompartmentTypes, ListOfSpeciesTypes, ListOfCompartments,
ListOfSpecies, ListOfParameters, ListOfInitialAssignments,
ListOfRules, ListOfConstraints, ListOfReactions, ListOfEvents.
"""
__swig_setmethods__ = {}
for _s in [ListOf]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, ListOfCompartments, name, value)
__swig_getmethods__ = {}
for _s in [ListOf]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, ListOfCompartments, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(ListOfCompartments self, unsigned int level, unsigned int version) -> ListOfCompartments
__init__(ListOfCompartments self, SBMLNamespaces sbmlns) -> ListOfCompartments
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
ListOfCompartments(SBMLNamespaces sbmlns)
Creates a new ListOfCompartments object.
The object is constructed such that it is valid for the SBML Level and
Version combination determined by the SBMLNamespaces object in
'sbmlns'.
Parameter 'sbmlns' is an SBMLNamespaces object that is used to
determine the characteristics of the ListOfCompartments object to be
created.
______________________________________________________________________
Method variant with the following signature:
ListOfCompartments(long level, long version)
Creates a new ListOfCompartments object.
The object is constructed such that it is valid for the given SBML
Level and Version combination.
Parameter 'level' is the SBML Level
Parameter 'version' is the Version within the SBML Level
"""
this = _libsbml.new_ListOfCompartments(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(ListOfCompartments self) -> ListOfCompartments
Creates and returns a deep copy of this ListOfCompartments object.
Returns the (deep) copy of this ListOfCompartments object.
"""
return _libsbml.ListOfCompartments_clone(self)
def getItemTypeCode(self):
"""
getItemTypeCode(ListOfCompartments self) -> int
Returns the libSBML type code for the objects contained in this ListOf
(i.e., Compartment objects, if the list is non-empty).
LibSBML attaches an identifying code to every kind of SBML object.
These are integer constants known as SBML type codes. The names of
all the codes begin with the characters SBML_. In the Python language
interface for libSBML, the type codes are defined as static integer
constants in the interface class 'libsbml'. Note that different Level
3 package plug-ins may use overlapping type codes; to identify the
package to which a given object belongs, call the getPackageName()
method on the object.
Returns the SBML type code for the objects contained in this ListOf
instance: SBML_COMPARTMENT (default).
See also getElementName(), getPackageName().
"""
return _libsbml.ListOfCompartments_getItemTypeCode(self)
def getElementName(self):
"""
getElementName(ListOfCompartments self) -> string
Returns the XML element name of this object.
For ListOfCompartments, the XML element name is always
'listOfCompartments'.
Returns the name of this element.
"""
return _libsbml.ListOfCompartments_getElementName(self)
def get(self, *args):
"""
get(ListOfCompartments self, unsigned int n) -> Compartment
get(ListOfCompartments self, unsigned int n) -> Compartment
get(ListOfCompartments self, string sid) -> Compartment
get(ListOfCompartments self, string sid) -> Compartment
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
get(string sid)
Get a Compartment object from the ListOfCompartments based on its
identifier.
Parameter 'sid' is a string representing the identifier of the
Compartment object to get.
Returns Compartment object in this ListOfCompartments with the given
'sid' or None if no such Compartment object exists.
See also get(), size(), size().
"""
return _libsbml.ListOfCompartments_get(self, *args)
def remove(self, *args):
"""
remove(ListOfCompartments self, unsigned int n) -> Compartment
remove(ListOfCompartments self, string sid) -> Compartment
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
remove(string sid)
Removes item in this ListOfCompartments items with the given
identifier.
The caller owns the returned item and is responsible for deleting it.
If none of the items in this list have the identifier 'sid', then None
is returned.
Parameter 'sid' is the identifier of the item to remove
Returns the item removed. As mentioned above, the caller owns the
returned item.
______________________________________________________________________
Method variant with the following signature:
remove(long n)
Removes the nth item from this ListOfCompartments items and returns a
pointer to it.
The caller owns the returned item and is responsible for deleting it.
Parameter 'n' is the index of the item to remove
See also size().
"""
return _libsbml.ListOfCompartments_remove(self, *args)
__swig_destroy__ = _libsbml.delete_ListOfCompartments
__del__ = lambda self: None
ListOfCompartments_swigregister = _libsbml.ListOfCompartments_swigregister
ListOfCompartments_swigregister(ListOfCompartments)
class Species(SBase):
"""
An SBML species - a pool of entities.
A species in SBML refers to a pool of entities that (a) are considered
indistinguishable from each other for the purposes of the model, (b)
participate in reactions, and (c) are located in a specific
compartment. The SBML Species object class is intended to represent
these pools.
As with other major constructs in SBML, Species has a mandatory
attribute, 'id', used to give the species type an identifier in the
model. The identifier must be a text string conforming to the
identifer syntax permitted in SBML. Species also has an optional
'name' attribute, of type string. The 'id' and 'name' must be used
according to the guidelines described in the SBML specifications.
The required attribute 'compartment' is used to identify the
compartment in which the species is located. The attribute's value
must be the identifier of an existing Compartment object. It is
important to note that there is no default value for the 'compartment'
attribute on Species; every species in an SBML model must be assigned
a compartment explicitly. (This also implies that every model with
one or more Species objects must define at least one Compartment
object.)
The initial amount and concentration of a species
======================================================================
The optional attributes 'initialAmount' and 'initialConcentration',
both having a data type of float, can be used to set the initial
quantity of the species in the compartment where the species is
located. These attributes are mutually exclusive; i.e., only one can
have a value on any given instance of a Species object. Missing
'initialAmount' and 'initialConcentration' values implies that their
values either are unknown, or to be obtained from an external source,
or determined by an InitialAssignment or other SBML construct
elsewhere in the model.
A species' initial quantity in SBML is set by the 'initialAmount' or
'initialConcentration' attribute exactly once. If the 'constant'
attribute is True, then the value of the species' quantity is fixed
and cannot be changed except by an InitialAssignment. These methods
differ in that the 'initialAmount' and 'initialConcentration'
attributes can only be used to set the species quantity to a literal
floating-point number, whereas the use of an InitialAssignment object
allows the value to be set using an arbitrary mathematical expression
(which, thanks to MathML's expressiveness, may evaluate to a rational
number). If the species' 'constant' attribute is False, the species'
quantity value may be overridden by an InitialAssignment or changed by
AssignmentRule or AlgebraicRule, and in addition, for t > 0, it may
also be changed by a RateRule, Event objects, and as a result of being
a reactant or product in one or more Reaction objects. (However, some
constructs are mutually exclusive; see the SBML specifications for the
precise details.) It is not an error to define 'initialAmount' or
'initialConcentration' on a species and also redefine the value using
an InitialAssignment, but the 'initialAmount' or
'initialConcentration' setting in that case is ignored. The SBML
specifications provide additional information about the semantics of
assignments, rules and values for simulation time t <= 0.
SBML Level 2 additionally stipulates that in cases where a species'
compartment has a 'spatialDimensions' value of 0 (zero), the species
cannot have a value for 'initialConcentration' because the concepts of
concentration and density break down when a container has zero
dimensions.
The units of a species' amount or concentration
======================================================================
When the attribute 'initialAmount' is set, the unit of measurement
associated with the value of 'initialAmount' is specified by the
Species attribute 'substanceUnits'. When the 'initialConcentration'
attribute is set, the unit of measurement associated with this
concentration value is {unit of amount} divided by {unit of size},
where the {unit of amount} is specified by the Species
'substanceUnits' attribute, and the {unit of size} is specified by the
'units' attribute of the Compartment object in which the species is
located. Note that in either case, a unit of amount is involved and
determined by the 'substanceUnits' attribute. Note these two
attributes alone do not determine the units of the species when the
species identifier appears in a mathematical expression; that aspect
is determined by the attribute 'hasOnlySubstanceUnits' discussed
below.
In SBML Level 3, if the 'substanceUnits' attribute is not set on a
given Species object instance, then the unit of amount for that
species is inherited from the 'substanceUnits' attribute on the
enclosing Model object instance. If that attribute on Model is not
set either, then the unit associated with the species' quantity is
undefined.
In SBML Level 2, if the 'substanceUnits' attribute is not set on a
given Species object instance, then the unit of amount for that
species is taken from the predefined SBML unit identifier 'substance'.
The value assigned to 'substanceUnits' must be chosen from one of the
following possibilities: one of the base unit identifiers defined in
SBML, the built-in unit identifier 'substance', or the identifier of a
new unit defined in the list of unit definitions in the enclosing
Model object. The chosen units for 'substanceUnits' must be be
'dimensionless', 'mole', 'item', 'kilogram', 'gram', or units derived
from these.
As noted at the beginning of this section, simply setting
'initialAmount' or 'initialConcentration' alone does not determine
whether a species identifier represents an amount or a concentration
when it appears elsewhere in an SBML model. The role of the attribute
'hasOnlySubstanceUnits' is to indicate whether the units of the
species, when the species identifier appears in mathematical formulas,
are intended to be concentration or amount. The attribute takes on a
boolean value. In SBML Level 3, the attribute has no default value
and must always be set in a model; in SBML Level 2, it has a default
value of False.
The units of the species are used in the following ways:
* When the species' identifier appears in a MathML formula, it
represents the species' quantity, and the unit of measurement
associated with the quantity is as described above.
* The 'math' elements of AssignmentRule, InitialAssignment and
EventAssignment objects referring to this species should all have the
same units as the unit of measurement associated with the species
quantity.
* In a RateRule object that defines the rate of change of the species'
quantity, the unit associated with the rule's 'math' element should be
equal to the unit of the species' quantity divided by the model-wide
unit of time; in other words, {unit of species quantity}/{unit of
time}.
The 'constant' and 'boundaryCondition' attributes
======================================================================
The Species object class has two boolean attributes named 'constant'
and 'boundaryCondition', used to indicate whether and how the quantity
of that species can vary during a simulation. In SBML Level 2 they
are optional; in SBML Level 3 they are mandatory. The following table
shows how to interpret the combined values of these attributes.
By default, when a species is a product or reactant of one or more
reactions, its quantity is determined by those reactions. In SBML, it
is possible to indicate that a given species' quantity is not
determined by the set of reactions even when that species occurs as a
product or reactant; i.e., the species is on the boundary of the
reaction system, and its quantity is not determined by the reactions.
The boolean attribute 'boundaryCondition' can be used to indicate
this. A value of False indicates that the species is part of the
reaction system. In SBML Level 2, the attribute has a default value
of False, while in SBML Level 3, it has no default.
The 'constant' attribute indicates whether the species' quantity can
be changed at all, regardless of whether by reactions, rules, or
constructs other than InitialAssignment. A value of False indicates
that the species' quantity can be changed. (This is also a common
value because the purpose of most simulations is precisely to
calculate changes in species quantities.) In SBML Level 2, the
attribute has a default value of False, while in SBML Level 3, it has
no default. Note that the initial quantity of a species can be set by
an InitialAssignment irrespective of the value of the 'constant'
attribute.
In practice, a 'boundaryCondition' value of True means a differential
equation derived from the reaction definitions should not be generated
for the species. However, the species' quantity may still be changed
by AssignmentRule, RateRule, AlgebraicRule, Event, and
InitialAssignment constructs if its 'constant' attribute is False.
Conversely, if the species' 'constant' attribute is True, then its
value cannot be changed by anything except InitialAssignment.
A species having 'boundaryCondition'=False and 'constant'=False can
appear as a product and/or reactant of one or more reactions in the
model. If the species is a reactant or product of a reaction, it must
not also appear as the target of any AssignmentRule or RateRule object
in the model. If instead the species has 'boundaryCondition'=False
and 'constant'=True, then it cannot appear as a reactant or product,
or as the target of any AssignmentRule, RateRule or EventAssignment
object in the model.
The conversionFactor attribute in SBML Level 3
======================================================================
In SBML Level 3, Species has an additional optional attribute,
'conversionFactor', that defines a conversion factor that applies to a
particular species. The value must be the identifier of a Parameter
object instance defined in the model. That Parameter object must be a
constant, meaning its 'constant' attribute must be set to True. If a
given Species object definition defines a value for its
'conversionFactor' attribute, it takes precedence over any factor
defined by the Model object's 'conversionFactor' attribute.
The unit of measurement associated with a species' quantity can be
different from the unit of extent of reactions in the model. SBML
Level 3 avoids implicit unit conversions by providing an explicit way
to indicate any unit conversion that might be required. The use of a
conversion factor in computing the effects of reactions on a species'
quantity is explained in detail in the SBML Level 3 specification
document. Because the value of the 'conversionFactor' attribute is
the identifier of a Parameter object, and because parameters can have
units attached to them, the transformation from reaction extent units
to species units can be completely specified using this approach.
Note that the unit conversion factor is only applied when calculating
the effect of a reaction on a species. It is not used in any rules or
other SBML constructs that affect the species, and it is also not used
when the value of the species is referenced in a mathematical
expression.
The speciesType attribute in SBML Level 2 Versions 2-4
======================================================================
In SBML Level 2 Versions 2-4, each species in a model may optionally
be designated as belonging to a particular species type. The optional
attribute 'speciesType' is used to identify the species type of the
chemical entities that make up the pool represented by the Species
objects. The attribute's value must be the identifier of an existing
SpeciesType object in the model. If the 'speciesType' attribute is
not present on a particular species definition, it means the pool
contains chemical entities of a type unique to that pool; in effect, a
virtual species type is assumed for that species, and no other species
can belong to that species type. The value of 'speciesType'
attributes on species have no effect on the numerical interpretation
of a model; simulators and other numerical analysis software may
ignore 'speciesType' attributes.
There can be only one species of a given species type in any given
compartment of a model. More specifically, for all Species objects
having a value for the 'speciesType' attribute, the pair
('speciesType' attribute value, 'compartment' attribute value)
must be unique across the set of all Species object in a model.
The spatialSizeUnits attribute in SBML Level 2 Versions 1-2
======================================================================
In versions of SBML Level 2 before Version 3, the class Species
included an attribute called 'spatialSizeUnits', which allowed
explicitly setting the units of size for initial concentration.
LibSBML retains this attribute for compatibility with older
definitions of Level 2, but its use is strongly discouraged because
many software tools do no properly interpret this unit declaration and
it is incompatible with all SBML specifications after Level 2 Version
3.
Additional considerations for interpreting the numerical value of a
species
======================================================================
Species are unique in SBML in that they have a kind of duality: a
species identifier may stand for either substance amount (meaning, a
count of the number of individual entities) or a concentration or
density (meaning, amount divided by a compartment size). The previous
sections explain the meaning of a species identifier when it is
referenced in a mathematical formula or in rules or other SBML
constructs; however, it remains to specify what happens to a species
when the compartment in which it is located changes in size.
When a species definition has a 'hasOnlySubstanceUnits' attribute
value of False and the size of the compartment in which the species is
located changes, the default in SBML is to assume that it is the
concentration that must be updated to account for the size change.
This follows from the principle that, all other things held constant,
if a compartment simply changes in size, the size change does not in
itself cause an increase or decrease in the number of entities of any
species in that compartment. In a sense, the default is that the
amount of a species is preserved across compartment size changes.
Upon such size changes, the value of the concentration or density must
be recalculated from the simple relationship concentration = amount /
size if the value of the concentration is needed (for example, if the
species identifier appears in a mathematical formula or is otherwise
referenced in an SBML construct). There is one exception: if the
species' quantity is determined by an AssignmentRule, RateRule,
AlgebraicRule, or an EventAssignment and the species has a
'hasOnlySubstanceUnits' attribute value of False, it means that the
concentration is assigned by the rule or event; in that case, the
amount must be calculated when the compartment size changes. (Events
also require additional care in this situation, because an event with
multiple assignments could conceivably reassign both a species
quantity and a compartment size simultaneously. Please refer to the
SBML specifications for the details.)
Note that the above only matters if a species has a
'hasOnlySubstanceUnits' attribute value of False, meaning that the
species identifier refers to a concentration wherever the identifier
appears in a mathematical formula. If instead the attribute's value
is True, then the identifier of the species always stands for an
amount wherever it appears in a mathematical formula or is referenced
by an SBML construct. In that case, there is never a question about
whether an assignment or event is meant to affect the amount or
concentration: it is always the amount.
A particularly confusing situation can occur when the species has
'constant' attribute value of True in combination with a
'hasOnlySubstanceUnits' attribute value of False. Suppose this
species is given a value for 'initialConcentration'. Does a
'constant' value of True mean that the concentration is held constant
if the compartment size changes? No; it is still the amount that is
kept constant across a compartment size change. The fact that the
species was initialized using a concentration value is irrelevant.
"""
__swig_setmethods__ = {}
for _s in [SBase]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, Species, name, value)
__swig_getmethods__ = {}
for _s in [SBase]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, Species, name)
__repr__ = _swig_repr
__swig_destroy__ = _libsbml.delete_Species
__del__ = lambda self: None
def __init__(self, *args):
"""
__init__(Species self, unsigned int level, unsigned int version) -> Species
__init__(Species self, SBMLNamespaces sbmlns) -> Species
__init__(Species self, Species orig) -> Species
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
Species(SBMLNamespaces sbmlns)
Creates a new Species using the given SBMLNamespaces object 'sbmlns'.
The SBMLNamespaces object encapsulates SBML Level/Version/namespaces
information. It is used to communicate the SBML Level, Version, and
(in Level 3) packages used in addition to SBML Level 3 Core. A common
approach to using libSBML's SBMLNamespaces facilities is to create an
SBMLNamespaces object somewhere in a program once, then hand that
object as needed to object constructors that accept SBMLNamespaces as
arguments.
It is worth emphasizing that although this constructor does not take
an identifier argument, in SBML Level 2 and beyond, the 'id'
(identifier) attribute of a Species is required to have a value. Thus,
callers are cautioned to assign a value after calling this
constructor. Setting the identifier can be accomplished using the
method Species.setId().
Parameter 'sbmlns' is an SBMLNamespaces object.
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
______________________________________________________________________
Method variant with the following signature:
Species(long level, long version)
Creates a new Species using the given SBML 'level' and 'version'
values.
Parameter 'level' is a long integer, the SBML Level to assign to this
Species
Parameter 'version' is a long integer, the SBML Version to assign to
this Species
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
______________________________________________________________________
Method variant with the following signature:
Species(Species orig)
Copy constructor; creates a copy of this Species object.
Parameter 'orig' is the object to copy.
Throws SBMLConstructorException: Thrown if the argument 'orig' is
None.
"""
this = _libsbml.new_Species(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(Species self) -> Species
Creates and returns a deep copy of this Species object.
Returns the (deep) copy of this Species object.
"""
return _libsbml.Species_clone(self)
def initDefaults(self):
"""
initDefaults(Species self)
Initializes the fields of this Species object to 'typical' defaults
values.
The SBML Species component has slightly different aspects and default
attribute values in different SBML Levels and Versions. This method
sets the values to certain common defaults, based mostly on what they
are in SBML Level 2. Specifically:
* Sets 'boundaryCondition' to False
* Sets 'constant' to False
* sets 'hasOnlySubstanceUnits' to False
* (Applies to Level 3 models only) Sets attribute 'substanceUnits'
to mole
"""
return _libsbml.Species_initDefaults(self)
def getId(self):
"""
getId(Species self) -> string
Returns the value of the 'id' attribute of this Species object.
Returns the id of this Species object.
"""
return _libsbml.Species_getId(self)
def getName(self):
"""
getName(Species self) -> string
Returns the value of the 'name' attribute of this Species object.
Returns the name of this Species object.
"""
return _libsbml.Species_getName(self)
def getSpeciesType(self):
"""
getSpeciesType(Species self) -> string
Get the type of this Species object object.
Returns the value of the 'speciesType' attribute of this Species as a
string.
Note:
The 'speciesType' attribute is only available in SBML Level 2 Versions
2-4.
"""
return _libsbml.Species_getSpeciesType(self)
def getCompartment(self):
"""
getCompartment(Species self) -> string
Get the compartment in which this species is located.
The compartment is designated by its identifier.
Returns the value of the 'compartment' attribute of this Species
object, as a string.
"""
return _libsbml.Species_getCompartment(self)
def getInitialAmount(self):
"""
getInitialAmount(Species self) -> double
Get the value of the 'initialAmount' attribute.
Returns the initialAmount of this Species, as a float-point number.
"""
return _libsbml.Species_getInitialAmount(self)
def getInitialConcentration(self):
"""
getInitialConcentration(Species self) -> double
Get the value of the 'initialConcentration' attribute.
Returns the initialConcentration of this Species,, as a float-point
number.
Note:
The attribute 'initialConcentration' is only available in SBML Level 2
and 3. It does not exist on Species in Level 1.
"""
return _libsbml.Species_getInitialConcentration(self)
def getSubstanceUnits(self):
"""
getSubstanceUnits(Species self) -> string
Get the value of the 'substanceUnits' attribute.
Returns the value of the 'substanceUnits' attribute of this Species,
as a string. An empty string indicates that no units have been
assigned.
Note:
There is an important distinction to be made between no units
assigned, and assuming a value without units has any specific unit
such as dimensionless. In SBML, default units are never attributed to
numbers, and numbers without units are not automatically assumed to
have the unit dimensionless. Please consult the relevant SBML
specification document for a more in-depth explanation of this topic
and the SBML unit system.
See also isSetSubstanceUnits(), setSubstanceUnits().
"""
return _libsbml.Species_getSubstanceUnits(self)
def getSpatialSizeUnits(self):
"""
getSpatialSizeUnits(Species self) -> string
Get the value of the 'spatialSizeUnits' attribute.
Returns the value of the 'spatialSizeUnits' attribute of this Species
object, as a string.
WARNING:
In versions of SBML Level 2 before Version 3, the class Species
included an attribute called 'spatialSizeUnits', which allowed
explicitly setting the units of size for initial concentration. This
attribute was removed in SBML Level 2 Version 3. LibSBML retains this
attribute for compatibility with older definitions of Level 2, but its
use is strongly discouraged because it is incompatible with Level 2
Version 3 and Level 2 Version 4.
"""
return _libsbml.Species_getSpatialSizeUnits(self)
def getUnits(self):
"""
getUnits(Species self) -> string
Get the value of the 'units' attribute.
Returns the units of this Species (L1 only).
Note:
The 'units' attribute is defined only in SBML Level 1. In SBML Level
2 and Level 3, it has been replaced by a combination of
'substanceUnits' and the units of the Compartment object in which a
species is located. In SBML Level 2 Versions 1-2, an additional
attribute 'spatialSizeUnits' helps determine the units of the species
quantity, but this attribute was removed in later versions of SBML
Level 2.
"""
return _libsbml.Species_getUnits(self)
def getHasOnlySubstanceUnits(self):
"""
getHasOnlySubstanceUnits(Species self) -> bool
Get the value of the 'hasOnlySubstanceUnits' attribute.
Returns True if this Species' 'hasOnlySubstanceUnits' attribute value
is nonzero, False otherwise.
Note:
The 'hasOnlySubstanceUnits' attribute does not exist in SBML Level 1.
"""
return _libsbml.Species_getHasOnlySubstanceUnits(self)
def getBoundaryCondition(self):
"""
getBoundaryCondition(Species self) -> bool
Get the value of the 'boundaryCondition' attribute.
Returns True if this Species' 'boundaryCondition' attribute value is
nonzero, False otherwise.
"""
return _libsbml.Species_getBoundaryCondition(self)
def getCharge(self):
"""
getCharge(Species self) -> int
Get the value of the 'charge' attribute.
Returns the charge of this Species object.
Note:
Beginning in SBML Level 2 Version 2, the 'charge' attribute on Species
is deprecated and in SBML Level 3 it does not exist at all. Its use
strongly discouraged. Its presence is considered a misfeature in
earlier definitions of SBML because its implications for the
mathematics of a model were never defined, and in any case, no known
modeling system ever used it. Instead, models take account of charge
values directly in their definitions of species by (for example)
having separate species identities for the charged and uncharged
versions of the same species. This allows the condition to affect
model mathematics directly. LibSBML retains this method for easier
compatibility with SBML Level 1.
"""
return _libsbml.Species_getCharge(self)
def getConstant(self):
"""
getConstant(Species self) -> bool
Get the value of the 'constant' attribute.
Returns True if this Species's 'constant' attribute value is nonzero,
False otherwise.
Note:
The attribute 'constant' is only available in SBML Levels 2 and 3. It
does not exist on Species in Level 1.
"""
return _libsbml.Species_getConstant(self)
def getConversionFactor(self):
"""
getConversionFactor(Species self) -> string
Get the value of the 'conversionFactor' attribute.
Returns the conversionFactor of this Species, as a string.
Note:
The 'conversionFactor' attribute was introduced in SBML Level 3. It
does not exist on Species in SBML Levels 1 and 2.
"""
return _libsbml.Species_getConversionFactor(self)
def isSetId(self):
"""
isSetId(Species self) -> bool
Predicate returning True if this Species object's 'id' attribute is
set.
Returns True if the 'id' attribute of this Species is set, False
otherwise.
"""
return _libsbml.Species_isSetId(self)
def isSetName(self):
"""
isSetName(Species self) -> bool
Predicate returning True if this Species object's 'name' attribute is
set.
Returns True if the 'name' attribute of this Species is set, False
otherwise.
"""
return _libsbml.Species_isSetName(self)
def isSetSpeciesType(self):
"""
isSetSpeciesType(Species self) -> bool
Predicate returning True if this Species object's 'speciesType'
attribute is set.
Returns True if the 'speciesType' attribute of this Species is set,
False otherwise.
Note:
The 'speciesType' attribute is only available in SBML Level 2 Versions
2-4.
"""
return _libsbml.Species_isSetSpeciesType(self)
def isSetCompartment(self):
"""
isSetCompartment(Species self) -> bool
Predicate returning True if this Species object's 'compartment'
attribute is set.
Returns True if the 'compartment' attribute of this Species is set,
False otherwise.
"""
return _libsbml.Species_isSetCompartment(self)
def isSetInitialAmount(self):
"""
isSetInitialAmount(Species self) -> bool
Predicate returning True if this Species object's 'initialAmount'
attribute is set.
Returns True if the 'initialAmount' attribute of this Species is set,
False otherwise.
Note:
In SBML Level 1, Species' 'initialAmount' is required and therefore
should always be set. (However, in Level 1, the attribute has no
default value either, so this method will not return True until a
value has been assigned.) In SBML Level 2, 'initialAmount' is
optional and as such may or may not be set.
"""
return _libsbml.Species_isSetInitialAmount(self)
def isSetInitialConcentration(self):
"""
isSetInitialConcentration(Species self) -> bool
Predicate returning True if this Species object's
'initialConcentration' attribute is set.
Returns True if the 'initialConcentration' attribute of this Species
is set, False otherwise.
Note:
The attribute 'initialConcentration' is only available in SBML Level 2
and 3. It does not exist on Species in Level 1.
"""
return _libsbml.Species_isSetInitialConcentration(self)
def isSetSubstanceUnits(self):
"""
isSetSubstanceUnits(Species self) -> bool
Predicate returning True if this Species object's 'substanceUnits'
attribute is set.
Returns True if the 'substanceUnits' attribute of this Species is set,
False otherwise.
"""
return _libsbml.Species_isSetSubstanceUnits(self)
def isSetSpatialSizeUnits(self):
"""
isSetSpatialSizeUnits(Species self) -> bool
Predicate returning True if this Species object's 'spatialSizeUnits'
attribute is set.
Returns True if the 'spatialSizeUnits' attribute of this Species is
set, False otherwise.
WARNING:
In versions of SBML Level 2 before Version 3, the class Species
included an attribute called 'spatialSizeUnits', which allowed
explicitly setting the units of size for initial concentration. This
attribute was removed in SBML Level 2 Version 3. LibSBML retains this
attribute for compatibility with older definitions of Level 2, but its
use is strongly discouraged because it is incompatible with Level 2
Version 3 and Level 2 Version 4.
"""
return _libsbml.Species_isSetSpatialSizeUnits(self)
def isSetUnits(self):
"""
isSetUnits(Species self) -> bool
Predicate returning True if this Species object's 'units' attribute is
set.
Returns True if the 'units' attribute of this Species is set, False
otherwise.
"""
return _libsbml.Species_isSetUnits(self)
def isSetCharge(self):
"""
isSetCharge(Species self) -> bool
Predicate returning True if this Species object's 'charge' attribute
is set.
Returns True if the 'charge' attribute of this Species is set, False
otherwise.
Note:
Beginning in SBML Level 2 Version 2, the 'charge' attribute on Species
is deprecated and in SBML Level 3 it does not exist at all. Its use
strongly discouraged. Its presence is considered a misfeature in
earlier definitions of SBML because its implications for the
mathematics of a model were never defined, and in any case, no known
modeling system ever used it. Instead, models take account of charge
values directly in their definitions of species by (for example)
having separate species identities for the charged and uncharged
versions of the same species. This allows the condition to affect
model mathematics directly. LibSBML retains this method for easier
compatibility with SBML Level 1.
"""
return _libsbml.Species_isSetCharge(self)
def isSetConversionFactor(self):
"""
isSetConversionFactor(Species self) -> bool
Predicate returning True if this Species object's 'conversionFactor'
attribute is set.
Returns True if the 'conversionFactor' attribute of this Species is
set, False otherwise.
Note:
The 'conversionFactor' attribute was introduced in SBML Level 3. It
does not exist on Species in SBML Levels 1 and 2.
"""
return _libsbml.Species_isSetConversionFactor(self)
def isSetBoundaryCondition(self):
"""
isSetBoundaryCondition(Species self) -> bool
Predicate returning True if this Species object's 'boundaryCondition'
attribute is set.
Returns True if the 'boundaryCondition' attribute of this Species is
set, False otherwise.
"""
return _libsbml.Species_isSetBoundaryCondition(self)
def isSetHasOnlySubstanceUnits(self):
"""
isSetHasOnlySubstanceUnits(Species self) -> bool
Predicate returning True if this Species object's
'hasOnlySubstanceUnits' attribute is set.
Returns True if the 'hasOnlySubstanceUnits' attribute of this Species
is set, False otherwise.
Note:
The 'hasOnlySubstanceUnits' attribute does not exist in SBML Level 1.
"""
return _libsbml.Species_isSetHasOnlySubstanceUnits(self)
def isSetConstant(self):
"""
isSetConstant(Species self) -> bool
Predicate returning True if this Species object's 'constant' attribute
is set.
Returns True if the 'constant' attribute of this Species is set, False
otherwise.
Note:
The attribute 'constant' is only available in SBML Levels 2 and 3. It
does not exist on Species in Level 1.
"""
return _libsbml.Species_isSetConstant(self)
def setId(self, sid):
"""
setId(Species self, string sid) -> int
Sets the value of the 'id' attribute of this Species object.
The string 'sid' is copied.
SBML has strict requirements for the syntax of identifiers, that is,
the values of the 'id' attribute present on most types of SBML
objects. The following is a summary of the definition of the SBML
identifier type SId, which defines the permitted syntax of
identifiers. We express the syntax using an extended form of BNF
notation:
letter ::= 'a'..'z','A'..'Z'
digit ::= '0'..'9'
idChar ::= letter | digit | '_'
SId ::= ( letter | '_' ) idChar*
The characters ( and ) are used for grouping, the character * 'zero or
more times', and the character | indicates logical 'or'. The equality
of SBML identifiers is determined by an exact character sequence
match; i.e., comparisons must be performed in a case-sensitive manner.
In addition, there are a few conditions for the uniqueness of
identifiers in an SBML model. Please consult the SBML specifications
for the exact details of the uniqueness requirements.
Parameter 'sid' is the string to use as the identifier of this Species
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
"""
return _libsbml.Species_setId(self, sid)
def setName(self, name):
"""
setName(Species self, string name) -> int
Sets the value of the 'name' attribute of this Species object.
The string in 'name' is copied.
Parameter 'name' is the new name for the Species
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
"""
return _libsbml.Species_setName(self, name)
def setSpeciesType(self, sid):
"""
setSpeciesType(Species self, string sid) -> int
Sets the 'speciesType' attribute of this Species object.
Parameter 'sid' is the identifier of a SpeciesType object defined
elsewhere in this Model.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
* LIBSBML_UNEXPECTED_ATTRIBUTE
Note:
The 'speciesType' attribute is only available in SBML Level 2 Versions
2-4.
"""
return _libsbml.Species_setSpeciesType(self, sid)
def setCompartment(self, sid):
"""
setCompartment(Species self, string sid) -> int
Sets the 'compartment' attribute of this Species object.
Parameter 'sid' is the identifier of a Compartment object defined
elsewhere in this Model.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
"""
return _libsbml.Species_setCompartment(self, sid)
def setInitialAmount(self, value):
"""
setInitialAmount(Species self, double value) -> int
Sets the 'initialAmount' attribute of this Species and marks the field
as set.
This method also unsets the 'initialConcentration' attribute.
Parameter 'value' is the value to which the 'initialAmount' attribute
should be set.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
"""
return _libsbml.Species_setInitialAmount(self, value)
def setInitialConcentration(self, value):
"""
setInitialConcentration(Species self, double value) -> int
Sets the 'initialConcentration' attribute of this Species and marks
the field as set.
This method also unsets the 'initialAmount' attribute.
Parameter 'value' is the value to which the 'initialConcentration'
attribute should be set.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_UNEXPECTED_ATTRIBUTE
Note:
The attribute 'initialConcentration' is only available in SBML Level 2
and 3. It does not exist on Species in Level 1.
"""
return _libsbml.Species_setInitialConcentration(self, value)
def setSubstanceUnits(self, sid):
"""
setSubstanceUnits(Species self, string sid) -> int
Sets the 'substanceUnits' attribute of this Species object.
Parameter 'sid' is the identifier of the unit to use.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
"""
return _libsbml.Species_setSubstanceUnits(self, sid)
def setSpatialSizeUnits(self, sid):
"""
setSpatialSizeUnits(Species self, string sid) -> int
(SBML Level 2 Versions 1-2) Sets the 'spatialSizeUnits' attribute of
this Species object.
Parameter 'sid' is the identifier of the unit to use.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
* LIBSBML_UNEXPECTED_ATTRIBUTE
WARNING:
In versions of SBML Level 2 before Version 3, the class Species
included an attribute called 'spatialSizeUnits', which allowed
explicitly setting the units of size for initial concentration. This
attribute was removed in SBML Level 2 Version 3. LibSBML retains this
attribute for compatibility with older definitions of Level 2, but its
use is strongly discouraged because it is incompatible with Level 2
Version 3 and Level 2 Version 4.
"""
return _libsbml.Species_setSpatialSizeUnits(self, sid)
def setUnits(self, sname):
"""
setUnits(Species self, string sname) -> int
(SBML Level 1 only) Sets the units of this Species object.
Parameter 'sname' is the identifier of the unit to use.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
"""
return _libsbml.Species_setUnits(self, sname)
def setHasOnlySubstanceUnits(self, value):
"""
setHasOnlySubstanceUnits(Species self, bool value) -> int
Sets the 'hasOnlySubstanceUnits' attribute of this Species object.
Parameter 'value' is boolean value for the 'hasOnlySubstanceUnits'
attribute.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_UNEXPECTED_ATTRIBUTE
Note:
The 'hasOnlySubstanceUnits' attribute does not exist in SBML Level 1.
"""
return _libsbml.Species_setHasOnlySubstanceUnits(self, value)
def setBoundaryCondition(self, value):
"""
setBoundaryCondition(Species self, bool value) -> int
Sets the 'boundaryCondition' attribute of this Species object.
Parameter 'value' is boolean value for the 'boundaryCondition'
attribute.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
"""
return _libsbml.Species_setBoundaryCondition(self, value)
def setCharge(self, value):
"""
setCharge(Species self, int value) -> int
Sets the 'charge' attribute of this Species object.
Parameter 'value' is an integer to which to set the 'charge' to.
Note:
Beginning in SBML Level 2 Version 2, the 'charge' attribute on Species
is deprecated and in SBML Level 3 it does not exist at all. Its use
strongly discouraged. Its presence is considered a misfeature in
earlier definitions of SBML because its implications for the
mathematics of a model were never defined, and in any case, no known
modeling system ever used it. Instead, models take account of charge
values directly in their definitions of species by (for example)
having separate species identities for the charged and uncharged
versions of the same species. This allows the condition to affect
model mathematics directly. LibSBML retains this method for easier
compatibility with SBML Level 1.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_UNEXPECTED_ATTRIBUTE
"""
return _libsbml.Species_setCharge(self, value)
def setConstant(self, value):
"""
setConstant(Species self, bool value) -> int
Sets the 'constant' attribute of this Species object.
Parameter 'value' is a boolean value for the 'constant' attribute
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_UNEXPECTED_ATTRIBUTE
Note:
The attribute 'constant' is only available in SBML Levels 2 and 3. It
does not exist on Species in Level 1.
"""
return _libsbml.Species_setConstant(self, value)
def setConversionFactor(self, sid):
"""
setConversionFactor(Species self, string sid) -> int
Sets the value of the 'conversionFactor' attribute of this Species
object.
The string in 'sid' is copied.
Parameter 'sid' is the new conversionFactor for the Species
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_UNEXPECTED_ATTRIBUTE
* LIBSBML_INVALID_ATTRIBUTE_VALUE
Note:
The 'conversionFactor' attribute was introduced in SBML Level 3. It
does not exist on Species in SBML Levels 1 and 2.
"""
return _libsbml.Species_setConversionFactor(self, sid)
def unsetName(self):
"""
unsetName(Species self) -> int
Unsets the value of the 'name' attribute of this Species object.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
"""
return _libsbml.Species_unsetName(self)
def unsetSpeciesType(self):
"""
unsetSpeciesType(Species self) -> int
Unsets the 'speciesType' attribute value of this Species object.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
Note:
The attribute 'speciesType' is only available in SBML Level 2 Versions
2-4.
"""
return _libsbml.Species_unsetSpeciesType(self)
def unsetInitialAmount(self):
"""
unsetInitialAmount(Species self) -> int
Unsets the 'initialAmount' attribute value of this Species object.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
"""
return _libsbml.Species_unsetInitialAmount(self)
def unsetInitialConcentration(self):
"""
unsetInitialConcentration(Species self) -> int
Unsets the 'initialConcentration' attribute value of this Species
object.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
Note:
The attribute 'initialConcentration' is only available in SBML Level 2
and 3. It does not exist on Species in Level 1.
"""
return _libsbml.Species_unsetInitialConcentration(self)
def unsetSubstanceUnits(self):
"""
unsetSubstanceUnits(Species self) -> int
Unsets the 'substanceUnits' attribute value of this Species object.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
"""
return _libsbml.Species_unsetSubstanceUnits(self)
def unsetSpatialSizeUnits(self):
"""
unsetSpatialSizeUnits(Species self) -> int
Unsets the 'spatialSizeUnits' attribute value of this Species object.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
WARNING:
In versions of SBML Level 2 before Version 3, the class Species
included an attribute called 'spatialSizeUnits', which allowed
explicitly setting the units of size for initial concentration. This
attribute was removed in SBML Level 2 Version 3. LibSBML retains this
attribute for compatibility with older definitions of Level 2, but its
use is strongly discouraged because it is incompatible with Level 2
Version 3 and Level 2 Version 4.
"""
return _libsbml.Species_unsetSpatialSizeUnits(self)
def unsetUnits(self):
"""
unsetUnits(Species self) -> int
Unsets the 'units' attribute value of this Species object.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
"""
return _libsbml.Species_unsetUnits(self)
def unsetCharge(self):
"""
unsetCharge(Species self) -> int
Unsets the 'charge' attribute value of this Species object.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_UNEXPECTED_ATTRIBUTE
* LIBSBML_OPERATION_FAILED
Note:
Beginning in SBML Level 2 Version 2, the 'charge' attribute on Species
is deprecated and in SBML Level 3 it does not exist at all. Its use
strongly discouraged. Its presence is considered a misfeature in
earlier definitions of SBML because its implications for the
mathematics of a model were never defined, and in any case, no known
modeling system ever used it. Instead, models take account of charge
values directly in their definitions of species by (for example)
having separate species identities for the charged and uncharged
versions of the same species. This allows the condition to affect
model mathematics directly. LibSBML retains this method for easier
compatibility with SBML Level 1.
"""
return _libsbml.Species_unsetCharge(self)
def unsetConversionFactor(self):
"""
unsetConversionFactor(Species self) -> int
Unsets the 'conversionFactor' attribute value of this Species object.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_UNEXPECTED_ATTRIBUTE
* LIBSBML_OPERATION_FAILED
Note:
The 'conversionFactor' attribute was introduced in SBML Level 3. It
does not exist on Species in SBML Levels 1 and 2.
"""
return _libsbml.Species_unsetConversionFactor(self)
def getDerivedUnitDefinition(self, *args):
"""
getDerivedUnitDefinition(Species self) -> UnitDefinition
getDerivedUnitDefinition(Species self) -> UnitDefinition
Constructs and returns a UnitDefinition that corresponds to the units
of this Species' amount or concentration.
Species in SBML have an attribute ('substanceUnits') for declaring the
units of measurement intended for the species' amount or concentration
(depending on which one applies). In the absence of a value given for
'substanceUnits', the units are taken from the enclosing Model's
definition of 'substance' or 'substance'/(size of the compartment) in
which the species is located, or finally, if these are not redefined
by the Model, the relevant SBML default units for those quantities.
Following that procedure, the method getDerivedUnitDefinition()
returns a UnitDefinition based on the interpreted units of this
species's amount or concentration.
Note that the functionality that facilitates unit analysis depends on
the model as a whole. Thus, in cases where the object has not been
added to a model or the model itself is incomplete, unit analysis is
not possible and this method will return None.
Note also that unit declarations for Species are in terms of the
identifier of a unit, but this method returns a UnitDefinition object,
not a unit identifier. It does this by constructing an appropriate
UnitDefinition. Callers may find this particularly useful when used
in conjunction with the helper methods on UnitDefinition for comparing
different UnitDefinition objects.
In SBML Level 2 specifications prior to Version 3, Species includes an
additional attribute named 'spatialSizeUnits', which allows explicitly
setting the units of size for initial concentration. The
getDerivedUnitDefinition() takes this into account for models
expressed in SBML Level 2 Versions 1 and 2.
Returns a UnitDefinition that expresses the units of this Species, or
None if one cannot be constructed.
See also getSubstanceUnits().
"""
return _libsbml.Species_getDerivedUnitDefinition(self, *args)
def getTypeCode(self):
"""
getTypeCode(Species self) -> int
Returns the libSBML type code for this SBML object.
LibSBML attaches an identifying code to every kind of SBML object.
These are integer constants known as SBML type codes. The names of
all the codes begin with the characters SBML_. In the Python language
interface for libSBML, the type codes are defined as static integer
constants in the interface class 'libsbml'. Note that different Level
3 package plug-ins may use overlapping type codes; to identify the
package to which a given object belongs, call the getPackageName()
method on the object.
Returns the SBML type code for this object: SBML_SPECIES (default).
WARNING:
The specific integer values of the possible type codes may be reused
by different Level 3 package plug-ins. Thus, to identifiy the correct
code, it is necessary to invoke both getTypeCode() and
getPackageName().
See also getElementName(), getPackageName().
"""
return _libsbml.Species_getTypeCode(self)
def getElementName(self):
"""
getElementName(Species self) -> string
Returns the XML element name of this object, which for Species, is
always 'species'.
Returns the name of this element, i.e., 'species'.
"""
return _libsbml.Species_getElementName(self)
def hasRequiredAttributes(self):
"""
hasRequiredAttributes(Species self) -> bool
Predicate returning True if all the required attributes for this
Species object have been set.
The required attributes for a Species object are:
* 'id' (or 'name' in SBML Level 1)
* 'compartment'
* 'initialAmount' (required in SBML Level 1 only; optional
otherwise)
* 'hasOnlySubstanceUnits' (required in SBML Level 3; optional in
SBML Level 2)
* 'boundaryCondition' (required in SBML Level 3; optional in Levels
1 and 2)
* 'constant' (required in SBML Level 3; optional in SBML Level 2)
Returns True if the required attributes have been set, False
otherwise.
"""
return _libsbml.Species_hasRequiredAttributes(self)
def renameSIdRefs(self, oldid, newid):
"""
renameSIdRefs(Species self, string oldid, string newid)
Replaces all uses of a given SIdRef type attribute value with another
value.
In SBML, object identifiers are of a data type called SId. In SBML
Level 3, an explicit data type called SIdRef was introduced for
attribute values that refer to SId values; in previous Levels of SBML,
this data type did not exist and attributes were simply described to
as 'referring to an identifier', but the effective data type was the
same as SIdRefin Level 3. These and other methods of libSBML refer to
the type SIdRef for all Levels of SBML, even if the corresponding SBML
specification did not explicitly name the data type.
This method works by looking at all attributes and (if appropriate)
mathematical formulas in MathML content, comparing the referenced
identifiers to the value of 'oldid'. If any matches are found, the
matching values are replaced with 'newid'. The method does not
descend into child elements.
Parameter 'oldid' is the old identifier Parameter 'newid' is the new
identifier
"""
return _libsbml.Species_renameSIdRefs(self, oldid, newid)
def renameUnitSIdRefs(self, oldid, newid):
"""
renameUnitSIdRefs(Species self, string oldid, string newid)
Replaces all uses of a given UnitSIdRef type attribute value with
another value.
In SBML, unit definitions have identifiers of type UnitSId. In SBML
Level 3, an explicit data type called UnitSIdRef was introduced for
attribute values that refer to UnitSId values; in previous Levels of
SBML, this data type did not exist and attributes were simply
described to as 'referring to a unit identifier', but the effective
data type was the same as UnitSIdRef in Level 3. These and other
methods of libSBML refer to the type UnitSIdRef for all Levels of
SBML, even if the corresponding SBML specification did not explicitly
name the data type.
This method works by looking at all unit identifier attribute values
(including, if appropriate, inside mathematical formulas), comparing
the referenced unit identifiers to the value of 'oldid'. If any
matches are found, the matching values are replaced with 'newid'. The
method does not descend into child elements.
Parameter 'oldid' is the old identifier Parameter 'newid' is the new
identifier
"""
return _libsbml.Species_renameUnitSIdRefs(self, oldid, newid)
Species_swigregister = _libsbml.Species_swigregister
Species_swigregister(Species)
class ListOfSpecies(ListOf):
"""
A list of Species objects.
The various ListOf___ classes in SBML are merely containers used for
organizing the main components of an SBML model. In libSBML's
implementation, ListOf___ classes are derived from the intermediate
utility class ListOf, which is not defined by the SBML specifications
but serves as a useful programmatic construct. ListOf is itself is in
turn derived from SBase, which provides all of the various ListOf___
classes with common features defined by the SBML specification, such
as 'metaid' attributes and annotations.
The relationship between the lists and the rest of an SBML model is
illustrated by the following (for SBML Level 2 Version 4):
...
...
...
...
...
...
... elements of subclasses of Rule ...
...
...
...
Readers may wonder about the motivations for using the ListOf___
containers in SBML. A simpler approach in XML might be to place the
components all directly at the top level of the model definition. The
choice made in SBML is to group them within XML elements named after
ListOfClassname, in part because it helps organize the components.
More importantly, the fact that the container classes are derived from
SBase means that software tools can add information about the lists
themselves into each list container's 'annotation'.
See also ListOfFunctionDefinitions, ListOfUnitDefinitions,
ListOfCompartmentTypes, ListOfSpeciesTypes, ListOfCompartments,
ListOfSpecies, ListOfParameters, ListOfInitialAssignments,
ListOfRules, ListOfConstraints, ListOfReactions, ListOfEvents.
"""
__swig_setmethods__ = {}
for _s in [ListOf]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, ListOfSpecies, name, value)
__swig_getmethods__ = {}
for _s in [ListOf]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, ListOfSpecies, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(ListOfSpecies self, unsigned int level, unsigned int version) -> ListOfSpecies
__init__(ListOfSpecies self, SBMLNamespaces sbmlns) -> ListOfSpecies
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
ListOfSpecies(SBMLNamespaces sbmlns)
Creates a new ListOfSpecies object.
The object is constructed such that it is valid for the SBML Level and
Version combination determined by the SBMLNamespaces object in
'sbmlns'.
Parameter 'sbmlns' is an SBMLNamespaces object that is used to
determine the characteristics of the ListOfSpecies object to be
created.
______________________________________________________________________
Method variant with the following signature:
ListOfSpecies(long level, long version)
Creates a new ListOfSpecies object.
The object is constructed such that it is valid for the given SBML
Level and Version combination.
Parameter 'level' is the SBML Level
Parameter 'version' is the Version within the SBML Level
"""
this = _libsbml.new_ListOfSpecies(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(ListOfSpecies self) -> ListOfSpecies
Creates and returns a deep copy of this ListOfSpecies object.
Returns the (deep) copy of this ListOfSpecies object.
"""
return _libsbml.ListOfSpecies_clone(self)
def getItemTypeCode(self):
"""
getItemTypeCode(ListOfSpecies self) -> int
Returns the libSBML type code for the objects contained in this ListOf
(i.e., Species objects, if the list is non-empty).
LibSBML attaches an identifying code to every kind of SBML object.
These are integer constants known as SBML type codes. The names of
all the codes begin with the characters SBML_. In the Python language
interface for libSBML, the type codes are defined as static integer
constants in the interface class 'libsbml'. Note that different Level
3 package plug-ins may use overlapping type codes; to identify the
package to which a given object belongs, call the getPackageName()
method on the object.
Returns the SBML type code for objects contained in this list:
SBML_SPECIES (default).
See also getElementName(), getPackageName().
"""
return _libsbml.ListOfSpecies_getItemTypeCode(self)
def getElementName(self):
"""
getElementName(ListOfSpecies self) -> string
Returns the XML element name of this object.
For ListOfSpeciess, the XML element name is 'listOfSpeciess'.
Returns the name of this element, i.e., 'listOfSpeciess'.
"""
return _libsbml.ListOfSpecies_getElementName(self)
def get(self, *args):
"""
get(ListOfSpecies self, unsigned int n) -> Species
get(ListOfSpecies self, unsigned int n) -> Species
get(ListOfSpecies self, string sid) -> Species
get(ListOfSpecies self, string sid) -> Species
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
get(string sid)
Get a Species from the ListOfSpecies based on its identifier.
Parameter 'sid' is a string representing the identifier of the
Species to get.
Returns Species in this ListOfSpecies with the given 'sid' or None if
no such Species exists.
See also get(), size(), size().
"""
return _libsbml.ListOfSpecies_get(self, *args)
def remove(self, *args):
"""
remove(ListOfSpecies self, unsigned int n) -> Species
remove(ListOfSpecies self, string sid) -> Species
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
remove(string sid)
Removes item in this ListOfSpeciess items with the given identifier.
The caller owns the returned item and is responsible for deleting it.
If none of the items in this list have the identifier 'sid', then None
is returned.
Parameter 'sid' is the identifier of the item to remove
Returns the item removed. As mentioned above, the caller owns the
returned item.
______________________________________________________________________
Method variant with the following signature:
remove(long n)
Removes the nth item from this ListOfSpeciess items and returns a
pointer to it.
The caller owns the returned item and is responsible for deleting it.
Parameter 'n' is the index of the item to remove
See also size().
"""
return _libsbml.ListOfSpecies_remove(self, *args)
__swig_destroy__ = _libsbml.delete_ListOfSpecies
__del__ = lambda self: None
ListOfSpecies_swigregister = _libsbml.ListOfSpecies_swigregister
ListOfSpecies_swigregister(ListOfSpecies)
class Parameter(SBase):
"""
An SBML parameter: a named symbol with a value.
A Parameter is used in SBML to define a symbol associated with a
value; this symbol can then be used in mathematical formulas in a
model. By default, parameters have constant value for the duration of
a simulation, and for this reason are called parameters instead of
variables in SBML, although it is crucial to understand that SBML
parameters represent both concepts. Whether a given SBML parameter is
intended to be constant or variable is indicated by the value of its
'constant' attribute.
SBML's Parameter has a required attribute, 'id', that gives the
parameter a unique identifier by which other parts of an SBML model
definition can refer to it. A parameter can also have an optional
'name' attribute of type string. Identifiers and names must be used
according to the guidelines described in the SBML specifications.
The optional attribute 'value' determines the value (of type float)
assigned to the parameter. A missing value for 'value' implies that
the value either is unknown, or to be obtained from an external
source, or determined by an initial assignment. The unit of
measurement associated with the value of the parameter can be
specified using the optional attribute 'units'. Here we only mention
briefly some notable points about the possible unit choices, but
readers are urged to consult the SBML specification documents for more
information:
* In SBML Level 3, there are no constraints on the units that can be
assigned to parameters in a model; there are also no units to inherit
from the enclosing Model object (unlike the case for, e.g., Species
and Compartment).
* In SBML Level 2, the value assigned to the parameter's 'units'
attribute must be chosen from one of the following possibilities: one
of the base unit identifiers defined in SBML; one of the built-in unit
identifiers 'substance', 'time', 'volume', 'area' or 'length'; or the
identifier of a new unit defined in the list of unit definitions in
the enclosing Model structure. There are no constraints on the units
that can be chosen from these sets. There are no default units for
parameters. The Parameter structure has another boolean attribute
named 'constant' that is used to indicate whether the parameter's
value can vary during a simulation. (In SBML Level 3, the attribute
is mandatory and must be given a value; in SBML Levels below Level 3,
the attribute is optional.) A value of True indicates the parameter's
value cannot be changed by any construct except InitialAssignment.
Conversely, if the value of 'constant' is False, other constructs in
SBML, such as rules and events, can change the value of the parameter.
SBML Level 3 uses a separate object class, LocalParameter, for
parameters that are local to a Reaction's KineticLaw. In Levels prior
to SBML Level 3, the Parameter class is used both for definitions of
global parameters, as well as reaction-local parameters stored in a
list within KineticLaw objects. Parameter objects that are local to a
reaction (that is, those defined within the KineticLaw structure of a
Reaction) cannot be changed by rules and therefore are implicitly
always constant; consequently, in SBML Level 2, parameter definitions
within Reaction structures should not have their 'constant' attribute
set to False.
What if a global parameter has its 'constant' attribute set to False,
but the model does not contain any rules, events or other constructs
that ever change its value over time? Although the model may be
suspect, this situation is not strictly an error. A value of False
for 'constant' only indicates that a parameter can change value, not
that it must.
As with all other major SBML components, Parameter is derived from
SBase, and the methods defined on SBase are available on Parameter.
Note:
The use of the term parameter in SBML sometimes leads to confusion
among readers who have a particular notion of what something called
'parameter' should be. It has been the source of heated debate, but
despite this, no one has yet found an adequate replacement term that
does not have different connotations to different people and hence
leads to confusion among some subset of users. Perhaps it would have
been better to have two constructs, one called constants and the other
called variables. The current approach in SBML is simply more
parsimonious, using a single Parameter construct with the boolean flag
'constant' indicating which flavor it is. In any case, readers are
implored to look past their particular definition of a parameter and
simply view SBML's Parameter as a single mechanism for defining both
constants and (additional) variables in a model. (We write additional
because the species in a model are usually considered to be the
central variables.) After all, software tools are not required to
expose to users the actual names of particular SBML constructs, and
thus tools can present to their users whatever terms their designers
feel best matches their target audience.
See also ListOfParameters.
"""
__swig_setmethods__ = {}
for _s in [SBase]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, Parameter, name, value)
__swig_getmethods__ = {}
for _s in [SBase]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, Parameter, name)
__repr__ = _swig_repr
__swig_destroy__ = _libsbml.delete_Parameter
__del__ = lambda self: None
def __init__(self, *args):
"""
__init__(Parameter self, unsigned int level, unsigned int version) -> Parameter
__init__(Parameter self, SBMLNamespaces sbmlns) -> Parameter
__init__(Parameter self, Parameter orig) -> Parameter
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
Parameter(SBMLNamespaces sbmlns)
Creates a new Parameter using the given SBMLNamespaces object
'sbmlns'.
The SBMLNamespaces object encapsulates SBML Level/Version/namespaces
information. It is used to communicate the SBML Level, Version, and
(in Level 3) packages used in addition to SBML Level 3 Core. A common
approach to using libSBML's SBMLNamespaces facilities is to create an
SBMLNamespaces object somewhere in a program once, then hand that
object as needed to object constructors that accept SBMLNamespaces as
arguments.
It is worth emphasizing that although this constructor does not take
an identifier argument, in SBML Level 2 and beyond, the 'id'
(identifier) attribute of a Parameter is required to have a value.
Thus, callers are cautioned to assign a value after calling this
constructor if no identifier is provided as an argument. Setting the
identifier can be accomplished using the method setId().
Parameter 'sbmlns' is an SBMLNamespaces object.
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
______________________________________________________________________
Method variant with the following signature:
Parameter(long level, long version)
Creates a new Parameter using the given SBML 'level' and 'version'
values.
Parameter 'level' is a long integer, the SBML Level to assign to this
Parameter
Parameter 'version' is a long integer, the SBML Version to assign to
this Parameter
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
______________________________________________________________________
Method variant with the following signature:
Parameter(Parameter orig)
Copy constructor; creates a copy of a Parameter.
Parameter 'orig' is the Parameter instance to copy.
Throws SBMLConstructorException: Thrown if the argument 'orig' is
None.
"""
this = _libsbml.new_Parameter(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(Parameter self) -> Parameter
Creates and returns a deep copy of this Parameter object.
Returns the (deep) copy of this Parameter object.
"""
return _libsbml.Parameter_clone(self)
def initDefaults(self):
"""
initDefaults(Parameter self)
Initializes the fields of this Parameter object to 'typical' defaults
values.
The SBML Parameter component has slightly different aspects and
default attribute values in different SBML Levels and Versions. Many
SBML object classes defined by libSBML have an initDefaults() method
to set the values to certain common defaults, based mostly on what
they are in SBML Level 2. In the case of Parameter, this method only
sets the value of the 'constant' attribute to True.
See also getConstant(), isSetConstant(), setConstant().
"""
return _libsbml.Parameter_initDefaults(self)
def getId(self):
"""
getId(Parameter self) -> string
Returns the value of the 'id' attribute of this Parameter.
Returns the id of this Parameter.
"""
return _libsbml.Parameter_getId(self)
def getName(self):
"""
getName(Parameter self) -> string
Returns the value of the 'name' attribute of this Parameter.
Returns the name of this Parameter.
"""
return _libsbml.Parameter_getName(self)
def getValue(self):
"""
getValue(Parameter self) -> double
Gets the numerical value of this Parameter.
Returns the value of the 'value' attribute of this Parameter, as a
number of type float.
Note:
It is crucial that callers not blindly call Parameter.getValue()
without first using Parameter.isSetValue() to determine whether a
value has ever been set. Otherwise, the value return by
Parameter.getValue() may not actually represent a value assigned to
the parameter. The reason is simply that the data type float in a
program always has some value. A separate test is needed to determine
whether the value is a true model value, or uninitialized data in a
computer's memory location.
See also isSetValue(), setValue(), getUnits().
"""
return _libsbml.Parameter_getValue(self)
def getUnits(self):
"""
getUnits(Parameter self) -> string
Gets the units defined for this Parameter.
The value of an SBML parameter's 'units' attribute establishes the
unit of measurement associated with the parameter's value.
Returns the value of the 'units' attribute of this Parameter, as a
string. An empty string indicates that no units have been assigned.
Note:
There is an important distinction to be made between no units
assigned, and assuming a value without units has any specific unit
such as dimensionless. In SBML, default units are never attributed to
numbers, and numbers without units are not automatically assumed to
have the unit dimensionless. Please consult the relevant SBML
specification document for a more in-depth explanation of this topic
and the SBML unit system.
See also isSetUnits(), setUnits(), getValue().
"""
return _libsbml.Parameter_getUnits(self)
def getConstant(self):
"""
getConstant(Parameter self) -> bool
Gets the value of the 'constant' attribute of this Parameter instance.
Returns True if this Parameter is declared as being constant, False
otherwise.
Note:
Readers who view the documentation for LocalParameter may be confused
about the presence of this method. LibSBML derives LocalParameter
from Parameter; however, this does not precisely match the object
hierarchy defined by SBML Level 3, where LocalParameter is derived
directly from SBase and not Parameter. We believe this arrangement
makes it easier for libSBML users to program applications that work
with both SBML Level 2 and SBML Level 3, but programmers should also
keep in mind this difference exists. A side-effect of libSBML's
scheme is that certain methods on LocalParameter that are inherited
from Parameter do not actually have relevance to LocalParameter
objects. An example of this is the methods pertaining to Parameter's
attribute 'constant' (i.e., isSetConstant(), setConstant(), and
getConstant()).
See also isSetConstant(), setConstant().
"""
return _libsbml.Parameter_getConstant(self)
def isSetId(self):
"""
isSetId(Parameter self) -> bool
Predicate returning True if this Parameter's 'id' attribute is set.
Returns True if the 'id' attribute of this Parameter is set, False
otherwise.
"""
return _libsbml.Parameter_isSetId(self)
def isSetName(self):
"""
isSetName(Parameter self) -> bool
Predicate returning True if this Parameter's 'name' attribute is set.
Returns True if the 'name' attribute of this Parameter is set, False
otherwise.
"""
return _libsbml.Parameter_isSetName(self)
def isSetValue(self):
"""
isSetValue(Parameter self) -> bool
Predicate returning True if the 'value' attribute of this Parameter is
set.
In SBML definitions after SBML Level 1 Version 1, parameter values are
optional and have no defaults. If a model read from a file does not
contain a setting for the 'value' attribute of a parameter, its value
is considered unset; it does not default to any particular value.
Similarly, when a Parameter object is created in libSBML, it has no
value until given a value. The Parameter.isSetValue() method allows
calling applications to determine whether a given parameter's value
has ever been set.
In SBML Level 1 Version 1, parameters are required to have values and
therefore, the value of a Parameter should always be set. In Level 1
Version 2 and beyond, the value is optional and as such, the 'value'
attribute may or may not be set.
Returns True if the value of this Parameter is set, False otherwise.
See also getValue(), setValue().
"""
return _libsbml.Parameter_isSetValue(self)
def isSetUnits(self):
"""
isSetUnits(Parameter self) -> bool
Predicate returning True if the 'units' attribute of this Parameter is
set.
Returns True if the 'units' attribute of this Parameter is set, False
otherwise.
Note:
There is an important distinction to be made between no units
assigned, and assuming a value without units has any specific unit
such as dimensionless. In SBML, default units are never attributed to
numbers, and numbers without units are not automatically assumed to
have the unit dimensionless. Please consult the relevant SBML
specification document for a more in-depth explanation of this topic
and the SBML unit system.
"""
return _libsbml.Parameter_isSetUnits(self)
def isSetConstant(self):
"""
isSetConstant(Parameter self) -> bool
Predicate returning True if the 'constant' attribute of this Parameter
is set.
Returns True if the 'constant' attribute of this Parameter is set,
False otherwise.
Note:
Readers who view the documentation for LocalParameter may be confused
about the presence of this method. LibSBML derives LocalParameter
from Parameter; however, this does not precisely match the object
hierarchy defined by SBML Level 3, where LocalParameter is derived
directly from SBase and not Parameter. We believe this arrangement
makes it easier for libSBML users to program applications that work
with both SBML Level 2 and SBML Level 3, but programmers should also
keep in mind this difference exists. A side-effect of libSBML's
scheme is that certain methods on LocalParameter that are inherited
from Parameter do not actually have relevance to LocalParameter
objects. An example of this is the methods pertaining to Parameter's
attribute 'constant' (i.e., isSetConstant(), setConstant(), and
getConstant()).
See also getConstant(), setConstant().
"""
return _libsbml.Parameter_isSetConstant(self)
def setId(self, sid):
"""
setId(Parameter self, string sid) -> int
Sets the value of the 'id' attribute of this Parameter.
The string 'sid' is copied.
SBML has strict requirements for the syntax of identifiers, that is,
the values of the 'id' attribute present on most types of SBML
objects. The following is a summary of the definition of the SBML
identifier type SId, which defines the permitted syntax of
identifiers. We express the syntax using an extended form of BNF
notation:
letter ::= 'a'..'z','A'..'Z'
digit ::= '0'..'9'
idChar ::= letter | digit | '_'
SId ::= ( letter | '_' ) idChar*
The characters ( and ) are used for grouping, the character * 'zero or
more times', and the character | indicates logical 'or'. The equality
of SBML identifiers is determined by an exact character sequence
match; i.e., comparisons must be performed in a case-sensitive manner.
In addition, there are a few conditions for the uniqueness of
identifiers in an SBML model. Please consult the SBML specifications
for the exact details of the uniqueness requirements.
Parameter 'sid' is the string to use as the identifier of this
Parameter
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
"""
return _libsbml.Parameter_setId(self, sid)
def setName(self, name):
"""
setName(Parameter self, string name) -> int
Sets the value of the 'name' attribute of this Parameter.
The string in 'name' is copied.
Parameter 'name' is the new name for the Parameter
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
"""
return _libsbml.Parameter_setName(self, name)
def setValue(self, value):
"""
setValue(Parameter self, double value) -> int
Sets the 'value' attribute of this Parameter to the given float value
and marks the attribute as set.
Parameter 'value' is a float, the value to assign
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
"""
return _libsbml.Parameter_setValue(self, value)
def setUnits(self, units):
"""
setUnits(Parameter self, string units) -> int
Sets the 'units' attribute of this Parameter to a copy of the given
units identifier 'units'.
Parameter 'units' is a string, the identifier of the units to assign
to this Parameter instance
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
"""
return _libsbml.Parameter_setUnits(self, units)
def setConstant(self, flag):
"""
setConstant(Parameter self, bool flag) -> int
Sets the 'constant' attribute of this Parameter to the given boolean
'flag'.
Parameter 'flag' is a boolean, the value for the 'constant' attribute
of this Parameter instance
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_UNEXPECTED_ATTRIBUTE
Note:
Readers who view the documentation for LocalParameter may be confused
about the presence of this method. LibSBML derives LocalParameter
from Parameter; however, this does not precisely match the object
hierarchy defined by SBML Level 3, where LocalParameter is derived
directly from SBase and not Parameter. We believe this arrangement
makes it easier for libSBML users to program applications that work
with both SBML Level 2 and SBML Level 3, but programmers should also
keep in mind this difference exists. A side-effect of libSBML's
scheme is that certain methods on LocalParameter that are inherited
from Parameter do not actually have relevance to LocalParameter
objects. An example of this is the methods pertaining to Parameter's
attribute 'constant' (i.e., isSetConstant(), setConstant(), and
getConstant()).
See also getConstant(), isSetConstant().
"""
return _libsbml.Parameter_setConstant(self, flag)
def unsetName(self):
"""
unsetName(Parameter self) -> int
Unsets the value of the 'name' attribute of this Parameter.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
"""
return _libsbml.Parameter_unsetName(self)
def unsetValue(self):
"""
unsetValue(Parameter self) -> int
Unsets the 'value' attribute of this Parameter instance.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
In SBML Level 1 Version 1, parameters are required to have values and
therefore, the value of a Parameter should always be set. In SBML
Level 1 Version 2 and beyond, the value is optional and as such, the
'value' attribute may or may not be set.
"""
return _libsbml.Parameter_unsetValue(self)
def unsetUnits(self):
"""
unsetUnits(Parameter self) -> int
Unsets the 'units' attribute of this Parameter instance.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
"""
return _libsbml.Parameter_unsetUnits(self)
def getDerivedUnitDefinition(self, *args):
"""
getDerivedUnitDefinition(Parameter self) -> UnitDefinition
getDerivedUnitDefinition(Parameter self) -> UnitDefinition
Constructs and returns a UnitDefinition that corresponds to the units
of this Parameter's value.
Parameters in SBML have an attribute ('units') for declaring the units
of measurement intended for the parameter's value. No defaults are
defined by SBML in the absence of a definition for 'units'. This
method returns a UnitDefinition object based on the units declared for
this Parameter using its 'units' attribute, or it returns None if no
units have been declared.
Note that unit declarations for Parameter objects are specified in
terms of the identifier of a unit (e.g., using setUnits()), but this
method returns a UnitDefinition object, not a unit identifier. It
does this by constructing an appropriate UnitDefinition.For SBML Level
2 models, it will do this even when the value of the 'units' attribute
is one of the special SBML Level 2 unit identifiers 'substance',
'volume', 'area', 'length' or 'time'. Callers may find this useful in
conjunction with the helper methods provided by the UnitDefinition
class for comparing different UnitDefinition objects.
Returns a UnitDefinition that expresses the units of this Parameter,
or None if one cannot be constructed.
Note:
The libSBML system for unit analysis depends on the model as a whole.
In cases where the Parameter object has not yet been added to a model,
or the model itself is incomplete, unit analysis is not possible, and
consequently this method will return None.
See also isSetUnits().
"""
return _libsbml.Parameter_getDerivedUnitDefinition(self, *args)
def getTypeCode(self):
"""
getTypeCode(Parameter self) -> int
Returns the libSBML type code for this SBML object.
LibSBML attaches an identifying code to every kind of SBML object.
These are integer constants known as SBML type codes. The names of
all the codes begin with the characters SBML_. In the Python language
interface for libSBML, the type codes are defined as static integer
constants in the interface class 'libsbml'. Note that different Level
3 package plug-ins may use overlapping type codes; to identify the
package to which a given object belongs, call the getPackageName()
method on the object.
Returns the SBML type code for this object: SBML_PARAMETER (default).
WARNING:
The specific integer values of the possible type codes may be reused
by different Level 3 package plug-ins. Thus, to identifiy the correct
code, it is necessary to invoke both getTypeCode() and
getPackageName().
See also getElementName(), getPackageName().
"""
return _libsbml.Parameter_getTypeCode(self)
def getElementName(self):
"""
getElementName(Parameter self) -> string
Returns the XML element name of this object, which for Parameter, is
always 'parameter'.
Returns the name of this element, i.e., 'parameter'.
"""
return _libsbml.Parameter_getElementName(self)
def hasRequiredAttributes(self):
"""
hasRequiredAttributes(Parameter self) -> bool
Predicate returning True if all the required attributes for this
Parameter object have been set.
The required attributes for a Parameter object are:
* 'id' (or 'name' in SBML Level 1)
* 'value' (required in Level 1, optional otherwise)
Returns True if the required attributes have been set, False
otherwise.
"""
return _libsbml.Parameter_hasRequiredAttributes(self)
def renameUnitSIdRefs(self, oldid, newid):
"""
renameUnitSIdRefs(Parameter self, string oldid, string newid)
Renames all the UnitSIdRef attributes on this element.
In SBML, unit definitions have identifiers of type UnitSId. In SBML
Level 3, an explicit data type called UnitSIdRef was introduced for
attribute values that refer to UnitSId values; in previous Levels of
SBML, this data type did not exist and attributes were simply
described to as 'referring to a unit identifier', but the effective
data type was the same as UnitSIdRef in Level 3. These and other
methods of libSBML refer to the type UnitSIdRef for all Levels of
SBML, even if the corresponding SBML specification did not explicitly
name the data type.
This method works by looking at all unit identifier attribute values
(including, if appropriate, inside mathematical formulas), comparing
the unit identifiers to the value of 'oldid'. If any matches are
found, the matching identifiers are replaced with 'newid'. The method
does not descend into child elements.
Parameter 'oldid' is the old identifier Parameter 'newid' is the new
identifier
"""
return _libsbml.Parameter_renameUnitSIdRefs(self, oldid, newid)
def setCalculatingUnits(self, calculatingUnits):
"""
setCalculatingUnits(Parameter self, bool calculatingUnits)
Internal implementation method.
"""
return _libsbml.Parameter_setCalculatingUnits(self, calculatingUnits)
Parameter_swigregister = _libsbml.Parameter_swigregister
Parameter_swigregister(Parameter)
class ListOfParameters(ListOf):
"""
A list of Parameter objects.
The various ListOf___ classes in SBML are merely containers used for
organizing the main components of an SBML model. In libSBML's
implementation, ListOf___ classes are derived from the intermediate
utility class ListOf, which is not defined by the SBML specifications
but serves as a useful programmatic construct. ListOf is itself is in
turn derived from SBase, which provides all of the various ListOf___
classes with common features defined by the SBML specification, such
as 'metaid' attributes and annotations.
The relationship between the lists and the rest of an SBML model is
illustrated by the following (for SBML Level 2 Version 4):
...
...
...
...
...
...
... elements of subclasses of Rule ...
...
...
...
Readers may wonder about the motivations for using the ListOf___
containers in SBML. A simpler approach in XML might be to place the
components all directly at the top level of the model definition. The
choice made in SBML is to group them within XML elements named after
ListOfClassname, in part because it helps organize the components.
More importantly, the fact that the container classes are derived from
SBase means that software tools can add information about the lists
themselves into each list container's 'annotation'.
See also ListOfFunctionDefinitions, ListOfUnitDefinitions,
ListOfCompartmentTypes, ListOfSpeciesTypes, ListOfCompartments,
ListOfSpecies, ListOfParameters, ListOfInitialAssignments,
ListOfRules, ListOfConstraints, ListOfReactions, ListOfEvents.
"""
__swig_setmethods__ = {}
for _s in [ListOf]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, ListOfParameters, name, value)
__swig_getmethods__ = {}
for _s in [ListOf]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, ListOfParameters, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(ListOfParameters self, unsigned int level, unsigned int version) -> ListOfParameters
__init__(ListOfParameters self, SBMLNamespaces sbmlns) -> ListOfParameters
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
ListOfParameters(SBMLNamespaces sbmlns)
Creates a new ListOfParameters object.
The object is constructed such that it is valid for the SBML Level and
Version combination determined by the SBMLNamespaces object in
'sbmlns'.
Parameter 'sbmlns' is an SBMLNamespaces object that is used to
determine the characteristics of the ListOfParameters object to be
created.
______________________________________________________________________
Method variant with the following signature:
ListOfParameters(long level, long version)
Creates a new ListOfParameters object.
The object is constructed such that it is valid for the given SBML
Level and Version combination.
Parameter 'level' is the SBML Level
Parameter 'version' is the Version within the SBML Level
"""
this = _libsbml.new_ListOfParameters(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(ListOfParameters self) -> ListOfParameters
Creates and returns a deep copy of this ListOfParameters object.
Returns the (deep) copy of this ListOfParameters object.
"""
return _libsbml.ListOfParameters_clone(self)
def getItemTypeCode(self):
"""
getItemTypeCode(ListOfParameters self) -> int
Returns the libSBML type code for the objects contained in this ListOf
(i.e., Parameter objects, if the list is non-empty).
LibSBML attaches an identifying code to every kind of SBML object.
These are integer constants known as SBML type codes. The names of
all the codes begin with the characters SBML_. In the Python language
interface for libSBML, the type codes are defined as static integer
constants in the interface class 'libsbml'. Note that different Level
3 package plug-ins may use overlapping type codes; to identify the
package to which a given object belongs, call the getPackageName()
method on the object.
Returns the SBML type code for this objects contained in this list:
SBML_PARAMETER (default).
See also getElementName(), getPackageName().
"""
return _libsbml.ListOfParameters_getItemTypeCode(self)
def getElementName(self):
"""
getElementName(ListOfParameters self) -> string
Returns the XML element name of this object.
For ListOfParameters, the XML element name is 'listOfParameters'.
Returns the name of this element, i.e., 'listOfParameters'.
"""
return _libsbml.ListOfParameters_getElementName(self)
def get(self, *args):
"""
get(ListOfParameters self, unsigned int n) -> Parameter
get(ListOfParameters self, unsigned int n) -> Parameter
get(ListOfParameters self, string sid) -> Parameter
get(ListOfParameters self, string sid) -> Parameter
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
get(string sid)
Returns the first Parameter object matching the given identifier.
Parameter 'sid' is a string representing the identifier of the
Parameter to get.
Returns the Parameter object found. The caller owns the returned
object and is responsible for deleting it. If none of the items have
an identifier matching 'sid', then None is returned.
See also get(), size(), size(), get().
"""
return _libsbml.ListOfParameters_get(self, *args)
def remove(self, *args):
"""
remove(ListOfParameters self, unsigned int n) -> Parameter
remove(ListOfParameters self, string sid) -> Parameter
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
remove(string sid)
Removes the first Parameter object in this ListOfParameters matching
the given identifier, and returns a pointer to it.
Parameter 'sid' is the identifier of the item to remove.
Returns the item removed. The caller owns the returned object and is
responsible for deleting it. If none of the items have an identifier
matching 'sid', then None is returned.
______________________________________________________________________
Method variant with the following signature:
remove(long n)
Removes the nth item from this ListOfParameters, and returns a pointer
to it.
Parameter 'n' is the index of the item to remove
Returns the item removed. The caller owns the returned object and is
responsible for deleting it. If the index number 'n' is out of bounds
for the length of the list, then None is returned.
See also size().
"""
return _libsbml.ListOfParameters_remove(self, *args)
__swig_destroy__ = _libsbml.delete_ListOfParameters
__del__ = lambda self: None
ListOfParameters_swigregister = _libsbml.ListOfParameters_swigregister
ListOfParameters_swigregister(ListOfParameters)
class LocalParameter(Parameter):
"""
A parameter inside an SBML reaction definition.
LocalParameter has been introduced in SBML Level 3 to serve as the
object class for parameter definitions that are intended to be local
to a Reaction. Objects of class LocalParameter never appear at the
Model level; they are always contained within ListOfLocalParameters
lists which are in turn contained within KineticLaw objects.
Like its global Parameter counterpart, the LocalParameter object class
is used to define a symbol associated with a value; this symbol can
then be used in a model's mathematical formulas (and specifically, for
LocalParameter, reaction rate formulas). Unlike Parameter, the
LocalParameter class does not have a 'constant' attribute: local
parameters within reactions are always constant.
LocalParameter has one required attribute, 'id', to give the parameter
a unique identifier by which other parts of an SBML model definition
can refer to it. A parameter can also have an optional 'name'
attribute of type string. Identifiers and names must be used
according to the guidelines described in the SBML specifications.
The optional attribute 'value' determines the value (of type float)
assigned to the parameter. A missing value for 'value' implies that
the value either is unknown, or to be obtained from an external
source, or determined by an initial assignment. The unit of
measurement associated with the value of the parameter can be
specified using the optional attribute 'units'. Here we only mention
briefly some notable points about the possible unit choices, but
readers are urged to consult the SBML specification documents for more
information:
* In SBML Level 3, there are no constraints on the units that can be
assigned to parameters in a model; there are also no units to inherit
from the enclosing Model object.
* In SBML Level 2, the value assigned to the parameter's 'units'
attribute must be chosen from one of the following possibilities: one
of the base unit identifiers defined in SBML; one of the built-in unit
identifiers 'substance', 'time', 'volume', 'area' or 'length'; or the
identifier of a new unit defined in the list of unit definitions in
the enclosing Model structure. There are no constraints on the units
that can be chosen from these sets. There are no default units for
local parameters. As with all other major SBML components,
LocalParameter is derived from SBase, and the methods defined on SBase
are available on LocalParameter.
WARNING:
LibSBML derives LocalParameter from Parameter; however, this does not
precisely match the object hierarchy defined by SBML Level 3, where
LocalParameter is derived directly from SBase and not Parameter. We
believe this arrangement makes it easier for libSBML users to program
applications that work with both SBML Level 2 and SBML Level 3, but
programmers should also keep in mind this difference exists. A side-
effect of libSBML's scheme is that certain methods on LocalParameter
that are inherited from Parameter do not actually have relevance to
LocalParameter objects. An example of this is the methods pertaining
to Parameter's attribute 'constant' (i.e., isSetConstant(),
setConstant(), and getConstant()).
See also ListOfLocalParameters, KineticLaw.
"""
__swig_setmethods__ = {}
for _s in [Parameter]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, LocalParameter, name, value)
__swig_getmethods__ = {}
for _s in [Parameter]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, LocalParameter, name)
__repr__ = _swig_repr
__swig_destroy__ = _libsbml.delete_LocalParameter
__del__ = lambda self: None
def __init__(self, *args):
"""
__init__(LocalParameter self, unsigned int level, unsigned int version) -> LocalParameter
__init__(LocalParameter self, SBMLNamespaces sbmlns) -> LocalParameter
__init__(LocalParameter self, LocalParameter orig) -> LocalParameter
__init__(LocalParameter self, Parameter orig) -> LocalParameter
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
LocalParameter(SBMLNamespaces sbmlns)
Creates a new LocalParameter object with the given SBMLNamespaces
object 'sbmlns'.
The SBMLNamespaces object encapsulates SBML Level/Version/namespaces
information. It is used to communicate the SBML Level, Version, and
(in Level 3) packages used in addition to SBML Level 3 Core. A common
approach to using libSBML's SBMLNamespaces facilities is to create an
SBMLNamespaces object somewhere in a program once, then hand that
object as needed to object constructors that accept SBMLNamespaces as
arguments.
It is worth emphasizing that although this constructor does not take
an identifier argument, in SBML Level 2 and beyond, the 'id'
(identifier) attribute of a LocalParameter is required to have a
value. Thus, callers are cautioned to assign a value after calling
this constructor if no identifier is provided as an argument. Setting
the identifier can be accomplished using the method setId().
Parameter 'sbmlns' is an SBMLNamespaces object.
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
______________________________________________________________________
Method variant with the following signature:
LocalParameter(long level, long version)
Creates a new LocalParameter object with the given SBML 'level' and
'version' values.
Parameter 'level' is a long integer, the SBML Level to assign to this
LocalParameter.
Parameter 'version' is a long integer, the SBML Version to assign to
this LocalParameter.
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
______________________________________________________________________
Method variant with the following signature:
LocalParameter(LocalParameter orig)
Copy constructor; creates a copy of a given LocalParameter object.
Parameter 'orig' is the LocalParameter instance to copy.
Throws SBMLConstructorException: Thrown if the argument 'orig' is
None.
______________________________________________________________________
Method variant with the following signature:
LocalParameter(Parameter orig)
Copy constructor; creates a LocalParameter object by copying the
attributes of a given Parameter object.
Parameter 'orig' is the Parameter instance to copy.
Throws SBMLConstructorException: Thrown if the argument 'orig' is
None.
"""
this = _libsbml.new_LocalParameter(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(LocalParameter self) -> LocalParameter
Creates and returns a deep copy of this LocalParameter object.
Returns the (deep) copy of this LocalParameter object.
"""
return _libsbml.LocalParameter_clone(self)
def getDerivedUnitDefinition(self, *args):
"""
getDerivedUnitDefinition(LocalParameter self) -> UnitDefinition
getDerivedUnitDefinition(LocalParameter self) -> UnitDefinition
Constructs and returns a UnitDefinition that corresponds to the units
of this LocalParameter's value.
LocalParameters in SBML have an attribute ('units') for declaring the
units of measurement intended for the parameter's value. No defaults
are defined by SBML in the absence of a definition for 'units'. This
method returns a UnitDefinition object based on the units declared for
this LocalParameter using its 'units' attribute, or it returns None if
no units have been declared.
Note that unit declarations for LocalParameter objects are specified
in terms of the identifier of a unit (e.g., using setUnits()), but
this method returns a UnitDefinition object, not a unit identifier.
It does this by constructing an appropriate UnitDefinition. For SBML
Level 2 models, it will do this even when the value of the 'units'
attribute is one of the predefined SBML units 'substance', 'volume',
'area', 'length' or 'time'. Callers may find this useful in
conjunction with the helper methods provided by the UnitDefinition
class for comparing different UnitDefinition objects.
Returns a UnitDefinition that expresses the units of this
LocalParameter, or None if one cannot be constructed.
Note:
The libSBML system for unit analysis depends on the model as a whole.
In cases where the LocalParameter object has not yet been added to a
model, or the model itself is incomplete, unit analysis is not
possible, and consequently this method will return None.
See also isSetUnits().
"""
return _libsbml.LocalParameter_getDerivedUnitDefinition(self, *args)
def getTypeCode(self):
"""
getTypeCode(LocalParameter self) -> int
Returns the libSBML type code for this SBML object.
LibSBML attaches an identifying code to every kind of SBML object.
These are integer constants known as SBML type codes. The names of
all the codes begin with the characters SBML_. In the Python language
interface for libSBML, the type codes are defined as static integer
constants in the interface class 'libsbml'. Note that different Level
3 package plug-ins may use overlapping type codes; to identify the
package to which a given object belongs, call the getPackageName()
method on the object.
Returns the SBML type code for this object: SBML_LOCAL_PARAMETER
(default).
WARNING:
The specific integer values of the possible type codes may be reused
by different Level 3 package plug-ins. Thus, to identifiy the correct
code, it is necessary to invoke both getTypeCode() and
getPackageName().
See also getElementName(), getPackageName().
"""
return _libsbml.LocalParameter_getTypeCode(self)
def getElementName(self):
"""
getElementName(LocalParameter self) -> string
Returns the XML element name of this object, which for LocalParameter,
is always 'localParameter'.
Returns the name of this element, i.e., 'localParameter'.
"""
return _libsbml.LocalParameter_getElementName(self)
def hasRequiredAttributes(self):
"""
hasRequiredAttributes(LocalParameter self) -> bool
Predicate returning True if all the required attributes for this
LocalParameter object have been set.
The required attributes for a LocalParameter object are:
* 'id'
* 'value'
Returns True if the required attributes have been set, False
otherwise.
"""
return _libsbml.LocalParameter_hasRequiredAttributes(self)
def getConstant(self):
"""
getConstant(LocalParameter self) -> bool
Internal implementation method.
"""
return _libsbml.LocalParameter_getConstant(self)
def isSetConstant(self):
"""
isSetConstant(LocalParameter self) -> bool
Internal implementation method.
"""
return _libsbml.LocalParameter_isSetConstant(self)
def setConstant(self, flag):
"""
setConstant(LocalParameter self, bool flag) -> int
Internal implementation method.
"""
return _libsbml.LocalParameter_setConstant(self, flag)
LocalParameter_swigregister = _libsbml.LocalParameter_swigregister
LocalParameter_swigregister(LocalParameter)
class ListOfLocalParameters(ListOfParameters):
"""
A list of LocalParameter objects.
The various ListOf___ classes in SBML are merely containers used for
organizing the main components of an SBML model. In libSBML's
implementation, ListOf___ classes are derived from the intermediate
utility class ListOf, which is not defined by the SBML specifications
but serves as a useful programmatic construct. ListOf is itself is in
turn derived from SBase, which provides all of the various ListOf___
classes with common features defined by the SBML specification, such
as 'metaid' attributes and annotations.
The relationship between the lists and the rest of an SBML model is
illustrated by the following (for SBML Level 2 Version 4):
...
...
...
...
...
...
... elements of subclasses of Rule ...
...
...
...
Readers may wonder about the motivations for using the ListOf___
containers in SBML. A simpler approach in XML might be to place the
components all directly at the top level of the model definition. The
choice made in SBML is to group them within XML elements named after
ListOfClassname, in part because it helps organize the components.
More importantly, the fact that the container classes are derived from
SBase means that software tools can add information about the lists
themselves into each list container's 'annotation'.
See also ListOfFunctionDefinitions, ListOfUnitDefinitions,
ListOfCompartmentTypes, ListOfSpeciesTypes, ListOfCompartments,
ListOfSpecies, ListOfParameters, ListOfInitialAssignments,
ListOfRules, ListOfConstraints, ListOfReactions, ListOfEvents.
"""
__swig_setmethods__ = {}
for _s in [ListOfParameters]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, ListOfLocalParameters, name, value)
__swig_getmethods__ = {}
for _s in [ListOfParameters]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, ListOfLocalParameters, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(ListOfLocalParameters self, unsigned int level, unsigned int version) -> ListOfLocalParameters
__init__(ListOfLocalParameters self, SBMLNamespaces sbmlns) -> ListOfLocalParameters
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
ListOfLocalParameters(SBMLNamespaces sbmlns)
Creates a new ListOfLocalParameters object.
The object is constructed such that it is valid for the SBML Level and
Version combination determined by the SBMLNamespaces object in
'sbmlns'.
Parameter 'sbmlns' is an SBMLNamespaces object that is used to
determine the characteristics of the ListOfLocalParameters object to
be created.
______________________________________________________________________
Method variant with the following signature:
ListOfLocalParameters(long level, long version)
Creates a new ListOfLocalParameters object.
The object is constructed such that it is valid for the given SBML
Level and Version combination.
Parameter 'level' is the SBML Level
Parameter 'version' is the Version within the SBML Level
"""
this = _libsbml.new_ListOfLocalParameters(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(ListOfLocalParameters self) -> ListOfLocalParameters
Creates and returns a deep copy of this ListOfLocalParameters object.
Returns the (deep) copy of this ListOfLocalParameters object.
"""
return _libsbml.ListOfLocalParameters_clone(self)
def getItemTypeCode(self):
"""
getItemTypeCode(ListOfLocalParameters self) -> int
Returns the libSBML type code for the objects contained in this ListOf
(i.e., LocalParameter objects, if the list is non-empty).
LibSBML attaches an identifying code to every kind of SBML object.
These are integer constants known as SBML type codes. The names of
all the codes begin with the characters SBML_. In the Python language
interface for libSBML, the type codes are defined as static integer
constants in the interface class 'libsbml'. Note that different Level
3 package plug-ins may use overlapping type codes; to identify the
package to which a given object belongs, call the getPackageName()
method on the object.
Returns the SBML type code for the objects contained in this ListOf:
SBML_LOCAL_PARAMETER (default).
See also getElementName(), getPackageName().
"""
return _libsbml.ListOfLocalParameters_getItemTypeCode(self)
def getElementName(self):
"""
getElementName(ListOfLocalParameters self) -> string
Returns the XML element name of this object.
For ListOfLocalParameters, the XML element name is
'listOfLocalParameters'.
Returns the name of this element, i.e., 'listOfLocalParameters'.
"""
return _libsbml.ListOfLocalParameters_getElementName(self)
def get(self, *args):
"""
get(ListOfLocalParameters self, unsigned int n) -> LocalParameter
get(ListOfLocalParameters self, unsigned int n) -> LocalParameter
get(ListOfLocalParameters self, string sid) -> LocalParameter
get(ListOfLocalParameters self, string sid) -> LocalParameter
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
get(string sid)
Returns the first LocalParameter object matching the given identifier.
Parameter 'sid' is a string representing the identifier of the
LocalParameter to get.
Returns the LocalParameter object found. The caller owns the returned
object and is responsible for deleting it. If none of the items have
an identifier matching 'sid', then None is returned.
See also get(), size(), size(), get().
"""
return _libsbml.ListOfLocalParameters_get(self, *args)
def getElementBySId(self, id):
"""
getElementBySId(ListOfLocalParameters self, string id) -> SBase
Returns the first child element found that has the given 'id' in the
model-wide SId namespace, or None if no such object is found.
Note that LocalParameters, while they use the SId namespace, are not
in the model-wide SId namespace, so no LocalParameter object will be
returned from this function (and is the reason we override the base
ListOf::getElementBySId function here).
Parameter 'id' is string representing the id of objects to find
Returns pointer to the first element found with the given 'id'.
"""
return _libsbml.ListOfLocalParameters_getElementBySId(self, id)
def remove(self, *args):
"""
remove(ListOfLocalParameters self, unsigned int n) -> LocalParameter
remove(ListOfLocalParameters self, string sid) -> LocalParameter
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
remove(string sid)
Removes the first LocalParameter object in this ListOfLocalParameters
matching the given identifier, and returns a pointer to it.
Parameter 'sid' is the identifier of the item to remove.
Returns the item removed. The caller owns the returned object and is
responsible for deleting it. If none of the items have an identifier
matching 'sid', then None is returned.
______________________________________________________________________
Method variant with the following signature:
remove(long n)
Removes the nth item from this ListOfLocalParameters, and returns a
pointer to it.
Parameter 'n' is the index of the item to remove.
Returns the item removed. The caller owns the returned object and is
responsible for deleting it. If the index number 'n' is out of bounds
for the length of the list, then None is returned.
See also size(), remove().
"""
return _libsbml.ListOfLocalParameters_remove(self, *args)
__swig_destroy__ = _libsbml.delete_ListOfLocalParameters
__del__ = lambda self: None
ListOfLocalParameters_swigregister = _libsbml.ListOfLocalParameters_swigregister
ListOfLocalParameters_swigregister(ListOfLocalParameters)
class InitialAssignment(SBase):
"""
An SBML initial assignment, evaluated once only.
SBML Level 2 Versions 2-4 and SBML Level 3 provide two ways of
assigning initial values to entities in a model. The simplest and
most basic is to set the values of the appropriate attributes in the
relevant components; for example, the initial value of a model
parameter (whether it is a constant or a variable) can be assigned by
setting its 'value' attribute directly in the model definition.
However, this approach is not suitable when the value must be
calculated, because the initial value attributes on different
components such as species, compartments, and parameters are single
values and not mathematical expressions. In those situations, the
InitialAssignment construct can be used; it permits the calculation of
the value of a constant or the initial value of a variable from the
values of other quantities in a model.
As explained below, the provision of InitialAssignment does not mean
that models necessarily must use this construct when defining initial
values of quantities in a model. If a value can be set directly using
the relevant attribute of a component in a model, then that approach
may be more efficient and more portable to other software tools.
InitialAssignment should be used when the other mechanism is
insufficient for the needs of a particular model.
The InitialAssignment construct has some similarities to
AssignmentRule. The main differences are: (a) an InitialAssignment can
set the value of a constant whereas an AssignmentRule cannot, and (b)
unlike AssignmentRule, an InitialAssignment definition only applies up
to and including the beginning of simulation time, i.e., t <= 0, while
an AssignmentRule applies at all times.
InitialAssignment has a required attribute, 'symbol', whose value must
follow the guidelines for identifiers described in the SBML
specification (e.g., Section 3.3 in the Level 2 Version 4
specification). The value of this attribute in an InitialAssignment
object can be the identifier of a Compartment, Species or global
Parameter elsewhere in the model. The InitialAssignment defines the
initial value of the constant or variable referred to by the 'symbol'
attribute. (The attribute's name is 'symbol' rather than 'variable'
because it may assign values to constants as well as variables in a
model.) Note that an initial assignment cannot be made to reaction
identifiers, that is, the 'symbol' attribute value of an
InitialAssignment cannot be an identifier that is the 'id' attribute
value of a Reaction object in the model. This is identical to a
restriction placed on rules.
InitialAssignment also has a required 'math' subelement that contains
a MathML expression used to calculate the value of the constant or the
initial value of the variable. The units of the value computed by the
formula in the 'math' subelement should (in SBML Level 2 Version 4 and
in SBML Level 3) or must (in previous Versions) be identical to be the
units associated with the identifier given in the 'symbol' attribute.
(That is, the units are the units of the species, compartment, or
parameter, as appropriate for the kind of object identified by the
value of 'symbol'.)
InitialAssignment was introduced in SBML Level 2 Version 2. It is not
available in SBML Level 2 Version 1 nor in any version of Level 1.
Semantics of Initial Assignments
======================================================================
The value calculated by an InitialAssignment object overrides the
value assigned to the given symbol by the object defining that symbol.
For example, if a compartment's 'size' attribute is set in its
definition, and the model also contains an InitialAssignment having
that compartment's identifier as its 'symbol' attribute value, then
the interpretation is that the 'size' assigned in the Compartment
object should be ignored and the value assigned based on the
computation defined in the InitialAssignment. Initial assignments can
take place for Compartment, Species and global Parameter objects
regardless of the value of their 'constant' attribute.
The actions of all InitialAssignment objects are in general terms the
same, but differ in the precise details depending on the type of
variable being set:
* In the case of a species, an InitialAssignment sets the referenced
species' initial quantity (concentration or amount of substance) to
the value determined by the formula in the 'math' subelement. The
overall units of the formula should (in SBML Level 2 Version 4 and in
SBML Level 3) or must (in previous Versions) be the same as the units
specified for the species.
* In the case of a compartment, an InitialAssignment sets the
referenced compartment's initial size to the size determined by the
formula in 'math'. The overall units of the formula should (in SBML
Level 2 Version 4 and in SBML Level 3) or must (in previous Versions)
be the same as the units specified for the size of the compartment.
* In the case of a parameter, an InitialAssignment sets the referenced
parameter's initial value to that determined by the formula in 'math'.
The overall units of the formula should (in SBML Level 2 Version 4 and
SBML Level 3) or must (in previous Versions) be the same as the units
defined for the parameter. In the context of a simulation, initial
assignments establish values that are in effect prior to and including
the start of simulation time, i.e., t <= 0. Section 3.4.8 in the SBML
Level 2 Version 4 and SBML Level 3 Version 1 Core specifications
provides information about the interpretation of assignments, rules,
and entity values for simulation time up to and including the start
time t = 0; this is important for establishing the initial conditions
of a simulation if the model involves expressions containing the delay
'csymbol'.
There cannot be two initial assignments for the same symbol in a
model; that is, a model must not contain two or more InitialAssignment
objects that both have the same identifier as their 'symbol' attribute
value. A model must also not define initial assignments and
assignment rules for the same entity. That is, there cannot be both
an InitialAssignment and an AssignmentRule for the same symbol in a
model, because both kinds of constructs apply prior to and at the
start of simulated time---allowing both to exist for a given symbol
would result in indeterminism).
The ordering of InitialAssignment objects is not significant. The
combined set of InitialAssignment, AssignmentRule and KineticLaw
objects form a set of assignment statements that must be considered as
a whole. The combined set of assignment statements should not contain
algebraic loops: a chain of dependency between these statements should
terminate. (More formally, consider the directed graph of assignment
statements where nodes are a model's assignment statements and
directed arcs exist for each occurrence of a symbol in an assignment
statement 'math' attribute. The directed arcs in this graph start
from the statement assigning the symbol and end at the statement that
contains the symbol in their math elements. Such a graph must be
acyclic.)
Finally, it is worth being explicit about the expected behavior in the
following situation. Suppose (1) a given symbol has a value x
assigned to it in its definition, and (2) there is an initial
assignment having the identifier as its 'symbol' value and reassigning
the value to y, and (3) the identifier is also used in the
mathematical formula of a second initial assignment. What value
should the second initial assignment use? It is y, the value assigned
to the symbol by the first initial assignment, not whatever value was
given in the symbol's definition. This follows directly from the
behavior described above: if an InitialAssignment object exists for a
given symbol, then the symbol's value is overridden by that initial
assignment.
"""
__swig_setmethods__ = {}
for _s in [SBase]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, InitialAssignment, name, value)
__swig_getmethods__ = {}
for _s in [SBase]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, InitialAssignment, name)
__repr__ = _swig_repr
__swig_destroy__ = _libsbml.delete_InitialAssignment
__del__ = lambda self: None
def __init__(self, *args):
"""
__init__(InitialAssignment self, unsigned int level, unsigned int version) -> InitialAssignment
__init__(InitialAssignment self, SBMLNamespaces sbmlns) -> InitialAssignment
__init__(InitialAssignment self, InitialAssignment orig) -> InitialAssignment
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
InitialAssignment(SBMLNamespaces sbmlns)
Creates a new InitialAssignment using the given SBMLNamespaces object
'sbmlns'.
The SBMLNamespaces object encapsulates SBML Level/Version/namespaces
information. It is used to communicate the SBML Level, Version, and
(in Level 3) packages used in addition to SBML Level 3 Core. A common
approach to using libSBML's SBMLNamespaces facilities is to create an
SBMLNamespaces object somewhere in a program once, then hand that
object as needed to object constructors that accept SBMLNamespaces as
arguments.
Parameter 'sbmlns' is an SBMLNamespaces object.
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
______________________________________________________________________
Method variant with the following signature:
InitialAssignment(long level, long version)
Creates a new InitialAssignment using the given SBML 'level' and
'version' values.
Parameter 'level' is a long integer, the SBML Level to assign to this
InitialAssignment
Parameter 'version' is a long integer, the SBML Version to assign to
this InitialAssignment
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
______________________________________________________________________
Method variant with the following signature:
InitialAssignment(InitialAssignment orig)
Copy constructor; creates a copy of this InitialAssignment.
Parameter 'orig' is the object to copy.
Throws SBMLConstructorException: Thrown if the argument 'orig' is
None.
"""
this = _libsbml.new_InitialAssignment(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(InitialAssignment self) -> InitialAssignment
Creates and returns a deep copy of this InitialAssignment object.
Returns the (deep) copy of this InitialAssignment object.
"""
return _libsbml.InitialAssignment_clone(self)
def getSymbol(self):
"""
getSymbol(InitialAssignment self) -> string
Get the value of the 'symbol' attribute of this InitialAssignment.
Returns the identifier string stored as the 'symbol' attribute value
in this InitialAssignment.
"""
return _libsbml.InitialAssignment_getSymbol(self)
def getMath(self):
"""
getMath(InitialAssignment self) -> ASTNode
Get the mathematical formula of this InitialAssignment.
Returns an ASTNode, the value of the 'math' subelement of this
InitialAssignment
"""
return _libsbml.InitialAssignment_getMath(self)
def isSetSymbol(self):
"""
isSetSymbol(InitialAssignment self) -> bool
Predicate returning True if this InitialAssignment's 'symbol'
attribute is set.
Returns True if the 'symbol' attribute of this InitialAssignment is
set, False otherwise.
"""
return _libsbml.InitialAssignment_isSetSymbol(self)
def isSetMath(self):
"""
isSetMath(InitialAssignment self) -> bool
Predicate returning True if this InitialAssignment's 'math' subelement
contains a value.
Returns True if the 'math' for this InitialAssignment is set, False
otherwise.
"""
return _libsbml.InitialAssignment_isSetMath(self)
def setSymbol(self, sid):
"""
setSymbol(InitialAssignment self, string sid) -> int
Sets the 'symbol' attribute value of this InitialAssignment.
Parameter 'sid' is the identifier of a Species, Compartment or
Parameter object defined elsewhere in this Model.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
"""
return _libsbml.InitialAssignment_setSymbol(self, sid)
def setMath(self, math):
"""
setMath(InitialAssignment self, ASTNode math) -> int
Sets the 'math' subelement of this InitialAssignment.
The AST passed in 'math' is copied.
Parameter 'math' is an AST containing the mathematical expression to
be used as the formula for this InitialAssignment.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_OBJECT
"""
return _libsbml.InitialAssignment_setMath(self, math)
def getDerivedUnitDefinition(self, *args):
"""
getDerivedUnitDefinition(InitialAssignment self) -> UnitDefinition
getDerivedUnitDefinition(InitialAssignment self) -> UnitDefinition
Calculates and returns a UnitDefinition that expresses the units of
measurement assumed for the 'math' expression of this
InitialAssignment.
The units are calculated based on the mathematical expression in the
InitialAssignment and the model quantities referenced by elements
used within that expression. The method
InitialAssignment.getDerivedUnitDefinition() returns the calculated
units, to the extent that libSBML can compute them.
Note:
The functionality that facilitates unit analysis depends on the model
as a whole. Thus, in cases where the object has not been added to a
model or the model itself is incomplete, unit analysis is not possible
and this method will return None.
WARNING:
Note that it is possible the 'math' expression in the
InitialAssignment contains literal numbers or parameters with
undeclared units. In those cases, it is not possible to calculate the
units of the overall expression without making assumptions. LibSBML
does not make assumptions about the units, and
InitialAssignment.getDerivedUnitDefinition() only returns the units as
far as it is able to determine them. For example, in an expression X
+ Y, if X has unambiguously-defined units and Y does not, it will
return the units of X. When using this method, it is critical that
callers also invoke the method
InitialAssignment.containsUndeclaredUnits() to determine whether this
situation holds. Callers should take suitable action in those
situations.
Returns a UnitDefinition that expresses the units of the math
expression of this InitialAssignment, or None if one cannot be
constructed.
See also containsUndeclaredUnits().
"""
return _libsbml.InitialAssignment_getDerivedUnitDefinition(self, *args)
def containsUndeclaredUnits(self, *args):
"""
containsUndeclaredUnits(InitialAssignment self) -> bool
containsUndeclaredUnits(InitialAssignment self) -> bool
Predicate returning True if the math expression of this
InitialAssignment contains parameters/numbers with undeclared units.
Returns True if the math expression of this InitialAssignment includes
parameters/numbers with undeclared units, False otherwise.
Note:
A return value of True indicates that the UnitDefinition returned by
InitialAssignment::getDerivedUnitDefinition may not accurately
represent the units of the expression.
See also getDerivedUnitDefinition().
"""
return _libsbml.InitialAssignment_containsUndeclaredUnits(self, *args)
def getTypeCode(self):
"""
getTypeCode(InitialAssignment self) -> int
Returns the libSBML type code for this SBML object.
LibSBML attaches an identifying code to every kind of SBML object.
These are integer constants known as SBML type codes. The names of
all the codes begin with the characters SBML_. In the Python language
interface for libSBML, the type codes are defined as static integer
constants in the interface class 'libsbml'. Note that different Level
3 package plug-ins may use overlapping type codes; to identify the
package to which a given object belongs, call the getPackageName()
method on the object.
Returns the SBML type code for this object: SBML_INITIAL_ASSIGNMENT
(default).
WARNING:
The specific integer values of the possible type codes may be reused
by different Level 3 package plug-ins. Thus, to identifiy the correct
code, it is necessary to invoke both getTypeCode() and
getPackageName().
See also getElementName(), getPackageName().
"""
return _libsbml.InitialAssignment_getTypeCode(self)
def getElementName(self):
"""
getElementName(InitialAssignment self) -> string
Returns the XML element name of this object, which for
InitialAssignment, is always 'initialAssignment'.
Returns the name of this element, i.e., 'initialAssignment'.
"""
return _libsbml.InitialAssignment_getElementName(self)
def hasRequiredAttributes(self):
"""
hasRequiredAttributes(InitialAssignment self) -> bool
Predicate returning True if all the required attributes for this
InitialAssignment object have been set.
The required attributes for an InitialAssignment object are:
* 'symbol'
Returns True if the required attributes have been set, False
otherwise.
"""
return _libsbml.InitialAssignment_hasRequiredAttributes(self)
def hasRequiredElements(self):
"""
hasRequiredElements(InitialAssignment self) -> bool
Predicate returning True if all the required elements for this
InitialAssignment object have been set.
Note:
The required elements for a InitialAssignment object are:
* 'math'
Returns a boolean value indicating whether all the required elements
for this object have been defined.
"""
return _libsbml.InitialAssignment_hasRequiredElements(self)
def getId(self):
"""
getId(InitialAssignment self) -> string
Internal implementation method.
"""
return _libsbml.InitialAssignment_getId(self)
def renameSIdRefs(self, oldid, newid):
"""
renameSIdRefs(InitialAssignment self, string oldid, string newid)
Replaces all uses of a given SIdRef type attribute value with another
value.
In SBML, object identifiers are of a data type called SId. In SBML
Level 3, an explicit data type called SIdRef was introduced for
attribute values that refer to SId values; in previous Levels of SBML,
this data type did not exist and attributes were simply described to
as 'referring to an identifier', but the effective data type was the
same as SIdRefin Level 3. These and other methods of libSBML refer to
the type SIdRef for all Levels of SBML, even if the corresponding SBML
specification did not explicitly name the data type.
This method works by looking at all attributes and (if appropriate)
mathematical formulas in MathML content, comparing the referenced
identifiers to the value of 'oldid'. If any matches are found, the
matching values are replaced with 'newid'. The method does not
descend into child elements.
Parameter 'oldid' is the old identifier Parameter 'newid' is the new
identifier
"""
return _libsbml.InitialAssignment_renameSIdRefs(self, oldid, newid)
def renameUnitSIdRefs(self, oldid, newid):
"""
renameUnitSIdRefs(InitialAssignment self, string oldid, string newid)
Replaces all uses of a given UnitSIdRef type attribute value with
another value.
In SBML, unit definitions have identifiers of type UnitSId. In SBML
Level 3, an explicit data type called UnitSIdRef was introduced for
attribute values that refer to UnitSId values; in previous Levels of
SBML, this data type did not exist and attributes were simply
described to as 'referring to a unit identifier', but the effective
data type was the same as UnitSIdRef in Level 3. These and other
methods of libSBML refer to the type UnitSIdRef for all Levels of
SBML, even if the corresponding SBML specification did not explicitly
name the data type.
This method works by looking at all unit identifier attribute values
(including, if appropriate, inside mathematical formulas), comparing
the referenced unit identifiers to the value of 'oldid'. If any
matches are found, the matching values are replaced with 'newid'. The
method does not descend into child elements.
Parameter 'oldid' is the old identifier Parameter 'newid' is the new
identifier
"""
return _libsbml.InitialAssignment_renameUnitSIdRefs(self, oldid, newid)
def replaceSIDWithFunction(self, id, function):
"""
replaceSIDWithFunction(InitialAssignment self, string id, ASTNode function)
Internal implementation method.
"""
return _libsbml.InitialAssignment_replaceSIDWithFunction(self, id, function)
def divideAssignmentsToSIdByFunction(self, id, function):
"""
divideAssignmentsToSIdByFunction(InitialAssignment self, string id, ASTNode function)
Internal implementation method.
"""
return _libsbml.InitialAssignment_divideAssignmentsToSIdByFunction(self, id, function)
def multiplyAssignmentsToSIdByFunction(self, id, function):
"""
multiplyAssignmentsToSIdByFunction(InitialAssignment self, string id, ASTNode function)
Internal implementation method.
"""
return _libsbml.InitialAssignment_multiplyAssignmentsToSIdByFunction(self, id, function)
InitialAssignment_swigregister = _libsbml.InitialAssignment_swigregister
InitialAssignment_swigregister(InitialAssignment)
class ListOfInitialAssignments(ListOf):
"""
A list of InitialAssignment objects.
The various ListOf___ classes in SBML are merely containers used for
organizing the main components of an SBML model. In libSBML's
implementation, ListOf___ classes are derived from the intermediate
utility class ListOf, which is not defined by the SBML specifications
but serves as a useful programmatic construct. ListOf is itself is in
turn derived from SBase, which provides all of the various ListOf___
classes with common features defined by the SBML specification, such
as 'metaid' attributes and annotations.
The relationship between the lists and the rest of an SBML model is
illustrated by the following (for SBML Level 2 Version 4):
...
...
...
...
...
...
... elements of subclasses of Rule ...
...
...
...
Readers may wonder about the motivations for using the ListOf___
containers in SBML. A simpler approach in XML might be to place the
components all directly at the top level of the model definition. The
choice made in SBML is to group them within XML elements named after
ListOfClassname, in part because it helps organize the components.
More importantly, the fact that the container classes are derived from
SBase means that software tools can add information about the lists
themselves into each list container's 'annotation'.
See also ListOfFunctionDefinitions, ListOfUnitDefinitions,
ListOfCompartmentTypes, ListOfSpeciesTypes, ListOfCompartments,
ListOfSpecies, ListOfParameters, ListOfInitialAssignments,
ListOfRules, ListOfConstraints, ListOfReactions, ListOfEvents.
"""
__swig_setmethods__ = {}
for _s in [ListOf]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, ListOfInitialAssignments, name, value)
__swig_getmethods__ = {}
for _s in [ListOf]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, ListOfInitialAssignments, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(ListOfInitialAssignments self, unsigned int level, unsigned int version) -> ListOfInitialAssignments
__init__(ListOfInitialAssignments self, SBMLNamespaces sbmlns) -> ListOfInitialAssignments
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
ListOfInitialAssignments(SBMLNamespaces sbmlns)
Creates a new ListOfInitialAssignments object.
The object is constructed such that it is valid for the SBML Level and
Version combination determined by the SBMLNamespaces object in
'sbmlns'.
Parameter 'sbmlns' is an SBMLNamespaces object that is used to
determine the characteristics of the ListOfInitialAssignments object
to be created.
______________________________________________________________________
Method variant with the following signature:
ListOfInitialAssignments(long level, long version)
Creates a new ListOfInitialAssignments object.
The object is constructed such that it is valid for the given SBML
Level and Version combination.
Parameter 'level' is the SBML Level
Parameter 'version' is the Version within the SBML Level
"""
this = _libsbml.new_ListOfInitialAssignments(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(ListOfInitialAssignments self) -> ListOfInitialAssignments
Creates and returns a deep copy of this ListOfInitialAssignments
object.
Returns the (deep) copy of this ListOfInitialAssignments object.
"""
return _libsbml.ListOfInitialAssignments_clone(self)
def getItemTypeCode(self):
"""
getItemTypeCode(ListOfInitialAssignments self) -> int
Returns the libSBML type code for the objects contained in this ListOf
(i.e., InitialAssignment objects, if the list is non-empty).
LibSBML attaches an identifying code to every kind of SBML object.
These are integer constants known as SBML type codes. The names of
all the codes begin with the characters SBML_. In the Python language
interface for libSBML, the type codes are defined as static integer
constants in the interface class 'libsbml'. Note that different Level
3 package plug-ins may use overlapping type codes; to identify the
package to which a given object belongs, call the getPackageName()
method on the object.
Returns the SBML type code for the objects contained in this ListOf:
SBML_INITIAL_ASSIGNMENT (default).
See also getElementName(), getPackageName().
"""
return _libsbml.ListOfInitialAssignments_getItemTypeCode(self)
def getElementName(self):
"""
getElementName(ListOfInitialAssignments self) -> string
Returns the XML element name of this object.
For ListOfInitialAssignments, the XML element name is
'listOfInitialAssignments'.
Returns the name of this element, i.e., 'listOfInitialAssignments'.
"""
return _libsbml.ListOfInitialAssignments_getElementName(self)
def get(self, *args):
"""
get(ListOfInitialAssignments self, unsigned int n) -> InitialAssignment
get(ListOfInitialAssignments self, unsigned int n) -> InitialAssignment
get(ListOfInitialAssignments self, string sid) -> InitialAssignment
get(ListOfInitialAssignments self, string sid) -> InitialAssignment
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
get(string sid)
Get a InitialAssignment from the ListOfInitialAssignments based on its
identifier.
Parameter 'sid' is a string representing the identifier of the
InitialAssignment to get.
Returns InitialAssignment in this ListOfInitialAssignments with the
given 'sid' or None if no such InitialAssignment exists.
See also get(), size(), size().
"""
return _libsbml.ListOfInitialAssignments_get(self, *args)
def remove(self, *args):
"""
remove(ListOfInitialAssignments self, unsigned int n) -> InitialAssignment
remove(ListOfInitialAssignments self, string sid) -> InitialAssignment
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
remove(string sid)
Removes item in this ListOfInitialAssignments items with the given
identifier.
The caller owns the returned item and is responsible for deleting it.
If none of the items in this list have the identifier 'sid', then None
is returned.
Parameter 'sid' is the identifier of the item to remove
Returns the item removed. As mentioned above, the caller owns the
returned item.
______________________________________________________________________
Method variant with the following signature:
remove(long n)
Removes the nth item from this ListOfInitialAssignments items and
returns a pointer to it.
The caller owns the returned item and is responsible for deleting it.
Parameter 'n' is the index of the item to remove
See also size().
"""
return _libsbml.ListOfInitialAssignments_remove(self, *args)
def getElementBySId(self, id):
"""
getElementBySId(ListOfInitialAssignments self, string id) -> SBase
Returns the first child element found that has the given 'id' in the
model-wide SId namespace, or None if no such object is found.
Note that InitialAssignments do not actually have IDs, though the
libsbml interface pretends that they do: no initial assignment is
returned by this function.
Parameter 'id' is string representing the id of objects to find
Returns pointer to the first element found with the given 'id'.
"""
return _libsbml.ListOfInitialAssignments_getElementBySId(self, id)
__swig_destroy__ = _libsbml.delete_ListOfInitialAssignments
__del__ = lambda self: None
ListOfInitialAssignments_swigregister = _libsbml.ListOfInitialAssignments_swigregister
ListOfInitialAssignments_swigregister(ListOfInitialAssignments)
_libsbml.RULE_TYPE_RATE_swigconstant(_libsbml)
RULE_TYPE_RATE = _libsbml.RULE_TYPE_RATE
_libsbml.RULE_TYPE_SCALAR_swigconstant(_libsbml)
RULE_TYPE_SCALAR = _libsbml.RULE_TYPE_SCALAR
_libsbml.RULE_TYPE_INVALID_swigconstant(_libsbml)
RULE_TYPE_INVALID = _libsbml.RULE_TYPE_INVALID
class Rule(SBase):
"""
Parent class for SBML rules in libSBML.
In SBML, rules provide additional ways to define the values of
variables in a model, their relationships, and the dynamical behaviors
of those variables. They enable encoding relationships that cannot be
expressed using Reaction nor InitialAssignment objects alone.
The libSBML implementation of rules mirrors the SBML Level 3 Version 1
Core definition (which is in turn is very similar to the Level 2
Version 4 definition), with Rule being the parent class of three
subclasses as explained below. The Rule class itself cannot be
instantiated by user programs and has no constructor; only the
subclasses AssignmentRule, AlgebraicRule and RateRule can be
instantiated directly.
General summary of SBML rules
======================================================================
In SBML Level 3 as well as Level 2, rules are separated into three
subclasses for the benefit of model analysis software. The three
subclasses are based on the following three different possible
functional forms (where x is a variable, f is some arbitrary function
returning a numerical result, V is a vector of variables that does not
include x, and W is a vector of variables that may include x):
Algebraic: left-hand side is zero 0 = f(W)
Assignment: left-hand side is a scalar: x = f(V)
Rate: left-hand side is a rate-of-change: dx/dt = f(W)
In their general form given above, there is little to distinguish
between assignment and algebraic rules. They are treated as separate
cases for the following reasons:
* Assignment rules can simply be evaluated to calculate
intermediate values for use in numerical methods. They are statements
of equality that hold at all times. (For assignments that are only
performed once, see InitialAssignment.)
* SBML needs to place restrictions on assignment rules, for example
the restriction that assignment rules cannot contain algebraic loops.
* Some simulators do not contain numerical solvers capable of
solving unconstrained algebraic equations, and providing more direct
forms such as assignment rules may enable those simulators to process
models they could not process if the same assignments were put in the
form of general algebraic equations;
* Those simulators that can solve these algebraic equations make a
distinction between the different categories listed above; and
* Some specialized numerical analyses of models may only be
applicable to models that do not contain algebraic rules.
The approach taken to covering these cases in SBML is to define an
abstract Rule structure containing a subelement, 'math', to hold the
right-hand side expression, then to derive subtypes of Rule that add
attributes to distinguish the cases of algebraic, assignment and rate
rules. The 'math' subelement must contain a MathML expression
defining the mathematical formula of the rule. This MathML formula
must return a numerical value. The formula can be an arbitrary
expression referencing the variables and other entities in an SBML
model.
Each of the three subclasses of Rule (AssignmentRule, AlgebraicRule,
RateRule) inherit the the 'math' subelement and other fields from
SBase. The AssignmentRule and RateRule classes add an additional
attribute, 'variable'. See the definitions of AssignmentRule,
AlgebraicRule and RateRule for details about the structure and
interpretation of each one.
Additional restrictions on SBML rules
======================================================================
An important design goal of SBML rule semantics is to ensure that a
model's simulation and analysis results will not be dependent on when
or how often rules are evaluated. To achieve this, SBML needs to
place two restrictions on rule use. The first concerns algebraic
loops in the system of assignments in a model, and the second concerns
overdetermined systems.
A model must not contain algebraic loops
......................................................................
The combined set of InitialAssignment, AssignmentRule and KineticLaw
objects in a model constitute a set of assignment statements that
should be considered as a whole. (A KineticLaw object is counted as
an assignment because it assigns a value to the symbol contained in
the 'id' attribute of the Reaction object in which it is defined.)
This combined set of assignment statements must not contain algebraic
loops---dependency chains between these statements must terminate. To
put this more formally, consider a directed graph in which nodes are
assignment statements and directed arcs exist for each occurrence of
an SBML species, compartment or parameter symbol in an assignment
statement's 'math' subelement. Let the directed arcs point from the
statement assigning the symbol to the statements that contain the
symbol in their 'math' subelement expressions. This graph must be
acyclic.
SBML does not specify when or how often rules should be evaluated.
Eliminating algebraic loops ensures that assignment statements can be
evaluated any number of times without the result of those evaluations
changing. As an example, consider the set of equations x = x + 1, y =
z + 200 and z = y + 100. If this set of equations were interpreted as
a set of assignment statements, it would be invalid because the rule
for x refers to x (exhibiting one type of loop), and the rule for y
refers to z while the rule for z refers back to y (exhibiting another
type of loop). Conversely, the following set of equations would
constitute a valid set of assignment statements: x = 10, y = z + 200,
and z = x + 100.
A model must not be overdetermined
......................................................................
An SBML model must not be overdetermined; that is, a model must not
define more equations than there are unknowns in a model. An SBML
model that does not contain AlgebraicRule structures cannot be
overdetermined.
LibSBML implements the static analysis procedure described in Appendix
B of the SBML Level 3 Version 1 Core specification for assessing
whether a model is overdetermined.
(In summary, assessing whether a given continuous, deterministic,
mathematical model is overdetermined does not require dynamic
analysis; it can be done by analyzing the system of equations created
from the model. One approach is to construct a bipartite graph in
which one set of vertices represents the variables and the other the
set of vertices represents the equations. Place edges between
vertices such that variables in the system are linked to the equations
that determine them. For algebraic equations, there will be edges
between the equation and each variable occurring in the equation. For
ordinary differential equations (such as those defined by rate rules
or implied by the reaction rate definitions), there will be a single
edge between the equation and the variable determined by that
differential equation. A mathematical model is overdetermined if the
maximal matchings of the bipartite graph contain disconnected vertexes
representing equations. If one maximal matching has this property,
then all the maximal matchings will have this property; i.e., it is
only necessary to find one maximal matching.)
Rule types for SBML Level 1
======================================================================
SBML Level 1 uses a different scheme than SBML Level 2 and Level 3 for
distinguishing rules; specifically, it uses an attribute whose value
is drawn from an enumeration of 3 values. LibSBML supports this using
methods that work with the enumeration values listed below.
* RULE_TYPE_RATE: Indicates the rule is a 'rate' rule.
* RULE_TYPE_SCALAR: Indicates the rule is a 'scalar' rule.
* RULE_TYPE_INVALID: Indicates the rule type is unknown or not yet
set.
"""
__swig_setmethods__ = {}
for _s in [SBase]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, Rule, name, value)
__swig_getmethods__ = {}
for _s in [SBase]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, Rule, name)
__repr__ = _swig_repr
__swig_destroy__ = _libsbml.delete_Rule
__del__ = lambda self: None
def __init__(self, orig):
"""
__init__(Rule self, Rule orig) -> Rule
@internal
"""
this = _libsbml.new_Rule(orig)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(Rule self) -> Rule
Creates and returns a deep copy of this Rule object.
Returns the (deep) copy of this Rule object.
"""
return _libsbml.Rule_clone(self)
def getFormula(self):
"""
getFormula(Rule self) -> string
Returns the mathematical expression of this Rule in text-string form.
The text string is produced by SBML_formulaToString(); please consult
the documentation for that function to find out more about the format
of the text-string formula.
Returns the formula text string for this Rule.
Note:
The attribute 'formula' is specific to SBML Level 1; in higher Levels
of SBML, it has been replaced with a subelement named 'math'.
However, libSBML provides a unified interface to the underlying math
expression and this method can be used for models of all Levels of
SBML.
See also getMath().
"""
return _libsbml.Rule_getFormula(self)
def getMath(self):
"""
getMath(Rule self) -> ASTNode
Get the mathematical formula of this Rule as an ASTNode tree.
Returns an ASTNode, the value of the 'math' subelement of this Rule.
Note:
The subelement 'math' is present in SBML Levels 2 and 3. In SBML
Level 1, the equivalent construct is the attribute named 'formula'.
LibSBML provides a unified interface to the underlying math expression
and this method can be used for models of all Levels of SBML.
See also getFormula().
"""
return _libsbml.Rule_getMath(self)
def getVariable(self):
"""
getVariable(Rule self) -> string
Get the value of the 'variable' attribute of this Rule object.
In SBML Level 1, the different rule types each have a different name
for the attribute holding the reference to the object constituting the
left-hand side of the rule. (E.g., for SBML Level 1's
SpeciesConcentrationRule the attribute is 'species', for
CompartmentVolumeRule it is 'compartment', etc.) In SBML Levels 2 and
3, the only two types of Rule objects with a left-hand side object
reference are AssignmentRule and RateRule, and both of them use the
same name for attribute: 'variable'. In order to make it easier for
application developers to work with all Levels of SBML, libSBML uses a
uniform name for all such attributes, and it is 'variable', regardless
of whether Level 1 rules or Level 2-3 rules are being used.
Returns the identifier string stored as the 'variable' attribute value
in this Rule, or None if this object is an AlgebraicRule object.
"""
return _libsbml.Rule_getVariable(self)
def getUnits(self):
"""
getUnits(Rule self) -> string
Returns the units for the mathematical formula of this Rule.
Returns the identifier of the units for the expression of this Rule.
Note:
The attribute 'units' exists on SBML Level 1 ParameterRule objects
only. It is not present in SBML Levels 2 and 3.
"""
return _libsbml.Rule_getUnits(self)
def isSetFormula(self):
"""
isSetFormula(Rule self) -> bool
Predicate returning True if this Rule's mathematical expression is
set.
This method is equivalent to isSetMath(). This version is present for
easier compatibility with SBML Level 1, in which mathematical formulas
were written in text-string form.
Returns True if the mathematical formula for this Rule is set, False
otherwise.
Note:
The attribute 'formula' is specific to SBML Level 1; in higher Levels
of SBML, it has been replaced with a subelement named 'math'.
However, libSBML provides a unified interface to the underlying math
expression and this method can be used for models of all Levels of
SBML.
See also isSetMath().
"""
return _libsbml.Rule_isSetFormula(self)
def isSetMath(self):
"""
isSetMath(Rule self) -> bool
Predicate returning True if this Rule's mathematical expression is
set.
This method is equivalent to isSetFormula().
Returns True if the formula (or equivalently the math) for this Rule
is set, False otherwise.
Note:
The subelement 'math' is present in SBML Levels 2 and 3. In SBML
Level 1, the equivalent construct is the attribute named 'formula'.
LibSBML provides a unified interface to the underlying math expression
and this method can be used for models of all Levels of SBML.
See also isSetFormula().
"""
return _libsbml.Rule_isSetMath(self)
def isSetVariable(self):
"""
isSetVariable(Rule self) -> bool
Predicate returning True if this Rule's 'variable' attribute is set.
In SBML Level 1, the different rule types each have a different name
for the attribute holding the reference to the object constituting the
left-hand side of the rule. (E.g., for SBML Level 1's
SpeciesConcentrationRule the attribute is 'species', for
CompartmentVolumeRule it is 'compartment', etc.) In SBML Levels 2 and
3, the only two types of Rule objects with a left-hand side object
reference are AssignmentRule and RateRule, and both of them use the
same name for attribute: 'variable'. In order to make it easier for
application developers to work with all Levels of SBML, libSBML uses a
uniform name for all such attributes, and it is 'variable', regardless
of whether Level 1 rules or Level 2-3 rules are being used.
Returns True if the 'variable' attribute value of this Rule is set,
False otherwise.
"""
return _libsbml.Rule_isSetVariable(self)
def isSetUnits(self):
"""
isSetUnits(Rule self) -> bool
Predicate returning True if this Rule's 'units' attribute is set.
Returns True if the units for this Rule is set, False otherwise
Note:
The attribute 'units' exists on SBML Level 1 ParameterRule objects
only. It is not present in SBML Levels 2 and 3.
"""
return _libsbml.Rule_isSetUnits(self)
def setFormula(self, formula):
"""
setFormula(Rule self, string formula) -> int
Sets the 'math' subelement of this Rule to an expression in text-
string form.
This is equivalent to setMath(ASTNode math). The provision of using
text-string formulas is retained for easier SBML Level 1
compatibility. The formula is converted to an ASTNode internally.
Parameter 'formula' is a mathematical formula in text-string form.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_OBJECT
Note:
The attribute 'formula' is specific to SBML Level 1; in higher Levels
of SBML, it has been replaced with a subelement named 'math'.
However, libSBML provides a unified interface to the underlying math
expression and this method can be used for models of all Levels of
SBML.
See also setMath().
"""
return _libsbml.Rule_setFormula(self, formula)
def setMath(self, math):
"""
setMath(Rule self, ASTNode math) -> int
Sets the 'math' subelement of this Rule to a copy of the given
ASTNode.
Parameter 'math' is the AST structure of the mathematical formula.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_OBJECT
Note:
The subelement 'math' is present in SBML Levels 2 and 3. In SBML
Level 1, the equivalent construct is the attribute named 'formula'.
LibSBML provides a unified interface to the underlying math expression
and this method can be used for models of all Levels of SBML.
See also setFormula().
"""
return _libsbml.Rule_setMath(self, math)
def setVariable(self, sid):
"""
setVariable(Rule self, string sid) -> int
Sets the 'variable' attribute value of this Rule object.
In SBML Level 1, the different rule types each have a different name
for the attribute holding the reference to the object constituting the
left-hand side of the rule. (E.g., for SBML Level 1's
SpeciesConcentrationRule the attribute is 'species', for
CompartmentVolumeRule it is 'compartment', etc.) In SBML Levels 2 and
3, the only two types of Rule objects with a left-hand side object
reference are AssignmentRule and RateRule, and both of them use the
same name for attribute: 'variable'. In order to make it easier for
application developers to work with all Levels of SBML, libSBML uses a
uniform name for all such attributes, and it is 'variable', regardless
of whether Level 1 rules or Level 2-3 rules are being used.
Parameter 'sid' is the identifier of a Compartment, Species or
Parameter elsewhere in the enclosing Model object.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
* LIBSBML_UNEXPECTED_ATTRIBUTE
"""
return _libsbml.Rule_setVariable(self, sid)
def setUnits(self, sname):
"""
setUnits(Rule self, string sname) -> int
Sets the units for this Rule.
Parameter 'sname' is the identifier of the units
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
* LIBSBML_UNEXPECTED_ATTRIBUTE
Note:
The attribute 'units' exists on SBML Level 1 ParameterRule objects
only. It is not present in SBML Levels 2 and 3.
"""
return _libsbml.Rule_setUnits(self, sname)
def unsetUnits(self):
"""
unsetUnits(Rule self) -> int
Unsets the 'units' for this Rule.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
* LIBSBML_UNEXPECTED_ATTRIBUTE
Note:
The attribute 'units' exists on SBML Level 1 ParameterRule objects
only. It is not present in SBML Levels 2 and 3.
"""
return _libsbml.Rule_unsetUnits(self)
def getDerivedUnitDefinition(self, *args):
"""
getDerivedUnitDefinition(Rule self) -> UnitDefinition
getDerivedUnitDefinition(Rule self) -> UnitDefinition
Calculates and returns a UnitDefinition that expresses the units of
measurement assumed for the 'math' expression of this Rule.
The units are calculated based on the mathematical expression in the
Rule and the model quantities referenced by elements used within
that expression. The method Rule.getDerivedUnitDefinition() returns
the calculated units, to the extent that libSBML can compute them.
Note:
The functionality that facilitates unit analysis depends on the model
as a whole. Thus, in cases where the object has not been added to a
model or the model itself is incomplete, unit analysis is not possible
and this method will return None.
WARNING:
Note that it is possible the 'math' expression in the Rule contains
pure numbers or parameters with undeclared units. In those cases, it
is not possible to calculate the units of the overall expression
without making assumptions. LibSBML does not make assumptions about
the units, and Rule.getDerivedUnitDefinition() only returns the units
as far as it is able to determine them. For example, in an expression
X + Y, if X has unambiguously-defined units and Y does not, it will
return the units of X. It is important that callers also invoke the
method Rule.containsUndeclaredUnits() to determine whether this
situation holds. Callers may wish to take suitable actions in those
scenarios.
Returns a UnitDefinition that expresses the units of the math
expression of this Rule, or None if one cannot be constructed.
See also containsUndeclaredUnits().
"""
return _libsbml.Rule_getDerivedUnitDefinition(self, *args)
def containsUndeclaredUnits(self, *args):
"""
containsUndeclaredUnits(Rule self) -> bool
containsUndeclaredUnits(Rule self) -> bool
Predicate returning True if the math expression of this Rule contains
parameters/numbers with undeclared units.
Returns True if the math expression of this Rule includes
parameters/numbers with undeclared units, False otherwise.
Note:
A return value of True indicates that the UnitDefinition returned by
getDerivedUnitDefinition() may not accurately represent the units of
the expression.
See also getDerivedUnitDefinition().
"""
return _libsbml.Rule_containsUndeclaredUnits(self, *args)
def getType(self):
"""
getType(Rule self) -> RuleType_t
Returns a code representing the type of rule this is.
Returns the rule type, which will be one of the following three
possible values:
* RULE_TYPE_RATE
* RULE_TYPE_SCALAR
* RULE_TYPE_INVALID
Note:
The attribute 'type' on Rule objects is present only in SBML Level 1.
In SBML Level 2 and later, the type has been replaced by subclassing
the Rule object.
"""
return _libsbml.Rule_getType(self)
def isAlgebraic(self):
"""
isAlgebraic(Rule self) -> bool
Predicate returning True if this Rule is an AlgebraicRule.
Returns True if this Rule is an AlgebraicRule, False otherwise.
"""
return _libsbml.Rule_isAlgebraic(self)
def isAssignment(self):
"""
isAssignment(Rule self) -> bool
Predicate returning True if this Rule is an AssignmentRule.
Returns True if this Rule is an AssignmentRule, False otherwise.
"""
return _libsbml.Rule_isAssignment(self)
def isCompartmentVolume(self):
"""
isCompartmentVolume(Rule self) -> bool
Predicate returning True if this Rule is an CompartmentVolumeRule or
equivalent.
This libSBML method works for SBML Level 1 models (where there is such
a thing as an explicit CompartmentVolumeRule), as well as other Levels
of SBML. For Levels above Level 1, this method checks the symbol
being affected by the rule, and returns True if the symbol is the
identifier of a Compartment object defined in the model.
Returns True if this Rule is a CompartmentVolumeRule, False otherwise.
"""
return _libsbml.Rule_isCompartmentVolume(self)
def isParameter(self):
"""
isParameter(Rule self) -> bool
Predicate returning True if this Rule is an ParameterRule or
equivalent.
This libSBML method works for SBML Level 1 models (where there is such
a thing as an explicit ParameterRule), as well as other Levels of
SBML. For Levels above Level 1, this method checks the symbol being
affected by the rule, and returns True if the symbol is the identifier
of a Parameter object defined in the model.
Returns True if this Rule is a ParameterRule, False otherwise.
"""
return _libsbml.Rule_isParameter(self)
def isRate(self):
"""
isRate(Rule self) -> bool
Predicate returning True if this Rule is a RateRule (SBML Levels 2-3)
or has a 'type' attribute value of 'rate' (SBML Level 1).
Returns True if this Rule is a RateRule (Level 2) or has type 'rate'
(Level 1), False otherwise.
"""
return _libsbml.Rule_isRate(self)
def isScalar(self):
"""
isScalar(Rule self) -> bool
Predicate returning True if this Rule is an AssignmentRule (SBML
Levels 2-3) or has a 'type' attribute value of 'scalar' (SBML Level
1).
Returns True if this Rule is an AssignmentRule (Level 2) or has type
'scalar' (Level 1), False otherwise.
"""
return _libsbml.Rule_isScalar(self)
def isSpeciesConcentration(self):
"""
isSpeciesConcentration(Rule self) -> bool
Predicate returning True if this Rule is a SpeciesConcentrationRule or
equivalent.
This libSBML method works for SBML Level 1 models (where there is such
a thing as an explicit SpeciesConcentrationRule), as well as other
Levels of SBML. For Levels above Level 1, this method checks the
symbol being affected by the rule, and returns True if the symbol is
the identifier of a Species object defined in the model.
Returns True if this Rule is a SpeciesConcentrationRule, False
otherwise.
"""
return _libsbml.Rule_isSpeciesConcentration(self)
def getTypeCode(self):
"""
getTypeCode(Rule self) -> int
Returns the libSBML type code for this SBML object.
LibSBML attaches an identifying code to every kind of SBML object.
These are integer constants known as SBML type codes. The names of
all the codes begin with the characters SBML_. In the Python language
interface for libSBML, the type codes are defined as static integer
constants in the interface class 'libsbml'. Note that different Level
3 package plug-ins may use overlapping type codes; to identify the
package to which a given object belongs, call the getPackageName()
method on the object.
Returns the SBML type code for this object, either
SBML_ASSIGNMENT_RULE, SBML_RATE_RULE, or SBML_ALGEBRAIC_RULE for SBML
Core.
WARNING:
The specific integer values of the possible type codes may be reused
by different Level 3 package plug-ins. Thus, to identifiy the correct
code, it is necessary to invoke both getTypeCode() and
getPackageName().
See also getElementName(), getPackageName().
"""
return _libsbml.Rule_getTypeCode(self)
def getL1TypeCode(self):
"""
getL1TypeCode(Rule self) -> int
Returns the SBML Level 1 type code for this Rule object.
This method only applies to SBML Level 1 model objects. If this is
not an SBML Level 1 rule object, this method will return SBML_UNKNOWN.
Returns the SBML Level 1 type code for this Rule (namely,
SBML_COMPARTMENT_VOLUME_RULE, SBML_PARAMETER_RULE,
SBML_SPECIES_CONCENTRATION_RULE, or SBML_UNKNOWN).
"""
return _libsbml.Rule_getL1TypeCode(self)
def getElementName(self):
"""
getElementName(Rule self) -> string
Returns the XML element name of this object.
The returned value can be any of a number of different strings,
depending on the SBML Level in use and the kind of Rule object this
is. The rules as of libSBML version are the following:
* (Level 2 and 3) RateRule: returns 'rateRule'
* (Level 2 and 3) AssignmentRule: returns 'assignmentRule'
* (Level 2 and 3) AlgebraicRule: returns 'algebraicRule'
* (Level 1 Version 1) SpecieConcentrationRule: returns
'specieConcentrationRule'
* (Level 1 Version 2) SpeciesConcentrationRule: returns
'speciesConcentrationRule'
* (Level 1) CompartmentVolumeRule: returns 'compartmentVolumeRule'
* (Level 1) ParameterRule: returns 'parameterRule'
* Unknown rule type: returns 'unknownRule' Beware that the last
('unknownRule') is not a valid SBML element name.
Returns the name of this element
"""
return _libsbml.Rule_getElementName(self)
def setL1TypeCode(self, type):
"""
setL1TypeCode(Rule self, int type) -> int
Sets the SBML Level 1 type code for this Rule.
Parameter 'type' is the SBML Level 1 type code for this Rule. The
allowable values are SBML_COMPARTMENT_VOLUME_RULE,
SBML_PARAMETER_RULE, and SBML_SPECIES_CONCENTRATION_RULE.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE if given 'type' value is not one
of the above.
"""
return _libsbml.Rule_setL1TypeCode(self, type)
def hasRequiredElements(self):
"""
hasRequiredElements(Rule self) -> bool
Predicate returning True if all the required elements for this Rule
object have been set.
The only required element for a Rule object is the 'math' subelement.
Returns a boolean value indicating whether all the required elements
for this object have been defined.
"""
return _libsbml.Rule_hasRequiredElements(self)
def hasRequiredAttributes(self):
"""
hasRequiredAttributes(Rule self) -> bool
Predicate returning True if all the required attributes for this Rule
object have been set.
The required attributes for a Rule object depend on the type of Rule
it is. For AssignmentRule and RateRule objects (and SBML
Level 1's SpeciesConcentrationRule, CompartmentVolumeRule, and
ParameterRule objects), the required attribute is 'variable'; for
AlgebraicRule objects, there is no required attribute.
Returns True if the required attributes have been set, False
otherwise.
"""
return _libsbml.Rule_hasRequiredAttributes(self)
def renameSIdRefs(self, oldid, newid):
"""
renameSIdRefs(Rule self, string oldid, string newid)
Replaces all uses of a given SIdRef type attribute value with another
value.
In SBML, object identifiers are of a data type called SId. In SBML
Level 3, an explicit data type called SIdRef was introduced for
attribute values that refer to SId values; in previous Levels of SBML,
this data type did not exist and attributes were simply described to
as 'referring to an identifier', but the effective data type was the
same as SIdRefin Level 3. These and other methods of libSBML refer to
the type SIdRef for all Levels of SBML, even if the corresponding SBML
specification did not explicitly name the data type.
This method works by looking at all attributes and (if appropriate)
mathematical formulas in MathML content, comparing the referenced
identifiers to the value of 'oldid'. If any matches are found, the
matching values are replaced with 'newid'. The method does not
descend into child elements.
Parameter 'oldid' is the old identifier Parameter 'newid' is the new
identifier
"""
return _libsbml.Rule_renameSIdRefs(self, oldid, newid)
def renameUnitSIdRefs(self, oldid, newid):
"""
renameUnitSIdRefs(Rule self, string oldid, string newid)
Replaces all uses of a given UnitSIdRef type attribute value with
another value.
In SBML, unit definitions have identifiers of type UnitSId. In SBML
Level 3, an explicit data type called UnitSIdRef was introduced for
attribute values that refer to UnitSId values; in previous Levels of
SBML, this data type did not exist and attributes were simply
described to as 'referring to a unit identifier', but the effective
data type was the same as UnitSIdRef in Level 3. These and other
methods of libSBML refer to the type UnitSIdRef for all Levels of
SBML, even if the corresponding SBML specification did not explicitly
name the data type.
This method works by looking at all unit identifier attribute values
(including, if appropriate, inside mathematical formulas), comparing
the referenced unit identifiers to the value of 'oldid'. If any
matches are found, the matching values are replaced with 'newid'. The
method does not descend into child elements.
Parameter 'oldid' is the old identifier Parameter 'newid' is the new
identifier
"""
return _libsbml.Rule_renameUnitSIdRefs(self, oldid, newid)
def getId(self):
"""
getId(Rule self) -> string
Internal implementation method.
"""
return _libsbml.Rule_getId(self)
def replaceSIDWithFunction(self, id, function):
"""
replaceSIDWithFunction(Rule self, string id, ASTNode function)
Internal implementation method.
"""
return _libsbml.Rule_replaceSIDWithFunction(self, id, function)
def divideAssignmentsToSIdByFunction(self, id, function):
"""
divideAssignmentsToSIdByFunction(Rule self, string id, ASTNode function)
Internal implementation method.
"""
return _libsbml.Rule_divideAssignmentsToSIdByFunction(self, id, function)
def multiplyAssignmentsToSIdByFunction(self, id, function):
"""
multiplyAssignmentsToSIdByFunction(Rule self, string id, ASTNode function)
Internal implementation method.
"""
return _libsbml.Rule_multiplyAssignmentsToSIdByFunction(self, id, function)
Rule_swigregister = _libsbml.Rule_swigregister
Rule_swigregister(Rule)
class ListOfRules(ListOf):
"""
A list of Rule objects.
The various ListOf___ classes in SBML are merely containers used for
organizing the main components of an SBML model. In libSBML's
implementation, ListOf___ classes are derived from the intermediate
utility class ListOf, which is not defined by the SBML specifications
but serves as a useful programmatic construct. ListOf is itself is in
turn derived from SBase, which provides all of the various ListOf___
classes with common features defined by the SBML specification, such
as 'metaid' attributes and annotations.
The relationship between the lists and the rest of an SBML model is
illustrated by the following (for SBML Level 2 Version 4):
...
...
...
...
...
...
... elements of subclasses of Rule ...
...
...
...
Readers may wonder about the motivations for using the ListOf___
containers in SBML. A simpler approach in XML might be to place the
components all directly at the top level of the model definition. The
choice made in SBML is to group them within XML elements named after
ListOfClassname, in part because it helps organize the components.
More importantly, the fact that the container classes are derived from
SBase means that software tools can add information about the lists
themselves into each list container's 'annotation'.
See also ListOfFunctionDefinitions, ListOfUnitDefinitions,
ListOfCompartmentTypes, ListOfSpeciesTypes, ListOfCompartments,
ListOfSpecies, ListOfParameters, ListOfInitialAssignments,
ListOfRules, ListOfConstraints, ListOfReactions, ListOfEvents.
"""
__swig_setmethods__ = {}
for _s in [ListOf]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, ListOfRules, name, value)
__swig_getmethods__ = {}
for _s in [ListOf]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, ListOfRules, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(ListOfRules self, unsigned int level, unsigned int version) -> ListOfRules
__init__(ListOfRules self, SBMLNamespaces sbmlns) -> ListOfRules
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
ListOfRules(SBMLNamespaces sbmlns)
Creates a new ListOfRules object.
The object is constructed such that it is valid for the SBML Level and
Version combination determined by the SBMLNamespaces object in
'sbmlns'.
Parameter 'sbmlns' is an SBMLNamespaces object that is used to
determine the characteristics of the ListOfRules object to be created.
______________________________________________________________________
Method variant with the following signature:
ListOfRules(long level, long version)
Creates a new ListOfRules object.
The object is constructed such that it is valid for the given SBML
Level and Version combination.
Parameter 'level' is the SBML Level
Parameter 'version' is the Version within the SBML Level
"""
this = _libsbml.new_ListOfRules(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(ListOfRules self) -> ListOfRules
Creates and returns a deep copy of this ListOfRules object.
Returns the (deep) copy of this ListOfRules object.
"""
return _libsbml.ListOfRules_clone(self)
def getItemTypeCode(self):
"""
getItemTypeCode(ListOfRules self) -> int
Returns the libSBML type code for the objects contained in this ListOf
(i.e., Rule objects, if the list is non-empty).
LibSBML attaches an identifying code to every kind of SBML object.
These are integer constants known as SBML type codes. The names of
all the codes begin with the characters SBML_. In the Python language
interface for libSBML, the type codes are defined as static integer
constants in the interface class 'libsbml'. Note that different Level
3 package plug-ins may use overlapping type codes; to identify the
package to which a given object belongs, call the getPackageName()
method on the object.
Returns the SBML type code for objects contained in this list:
SBML_RULE (default).
See also getElementName(), getPackageName().
"""
return _libsbml.ListOfRules_getItemTypeCode(self)
def getElementName(self):
"""
getElementName(ListOfRules self) -> string
Returns the XML element name of this object.
For ListOfRules, the XML element name is 'listOfRules'.
Returns the name of this element, i.e., 'listOfRules'.
"""
return _libsbml.ListOfRules_getElementName(self)
def get(self, *args):
"""
get(ListOfRules self, unsigned int n) -> Rule
get(ListOfRules self, unsigned int n) -> Rule
get(ListOfRules self, string sid) -> Rule
get(ListOfRules self, string sid) -> Rule
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
get(string sid)
Get a Rule from the ListOfRules based on its identifier.
Parameter 'sid' is a string representing the identifier of the Rule to
get.
Returns Rule in this ListOfRules with the given 'sid' or None if no
such Rule exists.
See also get(), size(), size().
"""
return _libsbml.ListOfRules_get(self, *args)
def getElementBySId(self, id):
"""
getElementBySId(ListOfRules self, string id) -> SBase
Returns the first child element found that has the given 'id' in the
model-wide SId namespace, or None if no such object is found.
Note that AssignmentRules and RateRules do not actually have IDs, but
the libsbml interface pretends that they do: no assignment rule or
rate rule is returned by this function.
Parameter 'id' is string representing the id of objects to find
Returns pointer to the first element found with the given 'id'.
"""
return _libsbml.ListOfRules_getElementBySId(self, id)
def remove(self, *args):
"""
remove(ListOfRules self, unsigned int n) -> Rule
remove(ListOfRules self, string sid) -> Rule
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
remove(string sid)
Removes item in this ListOfRules items with the given identifier.
The caller owns the returned item and is responsible for deleting it.
If none of the items in this list have the identifier 'sid', then None
is returned.
Parameter 'sid' is the identifier of the item to remove
Returns the item removed. As mentioned above, the caller owns the
returned item.
______________________________________________________________________
Method variant with the following signature:
remove(long n)
Removes the nth item from this ListOfRules items and returns a pointer
to it.
The caller owns the returned item and is responsible for deleting it.
Parameter 'n' is the index of the item to remove
See also size().
"""
return _libsbml.ListOfRules_remove(self, *args)
__swig_destroy__ = _libsbml.delete_ListOfRules
__del__ = lambda self: None
ListOfRules_swigregister = _libsbml.ListOfRules_swigregister
ListOfRules_swigregister(ListOfRules)
class AlgebraicRule(Rule):
"""
An SBML algebraic rule representing 0 = f(W).
The rule type AlgebraicRule is derived from the parent class Rule. It
is used to express equations that are neither assignments of model
variables nor rates of change. AlgebraicRule does not add any
attributes to the basic Rule; its role is simply to distinguish this
case from the other cases.
In the context of a simulation, algebraic rules are in effect at all
times, t >= 0. For purposes of evaluating expressions that involve
the delay 'csymbol' (see the SBML specification), algebraic rules are
considered to apply also at t <= 0. Please consult the relevant SBML
specification for additional information about the semantics of
assignments, rules, and entity values for simulation time t <= 0.
An SBML model must not be overdetermined. The ability to define
arbitrary algebraic expressions in an SBML model introduces the
possibility that a model is mathematically overdetermined by the
overall system of equations constructed from its rules, reactions and
events. Therefore, if an algebraic rule is introduced in a model, for
at least one of the entities referenced in the rule's 'math' element
the value of that entity must not be completely determined by other
constructs in the model. This means that at least this entity must
not have the attribute 'constant'=True and there must also not be a
rate rule or assignment rule for it. Furthermore, if the entity is a
Species object, its value must not be determined by reactions, which
means that it must either have the attribute 'boundaryCondition'=True
or else not be involved in any reaction at all. These restrictions
are explained in more detail in the SBML specification documents.
In SBML Levels 2 and 3, Reaction object identifiers can be referenced
in the 'math' expression of an algebraic rule, but reaction rates can
never be determined by algebraic rules. This is true even when a
reaction does not contain a KineticLaw object. (In such cases of
missing kinetic law definitions, the model is valid but incomplete;
the rates of reactions lacking kinetic laws are simply undefined, and
not determined by the algebraic rule.)
General summary of SBML rules
======================================================================
In SBML Level 3 as well as Level 2, rules are separated into three
subclasses for the benefit of model analysis software. The three
subclasses are based on the following three different possible
functional forms (where x is a variable, f is some arbitrary function
returning a numerical result, V is a vector of variables that does not
include x, and W is a vector of variables that may include x):
Algebraic: left-hand side is zero 0 = f(W)
Assignment: left-hand side is a scalar: x = f(V)
Rate: left-hand side is a rate-of-change: dx/dt = f(W)
In their general form given above, there is little to distinguish
between assignment and algebraic rules. They are treated as separate
cases for the following reasons:
* Assignment rules can simply be evaluated to calculate
intermediate values for use in numerical methods. They are statements
of equality that hold at all times. (For assignments that are only
performed once, see InitialAssignment.)
* SBML needs to place restrictions on assignment rules, for example
the restriction that assignment rules cannot contain algebraic loops.
* Some simulators do not contain numerical solvers capable of
solving unconstrained algebraic equations, and providing more direct
forms such as assignment rules may enable those simulators to process
models they could not process if the same assignments were put in the
form of general algebraic equations;
* Those simulators that can solve these algebraic equations make a
distinction between the different categories listed above; and
* Some specialized numerical analyses of models may only be
applicable to models that do not contain algebraic rules.
The approach taken to covering these cases in SBML is to define an
abstract Rule structure containing a subelement, 'math', to hold the
right-hand side expression, then to derive subtypes of Rule that add
attributes to distinguish the cases of algebraic, assignment and rate
rules. The 'math' subelement must contain a MathML expression
defining the mathematical formula of the rule. This MathML formula
must return a numerical value. The formula can be an arbitrary
expression referencing the variables and other entities in an SBML
model.
Each of the three subclasses of Rule (AssignmentRule, AlgebraicRule,
RateRule) inherit the the 'math' subelement and other fields from
SBase. The AssignmentRule and RateRule classes add an additional
attribute, 'variable'. See the definitions of AssignmentRule,
AlgebraicRule and RateRule for details about the structure and
interpretation of each one.
Additional restrictions on SBML rules
======================================================================
An important design goal of SBML rule semantics is to ensure that a
model's simulation and analysis results will not be dependent on when
or how often rules are evaluated. To achieve this, SBML needs to
place two restrictions on rule use. The first concerns algebraic
loops in the system of assignments in a model, and the second concerns
overdetermined systems.
A model must not contain algebraic loops
......................................................................
The combined set of InitialAssignment, AssignmentRule and KineticLaw
objects in a model constitute a set of assignment statements that
should be considered as a whole. (A KineticLaw object is counted as
an assignment because it assigns a value to the symbol contained in
the 'id' attribute of the Reaction object in which it is defined.)
This combined set of assignment statements must not contain algebraic
loops---dependency chains between these statements must terminate. To
put this more formally, consider a directed graph in which nodes are
assignment statements and directed arcs exist for each occurrence of
an SBML species, compartment or parameter symbol in an assignment
statement's 'math' subelement. Let the directed arcs point from the
statement assigning the symbol to the statements that contain the
symbol in their 'math' subelement expressions. This graph must be
acyclic.
SBML does not specify when or how often rules should be evaluated.
Eliminating algebraic loops ensures that assignment statements can be
evaluated any number of times without the result of those evaluations
changing. As an example, consider the set of equations x = x + 1, y =
z + 200 and z = y + 100. If this set of equations were interpreted as
a set of assignment statements, it would be invalid because the rule
for x refers to x (exhibiting one type of loop), and the rule for y
refers to z while the rule for z refers back to y (exhibiting another
type of loop). Conversely, the following set of equations would
constitute a valid set of assignment statements: x = 10, y = z + 200,
and z = x + 100.
A model must not be overdetermined
......................................................................
An SBML model must not be overdetermined; that is, a model must not
define more equations than there are unknowns in a model. An SBML
model that does not contain AlgebraicRule structures cannot be
overdetermined.
LibSBML implements the static analysis procedure described in Appendix
B of the SBML Level 3 Version 1 Core specification for assessing
whether a model is overdetermined.
(In summary, assessing whether a given continuous, deterministic,
mathematical model is overdetermined does not require dynamic
analysis; it can be done by analyzing the system of equations created
from the model. One approach is to construct a bipartite graph in
which one set of vertices represents the variables and the other the
set of vertices represents the equations. Place edges between
vertices such that variables in the system are linked to the equations
that determine them. For algebraic equations, there will be edges
between the equation and each variable occurring in the equation. For
ordinary differential equations (such as those defined by rate rules
or implied by the reaction rate definitions), there will be a single
edge between the equation and the variable determined by that
differential equation. A mathematical model is overdetermined if the
maximal matchings of the bipartite graph contain disconnected vertexes
representing equations. If one maximal matching has this property,
then all the maximal matchings will have this property; i.e., it is
only necessary to find one maximal matching.)
Rule types for SBML Level 1
======================================================================
SBML Level 1 uses a different scheme than SBML Level 2 and Level 3 for
distinguishing rules; specifically, it uses an attribute whose value
is drawn from an enumeration of 3 values. LibSBML supports this using
methods that work with the enumeration values listed below.
* RULE_TYPE_RATE: Indicates the rule is a 'rate' rule.
* RULE_TYPE_SCALAR: Indicates the rule is a 'scalar' rule.
* RULE_TYPE_INVALID: Indicates the rule type is unknown or not yet
set.
"""
__swig_setmethods__ = {}
for _s in [Rule]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, AlgebraicRule, name, value)
__swig_getmethods__ = {}
for _s in [Rule]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, AlgebraicRule, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(AlgebraicRule self, unsigned int level, unsigned int version) -> AlgebraicRule
__init__(AlgebraicRule self, SBMLNamespaces sbmlns) -> AlgebraicRule
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
AlgebraicRule(SBMLNamespaces sbmlns)
Creates a new AlgebraicRule object using the given SBMLNamespaces
object 'sbmlns'.
The SBMLNamespaces object encapsulates SBML Level/Version/namespaces
information. It is used to communicate the SBML Level, Version, and
(in Level 3) packages used in addition to SBML Level 3 Core. A common
approach to using libSBML's SBMLNamespaces facilities is to create an
SBMLNamespaces object somewhere in a program once, then hand that
object as needed to object constructors that accept SBMLNamespaces as
arguments.
Parameter 'sbmlns' is an SBMLNamespaces object.
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
______________________________________________________________________
Method variant with the following signature:
AlgebraicRule(long level, long version)
Creates a new AlgebraicRule object using the given SBML 'level' and
'version' values.
Parameter 'level' is the SBML Level to assign to this AlgebraicRule
object.
Parameter 'version' is the SBML Version to assign to this
AlgebraicRule object.
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
"""
this = _libsbml.new_AlgebraicRule(*args)
try:
self.this.append(this)
except:
self.this = this
__swig_destroy__ = _libsbml.delete_AlgebraicRule
__del__ = lambda self: None
def clone(self):
"""
clone(AlgebraicRule self) -> AlgebraicRule
Creates and returns a deep copy of this AlgebraicRule object.
Returns the (deep) copy of this Rule object.
"""
return _libsbml.AlgebraicRule_clone(self)
def hasRequiredAttributes(self):
"""
hasRequiredAttributes(AlgebraicRule self) -> bool
Predicate returning True if all the required attributes for this
AlgebraicRule object have been set.
In SBML Levels 2-3, there is no required attribute for an
AlgebraicRule object. For Level 1, the only required attribute is
'formula'.
Returns True if the required attributes have been set, False
otherwise.
"""
return _libsbml.AlgebraicRule_hasRequiredAttributes(self)
AlgebraicRule_swigregister = _libsbml.AlgebraicRule_swigregister
AlgebraicRule_swigregister(AlgebraicRule)
class AssignmentRule(Rule):
"""
An SBML assignment rule representing x = f(Y).
The rule type AssignmentRule is derived from the parent class Rule.
It is used to express equations that set the values of variables. The
left-hand side (the attribute named 'variable') of an assignment rule
can refer to the identifier of a Species, SpeciesReference (in SBML
Level 3), Compartment, or Parameter object in the model (but not a
Reaction). The entity identified must have its 'constant' attribute
set to False. The effects of an assignment rule construct are in
general terms the same, but differ in the precise details depending on
the type of SBML component being set:
* In the case of a species, an SBML assignment rule sets the
referenced species' quantity (whether a 'concentration' or 'amount')
to the value determined by the formula in the MathML subelement
'math'. The unit associated with the value produced by the 'math'
formula should (in SBML Level 2 Version 4 and in SBML Level 3) or must
(in SBML releases prior to Level 2 version 4) be equal to the unit
associated with the species' quantity. Restrictions: There must not
be both an AssignmentRule 'variable' attribute and a SpeciesReference
'species' attribute having the same value in a model, unless the
referenced Species object has its 'boundaryCondition' attribute set to
True. In other words, an assignment rule cannot be defined for a
species that is created or destroyed in a reaction unless that species
is defined as a boundary condition in the model.
* (For SBML Level 3 only) In the case of a species reference, an
assignment rule sets the stoichiometry of the referenced reactant or
product to the value determined by the formula in 'math'. The unit
associated with the value produced by the 'math' formula should be
consistent with the unit 'dimensionless', because reactant and product
stoichiometries in reactions are dimensionless quantities.
* In the case of a compartment, an SBML assignment rule sets the
referenced compartment's size to the value determined by the formula
in the 'math' subelement of the AssignmentRule object. The overall
units of the formula in 'math' should (in SBML Level 2 Version 4 and
in SBML Level 3) or must (in SBML releases prior to Level 2 version 4)
be the same as the units of the size of the compartment.
* In the case of a parameter, an assignment rule sets the referenced
parameter's value to that determined by the formula in the 'math'
subelement of the AssignmentRule object. The overall units of the
formula in the 'math' subelement should (in SBML Level 2 Version 4 and
in SBML Level 3) or must (in SBML releases prior to Level 2 version 4)
be the same as the units defined for the parameter. In the context of
a simulation, assignment rules are in effect at all times, t >= 0.
For purposes of evaluating expressions that involve the delay
'csymbol' (see the SBML Level 2 specification), assignment rules are
considered to apply also at t <= 0. Please consult the relevant SBML
specification for additional information about the semantics of
assignments, rules, and entity values for simulation time t <= 0.
A model must not contain more than one AssignmentRule or RateRule
object having the same value of 'variable'; in other words, in the set
of all assignment rules and rate rules in an SBML model, each variable
appearing in the left-hand sides can only appear once. This simply
follows from the fact that an indeterminate system would result if a
model contained more than one assignment rule for the same variable or
both an assignment rule and a rate rule for the same variable.
Similarly, a model must also not contain both an AssignmentRule and an
InitialAssignment definition for the same variable, because both kinds
of constructs apply prior to and at the start of simulation time,
i.e., t <= 0. If a model contained both an initial assignment and an
assignment rule for the same variable, an indeterminate system would
result.
The value calculated by an AssignmentRule object overrides the value
assigned to the given symbol by the model component defining that
symbol. For example, if a Compartment object's 'size' attribute value
is set in its definition, and the model also contains an
AssignmentRule object having that compartment's 'id' as its
'variable' value, then the 'size' assigned in the Compartment object
definition is ignored and the value assigned based on the computation
defined in the AssignmentRule. This does not mean that a definition
for a given symbol can be omitted if there is an AssignmentRule object
involving it. For example, there must be a Parameter object
definition for a given parameter if there is an AssignmentRule
definition for that parameter. It is only a question of which value
definition takes precedence.
General summary of SBML rules
======================================================================
In SBML Level 3 as well as Level 2, rules are separated into three
subclasses for the benefit of model analysis software. The three
subclasses are based on the following three different possible
functional forms (where x is a variable, f is some arbitrary function
returning a numerical result, V is a vector of variables that does not
include x, and W is a vector of variables that may include x):
Algebraic: left-hand side is zero 0 = f(W)
Assignment: left-hand side is a scalar: x = f(V)
Rate: left-hand side is a rate-of-change: dx/dt = f(W)
In their general form given above, there is little to distinguish
between assignment and algebraic rules. They are treated as separate
cases for the following reasons:
* Assignment rules can simply be evaluated to calculate
intermediate values for use in numerical methods. They are statements
of equality that hold at all times. (For assignments that are only
performed once, see InitialAssignment.)
* SBML needs to place restrictions on assignment rules, for example
the restriction that assignment rules cannot contain algebraic loops.
* Some simulators do not contain numerical solvers capable of
solving unconstrained algebraic equations, and providing more direct
forms such as assignment rules may enable those simulators to process
models they could not process if the same assignments were put in the
form of general algebraic equations;
* Those simulators that can solve these algebraic equations make a
distinction between the different categories listed above; and
* Some specialized numerical analyses of models may only be
applicable to models that do not contain algebraic rules.
The approach taken to covering these cases in SBML is to define an
abstract Rule structure containing a subelement, 'math', to hold the
right-hand side expression, then to derive subtypes of Rule that add
attributes to distinguish the cases of algebraic, assignment and rate
rules. The 'math' subelement must contain a MathML expression
defining the mathematical formula of the rule. This MathML formula
must return a numerical value. The formula can be an arbitrary
expression referencing the variables and other entities in an SBML
model.
Each of the three subclasses of Rule (AssignmentRule, AlgebraicRule,
RateRule) inherit the the 'math' subelement and other fields from
SBase. The AssignmentRule and RateRule classes add an additional
attribute, 'variable'. See the definitions of AssignmentRule,
AlgebraicRule and RateRule for details about the structure and
interpretation of each one.
Additional restrictions on SBML rules
======================================================================
An important design goal of SBML rule semantics is to ensure that a
model's simulation and analysis results will not be dependent on when
or how often rules are evaluated. To achieve this, SBML needs to
place two restrictions on rule use. The first concerns algebraic
loops in the system of assignments in a model, and the second concerns
overdetermined systems.
A model must not contain algebraic loops
......................................................................
The combined set of InitialAssignment, AssignmentRule and KineticLaw
objects in a model constitute a set of assignment statements that
should be considered as a whole. (A KineticLaw object is counted as
an assignment because it assigns a value to the symbol contained in
the 'id' attribute of the Reaction object in which it is defined.)
This combined set of assignment statements must not contain algebraic
loops---dependency chains between these statements must terminate. To
put this more formally, consider a directed graph in which nodes are
assignment statements and directed arcs exist for each occurrence of
an SBML species, compartment or parameter symbol in an assignment
statement's 'math' subelement. Let the directed arcs point from the
statement assigning the symbol to the statements that contain the
symbol in their 'math' subelement expressions. This graph must be
acyclic.
SBML does not specify when or how often rules should be evaluated.
Eliminating algebraic loops ensures that assignment statements can be
evaluated any number of times without the result of those evaluations
changing. As an example, consider the set of equations x = x + 1, y =
z + 200 and z = y + 100. If this set of equations were interpreted as
a set of assignment statements, it would be invalid because the rule
for x refers to x (exhibiting one type of loop), and the rule for y
refers to z while the rule for z refers back to y (exhibiting another
type of loop). Conversely, the following set of equations would
constitute a valid set of assignment statements: x = 10, y = z + 200,
and z = x + 100.
A model must not be overdetermined
......................................................................
An SBML model must not be overdetermined; that is, a model must not
define more equations than there are unknowns in a model. An SBML
model that does not contain AlgebraicRule structures cannot be
overdetermined.
LibSBML implements the static analysis procedure described in Appendix
B of the SBML Level 3 Version 1 Core specification for assessing
whether a model is overdetermined.
(In summary, assessing whether a given continuous, deterministic,
mathematical model is overdetermined does not require dynamic
analysis; it can be done by analyzing the system of equations created
from the model. One approach is to construct a bipartite graph in
which one set of vertices represents the variables and the other the
set of vertices represents the equations. Place edges between
vertices such that variables in the system are linked to the equations
that determine them. For algebraic equations, there will be edges
between the equation and each variable occurring in the equation. For
ordinary differential equations (such as those defined by rate rules
or implied by the reaction rate definitions), there will be a single
edge between the equation and the variable determined by that
differential equation. A mathematical model is overdetermined if the
maximal matchings of the bipartite graph contain disconnected vertexes
representing equations. If one maximal matching has this property,
then all the maximal matchings will have this property; i.e., it is
only necessary to find one maximal matching.)
Rule types for SBML Level 1
======================================================================
SBML Level 1 uses a different scheme than SBML Level 2 and Level 3 for
distinguishing rules; specifically, it uses an attribute whose value
is drawn from an enumeration of 3 values. LibSBML supports this using
methods that work with the enumeration values listed below.
* RULE_TYPE_RATE: Indicates the rule is a 'rate' rule.
* RULE_TYPE_SCALAR: Indicates the rule is a 'scalar' rule.
* RULE_TYPE_INVALID: Indicates the rule type is unknown or not yet
set.
"""
__swig_setmethods__ = {}
for _s in [Rule]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, AssignmentRule, name, value)
__swig_getmethods__ = {}
for _s in [Rule]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, AssignmentRule, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(AssignmentRule self, unsigned int level, unsigned int version) -> AssignmentRule
__init__(AssignmentRule self, SBMLNamespaces sbmlns) -> AssignmentRule
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
AssignmentRule(SBMLNamespaces sbmlns)
Creates a new AssignmentRule using the given SBMLNamespaces object
'sbmlns'.
The SBMLNamespaces object encapsulates SBML Level/Version/namespaces
information. It is used to communicate the SBML Level, Version, and
(in Level 3) packages used in addition to SBML Level 3 Core. A common
approach to using libSBML's SBMLNamespaces facilities is to create an
SBMLNamespaces object somewhere in a program once, then hand that
object as needed to object constructors that accept SBMLNamespaces as
arguments.
Parameter 'sbmlns' is an SBMLNamespaces object.
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
______________________________________________________________________
Method variant with the following signature:
AssignmentRule(long level, long version)
Creates a new AssignmentRule using the given SBML 'level' and
'version' values.
Parameter 'level' is a long integer, the SBML Level to assign to this
AssignmentRule.
Parameter 'version' is a long integer, the SBML Version to assign to
this AssignmentRule.
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
"""
this = _libsbml.new_AssignmentRule(*args)
try:
self.this.append(this)
except:
self.this = this
__swig_destroy__ = _libsbml.delete_AssignmentRule
__del__ = lambda self: None
def clone(self):
"""
clone(AssignmentRule self) -> AssignmentRule
Creates and returns a deep copy of this AssignmentRule object.
Returns the (deep) copy of this Rule object.
"""
return _libsbml.AssignmentRule_clone(self)
def hasRequiredAttributes(self):
"""
hasRequiredAttributes(AssignmentRule self) -> bool
Predicate returning True if all the required attributes for this
AssignmentRule object have been set.
In SBML Levels 2-3, the only required attribute for an AssignmentRule
object is 'variable'. For Level 1, where the equivalent attribute is
known by different names ('compartment', 'species', or 'name',
depending on the type of object), there is an additional required
attribute called 'formula'.
Returns True if the required attributes have been set, False
otherwise.
"""
return _libsbml.AssignmentRule_hasRequiredAttributes(self)
def renameSIdRefs(self, oldid, newid):
"""
renameSIdRefs(AssignmentRule self, string oldid, string newid)
Replaces all uses of a given SIdRef type attribute value with another
value.
In SBML, object identifiers are of a data type called SId. In SBML
Level 3, an explicit data type called SIdRef was introduced for
attribute values that refer to SId values; in previous Levels of SBML,
this data type did not exist and attributes were simply described to
as 'referring to an identifier', but the effective data type was the
same as SIdRefin Level 3. These and other methods of libSBML refer to
the type SIdRef for all Levels of SBML, even if the corresponding SBML
specification did not explicitly name the data type.
This method works by looking at all attributes and (if appropriate)
mathematical formulas in MathML content, comparing the referenced
identifiers to the value of 'oldid'. If any matches are found, the
matching values are replaced with 'newid'. The method does not
descend into child elements.
Parameter 'oldid' is the old identifier Parameter 'newid' is the new
identifier
"""
return _libsbml.AssignmentRule_renameSIdRefs(self, oldid, newid)
AssignmentRule_swigregister = _libsbml.AssignmentRule_swigregister
AssignmentRule_swigregister(AssignmentRule)
class RateRule(Rule):
"""
An SBML rate rule representing dx/dt = f(Y).
The rule type RateRule is derived from the parent class Rule. It is
used to express equations that determine the rates of change of
variables. The left-hand side (the 'variable' attribute) can refer to
the identifier of a species, compartment, or parameter (but not a
reaction). The entity identified must have its 'constant' attribute
set to False. The effects of a RateRule are in general terms the
same, but differ in the precise details depending on which variable is
being set:
* In the case of a species, a RateRule sets the rate of change of
the species' quantity (concentration or amount of substance) to the
value determined by the formula in the 'math' subelement of the
RateRule object. The overall units of the formula in 'math' should
(in SBML Level 2 Version 4 and in SBML Level 3) or must (in SBML
releases prior to Level 2 version 4) be equal to the unit of species
quantity divided by the model-wide unit of time. Restrictions: There
must not be both a RateRule 'variable' attribute and a
SpeciesReference 'species' attribute having the same value, unless
that species has its 'boundaryCondition' attribute is set to True.
This means a rate rule cannot be defined for a species that is created
or destroyed in a reaction, unless that species is defined as a
boundary condition in the model.
* (For SBML Level 3 only) In the case of a species reference, a
RateRule sets the rate of change of the stoichiometry of the
referenced reactant or product to the value determined by the formula
in 'math'. The unit associated with the value produced by the 'math'
formula should be consistent with the unit 'dimensionless' divided by
the model-wide unit of time.
* In the case of a compartment, a RateRule sets the rate of change of
the compartment's size to the value determined by the formula in the
'math' subelement of the RateRule object. The overall units of the
formula should (in SBML Level 2 Version 4 and in SBML Level 3) or must
(in SBML releases prior to Level 2 version 4) be the units of the
compartment's size divided by the model-wide unit of time.
* In the case of a parameter, a RateRule sets the rate of change of
the parameter's value to that determined by the formula in the 'math'
subelement of the RateRule object. The overall units of the formula
should (in SBML Level 2 Version 4 and in SBML Level 3) or must (in
SBML releases prior to Level 2 version 4) be the Parameter object's
'unit' attribute value divided by the model-wide unit of time. In the
context of a simulation, rate rules are in effect for simulation time
t < 0. Please consult the relevant SBML specification for additional
information about the semantics of assignments, rules, and entity
values for simulation time t <= 0.
As mentioned in the description of AssignmentRule, a model must not
contain more than one RateRule or AssignmentRule object having the
same value of 'variable'; in other words, in the set of all assignment
rules and rate rules in an SBML model, each variable appearing in the
left-hand sides can only appear once. This simply follows from the
fact that an indeterminate system would result if a model contained
more than one assignment rule for the same variable or both an
assignment rule and a rate rule for the same variable.
General summary of SBML rules
======================================================================
In SBML Level 3 as well as Level 2, rules are separated into three
subclasses for the benefit of model analysis software. The three
subclasses are based on the following three different possible
functional forms (where x is a variable, f is some arbitrary function
returning a numerical result, V is a vector of variables that does not
include x, and W is a vector of variables that may include x):
Algebraic: left-hand side is zero 0 = f(W)
Assignment: left-hand side is a scalar: x = f(V)
Rate: left-hand side is a rate-of-change: dx/dt = f(W)
In their general form given above, there is little to distinguish
between assignment and algebraic rules. They are treated as separate
cases for the following reasons:
* Assignment rules can simply be evaluated to calculate
intermediate values for use in numerical methods. They are statements
of equality that hold at all times. (For assignments that are only
performed once, see InitialAssignment.)
* SBML needs to place restrictions on assignment rules, for example
the restriction that assignment rules cannot contain algebraic loops.
* Some simulators do not contain numerical solvers capable of
solving unconstrained algebraic equations, and providing more direct
forms such as assignment rules may enable those simulators to process
models they could not process if the same assignments were put in the
form of general algebraic equations;
* Those simulators that can solve these algebraic equations make a
distinction between the different categories listed above; and
* Some specialized numerical analyses of models may only be
applicable to models that do not contain algebraic rules.
The approach taken to covering these cases in SBML is to define an
abstract Rule structure containing a subelement, 'math', to hold the
right-hand side expression, then to derive subtypes of Rule that add
attributes to distinguish the cases of algebraic, assignment and rate
rules. The 'math' subelement must contain a MathML expression
defining the mathematical formula of the rule. This MathML formula
must return a numerical value. The formula can be an arbitrary
expression referencing the variables and other entities in an SBML
model.
Each of the three subclasses of Rule (AssignmentRule, AlgebraicRule,
RateRule) inherit the the 'math' subelement and other fields from
SBase. The AssignmentRule and RateRule classes add an additional
attribute, 'variable'. See the definitions of AssignmentRule,
AlgebraicRule and RateRule for details about the structure and
interpretation of each one.
Additional restrictions on SBML rules
======================================================================
An important design goal of SBML rule semantics is to ensure that a
model's simulation and analysis results will not be dependent on when
or how often rules are evaluated. To achieve this, SBML needs to
place two restrictions on rule use. The first concerns algebraic
loops in the system of assignments in a model, and the second concerns
overdetermined systems.
A model must not contain algebraic loops
......................................................................
The combined set of InitialAssignment, AssignmentRule and KineticLaw
objects in a model constitute a set of assignment statements that
should be considered as a whole. (A KineticLaw object is counted as
an assignment because it assigns a value to the symbol contained in
the 'id' attribute of the Reaction object in which it is defined.)
This combined set of assignment statements must not contain algebraic
loops---dependency chains between these statements must terminate. To
put this more formally, consider a directed graph in which nodes are
assignment statements and directed arcs exist for each occurrence of
an SBML species, compartment or parameter symbol in an assignment
statement's 'math' subelement. Let the directed arcs point from the
statement assigning the symbol to the statements that contain the
symbol in their 'math' subelement expressions. This graph must be
acyclic.
SBML does not specify when or how often rules should be evaluated.
Eliminating algebraic loops ensures that assignment statements can be
evaluated any number of times without the result of those evaluations
changing. As an example, consider the set of equations x = x + 1, y =
z + 200 and z = y + 100. If this set of equations were interpreted as
a set of assignment statements, it would be invalid because the rule
for x refers to x (exhibiting one type of loop), and the rule for y
refers to z while the rule for z refers back to y (exhibiting another
type of loop). Conversely, the following set of equations would
constitute a valid set of assignment statements: x = 10, y = z + 200,
and z = x + 100.
A model must not be overdetermined
......................................................................
An SBML model must not be overdetermined; that is, a model must not
define more equations than there are unknowns in a model. An SBML
model that does not contain AlgebraicRule structures cannot be
overdetermined.
LibSBML implements the static analysis procedure described in Appendix
B of the SBML Level 3 Version 1 Core specification for assessing
whether a model is overdetermined.
(In summary, assessing whether a given continuous, deterministic,
mathematical model is overdetermined does not require dynamic
analysis; it can be done by analyzing the system of equations created
from the model. One approach is to construct a bipartite graph in
which one set of vertices represents the variables and the other the
set of vertices represents the equations. Place edges between
vertices such that variables in the system are linked to the equations
that determine them. For algebraic equations, there will be edges
between the equation and each variable occurring in the equation. For
ordinary differential equations (such as those defined by rate rules
or implied by the reaction rate definitions), there will be a single
edge between the equation and the variable determined by that
differential equation. A mathematical model is overdetermined if the
maximal matchings of the bipartite graph contain disconnected vertexes
representing equations. If one maximal matching has this property,
then all the maximal matchings will have this property; i.e., it is
only necessary to find one maximal matching.)
Rule types for SBML Level 1
======================================================================
SBML Level 1 uses a different scheme than SBML Level 2 and Level 3 for
distinguishing rules; specifically, it uses an attribute whose value
is drawn from an enumeration of 3 values. LibSBML supports this using
methods that work with the enumeration values listed below.
* RULE_TYPE_RATE: Indicates the rule is a 'rate' rule.
* RULE_TYPE_SCALAR: Indicates the rule is a 'scalar' rule.
* RULE_TYPE_INVALID: Indicates the rule type is unknown or not yet
set.
"""
__swig_setmethods__ = {}
for _s in [Rule]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, RateRule, name, value)
__swig_getmethods__ = {}
for _s in [Rule]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, RateRule, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(RateRule self, unsigned int level, unsigned int version) -> RateRule
__init__(RateRule self, SBMLNamespaces sbmlns) -> RateRule
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
RateRule(SBMLNamespaces sbmlns)
Creates a new RateRule using the given SBMLNamespaces object 'sbmlns'.
The SBMLNamespaces object encapsulates SBML Level/Version/namespaces
information. It is used to communicate the SBML Level, Version, and
(in Level 3) packages used in addition to SBML Level 3 Core. A common
approach to using libSBML's SBMLNamespaces facilities is to create an
SBMLNamespaces object somewhere in a program once, then hand that
object as needed to object constructors that accept SBMLNamespaces as
arguments.
Parameter 'sbmlns' is an SBMLNamespaces object.
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
______________________________________________________________________
Method variant with the following signature:
RateRule(long level, long version)
Creates a new RateRule using the given SBML 'level' and 'version'
values.
Parameter 'level' is a long integer, the SBML Level to assign to this
RateRule
Parameter 'version' is a long integer, the SBML Version to assign to
this RateRule
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
"""
this = _libsbml.new_RateRule(*args)
try:
self.this.append(this)
except:
self.this = this
__swig_destroy__ = _libsbml.delete_RateRule
__del__ = lambda self: None
def clone(self):
"""
clone(RateRule self) -> RateRule
Creates and returns a deep copy of this RateRule object.
Returns the (deep) copy of this RateRule object.
"""
return _libsbml.RateRule_clone(self)
def hasRequiredAttributes(self):
"""
hasRequiredAttributes(RateRule self) -> bool
Predicate returning True if all the required attributes for this
RateRule object have been set.
In SBML Levels 2-3, the only required attribute for a RateRule object
is 'variable'. For Level 1, where the equivalent attribute is known
by different names ('compartment', 'species', or 'name', depending on
the type of object), there is an additional required attribute called
'formula'.
Returns True if the required attributes have been set, False
otherwise.
"""
return _libsbml.RateRule_hasRequiredAttributes(self)
def renameSIdRefs(self, oldid, newid):
"""
renameSIdRefs(RateRule self, string oldid, string newid)
Replaces all uses of a given SIdRef type attribute value with another
value.
In SBML, object identifiers are of a data type called SId. In SBML
Level 3, an explicit data type called SIdRef was introduced for
attribute values that refer to SId values; in previous Levels of SBML,
this data type did not exist and attributes were simply described to
as 'referring to an identifier', but the effective data type was the
same as SIdRefin Level 3. These and other methods of libSBML refer to
the type SIdRef for all Levels of SBML, even if the corresponding SBML
specification did not explicitly name the data type.
This method works by looking at all attributes and (if appropriate)
mathematical formulas in MathML content, comparing the referenced
identifiers to the value of 'oldid'. If any matches are found, the
matching values are replaced with 'newid'. The method does not
descend into child elements.
Parameter 'oldid' is the old identifier Parameter 'newid' is the new
identifier
"""
return _libsbml.RateRule_renameSIdRefs(self, oldid, newid)
RateRule_swigregister = _libsbml.RateRule_swigregister
RateRule_swigregister(RateRule)
class Constraint(SBase):
"""
An SBML constraint, for stating validity assumptions.
The Constraint object class was introduced in SBML Level 2 Version 2
as a mechanism for stating the assumptions under which a model is
designed to operate. The constraints are statements about permissible
values of different quantities in a model. Constraints are not used to
compute dynamical values for simulation or analysis, but rather, they
serve an advisory role for simulation/analysis tools.
SBML's Constraint object class has one required attribute, 'id', to
give the parameter a unique identifier by which other parts of an SBML
model definition can refer to it. A Constraint object can also have
an optional 'name' attribute of type string. Identifiers and names
must be used according to the guidelines described in the SBML
specification (e.g., Section 3.3 in the Level 2 Version 4
specification).
Constraint has one required subelement, 'math', containing a MathML
formula defining the condition of the constraint. This formula must
return a boolean value of True when the model is a valid state. The
formula can be an arbitrary expression referencing the variables and
other entities in an SBML model. The evaluation of 'math' and
behavior of constraints are described in more detail below.
A Constraint structure also has an optional subelement called
'message'. This can contain a message in XHTML format that may be
displayed to the user when the condition of the formula in the 'math'
subelement evaluates to a value of False. Software tools are not
required to display the message, but it is recommended that they do so
as a matter of best practice. The XHTML content within a 'message'
subelement must follow the same restrictions as for the 'notes'
element on SBase described in in the SBML Level 2 specification;
please consult the SBML specification document corresponding to the
SBML Level and Version of your model for more information about the
requirements for 'notes' content.
Constraint was introduced in SBML Level 2 Version 2. It is not
available in earlier versions of Level 2 nor in any version of Level
1.
Semantics of Constraints
======================================================================
In the context of a simulation, a Constraint has effect at all times t
>= 0. Each Constraint's 'math' subelement is first evaluated after
any InitialAssignment definitions in a model at t = 0 and can
conceivably trigger at that point. (In other words, a simulation
could fail a constraint immediately.)
Constraint structures cannot and should not be used to compute the
dynamical behavior of a model as part of, for example, simulation.
Constraints may be used as input to non-dynamical analysis, for
instance by expressing flux constraints for flux balance analysis.
The results of a simulation of a model containing a constraint are
invalid from any simulation time at and after a point when the
function given by the 'math' subelement returns a value of False.
Invalid simulation results do not make a prediction of the behavior of
the biochemical reaction network represented by the model. The
precise behavior of simulation tools is left undefined with respect to
constraints. If invalid results are detected with respect to a given
constraint, the 'message' subelement may optionally be displayed to
the user. The simulation tool may also halt the simulation or clearly
delimit in output data the simulation time point at which the
simulation results become invalid.
SBML does not impose restrictions on duplicate Constraint definitions
or the order of evaluation of Constraint objects in a model. It is
possible for a model to define multiple constraints all with the same
mathematical expression. Since the failure of any constraint
indicates that the model simulation has entered an invalid state, a
system is not required to attempt to detect whether other constraints
in the model have failed once any one constraint has failed.
"""
__swig_setmethods__ = {}
for _s in [SBase]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, Constraint, name, value)
__swig_getmethods__ = {}
for _s in [SBase]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, Constraint, name)
__repr__ = _swig_repr
__swig_destroy__ = _libsbml.delete_Constraint
__del__ = lambda self: None
def __init__(self, *args):
"""
__init__(Constraint self, unsigned int level, unsigned int version) -> Constraint
__init__(Constraint self, SBMLNamespaces sbmlns) -> Constraint
__init__(Constraint self, Constraint orig) -> Constraint
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
Constraint(SBMLNamespaces sbmlns)
Creates a new Constraint using the given SBMLNamespaces object
'sbmlns'.
The SBMLNamespaces object encapsulates SBML Level/Version/namespaces
information. It is used to communicate the SBML Level, Version, and
(in Level 3) packages used in addition to SBML Level 3 Core. A common
approach to using libSBML's SBMLNamespaces facilities is to create an
SBMLNamespaces object somewhere in a program once, then hand that
object as needed to object constructors that accept SBMLNamespaces as
arguments.
Parameter 'sbmlns' is an SBMLNamespaces object.
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
______________________________________________________________________
Method variant with the following signature:
Constraint(long level, long version)
Creates a new Constraint using the given SBML 'level' and 'version'
values.
Parameter 'level' is a long integer, the SBML Level to assign to this
Constraint
Parameter 'version' is a long integer, the SBML Version to assign to
this Constraint
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
______________________________________________________________________
Method variant with the following signature:
Constraint(Constraint orig)
Copy constructor; creates a copy of this Constraint.
Parameter 'orig' is the object to copy.
Throws SBMLConstructorException: Thrown if the argument 'orig' is
None.
"""
this = _libsbml.new_Constraint(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(Constraint self) -> Constraint
Creates and returns a deep copy of this Constraint object.
Returns the (deep) copy of this Constraint object.
"""
return _libsbml.Constraint_clone(self)
def getMessage(self):
"""
getMessage(Constraint self) -> XMLNode
Get the message, if any, associated with this Constraint
Returns the message for this Constraint, as an XMLNode.
"""
return _libsbml.Constraint_getMessage(self)
def getMessageString(self):
"""
getMessageString(Constraint self) -> string
Get the message string, if any, associated with this Constraint
Returns the message for this Constraint, as a string.
"""
return _libsbml.Constraint_getMessageString(self)
def getMath(self):
"""
getMath(Constraint self) -> ASTNode
Get the mathematical expression of this Constraint
Returns the math for this Constraint, as an ASTNode.
"""
return _libsbml.Constraint_getMath(self)
def isSetMessage(self):
"""
isSetMessage(Constraint self) -> bool
Predicate returning True if a message is defined for this Constraint.
Returns True if the message of this Constraint is set, False
otherwise.
"""
return _libsbml.Constraint_isSetMessage(self)
def isSetMath(self):
"""
isSetMath(Constraint self) -> bool
Predicate returning True if a mathematical formula is defined for this
Constraint.
Returns True if the 'math' subelement for this Constraint is set,
False otherwise.
"""
return _libsbml.Constraint_isSetMath(self)
def setMessage(self, xhtml):
"""
setMessage(Constraint self, XMLNode xhtml) -> int
Sets the message of this Constraint.
The XMLNode tree passed in 'xhtml' is copied.
Parameter 'xhtml' is an XML tree containing XHTML content.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_OBJECT
"""
return _libsbml.Constraint_setMessage(self, xhtml)
def setMath(self, math):
"""
setMath(Constraint self, ASTNode math) -> int
Sets the mathematical expression of this Constraint to a copy of the
AST given as 'math'.
Parameter 'math' is an ASTNode expression to be assigned as the 'math'
subelement of this Constraint
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_OBJECT
"""
return _libsbml.Constraint_setMath(self, math)
def unsetMessage(self):
"""
unsetMessage(Constraint self) -> int
Unsets the 'message' subelement of this Constraint.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
"""
return _libsbml.Constraint_unsetMessage(self)
def renameSIdRefs(self, oldid, newid):
"""
renameSIdRefs(Constraint self, string oldid, string newid)
Replaces all uses of a given SIdRef type attribute value with another
value.
In SBML, object identifiers are of a data type called SId. In SBML
Level 3, an explicit data type called SIdRef was introduced for
attribute values that refer to SId values; in previous Levels of SBML,
this data type did not exist and attributes were simply described to
as 'referring to an identifier', but the effective data type was the
same as SIdRefin Level 3. These and other methods of libSBML refer to
the type SIdRef for all Levels of SBML, even if the corresponding SBML
specification did not explicitly name the data type.
This method works by looking at all attributes and (if appropriate)
mathematical formulas in MathML content, comparing the referenced
identifiers to the value of 'oldid'. If any matches are found, the
matching values are replaced with 'newid'. The method does not
descend into child elements.
Parameter 'oldid' is the old identifier Parameter 'newid' is the new
identifier
"""
return _libsbml.Constraint_renameSIdRefs(self, oldid, newid)
def renameUnitSIdRefs(self, oldid, newid):
"""
renameUnitSIdRefs(Constraint self, string oldid, string newid)
Replaces all uses of a given UnitSIdRef type attribute value with
another value.
In SBML, unit definitions have identifiers of type UnitSId. In SBML
Level 3, an explicit data type called UnitSIdRef was introduced for
attribute values that refer to UnitSId values; in previous Levels of
SBML, this data type did not exist and attributes were simply
described to as 'referring to a unit identifier', but the effective
data type was the same as UnitSIdRef in Level 3. These and other
methods of libSBML refer to the type UnitSIdRef for all Levels of
SBML, even if the corresponding SBML specification did not explicitly
name the data type.
This method works by looking at all unit identifier attribute values
(including, if appropriate, inside mathematical formulas), comparing
the referenced unit identifiers to the value of 'oldid'. If any
matches are found, the matching values are replaced with 'newid'. The
method does not descend into child elements.
Parameter 'oldid' is the old identifier Parameter 'newid' is the new
identifier
"""
return _libsbml.Constraint_renameUnitSIdRefs(self, oldid, newid)
def replaceSIDWithFunction(self, id, function):
"""
replaceSIDWithFunction(Constraint self, string id, ASTNode function)
Internal implementation method.
"""
return _libsbml.Constraint_replaceSIDWithFunction(self, id, function)
def getTypeCode(self):
"""
getTypeCode(Constraint self) -> int
Returns the libSBML type code for this SBML object.
LibSBML attaches an identifying code to every kind of SBML object.
These are integer constants known as SBML type codes. The names of
all the codes begin with the characters SBML_. In the Python language
interface for libSBML, the type codes are defined as static integer
constants in the interface class 'libsbml'. Note that different Level
3 package plug-ins may use overlapping type codes; to identify the
package to which a given object belongs, call the getPackageName()
method on the object.
Returns the SBML type code for this object: SBML_CONSTRAINT (default).
WARNING:
The specific integer values of the possible type codes may be reused
by different Level 3 package plug-ins. Thus, to identifiy the correct
code, it is necessary to invoke both getTypeCode() and
getPackageName().
See also getElementName(), getPackageName().
"""
return _libsbml.Constraint_getTypeCode(self)
def getElementName(self):
"""
getElementName(Constraint self) -> string
Returns the XML element name of this object, which for Constraint, is
always 'constraint'.
Returns the name of this element, i.e., 'constraint'.
"""
return _libsbml.Constraint_getElementName(self)
def hasRequiredElements(self):
"""
hasRequiredElements(Constraint self) -> bool
Predicate returning True if all the required elements for this
Constraint object have been set.
Note:
The required elements for a Constraint object are:
* 'math'
Returns a boolean value indicating whether all the required elements
for this object have been defined.
"""
return _libsbml.Constraint_hasRequiredElements(self)
Constraint_swigregister = _libsbml.Constraint_swigregister
Constraint_swigregister(Constraint)
class ListOfConstraints(ListOf):
"""
A list of Constraint objects.
The various ListOf___ classes in SBML are merely containers used for
organizing the main components of an SBML model. In libSBML's
implementation, ListOf___ classes are derived from the intermediate
utility class ListOf, which is not defined by the SBML specifications
but serves as a useful programmatic construct. ListOf is itself is in
turn derived from SBase, which provides all of the various ListOf___
classes with common features defined by the SBML specification, such
as 'metaid' attributes and annotations.
The relationship between the lists and the rest of an SBML model is
illustrated by the following (for SBML Level 2 Version 4):
...
...
...
...
...
...
... elements of subclasses of Rule ...
...
...
...
Readers may wonder about the motivations for using the ListOf___
containers in SBML. A simpler approach in XML might be to place the
components all directly at the top level of the model definition. The
choice made in SBML is to group them within XML elements named after
ListOfClassname, in part because it helps organize the components.
More importantly, the fact that the container classes are derived from
SBase means that software tools can add information about the lists
themselves into each list container's 'annotation'.
See also ListOfFunctionDefinitions, ListOfUnitDefinitions,
ListOfCompartmentTypes, ListOfSpeciesTypes, ListOfCompartments,
ListOfSpecies, ListOfParameters, ListOfInitialAssignments,
ListOfRules, ListOfConstraints, ListOfReactions, ListOfEvents.
"""
__swig_setmethods__ = {}
for _s in [ListOf]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, ListOfConstraints, name, value)
__swig_getmethods__ = {}
for _s in [ListOf]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, ListOfConstraints, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(ListOfConstraints self, unsigned int level, unsigned int version) -> ListOfConstraints
__init__(ListOfConstraints self, SBMLNamespaces sbmlns) -> ListOfConstraints
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
ListOfConstraints(SBMLNamespaces sbmlns)
Creates a new ListOfConstraints object.
The object is constructed such that it is valid for the SBML Level and
Version combination determined by the SBMLNamespaces object in
'sbmlns'.
Parameter 'sbmlns' is an SBMLNamespaces object that is used to
determine the characteristics of the ListOfConstraints object to be
created.
______________________________________________________________________
Method variant with the following signature:
ListOfConstraints(long level, long version)
Creates a new ListOfConstraints object.
The object is constructed such that it is valid for the given SBML
Level and Version combination.
Parameter 'level' is the SBML Level
Parameter 'version' is the Version within the SBML Level
"""
this = _libsbml.new_ListOfConstraints(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(ListOfConstraints self) -> ListOfConstraints
Creates and returns a deep copy of this ListOfConstraints object.
Returns the (deep) copy of this ListOfConstraints object.
"""
return _libsbml.ListOfConstraints_clone(self)
def getItemTypeCode(self):
"""
getItemTypeCode(ListOfConstraints self) -> int
Returns the libSBML type code for the objects contained in this ListOf
(i.e., Constraint objects, if the list is non-empty).
LibSBML attaches an identifying code to every kind of SBML object.
These are integer constants known as SBML type codes. The names of
all the codes begin with the characters SBML_. In the Python language
interface for libSBML, the type codes are defined as static integer
constants in the interface class 'libsbml'. Note that different Level
3 package plug-ins may use overlapping type codes; to identify the
package to which a given object belongs, call the getPackageName()
method on the object.
Returns the SBML type code for the objects contained in this ListOf
instance: SBML_CONSTRAINT (default).
See also getElementName(), getPackageName().
"""
return _libsbml.ListOfConstraints_getItemTypeCode(self)
def getElementName(self):
"""
getElementName(ListOfConstraints self) -> string
Returns the XML element name of this object.
For ListOfConstraints, the XML element name is 'listOfConstraints'.
Returns the name of this element.
"""
return _libsbml.ListOfConstraints_getElementName(self)
def get(self, *args):
"""
get(ListOfConstraints self, unsigned int n) -> Constraint
get(ListOfConstraints self, unsigned int n) -> Constraint
Get a Constraint from the ListOfConstraints.
Parameter 'n' is the index number of the Constraint to get.
Returns the nth Constraint in this ListOfConstraints.
See also size().
"""
return _libsbml.ListOfConstraints_get(self, *args)
def remove(self, n):
"""
remove(ListOfConstraints self, unsigned int n) -> Constraint
Removes the nth item from this ListOfConstraints items and returns a
pointer to it.
The caller owns the returned item and is responsible for deleting it.
Parameter 'n' is the index of the item to remove
See also size().
"""
return _libsbml.ListOfConstraints_remove(self, n)
__swig_destroy__ = _libsbml.delete_ListOfConstraints
__del__ = lambda self: None
ListOfConstraints_swigregister = _libsbml.ListOfConstraints_swigregister
ListOfConstraints_swigregister(ListOfConstraints)
class Reaction(SBase):
"""
An SBML reaction between species in an SBML model.
A reaction represents any transformation, transport or binding
process, typically a chemical reaction, that can change the quantity
of one or more species. In SBML, a reaction is defined primarily in
terms of the participating reactants and products (and their
corresponding stoichiometries), along with optional modifier species,
an optional rate at which the reaction takes place, and optional
parameters.
As with other major objects in SBML, Reaction has a mandatory
attribute, 'id', used to give the compartment type an identifier. The
identifier must be a text string conforming to the identifer syntax
permitted in SBML. In SBML Level 2 and Level 3, the reaction 'id'
identifier can be used in mathematical formulas elsewhere in an SBML
model to represent the rate of that reaction; this usage is explained
below. Reaction also has an optional 'name' attribute, of type
string. The 'id' and 'name' must be used according to the guidelines
described in the SBML specification.
The species participating as reactants, products, and/or modifiers in
a reaction are declared using lists of SpeciesReference and/or
ModifierSpeciesReference instances stored in subelements
'listOfReactants', 'listOfProducts' and 'listOfModifiers'. Certain
restrictions are placed on the appearance of species in reaction
definitions:
* The ability of a species to appear as a reactant or product of any
reaction in a model is governed by certain flags in that species'
definition; see the definition of Species for more information.
* Any species appearing in the mathematical formula of the subelement
'kineticLaw' (described below) of a Reaction must be declared in at
least one of that Reaction's lists of reactants, products, and/or
modifiers. Put another way, it is an error for a reaction's kinetic
law formula to refer to species that have not been declared for that
reaction.
* A reaction definition can contain an empty list of reactants or an
empty list of products, but it must have at least one reactant or
product; in other words, a reaction without any reactant or product
species is not permitted. (This restriction does not apply to
modifier species, which remain optional in all cases.) A reaction can
contain up to one KineticLaw object in a subelement named
'kineticLaw'. It defines the speed at which the process defined by
the reaction takes place. The description of KineticLaw provides more
details about its use. Note that although the inclusion of a
KineticLaw object in an instance of a Reaction component is optional,
there is no useful default that can be substituted in place of a
missing rate expression in a reaction. Moreover, a reaction's rate
cannot be defined in any other way in SBML---InitialAssignment,
AssignmentRule, RateRule, AlgebraicRule, Event, and other constructs
in SBML cannot be used to set the reaction rate separately.
Nevertheless, for some modeling applications, reactions without any
defined rate can be perfectly acceptable.
Reaction also has a boolean attribute named 'reversible' for
indicating whether the reaction is reversible. This attribute is
optional in SBML Level 2, with a default of True; it is mandatory in
SBML Level 3 (with no default value). To say that a reaction is
reversible is to say it can proceed in either the forward or the
reverse direction. Although the reversibility of a reaction can
sometimes be deduced by inspecting its rate expression, this is not
always the case, especially for complicated expressions. Moreover,
the need in SBML to allow rate expressions (i.e., KineticLaw) to be
optional leads to the need for a separate flag indicating
reversibility. Note that labeling a reaction as irreversible is an
assertion that the reaction always proceeds in the given forward
direction. (Why else would it be flagged as irreversible?) This
implies the rate expression in the KineticLaw always has a non-
negative value during simulations. Software tools could provide a
means of optionally testing that this condition holds. The presence of
reversibility information in two places (i.e., the rate expression and
the 'reversible' attribute on Reaction) leaves open the possibility
that a model could contain contradictory information, but the creation
of such a model would be an error on the part of the software
generating it.
The Reaction object class has another boolean attribute called 'fast'.
This attribute is optional in SBML Level 2, with a default of False;
it is mandatory in SBML Level 3 (with no default value). It is used
to indicate that a reaction occurs on a vastly faster time scale than
others in a system. Readers are directed to the SBML Level 2 Version
4 specification, which provides more detail about the conditions under
which a reaction can be considered to be fast in this sense. The
attribute's default value is False. SBML Level 1 and Level 2 Version
1 incorrectly claimed that software tools could ignore this attribute
if they did not implement support for the corresponding concept;
however, further research in SBML has revealed that this is not true,
and 'fast' cannot be ignored if it is set to True. SBML Level 2
Versions 2-4 therefore stipulate that if a model has any reactions
with 'fast' set to True, a software tool must be able to respect the
attribute or else indicate to the user that it does not have the
capacity to do so. Analysis software cannot ignore the value of the
'fast' attribute because doing so may lead to different results as
compared to a software system that does make use of 'fast'.
In SBML Level 3 Version 1, the Reaction object has an additional
optional attribute named 'compartment', whose value must be the
identifier of a compartment defined in the enclosing Model object. The
'compartment' attribute can be used to indicate the compartment in
which the reaction is assumed to take place. If the attribute is
present, its value must be the identifier of a Compartment object
defined in the enclosing Model object. Similar to the 'reversible'
attribute, the value of the 'compartment' attribute has no direct
impact on the construction of mathematical equations for the SBML
model. When a kinetic law is given for a reaction, the compartment
location may already be implicit in the kinetic law (although this
cannot always be guaranteed). Nevertheless, software tools may find
the 'compartment' attribute value useful for such purposes as
analyzing the structure of the model, guiding the modeler in
constructing correct rate formulas, and visualization purposes.
Readers are urged to read the SBML specification for more details
about the proper use of Reaction.
"""
__swig_setmethods__ = {}
for _s in [SBase]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, Reaction, name, value)
__swig_getmethods__ = {}
for _s in [SBase]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, Reaction, name)
__repr__ = _swig_repr
__swig_destroy__ = _libsbml.delete_Reaction
__del__ = lambda self: None
def __init__(self, *args):
"""
__init__(Reaction self, unsigned int level, unsigned int version) -> Reaction
__init__(Reaction self, SBMLNamespaces sbmlns) -> Reaction
__init__(Reaction self, Reaction orig) -> Reaction
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
Reaction(SBMLNamespaces sbmlns)
Creates a new Reaction using the given SBMLNamespaces object 'sbmlns'.
The SBMLNamespaces object encapsulates SBML Level/Version/namespaces
information. It is used to communicate the SBML Level, Version, and
(in Level 3) packages used in addition to SBML Level 3 Core. A common
approach to using libSBML's SBMLNamespaces facilities is to create an
SBMLNamespaces object somewhere in a program once, then hand that
object as needed to object constructors that accept SBMLNamespaces as
arguments.
Parameter 'sbmlns' is an SBMLNamespaces object.
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
______________________________________________________________________
Method variant with the following signature:
Reaction(long level, long version)
Creates a new Reaction using the given SBML 'level' and 'version'
values.
Parameter 'level' is a long integer, the SBML Level to assign to this
Reaction
Parameter 'version' is a long integer, the SBML Version to assign to
this Reaction
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
______________________________________________________________________
Method variant with the following signature:
Reaction(Reaction orig)
Copy constructor; creates a copy of this Reaction.
Parameter 'orig' is the object to copy.
Throws SBMLConstructorException: Thrown if the argument 'orig' is
None.
"""
this = _libsbml.new_Reaction(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(Reaction self) -> Reaction
Creates and returns a deep copy of this Reaction object.
Returns the (deep) copy of this Reaction object.
"""
return _libsbml.Reaction_clone(self)
def getElementBySId(self, id):
"""
getElementBySId(Reaction self, string id) -> SBase
Returns the first child element found that has the given 'id' in the
model-wide SId namespace, or None if no such object is found.
Parameter 'id' is string representing the id of objects to find.
Returns pointer to the first element found with the given 'id'.
"""
return _libsbml.Reaction_getElementBySId(self, id)
def getElementByMetaId(self, metaid):
"""
getElementByMetaId(Reaction self, string metaid) -> SBase
Returns the first child element it can find with the given 'metaid',
or None if no such object is found.
Parameter 'metaid' is string representing the metaid of objects to
find
Returns pointer to the first element found with the given 'metaid'.
"""
return _libsbml.Reaction_getElementByMetaId(self, metaid)
def renameSIdRefs(self, oldid, newid):
"""
renameSIdRefs(Reaction self, string oldid, string newid)
Replaces all uses of a given SIdRef type attribute value with another
value.
In SBML, object identifiers are of a data type called SId. In SBML
Level 3, an explicit data type called SIdRef was introduced for
attribute values that refer to SId values; in previous Levels of SBML,
this data type did not exist and attributes were simply described to
as 'referring to an identifier', but the effective data type was the
same as SIdRefin Level 3. These and other methods of libSBML refer to
the type SIdRef for all Levels of SBML, even if the corresponding SBML
specification did not explicitly name the data type.
This method works by looking at all attributes and (if appropriate)
mathematical formulas in MathML content, comparing the referenced
identifiers to the value of 'oldid'. If any matches are found, the
matching values are replaced with 'newid'. The method does not
descend into child elements.
Parameter 'oldid' is the old identifier Parameter 'newid' is the new
identifier
"""
return _libsbml.Reaction_renameSIdRefs(self, oldid, newid)
def initDefaults(self):
"""
initDefaults(Reaction self)
Initializes the fields of this Reaction object to 'typical' default
values.
The SBML Reaction component has slightly different aspects and default
attribute values in different SBML Levels and Versions. This method
sets the values to certain common defaults, based mostly on what they
are in SBML Level 2. Specifically:
* Sets the 'reversible' attribute to True
* Sets the 'fast' attribute to False
* Marks the 'fast' attribute as not having been set
WARNING:
SBML definitions before SBML Level 2 Version 2 incorrectly indicated
that software tools could ignore the 'fast' attribute if they did not
implement support for the corresponding concept; however, further
research in SBML has revealed that this is not true, and 'fast' cannot
be ignored if it is set to True. Beginning with SBML Level 2 Versions
2, the SBML specifications therefore stipulate that if a model has any
reactions with 'fast' set to True, a software tool must be able to
respect the attribute or else indicate to the user that it does not
have the capacity to do so. Readers are directed to the SBML
specifications, which provides more detail about the conditions under
which a reaction can be considered to be fast in this sense.
"""
return _libsbml.Reaction_initDefaults(self)
def getId(self):
"""
getId(Reaction self) -> string
Returns the value of the 'id' attribute of this Reaction.
Returns the id of this Reaction.
"""
return _libsbml.Reaction_getId(self)
def getName(self):
"""
getName(Reaction self) -> string
Returns the value of the 'name' attribute of this Reaction.
Returns the name of this Reaction.
"""
return _libsbml.Reaction_getName(self)
def getKineticLaw(self, *args):
"""
getKineticLaw(Reaction self) -> KineticLaw
getKineticLaw(Reaction self) -> KineticLaw
Returns the KineticLaw object contained in this Reaction.
Returns the KineticLaw instance.
"""
return _libsbml.Reaction_getKineticLaw(self, *args)
def getReversible(self):
"""
getReversible(Reaction self) -> bool
Returns the value of the 'reversible' attribute on the Reaction as a
boolean value.
Returns the reversibility status of this Reaction.
"""
return _libsbml.Reaction_getReversible(self)
def getFast(self):
"""
getFast(Reaction self) -> bool
Returns the value of the 'fast' attribute of this Reaction.
Returns the 'fast' status of this Reaction.
WARNING:
SBML definitions before SBML Level 2 Version 2 incorrectly indicated
that software tools could ignore the 'fast' attribute if they did not
implement support for the corresponding concept; however, further
research in SBML has revealed that this is not true, and 'fast' cannot
be ignored if it is set to True. Beginning with SBML Level 2 Versions
2, the SBML specifications therefore stipulate that if a model has any
reactions with 'fast' set to True, a software tool must be able to
respect the attribute or else indicate to the user that it does not
have the capacity to do so. Readers are directed to the SBML
specifications, which provides more detail about the conditions under
which a reaction can be considered to be fast in this sense.
"""
return _libsbml.Reaction_getFast(self)
def getCompartment(self):
"""
getCompartment(Reaction self) -> string
(SBML Level 3 only) Returns the value of the 'compartment' attribute
on the Reaction.
Returns the compartment of this Reaction.
Note:
The 'compartment' attribute is available in SBML Level 3 Version 1
Core, but is not present on Reaction in lower Levels of SBML.
"""
return _libsbml.Reaction_getCompartment(self)
def isSetId(self):
"""
isSetId(Reaction self) -> bool
Predicate returning True if this Reaction's 'id' attribute is set.
Returns True if the 'id' attribute of this Reaction is set, False
otherwise.
"""
return _libsbml.Reaction_isSetId(self)
def isSetName(self):
"""
isSetName(Reaction self) -> bool
Predicate returning True if this Reaction's 'name' attribute is set.
Returns True if the 'name' attribute of this Reaction is set, False
otherwise.
"""
return _libsbml.Reaction_isSetName(self)
def isSetKineticLaw(self):
"""
isSetKineticLaw(Reaction self) -> bool
Predicate returning True if this Reaction contains a kinetic law
object.
Returns True if a KineticLaw is present in this Reaction,, False
otherwise.
"""
return _libsbml.Reaction_isSetKineticLaw(self)
def isSetFast(self):
"""
isSetFast(Reaction self) -> bool
Predicate returning True if the value of the 'fast' attribute on this
Reaction.
Returns True if the 'fast' attribute is true, False otherwise.
WARNING:
SBML definitions before SBML Level 2 Version 2 incorrectly indicated
that software tools could ignore the 'fast' attribute if they did not
implement support for the corresponding concept; however, further
research in SBML has revealed that this is not true, and 'fast' cannot
be ignored if it is set to True. Beginning with SBML Level 2 Versions
2, the SBML specifications therefore stipulate that if a model has any
reactions with 'fast' set to True, a software tool must be able to
respect the attribute or else indicate to the user that it does not
have the capacity to do so. Readers are directed to the SBML
specifications, which provides more detail about the conditions under
which a reaction can be considered to be fast in this sense.
"""
return _libsbml.Reaction_isSetFast(self)
def isSetCompartment(self):
"""
isSetCompartment(Reaction self) -> bool
Predicate returning True if this Reaction's 'compartment' attribute is
set.
Returns True if the 'compartment' attribute of this Reaction is set,
False otherwise.
Note:
The 'compartment' attribute is available in SBML Level 3 Version 1
Core, but is not present on Reaction in lower Levels of SBML.
"""
return _libsbml.Reaction_isSetCompartment(self)
def isSetReversible(self):
"""
isSetReversible(Reaction self) -> bool
Predicate returning True if this Reaction's 'reversible' attribute is
set.
Returns True if the 'reversible' attribute of this Reaction is set,
False otherwise.
"""
return _libsbml.Reaction_isSetReversible(self)
def setId(self, sid):
"""
setId(Reaction self, string sid) -> int
Sets the value of the 'id' attribute of this Reaction.
The string 'sid' is copied.
SBML has strict requirements for the syntax of identifiers, that is,
the values of the 'id' attribute present on most types of SBML
objects. The following is a summary of the definition of the SBML
identifier type SId, which defines the permitted syntax of
identifiers. We express the syntax using an extended form of BNF
notation:
letter ::= 'a'..'z','A'..'Z'
digit ::= '0'..'9'
idChar ::= letter | digit | '_'
SId ::= ( letter | '_' ) idChar*
The characters ( and ) are used for grouping, the character * 'zero or
more times', and the character | indicates logical 'or'. The equality
of SBML identifiers is determined by an exact character sequence
match; i.e., comparisons must be performed in a case-sensitive manner.
In addition, there are a few conditions for the uniqueness of
identifiers in an SBML model. Please consult the SBML specifications
for the exact details of the uniqueness requirements.
Parameter 'sid' is the string to use as the identifier of this
Reaction
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
"""
return _libsbml.Reaction_setId(self, sid)
def setName(self, name):
"""
setName(Reaction self, string name) -> int
Sets the value of the 'name' attribute of this Reaction.
The string in 'name' is copied.
Parameter 'name' is the new name for the Reaction
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
"""
return _libsbml.Reaction_setName(self, name)
def setKineticLaw(self, kl):
"""
setKineticLaw(Reaction self, KineticLaw kl) -> int
Sets the 'kineticLaw' subelement of this Reaction to a copy of the
given KineticLaw object.
Parameter 'kl' is the KineticLaw object to use.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_LEVEL_MISMATCH
* LIBSBML_VERSION_MISMATCH
"""
return _libsbml.Reaction_setKineticLaw(self, kl)
def setReversible(self, value):
"""
setReversible(Reaction self, bool value) -> int
Sets the value of the 'reversible' attribute of this Reaction.
Parameter 'value' is the value of the 'reversible' attribute.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
"""
return _libsbml.Reaction_setReversible(self, value)
def setFast(self, value):
"""
setFast(Reaction self, bool value) -> int
Sets the value of the 'fast' attribute of this Reaction.
Parameter 'value' is the value of the 'fast' attribute.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
WARNING:
SBML definitions before SBML Level 2 Version 2 incorrectly indicated
that software tools could ignore the 'fast' attribute if they did not
implement support for the corresponding concept; however, further
research in SBML has revealed that this is not true, and 'fast' cannot
be ignored if it is set to True. Beginning with SBML Level 2 Versions
2, the SBML specifications therefore stipulate that if a model has any
reactions with 'fast' set to True, a software tool must be able to
respect the attribute or else indicate to the user that it does not
have the capacity to do so. Readers are directed to the SBML
specifications, which provides more detail about the conditions under
which a reaction can be considered to be fast in this sense.
"""
return _libsbml.Reaction_setFast(self, value)
def setCompartment(self, sid):
"""
setCompartment(Reaction self, string sid) -> int
Sets the value of the 'compartment' attribute of this Reaction.
The string 'sid' is copied.
Parameter 'sid' is the string to use as the compartment of this
Reaction
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_UNEXPECTED_ATTRIBUTE
* LIBSBML_INVALID_ATTRIBUTE_VALUE
Note:
The 'compartment' attribute is available in SBML Level 3 Version 1
Core, but is not present on Reaction in lower Levels of SBML.
"""
return _libsbml.Reaction_setCompartment(self, sid)
def unsetName(self):
"""
unsetName(Reaction self) -> int
Unsets the value of the 'name' attribute of this Reaction.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
"""
return _libsbml.Reaction_unsetName(self)
def unsetKineticLaw(self):
"""
unsetKineticLaw(Reaction self) -> int
Unsets the 'kineticLaw' subelement of this Reaction.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
"""
return _libsbml.Reaction_unsetKineticLaw(self)
def unsetFast(self):
"""
unsetFast(Reaction self) -> int
Unsets the value of the 'fast' attribute of this Reaction.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
WARNING:
SBML definitions before SBML Level 2 Version 2 incorrectly indicated
that software tools could ignore the 'fast' attribute if they did not
implement support for the corresponding concept; however, further
research in SBML has revealed that this is not true, and 'fast' cannot
be ignored if it is set to True. Beginning with SBML Level 2 Versions
2, the SBML specifications therefore stipulate that if a model has any
reactions with 'fast' set to True, a software tool must be able to
respect the attribute or else indicate to the user that it does not
have the capacity to do so. Readers are directed to the SBML
specifications, which provides more detail about the conditions under
which a reaction can be considered to be fast in this sense.
"""
return _libsbml.Reaction_unsetFast(self)
def unsetCompartment(self):
"""
unsetCompartment(Reaction self) -> int
Unsets the value of the 'compartment' attribute of this Reaction.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_UNEXPECTED_ATTRIBUTE
* LIBSBML_OPERATION_FAILED
Note:
The 'compartment' attribute is available in SBML Level 3 Version 1
Core, but is not present on Reaction in lower Levels of SBML.
"""
return _libsbml.Reaction_unsetCompartment(self)
def addReactant(self, sr):
"""
addReactant(Reaction self, SpeciesReference sr) -> int
Adds a given SpeciesReference object as a reactant in this Reaction.
The SpeciesReference instance in 'sr' is copied.
Parameter 'sr' is a SpeciesReference object referring to a Species in
the enclosing Model
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_LEVEL_MISMATCH
* LIBSBML_VERSION_MISMATCH
* LIBSBML_DUPLICATE_OBJECT_ID
* LIBSBML_INVALID_OBJECT
* LIBSBML_OPERATION_FAILED
Note:
This method should be used with some caution. The fact that this
method copies the object passed to it means that the caller will be
left holding a physically different object instance than the one
contained inside this object. Changes made to the original object
instance (such as resetting attribute values) will not affect the
instance in this object. In addition, the caller should make sure to
free the original object if it is no longer being used, or else a
memory leak will result. Please see other methods on this class
(particularly a corresponding method whose name begins with the word
create) for alternatives that do not lead to these issues.
See also createReactant().
"""
return _libsbml.Reaction_addReactant(self, sr)
def addProduct(self, sr):
"""
addProduct(Reaction self, SpeciesReference sr) -> int
Adds a given SpeciesReference object as a product in this Reaction.
The SpeciesReference instance in 'sr' is copied.
Parameter 'sr' is a SpeciesReference object referring to a Species in
the enclosing Model
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_LEVEL_MISMATCH
* LIBSBML_VERSION_MISMATCH
* LIBSBML_OPERATION_FAILED
Note:
This method should be used with some caution. The fact that this
method copies the object passed to it means that the caller will be
left holding a physically different object instance than the one
contained inside this object. Changes made to the original object
instance (such as resetting attribute values) will not affect the
instance in this object. In addition, the caller should make sure to
free the original object if it is no longer being used, or else a
memory leak will result. Please see other methods on this class
(particularly a corresponding method whose name begins with the word
create) for alternatives that do not lead to these issues.
See also createProduct().
"""
return _libsbml.Reaction_addProduct(self, sr)
def addModifier(self, msr):
"""
addModifier(Reaction self, ModifierSpeciesReference msr) -> int
Adds a given ModifierSpeciesReference object as a product in this
Reaction.
The ModifierSpeciesReference instance in 'msr' is copied.
Parameter 'msr' is a ModifierSpeciesReference object referring to a
Species in the enclosing Model
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_UNEXPECTED_ATTRIBUTE
* LIBSBML_LEVEL_MISMATCH
* LIBSBML_DUPLICATE_OBJECT_ID
* LIBSBML_VERSION_MISMATCH
* LIBSBML_OPERATION_FAILED
Note:
This method should be used with some caution. The fact that this
method copies the object passed to it means that the caller will be
left holding a physically different object instance than the one
contained inside this object. Changes made to the original object
instance (such as resetting attribute values) will not affect the
instance in this object. In addition, the caller should make sure to
free the original object if it is no longer being used, or else a
memory leak will result. Please see other methods on this class
(particularly a corresponding method whose name begins with the word
create) for alternatives that do not lead to these issues.
See also createModifier().
"""
return _libsbml.Reaction_addModifier(self, msr)
def createReactant(self):
"""
createReactant(Reaction self) -> SpeciesReference
Creates a new SpeciesReference, adds it to this Reaction's list of
reactants, and returns it.
Returns a new SpeciesReference object.
"""
return _libsbml.Reaction_createReactant(self)
def createProduct(self):
"""
createProduct(Reaction self) -> SpeciesReference
Creates a new SpeciesReference, adds it to this Reaction's list of
products, and returns it.
Returns a new SpeciesReference object.
"""
return _libsbml.Reaction_createProduct(self)
def createModifier(self):
"""
createModifier(Reaction self) -> ModifierSpeciesReference
Creates a new ModifierSpeciesReference, adds it to this Reaction's
list of modifiers and returns it.
Returns a new ModifierSpeciesReference object.
"""
return _libsbml.Reaction_createModifier(self)
def createKineticLaw(self):
"""
createKineticLaw(Reaction self) -> KineticLaw
Creates a new KineticLaw object, installs it as this Reaction's
'kineticLaw' subelement, and returns it.
If this Reaction had a previous KineticLaw, it will be destroyed.
Returns the new KineticLaw object
"""
return _libsbml.Reaction_createKineticLaw(self)
def getListOfReactants(self, *args):
"""
getListOfReactants(Reaction self) -> ListOfSpeciesReferences
getListOfReactants(Reaction self) -> ListOfSpeciesReferences
Returns the list of reactants in this Reaction object.
Returns the ListOfSpeciesReferences containing the references to the
species acting as reactants in this reaction
"""
return _libsbml.Reaction_getListOfReactants(self, *args)
def getListOfProducts(self, *args):
"""
getListOfProducts(Reaction self) -> ListOfSpeciesReferences
getListOfProducts(Reaction self) -> ListOfSpeciesReferences
Returns the list of products in this Reaction object.
Returns the ListOfSpeciesReferences containing the references to the
species acting as products in this reaction
"""
return _libsbml.Reaction_getListOfProducts(self, *args)
def getListOfModifiers(self, *args):
"""
getListOfModifiers(Reaction self) -> ListOfSpeciesReferences
getListOfModifiers(Reaction self) -> ListOfSpeciesReferences
Returns the list of modifiers in this Reaction object.
Returns the ListOfSpeciesReferences containing the references to the
species acting as modifiers in this reaction
"""
return _libsbml.Reaction_getListOfModifiers(self, *args)
def getReactant(self, *args):
"""
getReactant(Reaction self, unsigned int n) -> SpeciesReference
getReactant(Reaction self, unsigned int n) -> SpeciesReference
getReactant(Reaction self, string species) -> SpeciesReference
getReactant(Reaction self, string species) -> SpeciesReference
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
getReactant(long n)
Returns the nth reactant species (as a SpeciesReference object) in
the list of reactants in this Reaction.
Callers should first call getNumReactants() to find out how many
reactants there are, to avoid using an invalid index number.
Parameter 'n' is the index of the reactant sought.
Returns the nth reactant (as a SpeciesReference object) of this
Reaction.
______________________________________________________________________
Method variant with the following signature:
getReactant(string species)
Returns the reactant species (as a SpeciesReference object) having a
specific identifier in this Reaction.
Parameter 'species' is the identifier of the reactant Species
('species' attribute of the reactant SpeciesReference object)
Returns a SpeciesReference object, or None if no species with the
given identifier 'species' appears as a reactant in this Reaction.
"""
return _libsbml.Reaction_getReactant(self, *args)
def getProduct(self, *args):
"""
getProduct(Reaction self, unsigned int n) -> SpeciesReference
getProduct(Reaction self, unsigned int n) -> SpeciesReference
getProduct(Reaction self, string species) -> SpeciesReference
getProduct(Reaction self, string species) -> SpeciesReference
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
getProduct(long n)
Returns the nth product species (as a SpeciesReference object) in the
list of products in this Reaction.
Callers should first call getNumProducts() to find out how many
products there are, to avoid using an invalid index number.
Parameter 'n' is the index of the product sought.
Returns the nth product (as a SpeciesReference object) of this
Reaction.
______________________________________________________________________
Method variant with the following signature:
getProduct(string species)
Returns the product species (as a SpeciesReference object) having a
specific identifier in this Reaction.
Parameter 'species' is the identifier of the product Species
('species' attribute of the product SpeciesReference object)
Returns a SpeciesReference object, or None if no species with the
given identifier 'species' appears as a product in this Reaction.
"""
return _libsbml.Reaction_getProduct(self, *args)
def getModifier(self, *args):
"""
getModifier(Reaction self, unsigned int n) -> ModifierSpeciesReference
getModifier(Reaction self, unsigned int n) -> ModifierSpeciesReference
getModifier(Reaction self, string species) -> ModifierSpeciesReference
getModifier(Reaction self, string species) -> ModifierSpeciesReference
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
getModifier(long n)
Returns the nth modifier species (as a ModifierSpeciesReference
object) in the list of modifiers of this Reaction.
Callers should first call getNumModifiers() to find out how many
modifiers there are, to avoid using an invalid index number.
Parameter 'n' is the index of the modifier species sought
Returns the nth modifier (as a ModifierSpeciesReference object) of
this Reaction.
______________________________________________________________________
Method variant with the following signature:
getModifier(string species)
Returns the modifier species (as a ModifierSpeciesReference object)
having a specific identifier in this Reaction.
Parameter 'species' is the identifier of the modifier Species
('species' attribute of the ModifierSpeciesReference object)
Returns a ModifierSpeciesReference object, or None if no species with
the given identifier 'species' appears as a modifier in this Reaction.
"""
return _libsbml.Reaction_getModifier(self, *args)
def getNumReactants(self):
"""
getNumReactants(Reaction self) -> unsigned int
Returns the number of reactant species in this Reaction.
Returns the number of reactants in this Reaction.
"""
return _libsbml.Reaction_getNumReactants(self)
def getNumProducts(self):
"""
getNumProducts(Reaction self) -> unsigned int
Returns the number of product species in this Reaction.
Returns the number of products in this Reaction.
"""
return _libsbml.Reaction_getNumProducts(self)
def getNumModifiers(self):
"""
getNumModifiers(Reaction self) -> unsigned int
Returns the number of modifier species in this Reaction.
Returns the number of modifiers in this Reaction.
"""
return _libsbml.Reaction_getNumModifiers(self)
def removeReactant(self, *args):
"""
removeReactant(Reaction self, unsigned int n) -> SpeciesReference
removeReactant(Reaction self, string species) -> SpeciesReference
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
removeReactant(long n)
Removes the nth reactant species (SpeciesReference object) in the list
of reactants in this Reaction and returns a pointer to it.
The caller owns the returned object and is responsible for deleting
it. The caller should first call getNumReactants() to find out how
many reactants there are, to avoid using an invalid index number.
Parameter 'n' is the index of the reactant SpeciesReference object to
remove
Returns the removed reactant SpeciesReference object, or None if the
given index is out of range.
______________________________________________________________________
Method variant with the following signature:
removeReactant(string species)
Removes the reactant species (SpeciesReference object) having the
given 'species' attribute in this Reaction and returns a pointer to
it.
The caller owns the returned object and is responsible for deleting
it.
Parameter 'species' is the 'species' attribute of the reactant
SpeciesReference object
Returns the removed reactant SpeciesReference object, or None if no
reactant SpeciesReference object with the given 'species' attribute
'species' exists in this Reaction.
"""
return _libsbml.Reaction_removeReactant(self, *args)
def removeProduct(self, *args):
"""
removeProduct(Reaction self, unsigned int n) -> SpeciesReference
removeProduct(Reaction self, string species) -> SpeciesReference
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
removeProduct(long n)
Removes the nth product species (SpeciesReference object) in the list
of products in this Reaction and returns a pointer to it.
The caller owns the returned object and is responsible for deleting
it. The caller should first call getNumProducts() to find out how many
products there are, to avoid using an invalid index number.
Parameter 'n' is the index of the product SpeciesReference object to
remove
Returns the removed product SpeciesReference object, or None if the
given index is out of range.
______________________________________________________________________
Method variant with the following signature:
removeProduct(string species)
Removes the product species (SpeciesReference object) having the given
'species' attribute in this Reaction and returns a pointer to it.
The caller owns the returned object and is responsible for deleting
it.
Parameter 'species' is the 'species' attribute of the product
SpeciesReference object
Returns the removed product SpeciesReference object, or None if no
product SpeciesReference object with the given 'species' attribute
'species' exists in this Reaction.
"""
return _libsbml.Reaction_removeProduct(self, *args)
def removeModifier(self, *args):
"""
removeModifier(Reaction self, unsigned int n) -> ModifierSpeciesReference
removeModifier(Reaction self, string species) -> ModifierSpeciesReference
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
removeModifier(long n)
Removes the nth modifier species (ModifierSpeciesReference object) in
the list of modifiers in this Reaction and returns a pointer to it.
The caller owns the returned object and is responsible for deleting
it. The caller should first call getNumModifiers() to find out how
many modifiers there are, to avoid using an invalid index number.
Parameter 'n' is the index of the ModifierSpeciesReference object to
remove
Returns the removed ModifierSpeciesReference object, or None if the
given index is out of range.
______________________________________________________________________
Method variant with the following signature:
removeModifier(string species)
Removes the modifier species (ModifierSpeciesReference object) having
the given 'species' attribute in this Reaction and returns a pointer
to it.
The caller owns the returned object and is responsible for deleting
it.
Parameter 'species' is the 'species' attribute of the
ModifierSpeciesReference object
Returns the removed ModifierSpeciesReference object, or None if no
ModifierSpeciesReference object with the given 'species' attribute
'species' exists in this Reaction.
"""
return _libsbml.Reaction_removeModifier(self, *args)
def connectToChild(self):
"""connectToChild(Reaction self)"""
return _libsbml.Reaction_connectToChild(self)
def enablePackageInternal(self, pkgURI, pkgPrefix, flag):
"""
enablePackageInternal(Reaction self, string pkgURI, string pkgPrefix, bool flag)
Internal implementation method.
"""
return _libsbml.Reaction_enablePackageInternal(self, pkgURI, pkgPrefix, flag)
def getTypeCode(self):
"""
getTypeCode(Reaction self) -> int
Returns the libSBML type code for this SBML object.
LibSBML attaches an identifying code to every kind of SBML object.
These are integer constants known as SBML type codes. The names of
all the codes begin with the characters SBML_. In the Python language
interface for libSBML, the type codes are defined as static integer
constants in the interface class 'libsbml'. Note that different Level
3 package plug-ins may use overlapping type codes; to identify the
package to which a given object belongs, call the getPackageName()
method on the object.
Returns the SBML type code for this object: SBML_REACTION (default).
WARNING:
The specific integer values of the possible type codes may be reused
by different Level 3 package plug-ins. Thus, to identifiy the correct
code, it is necessary to invoke both getTypeCode() and
getPackageName().
See also getElementName(), getPackageName().
"""
return _libsbml.Reaction_getTypeCode(self)
def getElementName(self):
"""
getElementName(Reaction self) -> string
Returns the XML element name of this object, which for Reaction, is
always 'reaction'.
Returns the name of this element, i.e., 'reaction'.
"""
return _libsbml.Reaction_getElementName(self)
def hasRequiredAttributes(self):
"""
hasRequiredAttributes(Reaction self) -> bool
Predicate returning True if all the required attributes for this
Reaction object have been set.
The required attributes for a Reaction object are:
* 'id' (or 'name' in SBML Level 1)
* 'fast' (in Level 3 only, where it is defined as a required
attribute)
* 'reversible' (in Level 3 only, where it is defined as a required
attribute)
Returns True if the required attributes have been set, False
otherwise.
"""
return _libsbml.Reaction_hasRequiredAttributes(self)
Reaction_swigregister = _libsbml.Reaction_swigregister
Reaction_swigregister(Reaction)
class ListOfReactions(ListOf):
"""
A list of Reaction objects.
The various ListOf___ classes in SBML are merely containers used for
organizing the main components of an SBML model. In libSBML's
implementation, ListOf___ classes are derived from the intermediate
utility class ListOf, which is not defined by the SBML specifications
but serves as a useful programmatic construct. ListOf is itself is in
turn derived from SBase, which provides all of the various ListOf___
classes with common features defined by the SBML specification, such
as 'metaid' attributes and annotations.
The relationship between the lists and the rest of an SBML model is
illustrated by the following (for SBML Level 2 Version 4):
...
...
...
...
...
...
... elements of subclasses of Rule ...
...
...
...
Readers may wonder about the motivations for using the ListOf___
containers in SBML. A simpler approach in XML might be to place the
components all directly at the top level of the model definition. The
choice made in SBML is to group them within XML elements named after
ListOfClassname, in part because it helps organize the components.
More importantly, the fact that the container classes are derived from
SBase means that software tools can add information about the lists
themselves into each list container's 'annotation'.
See also ListOfFunctionDefinitions, ListOfUnitDefinitions,
ListOfCompartmentTypes, ListOfSpeciesTypes, ListOfCompartments,
ListOfSpecies, ListOfParameters, ListOfInitialAssignments,
ListOfRules, ListOfConstraints, ListOfReactions, ListOfEvents.
"""
__swig_setmethods__ = {}
for _s in [ListOf]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, ListOfReactions, name, value)
__swig_getmethods__ = {}
for _s in [ListOf]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, ListOfReactions, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(ListOfReactions self, unsigned int level, unsigned int version) -> ListOfReactions
__init__(ListOfReactions self, SBMLNamespaces sbmlns) -> ListOfReactions
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
ListOfReactions(SBMLNamespaces sbmlns)
Creates a new ListOfReactions object.
The object is constructed such that it is valid for the SBML Level and
Version combination determined by the SBMLNamespaces object in
'sbmlns'.
Parameter 'sbmlns' is an SBMLNamespaces object that is used to
determine the characteristics of the ListOfReactions object to be
created.
______________________________________________________________________
Method variant with the following signature:
ListOfReactions(long level, long version)
Creates a new ListOfReactions object.
The object is constructed such that it is valid for the given SBML
Level and Version combination.
Parameter 'level' is the SBML Level
Parameter 'version' is the Version within the SBML Level
"""
this = _libsbml.new_ListOfReactions(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(ListOfReactions self) -> ListOfReactions
Creates and returns a deep copy of this ListOfReactions object.
Returns the (deep) copy of this ListOfReactions object.
"""
return _libsbml.ListOfReactions_clone(self)
def getItemTypeCode(self):
"""
getItemTypeCode(ListOfReactions self) -> int
Returns the libSBML type code for the objects contained in this ListOf
(i.e., Reaction objects, if the list is non-empty).
LibSBML attaches an identifying code to every kind of SBML object.
These are integer constants known as SBML type codes. The names of
all the codes begin with the characters SBML_. In the Python language
interface for libSBML, the type codes are defined as static integer
constants in the interface class 'libsbml'. Note that different Level
3 package plug-ins may use overlapping type codes; to identify the
package to which a given object belongs, call the getPackageName()
method on the object.
Returns the SBML type code for objects contained in this list:
SBML_REACTION (default).
See also getElementName(), getPackageName().
"""
return _libsbml.ListOfReactions_getItemTypeCode(self)
def getElementName(self):
"""
getElementName(ListOfReactions self) -> string
Returns the XML element name of this object
For ListOfReactions, the XML element name is 'listOfReactions'.
Returns the name of this element, i.e., 'listOfReactions'.
"""
return _libsbml.ListOfReactions_getElementName(self)
def get(self, *args):
"""
get(ListOfReactions self, unsigned int n) -> Reaction
get(ListOfReactions self, unsigned int n) -> Reaction
get(ListOfReactions self, string sid) -> Reaction
get(ListOfReactions self, string sid) -> Reaction
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
get(string sid)
Get a Reaction from the ListOfReactions based on its identifier.
Parameter 'sid' is a string representing the identifier of the
Reaction to get.
Returns Reaction in this ListOfReactions with the given 'sid' or None
if no such Reaction exists.
See also get(), size(), size().
"""
return _libsbml.ListOfReactions_get(self, *args)
def remove(self, *args):
"""
remove(ListOfReactions self, unsigned int n) -> Reaction
remove(ListOfReactions self, string sid) -> Reaction
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
remove(string sid)
Removes item in this ListOfReactions items with the given identifier.
The caller owns the returned item and is responsible for deleting it.
If none of the items in this list have the identifier 'sid', then None
is returned.
Parameter 'sid' is the identifier of the item to remove
Returns the item removed. As mentioned above, the caller owns the
returned item.
______________________________________________________________________
Method variant with the following signature:
remove(long n)
Removes the nth item from this ListOfReactions items and returns a
pointer to it.
The caller owns the returned item and is responsible for deleting it.
Parameter 'n' is the index of the item to remove
See also size().
"""
return _libsbml.ListOfReactions_remove(self, *args)
__swig_destroy__ = _libsbml.delete_ListOfReactions
__del__ = lambda self: None
ListOfReactions_swigregister = _libsbml.ListOfReactions_swigregister
ListOfReactions_swigregister(ListOfReactions)
class KineticLaw(SBase):
"""
The rate expression for an SBML reaction.
An object of class KineticLaw is used to describe the rate at which
the process defined by a given Reaction takes place. KineticLaw has
subelements called 'math' (for MathML content) and 'listOfParameters'
(of class ListOfParameters), in addition to the attributes and
subelements it inherits from SBase.
KineticLaw's 'math' subelement for holding a MathML formula defines
the rate of the reaction. The formula may refer to other entities in
a model as well as local parameter definitions within the scope of the
Reaction (see below). It is important to keep in mind, however, that
the only Species identifiers that can be used in this formula are
those declared in the lists of reactants, products and modifiers in
the Reaction structure. (In other words, before a species can be
referenced in the KineticLaw, it must be declared in one of those
lists.)
KineticLaw provides a way to define local parameters whose identifiers
can be used in the 'math' formula of that KineticLaw instance. Prior
to SBML Level 3, these parameter definitions are stored inside a
'listOfParameters' subelement containing Parameter objects; in SBML
Level 3, this is achieved using a specialized object class called
LocalParameter and the containing subelement is called
'listOfLocalParameters'. In both cases, the parameters so defined are
only visible within the KineticLaw; they cannot be accessed outside.
A local parameter within one reaction is not visible from within
another reaction, nor is it visible to any other construct outside of
the KineticLaw in which it is defined. In addition, another important
feature is that if such a Parameter (or in Level 3, LocalParameter)
object has the same identifier as another object in the scope of the
enclosing Model, the definition inside the KineticLaw takes
precedence. In other words, within the KineticLaw's 'math' formula,
references to local parameter identifiers shadow any identical global
identifiers.
The values of local parameters defined within KineticLaw objects
cannot change. In SBML Level 3, this quality is built into the
LocalParameter construct. In Level 2, where the same kind of
Parameter object class is used as for global parameters, the Parameter
objects' 'constant' attribute must always have a value of True (either
explicitly or left to its default value).
A warning about identifier shadowing
======================================================================
A common misconception is that different classes of objects (e.g.,
species, compartments, parameters) in SBML have different identifier
scopes. They do not. The implication is that if a KineticLaw's local
parameter definition uses an identifier identical to any other
identifier defined in the model outside the KineticLaw, even if the
other identifier does not belong to a parameter type of object, the
local parameter's identifier takes precedence within that KineticLaw's
'math' formula. It is not an error in SBML for identifiers to shadow
each other this way, but can lead to confusing and subtle errors.
SBML Level/Version differences
======================================================================
In SBML Level 2 Version 1, the SBML specification included two
additional attributes on KineticLaw called 'substanceUnits' and
'timeUnits'. They were removed beginning with SBML Level 2 Version 2
because further research determined they introduced many problems.
The most significant problem was that their use could easily lead to
the creation of valid models whose reactions nevertheless could not be
integrated into a system of equations without outside knowledge for
converting the quantities used. Examination of real-life models
revealed that a common reason for using 'substanceUnits' on KineticLaw
was to set the units of all reactions to the same set of substance
units, something that is better achieved by using UnitDefinition to
redefine 'substance' for the whole Model.
As mentioned above, in SBML Level 2 Versions 2-4, local parameters are
of class Parameter. In SBML Level 3, the class of object is
LocalParameter.
"""
__swig_setmethods__ = {}
for _s in [SBase]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, KineticLaw, name, value)
__swig_getmethods__ = {}
for _s in [SBase]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, KineticLaw, name)
__repr__ = _swig_repr
__swig_destroy__ = _libsbml.delete_KineticLaw
__del__ = lambda self: None
def __init__(self, *args):
"""
__init__(KineticLaw self, unsigned int level, unsigned int version) -> KineticLaw
__init__(KineticLaw self, SBMLNamespaces sbmlns) -> KineticLaw
__init__(KineticLaw self, KineticLaw orig) -> KineticLaw
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
KineticLaw(SBMLNamespaces sbmlns)
Creates a new KineticLaw using the given SBMLNamespaces object
'sbmlns'.
The SBMLNamespaces object encapsulates SBML Level/Version/namespaces
information. It is used to communicate the SBML Level, Version, and
(in Level 3) packages used in addition to SBML Level 3 Core. A common
approach to using libSBML's SBMLNamespaces facilities is to create an
SBMLNamespaces object somewhere in a program once, then hand that
object as needed to object constructors that accept SBMLNamespaces as
arguments.
Parameter 'sbmlns' is an SBMLNamespaces object.
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
______________________________________________________________________
Method variant with the following signature:
KineticLaw(long level, long version)
Creates a new KineticLaw using the given SBML 'level' and 'version'
values.
Parameter 'level' is a long integer, the SBML Level to assign to this
KineticLaw
Parameter 'version' is a long integer, the SBML Version to assign to
this KineticLaw
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
______________________________________________________________________
Method variant with the following signature:
KineticLaw(KineticLaw orig)
Copy constructor; creates a copy of this KineticLaw.
Parameter 'orig' is the object to copy.
Throws SBMLConstructorException: Thrown if the argument 'orig' is
None.
"""
this = _libsbml.new_KineticLaw(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(KineticLaw self) -> KineticLaw
Creates and returns a deep copy of this KineticLaw object.
Returns the (deep) copy of this KineticLaw object.
"""
return _libsbml.KineticLaw_clone(self)
def getElementBySId(self, id):
"""
getElementBySId(KineticLaw self, string id) -> SBase
Returns the first child element found that has the given 'id' in the
model-wide SId namespace, or None if no such object is found.
Parameter 'id' is string representing the id of objects to find.
Returns pointer to the first element found with the given 'id'.
"""
return _libsbml.KineticLaw_getElementBySId(self, id)
def getElementByMetaId(self, metaid):
"""
getElementByMetaId(KineticLaw self, string metaid) -> SBase
Returns the first child element it can find with the given 'metaid',
or None if no such object is found.
Parameter 'metaid' is string representing the metaid of objects to
find
Returns pointer to the first element found with the given 'metaid'.
"""
return _libsbml.KineticLaw_getElementByMetaId(self, metaid)
def getFormula(self):
"""
getFormula(KineticLaw self) -> string
Returns the mathematical formula for this KineticLaw object and return
it as as a text string.
This is fundamentally equivalent to getMath(). This variant is
provided principally for compatibility compatibility with SBML Level
1.
Returns a string representing the formula of this KineticLaw.
Note:
See also getMath().
"""
return _libsbml.KineticLaw_getFormula(self)
def getMath(self):
"""
getMath(KineticLaw self) -> ASTNode
Returns the mathematical formula for this KineticLaw object and return
it as as an AST.
This is fundamentally equivalent to getFormula(). The latter is
provided principally for compatibility compatibility with SBML Level
1, which represented mathematical formulas in text-string form.
Returns the ASTNode representation of the mathematical formula.
See also getFormula().
"""
return _libsbml.KineticLaw_getMath(self)
def getTimeUnits(self):
"""
getTimeUnits(KineticLaw self) -> string
(SBML Level 2 Version 1 only) Returns the value of the 'timeUnits'
attribute of this KineticLaw object.
Returns the 'timeUnits' attribute value.
Note:
The attributes 'timeUnits' and 'substanceUnits' are present only in
SBML Level 2 Version 1. In SBML Level 2 Version 2, the 'timeUnits'
and 'substanceUnits' attributes were removed. For compatibility with
new versions of SBML, users are cautioned to avoid these attributes.
"""
return _libsbml.KineticLaw_getTimeUnits(self)
def getSubstanceUnits(self):
"""
getSubstanceUnits(KineticLaw self) -> string
(SBML Level 2 Version 1 only) Returns the value of the
'substanceUnits' attribute of this KineticLaw object.
Returns the 'substanceUnits' attribute value.
Note:
The attributes 'timeUnits' and 'substanceUnits' are present only in
SBML Level 2 Version 1. In SBML Level 2 Version 2, the 'timeUnits'
and 'substanceUnits' attributes were removed. For compatibility with
new versions of SBML, users are cautioned to avoid these attributes.
"""
return _libsbml.KineticLaw_getSubstanceUnits(self)
def isSetFormula(self):
"""
isSetFormula(KineticLaw self) -> bool
Predicate returning True if this KineticLaw's 'formula' attribute is
set.
This is functionally identical to the method isSetMath(). It is
provided in order to mirror the parallel between getFormula() and
getMath().
Returns True if the formula (meaning the math subelement) of this
KineticLaw is set, False otherwise.
Note:
See also isSetMath().
"""
return _libsbml.KineticLaw_isSetFormula(self)
def isSetMath(self):
"""
isSetMath(KineticLaw self) -> bool
Predicate returning True if this Kinetic's 'math' subelement is set.
This is identical to the method isSetFormula(). It is provided in
order to mirror the parallel between getFormula() and getMath().
Returns True if the formula (meaning the math subelement) of this
KineticLaw is set, False otherwise.
See also isSetFormula().
"""
return _libsbml.KineticLaw_isSetMath(self)
def isSetTimeUnits(self):
"""
isSetTimeUnits(KineticLaw self) -> bool
(SBML Level 2 Version 1 only) Predicate returning True if this
SpeciesReference's 'timeUnits' attribute is set.
Returns True if the 'timeUnits' attribute of this KineticLaw object is
set, False otherwise.
Note:
The attributes 'timeUnits' and 'substanceUnits' are present only in
SBML Level 2 Version 1. In SBML Level 2 Version 2, the 'timeUnits'
and 'substanceUnits' attributes were removed. For compatibility with
new versions of SBML, users are cautioned to avoid these attributes.
"""
return _libsbml.KineticLaw_isSetTimeUnits(self)
def isSetSubstanceUnits(self):
"""
isSetSubstanceUnits(KineticLaw self) -> bool
(SBML Level 2 Version 1 only) Predicate returning True if this
SpeciesReference's 'substanceUnits' attribute is set.
Returns True if the 'substanceUnits' attribute of this KineticLaw
object is set, False otherwise.
Note:
The attributes 'timeUnits' and 'substanceUnits' are present only in
SBML Level 2 Version 1. In SBML Level 2 Version 2, the 'timeUnits'
and 'substanceUnits' attributes were removed. For compatibility with
new versions of SBML, users are cautioned to avoid these attributes.
"""
return _libsbml.KineticLaw_isSetSubstanceUnits(self)
def setFormula(self, formula):
"""
setFormula(KineticLaw self, string formula) -> int
Sets the mathematical expression of this KineticLaw instance to the
given 'formula'.
The given 'formula' string is copied. Internally, libSBML stores the
mathematical expression as an ASTNode.
Parameter 'formula' is the mathematical expression to use, represented
in text-string form.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_OBJECT
Note:
See also setMath().
"""
return _libsbml.KineticLaw_setFormula(self, formula)
def setMath(self, math):
"""
setMath(KineticLaw self, ASTNode math) -> int
Sets the mathematical expression of this KineticLaw instance to a copy
of the given ASTNode.
This is fundamentally identical to getFormula(). The latter is
provided principally for compatibility compatibility with SBML Level
1, which represented mathematical formulas in text-string form.
Parameter 'math' is an ASTNode representing a formula tree.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_OBJECT
See also setFormula().
"""
return _libsbml.KineticLaw_setMath(self, math)
def setTimeUnits(self, sid):
"""
setTimeUnits(KineticLaw self, string sid) -> int
(SBML Level 2 Version 1 only) Sets the 'timeUnits' attribute of this
KineticLaw object to a copy of the identifier in 'sid'.
Parameter 'sid' is the identifier of the units to use.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
* LIBSBML_UNEXPECTED_ATTRIBUTE
Note:
The attributes 'timeUnits' and 'substanceUnits' are present only in
SBML Level 2 Version 1. In SBML Level 2 Version 2, the 'timeUnits'
and 'substanceUnits' attributes were removed. For compatibility with
new versions of SBML, users are cautioned to avoid these attributes.
"""
return _libsbml.KineticLaw_setTimeUnits(self, sid)
def setSubstanceUnits(self, sid):
"""
setSubstanceUnits(KineticLaw self, string sid) -> int
(SBML Level 2 Version 1 only) Sets the 'substanceUnits' attribute of
this KineticLaw object to a copy of the identifier given in 'sid'.
Parameter 'sid' is the identifier of the units to use.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
* LIBSBML_UNEXPECTED_ATTRIBUTE
Note:
The attributes 'timeUnits' and 'substanceUnits' are present only in
SBML Level 2 Version 1. In SBML Level 2 Version 2, the 'timeUnits'
and 'substanceUnits' attributes were removed. For compatibility with
new versions of SBML, users are cautioned to avoid these attributes.
"""
return _libsbml.KineticLaw_setSubstanceUnits(self, sid)
def unsetTimeUnits(self):
"""
unsetTimeUnits(KineticLaw self) -> int
(SBML Level 2 Version 1 only) Unsets the 'timeUnits' attribugte of
this KineticLaw object.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
* LIBSBML_UNEXPECTED_ATTRIBUTE
Note:
The attributes 'timeUnits' and 'substanceUnits' are present only in
SBML Level 2 Version 1. In SBML Level 2 Version 2, the 'timeUnits'
and 'substanceUnits' attributes were removed. For compatibility with
new versions of SBML, users are cautioned to avoid these attributes.
"""
return _libsbml.KineticLaw_unsetTimeUnits(self)
def unsetSubstanceUnits(self):
"""
unsetSubstanceUnits(KineticLaw self) -> int
(SBML Level 2 Version 1 only) Unsets the 'substanceUnits' attribute of
this KineticLaw object.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
* LIBSBML_UNEXPECTED_ATTRIBUTE
Note:
The attributes 'timeUnits' and 'substanceUnits' are present only in
SBML Level 2 Version 1. In SBML Level 2 Version 2, the 'timeUnits'
and 'substanceUnits' attributes were removed. For compatibility with
new versions of SBML, users are cautioned to avoid these attributes.
"""
return _libsbml.KineticLaw_unsetSubstanceUnits(self)
def addParameter(self, p):
"""
addParameter(KineticLaw self, Parameter p) -> int
Adds a copy of the given Parameter object to the list of local
parameters in this KineticLaw.
Parameter 'p' is the Parameter to add
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_LEVEL_MISMATCH
* LIBSBML_VERSION_MISMATCH
* LIBSBML_DUPLICATE_OBJECT_ID
* LIBSBML_INVALID_OBJECT
* LIBSBML_OPERATION_FAILED
Note:
This method should be used with some caution. The fact that this
method copies the object passed to it means that the caller will be
left holding a physically different object instance than the one
contained inside this object. Changes made to the original object
instance (such as resetting attribute values) will not affect the
instance in this object. In addition, the caller should make sure to
free the original object if it is no longer being used, or else a
memory leak will result. Please see other methods on this class
(particularly a corresponding method whose name begins with the word
create) for alternatives that do not lead to these issues.
See also createParameter().
"""
return _libsbml.KineticLaw_addParameter(self, p)
def addLocalParameter(self, p):
"""
addLocalParameter(KineticLaw self, LocalParameter p) -> int
Adds a copy of the given LocalParameter object to the list of local
parameters in this KineticLaw.
Parameter 'p' is the LocalParameter to add
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_LEVEL_MISMATCH
* LIBSBML_VERSION_MISMATCH
* LIBSBML_DUPLICATE_OBJECT_ID
* LIBSBML_INVALID_OBJECT
* LIBSBML_OPERATION_FAILED
Note:
This method should be used with some caution. The fact that this
method copies the object passed to it means that the caller will be
left holding a physically different object instance than the one
contained inside this object. Changes made to the original object
instance (such as resetting attribute values) will not affect the
instance in this object. In addition, the caller should make sure to
free the original object if it is no longer being used, or else a
memory leak will result. Please see other methods on this class
(particularly a corresponding method whose name begins with the word
create) for alternatives that do not lead to these issues.
See also createLocalParameter().
"""
return _libsbml.KineticLaw_addLocalParameter(self, p)
def createParameter(self):
"""
createParameter(KineticLaw self) -> Parameter
Creates a new Parameter object, adds it to this KineticLaw's list of
local parameters, and returns the Parameter object created.
Returns a new Parameter object instance
See also addParameter().
"""
return _libsbml.KineticLaw_createParameter(self)
def createLocalParameter(self):
"""
createLocalParameter(KineticLaw self) -> LocalParameter
Creates a new LocalParameter object, adds it to this KineticLaw's list
of local parameters, and returns the LocalParameter object created.
Returns a new LocalParameter object instance
See also addLocalParameter().
"""
return _libsbml.KineticLaw_createLocalParameter(self)
def getListOfParameters(self, *args):
"""
getListOfParameters(KineticLaw self) -> ListOfParameters
getListOfParameters(KineticLaw self) -> ListOfParameters
Returns the list of local parameters in this KineticLaw object.
Returns the list of Parameters for this KineticLaw.
"""
return _libsbml.KineticLaw_getListOfParameters(self, *args)
def getListOfLocalParameters(self, *args):
"""
getListOfLocalParameters(KineticLaw self) -> ListOfLocalParameters
getListOfLocalParameters(KineticLaw self) -> ListOfLocalParameters
Returns the list of local parameters in this KineticLaw object.
Returns the list of LocalParameters for this KineticLaw.
"""
return _libsbml.KineticLaw_getListOfLocalParameters(self, *args)
def getParameter(self, *args):
"""
getParameter(KineticLaw self, unsigned int n) -> Parameter
getParameter(KineticLaw self, unsigned int n) -> Parameter
getParameter(KineticLaw self, string sid) -> Parameter
getParameter(KineticLaw self, string sid) -> Parameter
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
getParameter(string sid)
Returns a local parameter based on its identifier.
Parameter 'sid' is the identifier of the Parameter being sought.
Returns the Parameter object in this KineticLaw instace having the
given 'id', or None if no such Parameter exists.
______________________________________________________________________
Method variant with the following signature:
getParameter(long n)
Returns the nth Parameter object in the list of local parameters in
this KineticLaw instance.
Parameter 'n' is the index of the Parameter object sought
Returns the nth Parameter of this KineticLaw.
"""
return _libsbml.KineticLaw_getParameter(self, *args)
def getLocalParameter(self, *args):
"""
getLocalParameter(KineticLaw self, unsigned int n) -> LocalParameter
getLocalParameter(KineticLaw self, unsigned int n) -> LocalParameter
getLocalParameter(KineticLaw self, string sid) -> LocalParameter
getLocalParameter(KineticLaw self, string sid) -> LocalParameter
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
getLocalParameter(string sid)
Returns a local parameter based on its identifier.
Parameter 'sid' is the identifier of the LocalParameter being sought.
Returns the LocalParameter object in this KineticLaw instace having
the given 'id', or None if no such LocalParameter exists.
______________________________________________________________________
Method variant with the following signature:
getLocalParameter(long n)
Returns the nth LocalParameter object in the list of local parameters
in this KineticLaw instance.
Parameter 'n' is the index of the LocalParameter object sought
Returns the nth LocalParameter of this KineticLaw.
"""
return _libsbml.KineticLaw_getLocalParameter(self, *args)
def getNumParameters(self):
"""
getNumParameters(KineticLaw self) -> unsigned int
Returns the number of local parameters in this KineticLaw instance.
Returns the number of Parameters in this KineticLaw.
"""
return _libsbml.KineticLaw_getNumParameters(self)
def getNumLocalParameters(self):
"""
getNumLocalParameters(KineticLaw self) -> unsigned int
Returns the number of local parameters in this KineticLaw instance.
Returns the number of LocalParameters in this KineticLaw.
"""
return _libsbml.KineticLaw_getNumLocalParameters(self)
def getDerivedUnitDefinition(self, *args):
"""
getDerivedUnitDefinition(KineticLaw self) -> UnitDefinition
getDerivedUnitDefinition(KineticLaw self) -> UnitDefinition
Calculates and returns a UnitDefinition that expresses the units of
measurement assumed for the 'math' expression of this KineticLaw.
The units are calculated based on the mathematical expression in the
KineticLaw and the model quantities referenced by elements used
within that expression. The getDerivedUnitDefinition() method returns
the calculated units.
Note:
The functionality that facilitates unit analysis depends on the model
as a whole. Thus, in cases where the object has not been added to a
model or the model itself is incomplete, unit analysis is not possible
and this method will return None.
WARNING:
Note that it is possible the 'math' expression in the KineticLaw
contains pure numbers or parameters with undeclared units. In those
cases, it is not possible to calculate the units of the overall
expression without making assumptions. LibSBML does not make
assumptions about the units, and KineticLaw.getDerivedUnitDefinition()
returns the units as far as it is able to determine them. For
example, in an expression X + Y, if X has unambiguously-defined units
and Y does not, it will return the units of X. It is important that
callers also invoke the method KineticLaw.containsUndeclaredUnits()to
determine whether this situation holds. Callers may wish to take
suitable actions in those scenarios.
Returns a UnitDefinition that expresses the units of the math
expression of this KineticLaw, or None if one cannot be constructed.
See also containsUndeclaredUnits().
"""
return _libsbml.KineticLaw_getDerivedUnitDefinition(self, *args)
def containsUndeclaredUnits(self, *args):
"""
containsUndeclaredUnits(KineticLaw self) -> bool
containsUndeclaredUnits(KineticLaw self) -> bool
Predicate returning True if the math expression of this KineticLaw
contains parameters/numbers with undeclared units.
Returns True if the math expression of this KineticLaw includes
parameters/numbers with undeclared units, False otherwise.
Note:
A return value of True indicates that the UnitDefinition returned by
getDerivedUnitDefinition() may not accurately represent the units of
the expression.
See also getDerivedUnitDefinition().
"""
return _libsbml.KineticLaw_containsUndeclaredUnits(self, *args)
def removeParameter(self, *args):
"""
removeParameter(KineticLaw self, unsigned int n) -> Parameter
removeParameter(KineticLaw self, string sid) -> Parameter
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
removeParameter(string sid)
Removes a Parameter object with the given identifier in the list of
local parameters in this KineticLaw instance and returns a pointer to
it.
The caller owns the returned object and is responsible for deleting
it.
Parameter 'sid' is the identifier of the Parameter to remove
Returns the Parameter object removed. As mentioned above, the caller
owns the returned object. None is returned if no Parameter object with
the identifier exists in this KineticLaw instance.
______________________________________________________________________
Method variant with the following signature:
removeParameter(long n)
Removes the nth Parameter object in the list of local parameters in
this KineticLaw instance and returns a pointer to it.
The caller owns the returned object and is responsible for deleting
it.
Parameter 'n' is the index of the Parameter object to remove
Returns the Parameter object removed. As mentioned above, the caller
owns the returned item. None is returned if the given index is out of
range.
"""
return _libsbml.KineticLaw_removeParameter(self, *args)
def removeLocalParameter(self, *args):
"""
removeLocalParameter(KineticLaw self, unsigned int n) -> LocalParameter
removeLocalParameter(KineticLaw self, string sid) -> LocalParameter
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
removeLocalParameter(string sid)
Removes a LocalParameter object with the given identifier in the list
of local parameters in this KineticLaw instance and returns a pointer
to it.
The caller owns the returned object and is responsible for deleting
it.
Parameter 'sid' is the identifier of the LocalParameter to remove
Returns the LocalParameter object removed. As mentioned above, the
caller owns the returned object. None is returned if no LocalParameter
object with the identifier exists in this KineticLaw instance.
______________________________________________________________________
Method variant with the following signature:
removeLocalParameter(long n)
Removes the nth LocalParameter object in the list of local parameters
in this KineticLaw instance and returns a pointer to it.
The caller owns the returned object and is responsible for deleting
it.
Parameter 'n' is the index of the LocalParameter object to remove
Returns the LocalParameter object removed. As mentioned above, the
caller owns the returned item. None is returned if the given index is
out of range.
"""
return _libsbml.KineticLaw_removeLocalParameter(self, *args)
def connectToChild(self):
"""connectToChild(KineticLaw self)"""
return _libsbml.KineticLaw_connectToChild(self)
def enablePackageInternal(self, pkgURI, pkgPrefix, flag):
"""
enablePackageInternal(KineticLaw self, string pkgURI, string pkgPrefix, bool flag)
Internal implementation method.
"""
return _libsbml.KineticLaw_enablePackageInternal(self, pkgURI, pkgPrefix, flag)
def getTypeCode(self):
"""
getTypeCode(KineticLaw self) -> int
Returns the libSBML type code for this SBML object.
LibSBML attaches an identifying code to every kind of SBML object.
These are integer constants known as SBML type codes. The names of
all the codes begin with the characters SBML_. In the Python language
interface for libSBML, the type codes are defined as static integer
constants in the interface class 'libsbml'. Note that different Level
3 package plug-ins may use overlapping type codes; to identify the
package to which a given object belongs, call the getPackageName()
method on the object.
Returns the SBML type code for this object: SBML_KINETIC_LAW
(default).
WARNING:
The specific integer values of the possible type codes may be reused
by different Level 3 package plug-ins. Thus, to identifiy the correct
code, it is necessary to invoke both getTypeCode() and
getPackageName().
See also getElementName(), getPackageName().
"""
return _libsbml.KineticLaw_getTypeCode(self)
def getElementName(self):
"""
getElementName(KineticLaw self) -> string
Returns the XML element name of this object, which for Species, is
always 'kineticLaw'.
Returns the name of this element, i.e., 'kineticLaw'.
"""
return _libsbml.KineticLaw_getElementName(self)
def hasRequiredAttributes(self):
"""
hasRequiredAttributes(KineticLaw self) -> bool
Predicate returning True if all the required attributes for this
KineticLaw object have been set.
The required attributes for a KineticLaw object are:
* 'formula' (SBML Level 1 only)
Returns True if the required attributes have been set, False
otherwise.
"""
return _libsbml.KineticLaw_hasRequiredAttributes(self)
def hasRequiredElements(self):
"""
hasRequiredElements(KineticLaw self) -> bool
Predicate returning True if all the required elements for this
KineticLaw object have been set.
Note:
The required elements for a KineticLaw object are:
* 'math'
Returns a boolean value indicating whether all the required elements
for this object have been defined.
"""
return _libsbml.KineticLaw_hasRequiredElements(self)
def removeFromParentAndDelete(self):
"""
removeFromParentAndDelete(KineticLaw self) -> int
Finds this KineticLaw's Reaction parent and calls unsetKineticLaw() on
it, indirectly deleting itself.
Overridden from the SBase function since the parent is not a ListOf.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
"""
return _libsbml.KineticLaw_removeFromParentAndDelete(self)
def renameSIdRefs(self, oldid, newid):
"""
renameSIdRefs(KineticLaw self, string oldid, string newid)
Replaces all uses of a given SIdRef type attribute value with another
value.
In SBML, object identifiers are of a data type called SId. In SBML
Level 3, an explicit data type called SIdRef was introduced for
attribute values that refer to SId values; in previous Levels of SBML,
this data type did not exist and attributes were simply described to
as 'referring to an identifier', but the effective data type was the
same as SIdRefin Level 3. These and other methods of libSBML refer to
the type SIdRef for all Levels of SBML, even if the corresponding SBML
specification did not explicitly name the data type.
This method works by looking at all attributes and (if appropriate)
mathematical formulas in MathML content, comparing the referenced
identifiers to the value of 'oldid'. If any matches are found, the
matching values are replaced with 'newid'. The method does not
descend into child elements.
Parameter 'oldid' is the old identifier Parameter 'newid' is the new
identifier
"""
return _libsbml.KineticLaw_renameSIdRefs(self, oldid, newid)
def renameUnitSIdRefs(self, oldid, newid):
"""
renameUnitSIdRefs(KineticLaw self, string oldid, string newid)
Replaces all uses of a given UnitSIdRef type attribute value with
another value.
In SBML, unit definitions have identifiers of type UnitSId. In SBML
Level 3, an explicit data type called UnitSIdRef was introduced for
attribute values that refer to UnitSId values; in previous Levels of
SBML, this data type did not exist and attributes were simply
described to as 'referring to a unit identifier', but the effective
data type was the same as UnitSIdRef in Level 3. These and other
methods of libSBML refer to the type UnitSIdRef for all Levels of
SBML, even if the corresponding SBML specification did not explicitly
name the data type.
This method works by looking at all unit identifier attribute values
(including, if appropriate, inside mathematical formulas), comparing
the referenced unit identifiers to the value of 'oldid'. If any
matches are found, the matching values are replaced with 'newid'. The
method does not descend into child elements.
Parameter 'oldid' is the old identifier Parameter 'newid' is the new
identifier
"""
return _libsbml.KineticLaw_renameUnitSIdRefs(self, oldid, newid)
def replaceSIDWithFunction(self, id, function):
"""
replaceSIDWithFunction(KineticLaw self, string id, ASTNode function)
Internal implementation method.
"""
return _libsbml.KineticLaw_replaceSIDWithFunction(self, id, function)
def divideAssignmentsToSIdByFunction(self, id, function):
"""
divideAssignmentsToSIdByFunction(KineticLaw self, string id, ASTNode function)
Internal implementation method.
"""
return _libsbml.KineticLaw_divideAssignmentsToSIdByFunction(self, id, function)
def multiplyAssignmentsToSIdByFunction(self, id, function):
"""
multiplyAssignmentsToSIdByFunction(KineticLaw self, string id, ASTNode function)
Internal implementation method.
"""
return _libsbml.KineticLaw_multiplyAssignmentsToSIdByFunction(self, id, function)
KineticLaw_swigregister = _libsbml.KineticLaw_swigregister
KineticLaw_swigregister(KineticLaw)
class SimpleSpeciesReference(SBase):
"""
Abstract class for references to species in reactions.
As mentioned in the description of Reaction, every species that enters
into a given reaction must appear in that reaction's lists of
reactants, products and/or modifiers. In an SBML model, all species
that may participate in any reaction are listed in the 'listOfSpecies'
element of the top-level Model object. Lists of products, reactants
and modifiers in Reaction objects do not introduce new species, but
rather, they refer back to those listed in the model's top-level
'listOfSpecies'. For reactants and products, the connection is made
using SpeciesReference objects; for modifiers, it is made using
ModifierSpeciesReference objects. SimpleSpeciesReference is an
abstract type that serves as the parent class of both SpeciesReference
and ModifierSpeciesReference. It is used simply to hold the
attributes and elements that are common to the latter two structures.
The SimpleSpeciesReference structure has a mandatory attribute,
'species', which must be a text string conforming to the identifer
syntax permitted in SBML. This attribute is inherited by the
SpeciesReference and ModifierSpeciesReference subclasses derived from
SimpleSpeciesReference. The value of the 'species' attribute must be
the identifier of a species defined in the enclosing Model. The
species is thereby declared as participating in the reaction being
defined. The precise role of that species as a reactant, product, or
modifier in the reaction is determined by the subclass of
SimpleSpeciesReference (i.e., either SpeciesReference or
ModifierSpeciesReference) in which the identifier appears.
SimpleSpeciesReference also contains an optional attribute, 'id',
allowing instances to be referenced from other structures. No SBML
structures currently do this; however, such structures are anticipated
in future SBML Levels.
"""
__swig_setmethods__ = {}
for _s in [SBase]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, SimpleSpeciesReference, name, value)
__swig_getmethods__ = {}
for _s in [SBase]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, SimpleSpeciesReference, name)
def __init__(self, *args, **kwargs):
raise AttributeError("No constructor defined - class is abstract")
__repr__ = _swig_repr
__swig_destroy__ = _libsbml.delete_SimpleSpeciesReference
__del__ = lambda self: None
def getId(self):
"""
getId(SimpleSpeciesReference self) -> string
Returns the value of the 'id' attribute of this
SimpleSpeciesReference.
Returns the id of this SimpleSpeciesReference.
"""
return _libsbml.SimpleSpeciesReference_getId(self)
def getName(self):
"""
getName(SimpleSpeciesReference self) -> string
Returns the value of the 'name' attribute of this
SimpleSpeciesReference.
Returns the name of this SimpleSpeciesReference.
"""
return _libsbml.SimpleSpeciesReference_getName(self)
def getSpecies(self):
"""
getSpecies(SimpleSpeciesReference self) -> string
Get the value of the 'species' attribute.
Returns the value of the attribute 'species' for this
SimpleSpeciesReference.
"""
return _libsbml.SimpleSpeciesReference_getSpecies(self)
def isSetId(self):
"""
isSetId(SimpleSpeciesReference self) -> bool
Predicate returning True if this SimpleSpeciesReference's 'id'
attribute is set.
Returns True if the 'id' attribute of this SimpleSpeciesReference is
set, False otherwise.
"""
return _libsbml.SimpleSpeciesReference_isSetId(self)
def isSetName(self):
"""
isSetName(SimpleSpeciesReference self) -> bool
Predicate returning True if this SimpleSpeciesReference's 'name'
attribute is set.
Returns True if the 'name' attribute of this SimpleSpeciesReference is
set, False otherwise.
"""
return _libsbml.SimpleSpeciesReference_isSetName(self)
def isSetSpecies(self):
"""
isSetSpecies(SimpleSpeciesReference self) -> bool
Predicate returning True if this SimpleSpeciesReference's 'species'
attribute is set.
Returns True if the 'species' attribute of this SimpleSpeciesReference
is set, False otherwise.
"""
return _libsbml.SimpleSpeciesReference_isSetSpecies(self)
def setSpecies(self, sid):
"""
setSpecies(SimpleSpeciesReference self, string sid) -> int
Sets the 'species' attribute of this SimpleSpeciesReference.
The identifier string passed in 'sid' is copied.
Parameter 'sid' is the identifier of a species defined in the
enclosing Model's ListOfSpecies.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
"""
return _libsbml.SimpleSpeciesReference_setSpecies(self, sid)
def setId(self, sid):
"""
setId(SimpleSpeciesReference self, string sid) -> int
Sets the value of the 'id' attribute of this SimpleSpeciesReference.
The string 'sid' is copied.
SBML has strict requirements for the syntax of identifiers, that is,
the values of the 'id' attribute present on most types of SBML
objects. The following is a summary of the definition of the SBML
identifier type SId, which defines the permitted syntax of
identifiers. We express the syntax using an extended form of BNF
notation:
letter ::= 'a'..'z','A'..'Z'
digit ::= '0'..'9'
idChar ::= letter | digit | '_'
SId ::= ( letter | '_' ) idChar*
The characters ( and ) are used for grouping, the character * 'zero or
more times', and the character | indicates logical 'or'. The equality
of SBML identifiers is determined by an exact character sequence
match; i.e., comparisons must be performed in a case-sensitive manner.
In addition, there are a few conditions for the uniqueness of
identifiers in an SBML model. Please consult the SBML specifications
for the exact details of the uniqueness requirements.
Parameter 'sid' is the string to use as the identifier of this
SimpleSpeciesReference
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
* LIBSBML_UNEXPECTED_ATTRIBUTE
"""
return _libsbml.SimpleSpeciesReference_setId(self, sid)
def setName(self, name):
"""
setName(SimpleSpeciesReference self, string name) -> int
Sets the value of the 'name' attribute of this SimpleSpeciesReference.
The string in 'name' is copied.
Parameter 'name' is the new name for the SimpleSpeciesReference
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
* LIBSBML_UNEXPECTED_ATTRIBUTE
"""
return _libsbml.SimpleSpeciesReference_setName(self, name)
def unsetId(self):
"""
unsetId(SimpleSpeciesReference self) -> int
Unsets the value of the 'id' attribute of this SimpleSpeciesReference.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
"""
return _libsbml.SimpleSpeciesReference_unsetId(self)
def unsetName(self):
"""
unsetName(SimpleSpeciesReference self) -> int
Unsets the value of the 'name' attribute of this
SimpleSpeciesReference.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
"""
return _libsbml.SimpleSpeciesReference_unsetName(self)
def isModifier(self):
"""
isModifier(SimpleSpeciesReference self) -> bool
Predicate returning True if this is a ModifierSpeciesReference.
Returns True if this SimpleSpeciesReference's subclass is
ModiferSpeciesReference, False if it is a plain SpeciesReference.
"""
return _libsbml.SimpleSpeciesReference_isModifier(self)
def renameSIdRefs(self, oldid, newid):
"""
renameSIdRefs(SimpleSpeciesReference self, string oldid, string newid)
Replaces all uses of a given SIdRef type attribute value with another
value.
In SBML, object identifiers are of a data type called SId. In SBML
Level 3, an explicit data type called SIdRef was introduced for
attribute values that refer to SId values; in previous Levels of SBML,
this data type did not exist and attributes were simply described to
as 'referring to an identifier', but the effective data type was the
same as SIdRefin Level 3. These and other methods of libSBML refer to
the type SIdRef for all Levels of SBML, even if the corresponding SBML
specification did not explicitly name the data type.
This method works by looking at all attributes and (if appropriate)
mathematical formulas in MathML content, comparing the referenced
identifiers to the value of 'oldid'. If any matches are found, the
matching values are replaced with 'newid'. The method does not
descend into child elements.
Parameter 'oldid' is the old identifier Parameter 'newid' is the new
identifier
"""
return _libsbml.SimpleSpeciesReference_renameSIdRefs(self, oldid, newid)
SimpleSpeciesReference_swigregister = _libsbml.SimpleSpeciesReference_swigregister
SimpleSpeciesReference_swigregister(SimpleSpeciesReference)
class SpeciesReference(SimpleSpeciesReference):
"""
A reference to an SBML species in a reaction.
The Reaction structure provides a way to express which species act as
reactants and which species act as products in a reaction. In a given
reaction, references to those species acting as reactants and/or
products are made using instances of SpeciesReference structures in a
Reaction object's lists of reactants and products.
A species can occur more than once in the lists of reactants and
products of a given Reaction instance. The effective stoichiometry
for a species in a reaction is the sum of the stoichiometry values
given on the SpeciesReference object in the list of products minus the
sum of stoichiometry values given on the SpeciesReference objects in
the list of reactants. A positive value indicates the species is
effectively a product and a negative value indicates the species is
effectively a reactant. SBML places no restrictions on the effective
stoichiometry of a species in a reaction; for example, it can be zero.
In the following SBML fragment, the two reactions have the same
effective stoichiometry for all their species:
The precise structure of SpeciesReference differs between SBML Level 2
and Level 3. We discuss the two variants in separate sections below.
SpeciesReference in SBML Level 2
======================================================================
The mandatory 'species' attribute of SpeciesReference must have as its
value the identifier of an existing species defined in the enclosing
Model. The species is thereby designated as a reactant or product in
the reaction. Which one it is (i.e., reactant or product) is
indicated by whether the SpeciesReference appears in the Reaction's
'reactant' or 'product' lists.
Product and reactant stoichiometries can be specified using either
'stoichiometry' or 'stoichiometryMath' in a SpeciesReference object.
The 'stoichiometry' attribute is of type double and should contain
values greater than zero (0). The 'stoichiometryMath' element is
implemented as an element containing a MathML expression. These two
are mutually exclusive; only one of 'stoichiometry' or
'stoichiometryMath' should be defined in a given SpeciesReference
instance. When neither the attribute nor the element is present, the
value of 'stoichiometry' in the SpeciesReference instance defaults to
1.
For maximum interoperability, the 'stoichiometry' attribute should be
used in preference to 'stoichiometryMath' when a species'
stoichiometry is a simple scalar number (integer or decimal). When
the stoichiometry is a rational number, or when it is a more
complicated formula, 'stoichiometryMath' must be used. The MathML
expression in 'stoichiometryMath' may also refer to identifiers of
entities in a model (except reaction identifiers). However, the only
species identifiers that can be used in 'stoichiometryMath' are those
referenced in the Reaction list of reactants, products and modifiers.
The following is a simple example of a species reference for species
X0, with stoichiometry 2, in a list of reactants within a reaction
having the identifier J1:
...
...
...
...
The following is a more complex example of a species reference for
species X0, with a stoichiometry formula consisting of the parameter
x:
...
x
...
...
...
SpeciesReference in SBML Level 3
======================================================================
In Level 2's definition of a reaction, the stoichiometry attribute of
a SpeciesReference is actually a combination of two factors, the
standard biochemical stoichiometry and a conversion factor that may be
needed to translate the units of the species quantity to the units of
the reaction rate. Unfortunately, Level 2 offers no direct way of
decoupling these two factors, or for explicitly indicating the units.
The only way to do it in Level 2 is to use the StoichiometryMath
object associated with SpeciesReferences, and to reference SBML
Parameter objects from within the StoichiometryMath formula. This
works because Parameter offers a way to attach units to a numerical
value, but the solution is indirect and awkward for something that
should be a simple matter. Moreover, the question of how to properly
encode stoichiometries in SBML reactions has caused much confusion
among implementors of SBML software.
SBML Level 3 approaches this problem differently. It (1) extends the
the use of the SpeciesReference identifier to represent the value of
the 'stoichiometry' attribute, (2) makes the 'stoichiometry' attribute
optional, (3) removes StoichiometryMath, and (4) adds a new 'constant'
boolean attribute on SpeciesReference.
As in Level 2, the 'stoichiometry' attribute is of type float and
should contain values greater than zero (0). A missing
'stoichiometry' implies that the stoichiometry is either unknown, or
to be obtained from an external source, or determined by an
InitialAssignment object or other SBML construct elsewhere in the
model.
A species reference's stoichiometry is set by its 'stoichiometry'
attribute exactly once. If the SpeciesReference object's 'constant'
attribute has the value True, then the stoichiometry is fixed and
cannot be changed except by an InitialAssignment object. These two
methods of setting the stoichiometry (i.e., using 'stoichiometry'
directly, or using InitialAssignment) differ in that the
'stoichiometry' attribute can only be set to a literal floating-point
number, whereas InitialAssignment allows the value to be set using an
arbitrary mathematical expression. (As an example, the approach could
be used to set the stoichiometry to a rational number of the form p/q,
where p and q are integers, something that is occasionally useful in
the context of biochemical reaction networks.) If the species
reference's 'constant' attribute has the value False, the species
reference's value may be overridden by an InitialAssignment or changed
by AssignmentRule or AlgebraicRule, and in addition, for simulation
time t > 0, it may also be changed by a RateRule or Event objects.
(However, some of these constructs are mutually exclusive; see the
SBML Level 3 Version 1 Core specifiation for more details.) It is not
an error to define 'stoichiometry' on a species reference and also
redefine the stoichiometry using an InitialAssignment, but the
'stoichiometry' attribute in that case is ignored.
The value of the 'id' attribute of a SpeciesReference can be used as
the content of a element in MathML formulas elsewhere in the
model. When the identifier appears in a MathML element, it
represents the stoichiometry of the corresponding species in the
reaction where the SpeciesReference object instance appears. More
specifically, it represents the value of the 'stoichiometry' attribute
on the SpeciesReference object.
In SBML Level 3, the unit of measurement associated with the value of
a species' stoichiometry is always considered to be dimensionless.
This has the following implications:
* When a species reference's identifier appears in mathematical
formulas elsewhere in the model, the unit associated with that value
is dimensionless.
* The units of the 'math' elements of AssignmentRule,
InitialAssignment and EventAssignment objects setting the
stoichiometry of the species reference should be dimensionless.
* If a species reference's identifier is the subject of a RateRule,
the unit associated with the RateRule object's value should be
dimensionless/time, where time is the model-wide unit of time set on
the Model object.
"""
__swig_setmethods__ = {}
for _s in [SimpleSpeciesReference]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, SpeciesReference, name, value)
__swig_getmethods__ = {}
for _s in [SimpleSpeciesReference]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, SpeciesReference, name)
__repr__ = _swig_repr
__swig_destroy__ = _libsbml.delete_SpeciesReference
__del__ = lambda self: None
def __init__(self, *args):
"""
__init__(SpeciesReference self, unsigned int level, unsigned int version) -> SpeciesReference
__init__(SpeciesReference self, SBMLNamespaces sbmlns) -> SpeciesReference
__init__(SpeciesReference self, SpeciesReference orig) -> SpeciesReference
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
SpeciesReference(SBMLNamespaces sbmlns)
Creates a new SpeciesReference using the given SBMLNamespaces object
'sbmlns'.
Parameter 'sbmlns' is an SBMLNamespaces object.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
______________________________________________________________________
Method variant with the following signature:
SpeciesReference(long level, long version)
Creates a new SpeciesReference using the given SBML 'level' and
'version' values.
Parameter 'level' is a long integer, the SBML Level to assign to this
SpeciesReference
Parameter 'version' is a long integer, the SBML Version to assign to
this SpeciesReference
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
______________________________________________________________________
Method variant with the following signature:
SpeciesReference(SpeciesReference orig)
Copy constructor; creates a copy of this SpeciesReference.
Parameter 'orig' is the SpeciesReference instance to copy.
Throws SBMLConstructorException: Thrown if the argument 'orig' is
None.
"""
this = _libsbml.new_SpeciesReference(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(SpeciesReference self) -> SpeciesReference
Creates and returns a deep copy of this SpeciesReference object.
Returns the (deep) copy of this SpeciesReference object.
"""
return _libsbml.SpeciesReference_clone(self)
def initDefaults(self):
"""
initDefaults(SpeciesReference self)
Initializes the fields of this SpeciesReference object to 'typical'
default values.
The SBML SpeciesReference component has slightly different aspects and
default attribute values in different SBML Levels and Versions. This
method sets the values to certain common defaults, based mostly on
what they are in SBML Level 2. Specifically:
* Sets attribute 'stoichiometry' to 1.0
* (Applies to Level 1 models only) Sets attribute 'denominator' to
1 See also getDenominator(), setDenominator(), getStoichiometry(),
setStoichiometry(), getStoichiometryMath(), setStoichiometryMath().
"""
return _libsbml.SpeciesReference_initDefaults(self)
def getStoichiometry(self):
"""
getStoichiometry(SpeciesReference self) -> double
Get the value of the 'stoichiometry' attribute.
In SBML Level 2, product and reactant stoichiometries can be specified
using either 'stoichiometry' or 'stoichiometryMath' in a
SpeciesReference object. The former is to be used when a
stoichiometry is simply a scalar number, while the latter is for
occasions when it needs to be a rational number or it needs to
reference other mathematical expressions. The 'stoichiometry'
attribute is of type float and should contain values greater than zero
(0). The 'stoichiometryMath' element is implemented as an element
containing a MathML expression. These two are mutually exclusive;
only one of 'stoichiometry' or 'stoichiometryMath' should be defined
in a given SpeciesReference instance. When neither the attribute nor
the element is present, the value of 'stoichiometry' in the
SpeciesReference instance defaults to 1. For maximum interoperability
between different software tools, the 'stoichiometry' attribute should
be used in preference to 'stoichiometryMath' when a species'
stoichiometry is a simple scalar number (integer or decimal).
In SBML Level 3, there is no StoichiometryMath, and SpeciesReference
objects have only the 'stoichiometry' attribute.
Returns the value of the (scalar) 'stoichiometry' attribute of this
SpeciesReference.
See also getStoichiometryMath().
"""
return _libsbml.SpeciesReference_getStoichiometry(self)
def getStoichiometryMath(self, *args):
"""
getStoichiometryMath(SpeciesReference self) -> StoichiometryMath
getStoichiometryMath(SpeciesReference self) -> StoichiometryMath
Get the content of the 'stoichiometryMath' subelement as an ASTNode
tree.
The 'stoichiometryMath' element exists only in SBML Level 2. There,
product and reactant stoichiometries can be specified using either
'stoichiometry' or 'stoichiometryMath' in a SpeciesReference object.
The former is to be used when a stoichiometry is simply a scalar
number, while the latter is for occasions when it needs to be a
rational number or it needs to reference other mathematical
expressions. The 'stoichiometry' attribute is of type float and
should contain values greater than zero (0). The 'stoichiometryMath'
element is implemented as an element containing a MathML expression.
These two are mutually exclusive; only one of 'stoichiometry' or
'stoichiometryMath' should be defined in a given SpeciesReference
instance. When neither the attribute nor the element is present, the
value of 'stoichiometry' in the SpeciesReference instance defaults to
1. For maximum interoperability between different software tools, the
'stoichiometry' attribute should be used in preference to
'stoichiometryMath' when a species' stoichiometry is a simple scalar
number (integer or decimal).
Returns the content of the 'stoichiometryMath' subelement of this
SpeciesReference.
"""
return _libsbml.SpeciesReference_getStoichiometryMath(self, *args)
def getDenominator(self):
"""
getDenominator(SpeciesReference self) -> int
Get the value of the 'denominator' attribute, for the case of a
rational-numbered stoichiometry or a model in SBML Level 1.
The 'denominator' attribute is only actually written out in the case
of an SBML Level 1 model. In SBML Level 2, rational-number
stoichiometries are written as MathML elements in the
'stoichiometryMath' subelement. However, as a convenience to users,
libSBML allows the creation and manipulation of rational-number
stoichiometries by supplying the numerator and denominator directly
rather than having to manually create an ASTNode object. LibSBML will
write out the appropriate constructs (either a combination of
'stoichiometry' and 'denominator' in the case of SBML Level 1, or a
'stoichiometryMath' subelement in the case of SBML Level 2).
Returns the value of the 'denominator' attribute of this
SpeciesReference.
"""
return _libsbml.SpeciesReference_getDenominator(self)
def getConstant(self):
"""
getConstant(SpeciesReference self) -> bool
Get the value of the 'constant' attribute.
Returns the value of the 'constant' attribute of this
SpeciesReference.
"""
return _libsbml.SpeciesReference_getConstant(self)
def isSetStoichiometryMath(self):
"""
isSetStoichiometryMath(SpeciesReference self) -> bool
Predicate returning True if this SpeciesReference's
'stoichiometryMath' subelement is set
Returns True if the 'stoichiometryMath' subelement of this
SpeciesReference is set, False otherwise.
"""
return _libsbml.SpeciesReference_isSetStoichiometryMath(self)
def isSetConstant(self):
"""
isSetConstant(SpeciesReference self) -> bool
Predicate returning True if this SpeciesReference's 'constant'
attribute is set
Returns True if the 'constant' attribute of this SpeciesReference is
set, False otherwise.
"""
return _libsbml.SpeciesReference_isSetConstant(self)
def isSetStoichiometry(self):
"""
isSetStoichiometry(SpeciesReference self) -> bool
Predicate returning True if this SpeciesReference's 'stoichiometry'
attribute is set.
Returns True if the 'stoichiometry' attribute of this SpeciesReference
is set, False otherwise.
"""
return _libsbml.SpeciesReference_isSetStoichiometry(self)
def setStoichiometry(self, value):
"""
setStoichiometry(SpeciesReference self, double value) -> int
Sets the value of the 'stoichiometry' attribute of this
SpeciesReference.
In SBML Level 2, product and reactant stoichiometries can be specified
using either 'stoichiometry' or 'stoichiometryMath' in a
SpeciesReference object. The former is to be used when a
stoichiometry is simply a scalar number, while the latter is for
occasions when it needs to be a rational number or it needs to
reference other mathematical expressions. The 'stoichiometry'
attribute is of type float and should contain values greater than zero
(0). The 'stoichiometryMath' element is implemented as an element
containing a MathML expression. These two are mutually exclusive;
only one of 'stoichiometry' or 'stoichiometryMath' should be defined
in a given SpeciesReference instance. When neither the attribute nor
the element is present, the value of 'stoichiometry' in the
SpeciesReference instance defaults to 1. For maximum interoperability
between different software tools, the 'stoichiometry' attribute should
be used in preference to 'stoichiometryMath' when a species'
stoichiometry is a simple scalar number (integer or decimal).
In SBML Level 3, there is no StoichiometryMath, and SpeciesReference
objects have only the 'stoichiometry' attribute.
Parameter 'value' is the new value of the 'stoichiometry' attribute
Note:
In SBML Level 2, the 'stoichiometryMath' subelement of this
SpeciesReference object will be unset because the 'stoichiometry'
attribute and the stoichiometryMath' subelement are mutually
exclusive.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
"""
return _libsbml.SpeciesReference_setStoichiometry(self, value)
def setStoichiometryMath(self, math):
"""
setStoichiometryMath(SpeciesReference self, StoichiometryMath math) -> int
Sets the 'stoichiometryMath' subelement of this SpeciesReference.
The Abstract Syntax Tree in 'math' is copied.
In SBML Level 2, product and reactant stoichiometries can be specified
using either 'stoichiometry' or 'stoichiometryMath' in a
SpeciesReference object. The former is to be used when a
stoichiometry is simply a scalar number, while the latter is for
occasions when it needs to be a rational number or it needs to
reference other mathematical expressions. The 'stoichiometry'
attribute is of type float and should contain values greater than zero
(0). The 'stoichiometryMath' element is implemented as an element
containing a MathML expression. These two are mutually exclusive;
only one of 'stoichiometry' or 'stoichiometryMath' should be defined
in a given SpeciesReference instance. When neither the attribute nor
the element is present, the value of 'stoichiometry' in the
SpeciesReference instance defaults to 1. For maximum interoperability
between different software tools, the 'stoichiometry' attribute should
be used in preference to 'stoichiometryMath' when a species'
stoichiometry is a simple scalar number (integer or decimal).
In SBML Level 3, there is no StoichiometryMath, and SpeciesReference
objects have only the 'stoichiometry' attribute.
Parameter 'math' is the StoichiometryMath expression that is to be
copied as the content of the 'stoichiometryMath' subelement.
Note:
In SBML Level 2, the 'stoichiometry' attribute of this
SpeciesReference object will be unset (isSetStoichiometry() will
return False although getStoichiometry() will return 1.0) if the given
math is not null because the 'stoichiometry' attribute and the
stoichiometryMath' subelement are mutually exclusive.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_UNEXPECTED_ATTRIBUTE
* LIBSBML_LEVEL_MISMATCH
* LIBSBML_VERSION_MISMATCH
"""
return _libsbml.SpeciesReference_setStoichiometryMath(self, math)
def setDenominator(self, value):
"""
setDenominator(SpeciesReference self, int value) -> int
Set the value of the 'denominator' attribute, for the case of a
rational-numbered stoichiometry or a model in SBML Level 1.
The 'denominator' attribute is only actually written out in the case
of an SBML Level 1 model. In SBML Level 2, rational-number
stoichiometries are written as MathML elements in the
'stoichiometryMath' subelement. However, as a convenience to users,
libSBML allows the creation and manipulation of rational-number
stoichiometries by supplying the numerator and denominator directly
rather than having to manually create an ASTNode object. LibSBML will
write out the appropriate constructs (either a combination of
'stoichiometry' and 'denominator' in the case of SBML Level 1, or a
'stoichiometryMath' subelement in the case of SBML Level 2).
Parameter 'value' is the scalar value
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
"""
return _libsbml.SpeciesReference_setDenominator(self, value)
def setConstant(self, flag):
"""
setConstant(SpeciesReference self, bool flag) -> int
Sets the 'constant' attribute of this SpeciesReference to the given
boolean 'flag'.
Parameter 'flag' is a boolean, the value for the 'constant' attribute
of this SpeciesReference instance
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_UNEXPECTED_ATTRIBUTE
"""
return _libsbml.SpeciesReference_setConstant(self, flag)
def unsetStoichiometryMath(self):
"""
unsetStoichiometryMath(SpeciesReference self) -> int
Unsets the 'stoichiometryMath' subelement of this SpeciesReference.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_UNEXPECTED_ATTRIBUTE
* LIBSBML_OPERATION_FAILED
In SBML Level 2, product and reactant stoichiometries can be specified
using either 'stoichiometry' or 'stoichiometryMath' in a
SpeciesReference object. The former is to be used when a
stoichiometry is simply a scalar number, while the latter is for
occasions when it needs to be a rational number or it needs to
reference other mathematical expressions. The 'stoichiometry'
attribute is of type float and should contain values greater than zero
(0). The 'stoichiometryMath' element is implemented as an element
containing a MathML expression. These two are mutually exclusive;
only one of 'stoichiometry' or 'stoichiometryMath' should be defined
in a given SpeciesReference instance. When neither the attribute nor
the element is present, the value of 'stoichiometry' in the
SpeciesReference instance defaults to 1. For maximum interoperability
between different software tools, the 'stoichiometry' attribute should
be used in preference to 'stoichiometryMath' when a species'
stoichiometry is a simple scalar number (integer or decimal).
In SBML Level 3, there is no StoichiometryMath, and SpeciesReference
objects have only the 'stoichiometry' attribute.
Note:
In SBML Level 2, the 'stoichiometry' attribute of this
SpeciesReference object will be reset to a default value (1.0) if the
'stoichiometry' attribute has not been set.
"""
return _libsbml.SpeciesReference_unsetStoichiometryMath(self)
def unsetStoichiometry(self):
"""
unsetStoichiometry(SpeciesReference self) -> int
Unsets the 'stoichiometry' attribute of this SpeciesReference.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
Note:
In SBML Level 1, the 'stoichiometry' attribute of this
SpeciesReference object will be just reset to a default value (1.0)
and isSetStoichiometry() will still return True. In SBML Level 2, the
'stoichiometry' attribute of this object will be unset (which will
result in isSetStoichiometry() returning False, although
getStoichiometry() will return 1.0) if the 'stoichiometryMath'
subelement is set, otherwise the attribute will be just reset to the
default value (1.0) (and isSetStoichiometry() will still return True).
In SBML Level 3, the 'stoichiometry' attribute of this object will be
set to NaN and isSetStoichiometry() will return False.
"""
return _libsbml.SpeciesReference_unsetStoichiometry(self)
def createStoichiometryMath(self):
"""
createStoichiometryMath(SpeciesReference self) -> StoichiometryMath
Creates a new, empty StoichiometryMath object, adds it to this
SpeciesReference, and returns it.
Returns the newly created StoichiometryMath object instance
See also Reaction.addReactant(), Reaction.addProduct().
"""
return _libsbml.SpeciesReference_createStoichiometryMath(self)
def setAnnotation(self, *args):
"""
setAnnotation(SpeciesReference self, XMLNode annotation) -> int
setAnnotation(SpeciesReference self, string annotation) -> int
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
setAnnotation(XMLNode annotation)
Sets the value of the 'annotation' subelement of this SBML object to a
copy of 'annotation'.
Any existing content of the 'annotation' subelement is discarded.
Unless you have taken steps to first copy and reconstitute any
existing annotations into the 'annotation' that is about to be
assigned, it is likely that performing such wholesale replacement is
unfriendly towards other software applications whose annotations are
discarded. An alternative may be to use appendAnnotation().
Parameter 'annotation' is an XML structure that is to be used as the
content of the 'annotation' subelement of this object
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
See also appendAnnotation(), appendAnnotation(), appendAnnotation(),
appendAnnotation().
"""
return _libsbml.SpeciesReference_setAnnotation(self, *args)
def appendAnnotation(self, *args):
"""
appendAnnotation(SpeciesReference self, XMLNode annotation) -> int
appendAnnotation(SpeciesReference self, string annotation) -> int
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
appendAnnotation(XMLNode annotation)
Appends annotation content to any existing content in the 'annotation'
subelement of this object.
The content in 'annotation' is copied. Unlike
SpeciesReference.setAnnotation(), this method allows other annotations
to be preserved when an application adds its own data.
Parameter 'annotation' is an XML structure that is to be copied and
appended to the content of the 'annotation' subelement of this object
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
See also setAnnotation(), setAnnotation(), setAnnotation(),
setAnnotation().
"""
return _libsbml.SpeciesReference_appendAnnotation(self, *args)
def getTypeCode(self):
"""
getTypeCode(SpeciesReference self) -> int
Returns the libSBML type code for this SBML object.
LibSBML attaches an identifying code to every kind of SBML object.
These are integer constants known as SBML type codes. The names of
all the codes begin with the characters SBML_. In the Python language
interface for libSBML, the type codes are defined as static integer
constants in the interface class 'libsbml'. Note that different Level
3 package plug-ins may use overlapping type codes; to identify the
package to which a given object belongs, call the getPackageName()
method on the object.
Returns the SBML type code for this object: SBML_SPECIES_REFERENCE
(default).
See also getElementName(), getPackageName().
"""
return _libsbml.SpeciesReference_getTypeCode(self)
def getElementName(self):
"""
getElementName(SpeciesReference self) -> string
Returns the XML element name of this object, which for
SpeciesReference, is always 'speciesReference'.
Returns the name of this element, i.e., 'speciesReference'.
"""
return _libsbml.SpeciesReference_getElementName(self)
def hasRequiredAttributes(self):
"""
hasRequiredAttributes(SpeciesReference self) -> bool
Predicate returning True if all the required attributes for this
SpeciesReference object have been set.
The required attributes for a SpeciesReference object are:
* 'species'
* 'constant' (only available SBML Level 3)
Returns True if the required attributes have been set, False
otherwise.
"""
return _libsbml.SpeciesReference_hasRequiredAttributes(self)
SpeciesReference_swigregister = _libsbml.SpeciesReference_swigregister
SpeciesReference_swigregister(SpeciesReference)
class ListOfSpeciesReferences(ListOf):
"""
A list of SpeciesReference objects.
The various ListOf___ classes in SBML are merely containers used for
organizing the main components of an SBML model. In libSBML's
implementation, ListOf___ classes are derived from the intermediate
utility class ListOf, which is not defined by the SBML specifications
but serves as a useful programmatic construct. ListOf is itself is in
turn derived from SBase, which provides all of the various ListOf___
classes with common features defined by the SBML specification, such
as 'metaid' attributes and annotations.
The relationship between the lists and the rest of an SBML model is
illustrated by the following (for SBML Level 2 Version 4):
...
...
...
...
...
...
... elements of subclasses of Rule ...
...
...
...
Readers may wonder about the motivations for using the ListOf___
containers in SBML. A simpler approach in XML might be to place the
components all directly at the top level of the model definition. The
choice made in SBML is to group them within XML elements named after
ListOfClassname, in part because it helps organize the components.
More importantly, the fact that the container classes are derived from
SBase means that software tools can add information about the lists
themselves into each list container's 'annotation'.
See also ListOfFunctionDefinitions, ListOfUnitDefinitions,
ListOfCompartmentTypes, ListOfSpeciesTypes, ListOfCompartments,
ListOfSpecies, ListOfParameters, ListOfInitialAssignments,
ListOfRules, ListOfConstraints, ListOfReactions, ListOfEvents.
"""
__swig_setmethods__ = {}
for _s in [ListOf]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, ListOfSpeciesReferences, name, value)
__swig_getmethods__ = {}
for _s in [ListOf]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, ListOfSpeciesReferences, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(ListOfSpeciesReferences self, unsigned int level, unsigned int version) -> ListOfSpeciesReferences
__init__(ListOfSpeciesReferences self, SBMLNamespaces sbmlns) -> ListOfSpeciesReferences
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
ListOfSpeciesReferences(SBMLNamespaces sbmlns)
Creates a new ListOfSpeciesReferences object.
The object is constructed such that it is valid for the SBML Level and
Version combination determined by the SBMLNamespaces object in
'sbmlns'.
Parameter 'sbmlns' is an SBMLNamespaces object that is used to
determine the characteristics of the ListOfSpeciesReferences object to
be created.
______________________________________________________________________
Method variant with the following signature:
ListOfSpeciesReferences(long level, long version)
Creates a new, empty ListOfSpeciesReferences object.
The object is constructed such that it is valid for the given SBML
Level and Version combination.
Parameter 'level' is the SBML Level
Parameter 'version' is the Version within the SBML Level
"""
this = _libsbml.new_ListOfSpeciesReferences(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(ListOfSpeciesReferences self) -> ListOfSpeciesReferences
Creates and returns a deep copy of this ListOfSpeciesReferences
object.
Returns the (deep) copy of this ListOfSpeciesReferences object.
"""
return _libsbml.ListOfSpeciesReferences_clone(self)
def getItemTypeCode(self):
"""
getItemTypeCode(ListOfSpeciesReferences self) -> int
Returns the libSBML type code for the objects contained in this ListOf
(i.e., SpeciesReference objects, if the list is non-empty).
LibSBML attaches an identifying code to every kind of SBML object.
These are integer constants known as SBML type codes. The names of
all the codes begin with the characters SBML_. In the Python language
interface for libSBML, the type codes are defined as static integer
constants in the interface class 'libsbml'. Note that different Level
3 package plug-ins may use overlapping type codes; to identify the
package to which a given object belongs, call the getPackageName()
method on the object.
Returns the SBML type code for objects contained in this list:
SBML_SPECIES_REFERENCE (default).
See also getElementName(), getPackageName().
"""
return _libsbml.ListOfSpeciesReferences_getItemTypeCode(self)
def getElementName(self):
"""
getElementName(ListOfSpeciesReferences self) -> string
Returns the XML element name of this object.
For ListOfSpeciesReferences, the XML element name is
'listOfSpeciesReferences'.
Returns the name of this element, i.e., 'listOfSpeciesReferences'.
"""
return _libsbml.ListOfSpeciesReferences_getElementName(self)
def get(self, *args):
"""
get(ListOfSpeciesReferences self, unsigned int n) -> SimpleSpeciesReference
get(ListOfSpeciesReferences self, unsigned int n) -> SimpleSpeciesReference
get(ListOfSpeciesReferences self, string sid) -> SimpleSpeciesReference
get(ListOfSpeciesReferences self, string sid) -> SimpleSpeciesReference
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
get(string sid)
Get a SpeciesReference from the ListOfSpeciesReferences based on its
identifier.
Parameter 'sid' is a string representing the identifier of the
SpeciesReference to get.
Returns SpeciesReference in this ListOfSpeciesReferences with the
given 'sid' or None if no such SpeciesReference exists.
See also get(), size(), size().
"""
return _libsbml.ListOfSpeciesReferences_get(self, *args)
def remove(self, *args):
"""
remove(ListOfSpeciesReferences self, unsigned int n) -> SimpleSpeciesReference
remove(ListOfSpeciesReferences self, string sid) -> SimpleSpeciesReference
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
remove(string sid)
Removes item in this ListOfSpeciesReferences items with the given
identifier.
The caller owns the returned item and is responsible for deleting it.
If none of the items in this list have the identifier 'sid', then None
is returned.
Parameter 'sid' is the identifier of the item to remove
Returns the item removed. As mentioned above, the caller owns the
returned item.
______________________________________________________________________
Method variant with the following signature:
remove(long n)
Removes the nth item from this ListOfSpeciesReferences items and
returns a pointer to it.
The caller owns the returned item and is responsible for deleting it.
Parameter 'n' is the index of the item to remove
See also size().
"""
return _libsbml.ListOfSpeciesReferences_remove(self, *args)
__swig_destroy__ = _libsbml.delete_ListOfSpeciesReferences
__del__ = lambda self: None
ListOfSpeciesReferences_swigregister = _libsbml.ListOfSpeciesReferences_swigregister
ListOfSpeciesReferences_swigregister(ListOfSpeciesReferences)
class ModifierSpeciesReference(SimpleSpeciesReference):
"""
A reference to an SBML modifier species.
Sometimes a species appears in the kinetic rate formula of a reaction
but is itself neither created nor destroyed in that reaction (for
example, because it acts as a catalyst or inhibitor). In SBML, all
such species are simply called modifiers without regard to the
detailed role of those species in the model. The Reaction structure
provides a way to express which species act as modifiers in a given
reaction. This is the purpose of the list of modifiers available in
Reaction. The list contains instances of ModifierSpeciesReference
structures.
The ModifierSpeciesReference structure inherits the mandatory
attribute 'species' and optional attributes 'id' and 'name' from the
parent class SimpleSpeciesReference. See the description of
SimpleSpeciesReference for more information about these.
The value of the 'species' attribute must be the identifier of a
species defined in the enclosing Model; this species is designated as
a modifier for the current reaction. A reaction may have any number
of modifiers. It is permissible for a modifier species to appear
simultaneously in the list of reactants and products of the same
reaction where it is designated as a modifier, as well as to appear in
the list of reactants, products and modifiers of other reactions in
the model.
"""
__swig_setmethods__ = {}
for _s in [SimpleSpeciesReference]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, ModifierSpeciesReference, name, value)
__swig_getmethods__ = {}
for _s in [SimpleSpeciesReference]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, ModifierSpeciesReference, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(ModifierSpeciesReference self, unsigned int level, unsigned int version) -> ModifierSpeciesReference
__init__(ModifierSpeciesReference self, SBMLNamespaces sbmlns) -> ModifierSpeciesReference
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
ModifierSpeciesReference(SBMLNamespaces sbmlns)
Creates a new ModifierSpeciesReference using the given SBMLNamespaces
object 'sbmlns'.
Parameter 'sbmlns' is an SBMLNamespaces object.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
______________________________________________________________________
Method variant with the following signature:
ModifierSpeciesReference(long level, long version)
Creates a new ModifierSpeciesReference using the given SBML 'level'
and 'version' values.
Parameter 'level' is a long integer, the SBML Level to assign to this
ModifierSpeciesReference
Parameter 'version' is a long integer, the SBML Version to assign to
this ModifierSpeciesReference
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
"""
this = _libsbml.new_ModifierSpeciesReference(*args)
try:
self.this.append(this)
except:
self.this = this
__swig_destroy__ = _libsbml.delete_ModifierSpeciesReference
__del__ = lambda self: None
def clone(self):
"""
clone(ModifierSpeciesReference self) -> ModifierSpeciesReference
Creates and returns a deep copy of this ModifierSpeciesReference
object.
Returns the (deep) copy of this ModifierSpeciesReference object.
"""
return _libsbml.ModifierSpeciesReference_clone(self)
def getTypeCode(self):
"""
getTypeCode(ModifierSpeciesReference self) -> int
Returns the libSBML type code for this SBML object.
LibSBML attaches an identifying code to every kind of SBML object.
These are integer constants known as SBML type codes. The names of
all the codes begin with the characters SBML_. In the Python language
interface for libSBML, the type codes are defined as static integer
constants in the interface class 'libsbml'. Note that different Level
3 package plug-ins may use overlapping type codes; to identify the
package to which a given object belongs, call the getPackageName()
method on the object.
Returns the SBML type code for this object:
SBML_MODIFIER_SPECIES_REFERENCE (default).
WARNING:
The specific integer values of the possible type codes may be reused
by different Level 3 package plug-ins. Thus, to identifiy the correct
code, it is necessary to invoke both getTypeCode() and
getPackageName().
See also getElementName(), getPackageName().
"""
return _libsbml.ModifierSpeciesReference_getTypeCode(self)
def getElementName(self):
"""
getElementName(ModifierSpeciesReference self) -> string
Returns the XML element name of this object, which for Species, is
always 'modifierSpeciesReference'.
Returns the name of this element, i.e., 'modifierSpeciesReference'.
"""
return _libsbml.ModifierSpeciesReference_getElementName(self)
def hasRequiredAttributes(self):
"""
hasRequiredAttributes(ModifierSpeciesReference self) -> bool
Predicate returning True if all the required attributes for this
ModifierSpeciesReference object have been set.
The required attributes for a ModifierSpeciesReference object are:
species
Returns True if the required attributes have been set, False
otherwise.
"""
return _libsbml.ModifierSpeciesReference_hasRequiredAttributes(self)
ModifierSpeciesReference_swigregister = _libsbml.ModifierSpeciesReference_swigregister
ModifierSpeciesReference_swigregister(ModifierSpeciesReference)
class Event(SBase):
"""
A discontinuous SBML event.
An SBML Event object defines when the event can occur, the variables
that are affected by it, how the variables are affected, and the
event's relationship to other events. The effect of the event can
optionally be delayed after the occurrence of the condition which
invokes it.
The operation of Event is divided into two phases (even when the event
is not delayed): one when the event is triggered, and the other when
the event is executed. Trigger objects define the conditions for
triggering an event, Delay objects define when the event is actually
executed, EventAssignment objects define the effects of executing the
event, and (in SBML Level 3) Priority objects influence the order of
EventAssignment performance in cases of simultaneous events. Please
consult the descriptions of Trigger, Delay, EventAssignment and
Priority for more information.
SBML Level/Version differences
======================================================================
SBML Level 3
......................................................................
SBML Level 3 introduces several changes to the structure and
components of Events compared to SBML Level 2. These changes fall
into two main categories: changes to what is optional or required, and
additions of new attributes and elements.
* The attribute 'useValuesFromTriggerTime' on Event is mandatory (it
was optional in Level 2);
* Event's 'listOfEventAssignments' element (of class
ListOfEventAssignments) is optional (it was mandatory in Level 2);
* Event's 'priority' element (of class Priority) is new in Level 3;
and
* The Trigger object gains new mandatory attributes (described as
part of the definition of Trigger). The changes to the attributes of
Event are described below; the changes to Trigger and Priority are
described in their respective sections.
SBML Level 2
......................................................................
In SBML Level 2 versions before Version 4, the semantics of Event time
delays were defined such that the expressions in the event's
assignments were always evaluated at the time the event was triggered.
This definition made it difficult to define an event whose assignment
formulas were meant to be evaluated at the time the event was executed
(i.e., after the time period defined by the value of the Delay
element). In SBML Level 2 Version 4 and in Level 3, the attribute
'useValuesFromTriggerTime' on Event allows a model to indicate the
time at which the event's assignments are intended the values of the
assignment formulas are computed at the moment the event is triggered,
not after the delay. If 'useValuesFromTriggerTime'=False, it means
that the formulas in the event's assignments are to be computed after
the delay, at the time the event is executed.
The definition of Event in SBML Level 2 Versions 1 and 2 includes an
additional attribute called 'timeUnits', which allowed the time units
of the Delay to be set explicitly. Later Versions of SBML Level 2 as
well as SBML Level 3 do not define this attribute. LibSBML supports
this attribute for compatibility with previous versions of SBML Level
2; however, if a model in SBML Level 3 or Level 2 Versions 3-4 format
sets the attribute, the consistency-checking method
SBMLDocument.checkConsistency() will report an error.
The attribute 'useValuesFromTriggerTime' was introduced in SBML Level
2 Version 4. Models defined in prior Versions of SBML Level 2 cannot
use this attribute, and SBMLDocument.checkConsistency() will report an
error if they do.
Semantics of events in SBML Level 3 Version 1
======================================================================
The detailed semantics of events are described in the specification
documents for each SBML Level/Version. Here we include the
description from the SBML Level 1 Version 1. Any transition of a
Trigger object's 'math' formula from the value False to True will
cause the enclosing Event object to trigger. Such a transition is not
possible at the very start of a simulation (i.e., at time t = 0)
unless the Trigger object's 'initialValue' attribute has a value of
False; this defines the value of the trigger formula to be False
immediately prior to the start of simulation, thereby giving it the
potential to change in value from False to True when the formula is
evaluated at t = 0. If 'initialValue'=True, then the trigger
expression cannot transition from False to True at t = 0 but may do so
at some time t > 0.
Consider an Event object definition E with delay d in which the
Trigger object's 'math' formula makes a transition in value from False
to True at times t_1 and t_2. The EventAssignment within the Event
object will have effect at t_1 + d and t_2 + d irrespective of the
relative times of t_1 and t_2. For example, events can 'overlap' so
that t_1 < t_2 < t_1 + d still causes an event assignments to occur at
t_1 + d and t_2 + d.
It is entirely possible for two events to be executed simultaneously,
and it is possible for events to trigger other events (i.e., an event
assignment can cause an event to trigger). This leads to several
points:
* A software package should retest all event triggers after executing
an event assignment in order to account for the possibility that the
assignment causes another event trigger to transition from False to
True. This check should be made after each individual Event object's
execution, even when several events are to be executed simultaneously.
* Any Event object whose Trigger 'persistent' attribute has the value
False must have its trigger expression reevaluated continuously
between when the event is triggered and when it is executed. If its
trigger expression ever evaluates to False, it must be removed from
the queue of events pending execution and treated as any other event
whose trigger expression evaluates to False.
* Although the precise time at which events are executed is not
resolved beyond the given execution point in simulated time, it is
assumed that the order in which the events occur is resolved. This
order can be significant in determining the overall outcome of a given
simulation. When an event X triggers another event Y and event Y has
zero delay, then event Y is added to the existing set of simultaneous
events that are pending execution. Events X and Y form a cascade of
events at the same point in simulation time. An event such as Y may
have a special priority if it contains a Priority subobject.
* All events in a model are open to being in a cascade. The position
of an event in the event queue does not affect whether it can be in
the cascade: event Y can be triggered whether it is before or after X
in the queue of events pending execution. A cascade of events can be
potentially infinite (never terminate); when this occurs a simulator
should indicate this has occurred---it is incorrect for a simulator to
break a cascade arbitrarily and continue the simulation without at
least indicating that the infinite cascade occurred.
* Simultaneous events having no defined priorities are executed in an
undefined order. This does not mean that the behavior of the
simulation is completely undefined; merely that the order of execution
of these particular events is undefined. A given simulator may use
any algorithm to choose an order as long as every event is executed
exactly once.
* Events with defined priorities are executed in the order implied by
their Priority 'math' formula values, with events having higher
priorities being executed ahead of events with lower priorities, and
events with identical priorities being executed in a random order with
respect to one another (as determined at run-time by some random
algorithm equivalent to coin-flipping). Newly-triggered events that
are to be executed immediately (i.e., if they define no delays) should
be inserted into the queue of events pending execution according to
their priorities: events with higher priority values value must be
inserted ahead of events with lower priority values and after any
pending events with even higher priorities, and inserted randomly
among pending events with the same priority values. Events without
Priority objects must be inserted into the queue in some fashion, but
the algorithm used to place it in the queue is undefined. Similarly,
there is no restriction on the order of a newly-inserted event with a
defined Priority with respect to any other pending Event without a
defined Priority.
* A model variable that is the target of one or more event assignments
can change more than once when simultaneous events are processed at
some time point t. The model's behavior (output) for such a variable
is the value of the variable at the end of processing all the
simultaneous events at time t.
See also Trigger, Priority, Delay, EventAssignment.
"""
__swig_setmethods__ = {}
for _s in [SBase]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, Event, name, value)
__swig_getmethods__ = {}
for _s in [SBase]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, Event, name)
__repr__ = _swig_repr
__swig_destroy__ = _libsbml.delete_Event
__del__ = lambda self: None
def __init__(self, *args):
"""
__init__(Event self, unsigned int level, unsigned int version) -> Event
__init__(Event self, SBMLNamespaces sbmlns) -> Event
__init__(Event self, Event orig) -> Event
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
Event(SBMLNamespaces sbmlns)
Creates a new Event using the given SBMLNamespaces object 'sbmlns'.
The SBMLNamespaces object encapsulates SBML Level/Version/namespaces
information. It is used to communicate the SBML Level, Version, and
(in Level 3) packages used in addition to SBML Level 3 Core. A common
approach to using libSBML's SBMLNamespaces facilities is to create an
SBMLNamespaces object somewhere in a program once, then hand that
object as needed to object constructors that accept SBMLNamespaces as
arguments.
Parameter 'sbmlns' is an SBMLNamespaces object.
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
______________________________________________________________________
Method variant with the following signature:
Event(long level, long version)
Creates a new Event using the given SBML 'level' and 'version' values.
Parameter 'level' is a long integer, the SBML Level to assign to this
Event
Parameter 'version' is a long integer, the SBML Version to assign to
this Event
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
______________________________________________________________________
Method variant with the following signature:
Event(Event orig)
Copy constructor; creates a copy of this Event.
Parameter 'orig' is the object to copy.
Throws SBMLConstructorException: Thrown if the argument 'orig' is
None.
"""
this = _libsbml.new_Event(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(Event self) -> Event
Creates and returns a deep copy of this Event object.
Returns the (deep) copy of this Event object.
"""
return _libsbml.Event_clone(self)
def getElementBySId(self, id):
"""
getElementBySId(Event self, string id) -> SBase
Returns the first child element found that has the given 'id' in the
model-wide SId namespace, or None if no such object is found.
Parameter 'id' is string representing the id of objects to find
Returns pointer to the first element found with the given 'id'.
"""
return _libsbml.Event_getElementBySId(self, id)
def getElementByMetaId(self, metaid):
"""
getElementByMetaId(Event self, string metaid) -> SBase
Returns the first child element it can find with the given 'metaid',
or None if no such object is found.
Parameter 'metaid' is string representing the metaid of objects to
find
Returns pointer to the first element found with the given 'metaid'.
"""
return _libsbml.Event_getElementByMetaId(self, metaid)
def getId(self):
"""
getId(Event self) -> string
Returns the value of the 'id' attribute of this Event.
Returns the id of this Event.
"""
return _libsbml.Event_getId(self)
def getName(self):
"""
getName(Event self) -> string
Returns the value of the 'name' attribute of this Event.
Returns the name of this Event.
"""
return _libsbml.Event_getName(self)
def getTrigger(self, *args):
"""
getTrigger(Event self) -> Trigger
getTrigger(Event self) -> Trigger
Get the event trigger portion of this Event.
Returns the Trigger object of this Event.
"""
return _libsbml.Event_getTrigger(self, *args)
def getDelay(self, *args):
"""
getDelay(Event self) -> Delay
getDelay(Event self) -> Delay
Get the assignment delay portion of this Event, if there is one.
Returns the delay of this Event if one is defined, or None if none is
defined.
"""
return _libsbml.Event_getDelay(self, *args)
def getPriority(self, *args):
"""
getPriority(Event self) -> Priority
getPriority(Event self) -> Priority
(SBML Level 3 only) Get the event priority portion of this Event.
Returns the Priority object of this Event.
Note:
The element 'priority' is available in SBML Level 3 Version 1 Core,
but is not present in lower Levels of SBML.
"""
return _libsbml.Event_getPriority(self, *args)
def getTimeUnits(self):
"""
getTimeUnits(Event self) -> string
Get the value of the 'timeUnits' attribute of this Event, if it has
one.
Returns the value of the attribute 'timeUnits' as a string.
WARNING:
Definitions of Event in SBML Level 2 Versions 1 and 2 included the
additional attribute called 'timeUnits', but it was removed in SBML
Level 2 Version 3. LibSBML supports this attribute for compatibility
with previous versions of SBML Level 2, but its use is discouraged
since models in Level 2 Versions 3 and 4 cannot contain it. If a
Version 3 or 4 model sets the attribute, the consistency-checking
method SBMLDocument.checkConsistency() will report an error.
"""
return _libsbml.Event_getTimeUnits(self)
def getUseValuesFromTriggerTime(self):
"""
getUseValuesFromTriggerTime(Event self) -> bool
Get the value of the 'useValuesFromTriggerTime' attribute of this
Event.
The optional Delay on Event means there are two times to consider
when computing the results of an event: the time at which the event is
triggered, and the time at which assignments are executed. It is also
possible to distinguish between the time at which the
EventAssignment's expression is calculated, and the time at which the
assignment is made: the expression could be evaluated at the same time
the assignments are performed, i.e., when the event is executed, but
it could also be defined to be evaluated at the time the event is
triggered.
In SBML Level 2 versions prior to Version 4, the semantics of Event
time delays were defined such that the expressions in the event's
assignments were always evaluated at the time the event was triggered.
This definition made it difficult to define an event whose assignment
formulas were meant to be evaluated at the time the event was executed
(i.e., after the time period defined by the value of the Delay
element). In SBML Level 2 Version 4, the attribute
'useValuesFromTriggerTime' on Event allows a model to indicate the
time at which the event's assignments are intended to be evaluated.
In SBML Level 2, the attribute has a default value of True, which
corresponds to the interpretation of event assignments prior to
Version 4: the values of the assignment formulas are computed at the
moment the event is triggered, not after the delay. If
'useValuesFromTriggerTime'=False, it means that the formulas in the
event's assignments are to be computed after the delay, at the time
the event is executed. In SBML Level 3, the attribute is mandatory,
not optional, and all events must specify a value for it.
Returns the value of the attribute 'useValuesFromTriggerTime' as a
boolean.
WARNING:
The attribute 'useValuesFromTriggerTime' was introduced in SBML Level
2 Version 4. It is not valid in models defined using SBML Level 2
versions prior to Version 4. If a Level 2 Version 1-3 model sets the
attribute, the consistency-checking method
SBMLDocument.checkConsistency() will report an error.
"""
return _libsbml.Event_getUseValuesFromTriggerTime(self)
def isSetId(self):
"""
isSetId(Event self) -> bool
Predicate returning True if this Event's 'id' attribute is set.
Returns True if the 'id' attribute of this Event is set, False
otherwise.
"""
return _libsbml.Event_isSetId(self)
def isSetName(self):
"""
isSetName(Event self) -> bool
Predicate returning True if this Event's 'name' attribute is set.
Returns True if the 'name' attribute of this Event is set, False
otherwise.
"""
return _libsbml.Event_isSetName(self)
def isSetTrigger(self):
"""
isSetTrigger(Event self) -> bool
Predicate for testing whether the trigger for this Event is set.
Returns True if the trigger of this Event is set, False otherwise.
"""
return _libsbml.Event_isSetTrigger(self)
def isSetDelay(self):
"""
isSetDelay(Event self) -> bool
Predicate for testing whether the delay for this Event is set.
Returns True if the delay of this Event is set, False otherwise.
"""
return _libsbml.Event_isSetDelay(self)
def isSetPriority(self):
"""
isSetPriority(Event self) -> bool
(SBML Level 3 only) Predicate for testing whether the priority for
this Event is set.
Returns True if the priority of this Event is set, False otherwise.
Note:
The element 'priority' is available in SBML Level 3 Version 1 Core,
but is not present in lower Levels of SBML.
"""
return _libsbml.Event_isSetPriority(self)
def isSetTimeUnits(self):
"""
isSetTimeUnits(Event self) -> bool
Predicate for testing whether the 'timeUnits' attribute of this Event
is set.
Returns True if the 'timeUnits' attribute of this Event is set, False
otherwise.
WARNING:
Definitions of Event in SBML Level 2 Versions 1 and 2 included the
additional attribute called 'timeUnits', but it was removed in SBML
Level 2 Version 3. LibSBML supports this attribute for compatibility
with previous versions of SBML Level 2, but its use is discouraged
since models in Level 2 Versions 3 and 4 cannot contain it. If a
Version 3 or 4 model sets the attribute, the consistency-checking
method SBMLDocument.checkConsistency() will report an error.
"""
return _libsbml.Event_isSetTimeUnits(self)
def isSetUseValuesFromTriggerTime(self):
"""
isSetUseValuesFromTriggerTime(Event self) -> bool
Predicate for testing whether the 'useValuesFromTriggerTime' attribute
of this Event is set.
Returns True if the 'useValuesFromTriggerTime' attribute of this Event
is set, False otherwise.
Note:
In SBML Level 2, this attribute is optional and has a default value of
True, whereas in Level 3 Version 1, this optional is mandatory and has
no default value.
"""
return _libsbml.Event_isSetUseValuesFromTriggerTime(self)
def setId(self, sid):
"""
setId(Event self, string sid) -> int
Sets the value of the 'id' attribute of this Event.
The string 'sid' is copied.
SBML has strict requirements for the syntax of identifiers, that is,
the values of the 'id' attribute present on most types of SBML
objects. The following is a summary of the definition of the SBML
identifier type SId, which defines the permitted syntax of
identifiers. We express the syntax using an extended form of BNF
notation:
letter ::= 'a'..'z','A'..'Z'
digit ::= '0'..'9'
idChar ::= letter | digit | '_'
SId ::= ( letter | '_' ) idChar*
The characters ( and ) are used for grouping, the character * 'zero or
more times', and the character | indicates logical 'or'. The equality
of SBML identifiers is determined by an exact character sequence
match; i.e., comparisons must be performed in a case-sensitive manner.
In addition, there are a few conditions for the uniqueness of
identifiers in an SBML model. Please consult the SBML specifications
for the exact details of the uniqueness requirements.
Parameter 'sid' is the string to use as the identifier of this Event
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
"""
return _libsbml.Event_setId(self, sid)
def setName(self, name):
"""
setName(Event self, string name) -> int
Sets the value of the 'name' attribute of this Event.
The string in 'name' is copied.
Parameter 'name' is the new name for the Event
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
"""
return _libsbml.Event_setName(self, name)
def setTrigger(self, trigger):
"""
setTrigger(Event self, Trigger trigger) -> int
Sets the trigger definition of this Event to a copy of the given
Trigger object instance.
Parameter 'trigger' is the Trigger object instance to use.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_LEVEL_MISMATCH
* LIBSBML_VERSION_MISMATCH
"""
return _libsbml.Event_setTrigger(self, trigger)
def setDelay(self, delay):
"""
setDelay(Event self, Delay delay) -> int
Sets the delay definition of this Event to a copy of the given Delay
object instance.
Parameter 'delay' is the Delay object instance to use
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_LEVEL_MISMATCH
* LIBSBML_VERSION_MISMATCH
"""
return _libsbml.Event_setDelay(self, delay)
def setPriority(self, priority):
"""
setPriority(Event self, Priority priority) -> int
(SBML Level 3 only) Sets the priority definition of this Event to a
copy of the given Priority object instance.
Parameter 'priority' is the Priority object instance to use
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_LEVEL_MISMATCH
* LIBSBML_VERSION_MISMATCH
* LIBSBML_UNEXPECTED_ATTRIBUTE
Note:
The element 'priority' is available in SBML Level 3 Version 1 Core,
but is not present in lower Levels of SBML.
"""
return _libsbml.Event_setPriority(self, priority)
def setTimeUnits(self, sid):
"""
setTimeUnits(Event self, string sid) -> int
Sets the 'timeUnits' attribute of this Event to a copy of 'sid'.
Parameter 'sid' is the identifier of the time units to use.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
* LIBSBML_UNEXPECTED_ATTRIBUTE
WARNING:
Definitions of Event in SBML Level 2 Versions 1 and 2 included the
additional attribute called 'timeUnits', but it was removed in SBML
Level 2 Version 3. LibSBML supports this attribute for compatibility
with previous versions of SBML Level 2, but its use is discouraged
since models in Level 2 Versions 3 and 4 cannot contain it. If a
Version 3 or 4 model sets the attribute, the consistency-checking
method SBMLDocument.checkConsistency() will report an error.
"""
return _libsbml.Event_setTimeUnits(self, sid)
def setUseValuesFromTriggerTime(self, value):
"""
setUseValuesFromTriggerTime(Event self, bool value) -> int
Sets the 'useValuesFromTriggerTime' attribute of this Event to a
'value'.
The optional Delay on Event means there are two times to consider
when computing the results of an event: the time at which the event is
triggered, and the time at which assignments are executed. It is also
possible to distinguish between the time at which the
EventAssignment's expression is calculated, and the time at which the
assignment is made: the expression could be evaluated at the same time
the assignments are performed, i.e., when the event is executed, but
it could also be defined to be evaluated at the time the event is
triggered.
In SBML Level 2 versions prior to Version 4, the semantics of Event
time delays were defined such that the expressions in the event's
assignments were always evaluated at the time the event was triggered.
This definition made it difficult to define an event whose assignment
formulas were meant to be evaluated at the time the event was executed
(i.e., after the time period defined by the value of the Delay
element). In SBML Level 2 Version 4, the attribute
'useValuesFromTriggerTime' on Event allows a model to indicate the
time at which the event's assignments are intended to be evaluated.
In SBML Level 2, the attribute has a default value of True, which
corresponds to the interpretation of event assignments prior to
Version 4: the values of the assignment formulas are computed at the
moment the event is triggered, not after the delay. If
'useValuesFromTriggerTime'=False, it means that the formulas in the
event's assignments are to be computed after the delay, at the time
the event is executed. In SBML Level 3, the attribute is mandatory,
not optional, and all events must specify a value for it.
Parameter 'value' is the value of useValuesFromTriggerTime to use.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_UNEXPECTED_ATTRIBUTE
WARNING:
The attribute 'useValuesFromTriggerTime' was introduced in SBML Level
2 Version 4. It is not valid in models defined using SBML Level 2
versions prior to Version 4. If a Level 2 Version 1-3 model sets the
attribute, the consistency-checking method
SBMLDocument.checkConsistency() will report an error.
"""
return _libsbml.Event_setUseValuesFromTriggerTime(self, value)
def unsetId(self):
"""
unsetId(Event self) -> int
Unsets the value of the 'id' attribute of this Event.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
"""
return _libsbml.Event_unsetId(self)
def unsetName(self):
"""
unsetName(Event self) -> int
Unsets the value of the 'name' attribute of this Event.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
"""
return _libsbml.Event_unsetName(self)
def unsetDelay(self):
"""
unsetDelay(Event self) -> int
Unsets the Delay of this Event.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
"""
return _libsbml.Event_unsetDelay(self)
def unsetPriority(self):
"""
unsetPriority(Event self) -> int
(SBML Level 3 only) Unsets the Priority of this Event.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
Note:
The element 'priority' is available in SBML Level 3 Version 1 Core,
but is not present in lower Levels of SBML.
"""
return _libsbml.Event_unsetPriority(self)
def unsetTrigger(self):
"""
unsetTrigger(Event self) -> int
Unsets the Trigger of this Event.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
Note:
The element 'priority' is available in SBML Level 3 Version 1 Core,
but is not present in lower Levels of SBML.
"""
return _libsbml.Event_unsetTrigger(self)
def unsetTimeUnits(self):
"""
unsetTimeUnits(Event self) -> int
Unsets the 'timeUnits' attribute of this Event.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_UNEXPECTED_ATTRIBUTE
* LIBSBML_OPERATION_FAILED
WARNING:
Definitions of Event in SBML Level 2 Versions 1 and 2 included the
additional attribute called 'timeUnits', but it was removed in SBML
Level 2 Version 3. LibSBML supports this attribute for compatibility
with previous versions of SBML Level 2, but its use is discouraged
since models in Level 2 Versions 3 and 4 cannot contain it. If a
Version 3 or 4 model sets the attribute, the consistency-checking
method SBMLDocument.checkConsistency() will report an error.
"""
return _libsbml.Event_unsetTimeUnits(self)
def addEventAssignment(self, ea):
"""
addEventAssignment(Event self, EventAssignment ea) -> int
Appends a copy of the given EventAssignment to this Event.
Parameter 'ea' is the EventAssignment object to add.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_LEVEL_MISMATCH
* LIBSBML_VERSION_MISMATCH
* LIBSBML_DUPLICATE_OBJECT_ID
* LIBSBML_OPERATION_FAILED
Note:
This method should be used with some caution. The fact that this
method copies the object passed to it means that the caller will be
left holding a physically different object instance than the one
contained inside this object. Changes made to the original object
instance (such as resetting attribute values) will not affect the
instance in this object. In addition, the caller should make sure to
free the original object if it is no longer being used, or else a
memory leak will result. Please see other methods on this class
(particularly a corresponding method whose name begins with the word
create) for alternatives that do not lead to these issues.
See also createEventAssignment().
"""
return _libsbml.Event_addEventAssignment(self, ea)
def createEventAssignment(self):
"""
createEventAssignment(Event self) -> EventAssignment
Creates a new, empty EventAssignment, adds it to this Event's list of
event assignments and returns the EventAssignment.
Returns the newly created EventAssignment object instance
See also addEventAssignment().
"""
return _libsbml.Event_createEventAssignment(self)
def createTrigger(self):
"""
createTrigger(Event self) -> Trigger
Creates a new, empty Trigger, adds it to this Event and returns the
Trigger.
Returns the newly created Trigger object instance
"""
return _libsbml.Event_createTrigger(self)
def createDelay(self):
"""
createDelay(Event self) -> Delay
Creates a new, empty Delay, adds it to this Event and returns the
Delay.
Returns the newly created Delay object instance
"""
return _libsbml.Event_createDelay(self)
def createPriority(self):
"""
createPriority(Event self) -> Priority
(SBML Level 3 only) Creates a new, empty Priority, adds it to this
Event and returns the Priority.
Returns the newly created Priority object instance
Note:
The element 'priority' is available in SBML Level 3 Version 1 Core,
but is not present in lower Levels of SBML.
"""
return _libsbml.Event_createPriority(self)
def getListOfEventAssignments(self, *args):
"""
getListOfEventAssignments(Event self) -> ListOfEventAssignments
getListOfEventAssignments(Event self) -> ListOfEventAssignments
Returns the list of event assignments for this Event.
Returns the list of EventAssignments for this Event.
"""
return _libsbml.Event_getListOfEventAssignments(self, *args)
def getEventAssignment(self, *args):
"""
getEventAssignment(Event self, unsigned int n) -> EventAssignment
getEventAssignment(Event self, unsigned int n) -> EventAssignment
getEventAssignment(Event self, string variable) -> EventAssignment
getEventAssignment(Event self, string variable) -> EventAssignment
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
getEventAssignment(long n)
Return a specific EventAssignment object of this Event.
Parameter 'n' is an integer, the index of the EventAssignment object
to return
Returns the nth EventAssignment of this Event.
______________________________________________________________________
Method variant with the following signature:
getEventAssignment(string variable)
Return the event assignment indicated by the given 'variable'.
Parameter 'variable' is a string, the identifier of the variable whose
EventAssignment is being sought.
Returns the EventAssignment for the given 'variable', or None if no
such EventAssignment exits.
"""
return _libsbml.Event_getEventAssignment(self, *args)
def getNumEventAssignments(self):
"""
getNumEventAssignments(Event self) -> unsigned int
Returns the number of EventAssignment objects attached to this Event.
Returns the number of EventAssignments in this Event.
"""
return _libsbml.Event_getNumEventAssignments(self)
def removeEventAssignment(self, *args):
"""
removeEventAssignment(Event self, unsigned int n) -> EventAssignment
removeEventAssignment(Event self, string variable) -> EventAssignment
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
removeEventAssignment(long n)
Removes the nth EventAssignment object from this Event object and
returns a pointer to it.
The caller owns the returned object and is responsible for deleting
it.
Parameter 'n' is the index of the EventAssignment object to remove
Returns the EventAssignment object removed. As mentioned above, the
caller owns the returned item. None is returned if the given index is
out of range.
______________________________________________________________________
Method variant with the following signature:
removeEventAssignment(string variable)
Removes the EventAssignment object with the given 'variable' attribute
from this Event object and returns a pointer to it.
The caller owns the returned object and is responsible for deleting
it. If none of the EventAssignment objects in this Event object have
the 'variable' attribute 'variable', then None is returned.
Parameter 'variable' is the 'variable' attribute of the
EventAssignment object to remove
Returns the EventAssignment object removed. As mentioned above, the
caller owns the returned object. None is returned if no
EventAssignment object with the 'variable' attribute exists in this
Event object.
"""
return _libsbml.Event_removeEventAssignment(self, *args)
def connectToChild(self):
"""connectToChild(Event self)"""
return _libsbml.Event_connectToChild(self)
def enablePackageInternal(self, pkgURI, pkgPrefix, flag):
"""
enablePackageInternal(Event self, string pkgURI, string pkgPrefix, bool flag)
Internal implementation method.
"""
return _libsbml.Event_enablePackageInternal(self, pkgURI, pkgPrefix, flag)
def getTypeCode(self):
"""
getTypeCode(Event self) -> int
Returns the libSBML type code of this object instance.
LibSBML attaches an identifying code to every kind of SBML object.
These are integer constants known as SBML type codes. The names of
all the codes begin with the characters SBML_. In the Python language
interface for libSBML, the type codes are defined as static integer
constants in the interface class 'libsbml'. Note that different Level
3 package plug-ins may use overlapping type codes; to identify the
package to which a given object belongs, call the getPackageName()
method on the object.
Returns the SBML type code for this object: SBML_EVENT (default).
WARNING:
The specific integer values of the possible type codes may be reused
by different Level 3 package plug-ins. Thus, to identifiy the correct
code, it is necessary to invoke both getTypeCode() and
getPackageName().
See also getElementName(), getPackageName().
"""
return _libsbml.Event_getTypeCode(self)
def getElementName(self):
"""
getElementName(Event self) -> string
Returns the XML element name of this object, which for Event, is
always 'event'.
Returns the name of this element, i.e., 'event'.
"""
return _libsbml.Event_getElementName(self)
def hasRequiredAttributes(self):
"""
hasRequiredAttributes(Event self) -> bool
Predicate returning True if all the required attributes for this Event
object have been set.
The required attributes for an Event object are:
* 'useValuesfromTriggerTime' (required in SBML Level 3)
Returns True if the required attributes have been set, False
otherwise.
"""
return _libsbml.Event_hasRequiredAttributes(self)
def hasRequiredElements(self):
"""
hasRequiredElements(Event self) -> bool
Predicate returning True if all the required elements for this Event
object have been set.
Note:
The required elements for an Event object are:
* 'trigger'
* 'listOfEventAssignments' (required in SBML Level 2, optional in
Level 3)
"""
return _libsbml.Event_hasRequiredElements(self)
Event_swigregister = _libsbml.Event_swigregister
Event_swigregister(Event)
class ListOfEvents(ListOf):
"""
A list of Event objects.
The various ListOf___ classes in SBML are merely containers used for
organizing the main components of an SBML model. In libSBML's
implementation, ListOf___ classes are derived from the intermediate
utility class ListOf, which is not defined by the SBML specifications
but serves as a useful programmatic construct. ListOf is itself is in
turn derived from SBase, which provides all of the various ListOf___
classes with common features defined by the SBML specification, such
as 'metaid' attributes and annotations.
The relationship between the lists and the rest of an SBML model is
illustrated by the following (for SBML Level 2 Version 4):
...
...
...
...
...
...
... elements of subclasses of Rule ...
...
...
...
Readers may wonder about the motivations for using the ListOf___
containers in SBML. A simpler approach in XML might be to place the
components all directly at the top level of the model definition. The
choice made in SBML is to group them within XML elements named after
ListOfClassname, in part because it helps organize the components.
More importantly, the fact that the container classes are derived from
SBase means that software tools can add information about the lists
themselves into each list container's 'annotation'.
See also ListOfFunctionDefinitions, ListOfUnitDefinitions,
ListOfCompartmentTypes, ListOfSpeciesTypes, ListOfCompartments,
ListOfSpecies, ListOfParameters, ListOfInitialAssignments,
ListOfRules, ListOfConstraints, ListOfReactions, ListOfEvents.
"""
__swig_setmethods__ = {}
for _s in [ListOf]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, ListOfEvents, name, value)
__swig_getmethods__ = {}
for _s in [ListOf]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, ListOfEvents, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(ListOfEvents self, unsigned int level, unsigned int version) -> ListOfEvents
__init__(ListOfEvents self, SBMLNamespaces sbmlns) -> ListOfEvents
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
ListOfEvents(SBMLNamespaces sbmlns)
Creates a new ListOfEvents object.
The object is constructed such that it is valid for the SBML Level and
Version combination determined by the SBMLNamespaces object in
'sbmlns'.
Parameter 'sbmlns' is an SBMLNamespaces object that is used to
determine the characteristics of the ListOfEvents object to be
created.
______________________________________________________________________
Method variant with the following signature:
ListOfEvents(long level, long version)
Creates a new ListOfEvents object.
The object is constructed such that it is valid for the given SBML
Level and Version combination.
Parameter 'level' is the SBML Level
Parameter 'version' is the Version within the SBML Level
"""
this = _libsbml.new_ListOfEvents(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(ListOfEvents self) -> ListOfEvents
Creates and returns a deep copy of this ListOfEvents object.
Returns the (deep) copy of this ListOfEvents object.
"""
return _libsbml.ListOfEvents_clone(self)
def getItemTypeCode(self):
"""
getItemTypeCode(ListOfEvents self) -> int
Returns the libSBML type code for the objects contained in this ListOf
(i.e., Event objects, if the list is non-empty).
LibSBML attaches an identifying code to every kind of SBML object.
These are integer constants known as SBML type codes. The names of
all the codes begin with the characters SBML_. In the Python language
interface for libSBML, the type codes are defined as static integer
constants in the interface class 'libsbml'. Note that different Level
3 package plug-ins may use overlapping type codes; to identify the
package to which a given object belongs, call the getPackageName()
method on the object.
Returns the SBML type code for the objects contained in this ListOf:
SBML_EVENT (default).
See also getElementName(), getPackageName().
"""
return _libsbml.ListOfEvents_getItemTypeCode(self)
def getElementName(self):
"""
getElementName(ListOfEvents self) -> string
Returns the XML element name of this object.
For ListOfEvents, the XML element name is 'listOfEvents'.
Returns the name of this element, i.e., 'listOfEvents'.
"""
return _libsbml.ListOfEvents_getElementName(self)
def get(self, *args):
"""
get(ListOfEvents self, unsigned int n) -> Event
get(ListOfEvents self, unsigned int n) -> Event
get(ListOfEvents self, string sid) -> Event
get(ListOfEvents self, string sid) -> Event
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
get(string sid)
Get an Event from the ListOfEvents based on its identifier.
Parameter 'sid' is a string representing the identifier of the Event
to get.
Returns Event in this ListOfEvents with the given 'sid' or None if no
such Event exists.
See also get(), size(), size().
"""
return _libsbml.ListOfEvents_get(self, *args)
def remove(self, *args):
"""
remove(ListOfEvents self, unsigned int n) -> Event
remove(ListOfEvents self, string sid) -> Event
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
remove(string sid)
Removes item in this ListOfEvents items with the given identifier.
The caller owns the returned item and is responsible for deleting it.
If none of the items in this list have the identifier 'sid', then None
is returned.
Parameter 'sid' is the identifier of the item to remove
Returns the item removed. As mentioned above, the caller owns the
returned item.
______________________________________________________________________
Method variant with the following signature:
remove(long n)
Removes the nth item from this ListOfEvents items and returns a
pointer to it.
The caller owns the returned item and is responsible for deleting it.
Parameter 'n' is the index of the item to remove
See also size().
"""
return _libsbml.ListOfEvents_remove(self, *args)
__swig_destroy__ = _libsbml.delete_ListOfEvents
__del__ = lambda self: None
ListOfEvents_swigregister = _libsbml.ListOfEvents_swigregister
ListOfEvents_swigregister(ListOfEvents)
class EventAssignment(SBase):
"""
An assignment to a variable by an SBML event.
Event contains an optional element called 'listOfEventAssignments', of
class ListOfEventAssignments. In every instance of an event
definition in a model, the object's 'listOfEventAssignments' element
must have a non-empty list of one or more 'eventAssignment' elements
of class EventAssignment. The object class EventAssignment has one
required attribute, 'variable', and a required element, 'math'. Being
derived from SBase, it also has all the usual attributes and elements
of its parent class.
An Event object defines when the event can occur, the variables that
are affected by the event, and how the variables are affected. The
purpose of the EventAssignment object class is to define how variables
are affected by an Event. In SBML Level 2, every Event object
instance must have a nonempty list of event assignments; in SBML Level
3, the list of assignments is optional.
The operation of an Event is divided into two phases (regardless of
whether a delay is involved): one phase when the event is triggered,
and the other when the event is executed. EventAssignment objects
are interpreted when an event is executed. The effects are described
below.
The attribute 'variable'
======================================================================
The EventAssignment attribute 'variable' must be the identifier of an
existing Compartment, Species, SpeciesReference, or Parameter instance
defined in the model. When the event is executed, the value of the
model component identified by 'variable' is changed by the
EventAssignment to the value computed by the 'math' element; that is,
a species' quantity, species reference's stoichiometry, compartment's
size or parameter's value are reset to the value computed by 'math'.
Certain restrictions are placed on what can appear in 'variable':
* The object identified by the value of the EventAssignment attribute
'variable' must not have its 'constant' attribute set to or default to
True. (Constants cannot be affected by events.)
* The 'variable' attribute must not contain the identifier of a
reaction; only species, species references, compartment and parameter
values may be set by an Event.
* The value of every 'variable' attribute must be unique among the set
of EventAssignment structures within a given Event structure. In
other words, a single event cannot have multiple EventAssignment
objects assigning the same variable. (All of them would be performed
at the same time when that particular Event triggers, resulting in
indeterminacy.) However, separate Event instances can refer to the
same variable.
* A variable cannot be assigned a value in an EventAssignment object
instance and also be assigned a value by an AssignmentRule; i.e., the
value of an EventAssignment's 'variable' attribute cannot be the same
as the value of a AssignmentRule' 'variable' attribute. (Assignment
rules hold at all times, therefore it would be inconsistent to also
define an event that reassigns the value of the same variable.) Note
that the time of assignment of the object identified by the value of
the 'variable' attribute is always the time at which the Event is
executed, not when it is triggered. The timing is controlled by the
optional Delay in an Event. The time of assignment is not affected by
the 'useValuesFromTriggerTime' attribute on Event---that attribute
affects the time at which the EventAssignment's 'math' expression is
evaluated. In other words, SBML allows decoupling the time at which
the 'variable' is assigned from the time at which its value expression
is calculated.
The 'math' subelement in an EventAssignment
======================================================================
The MathML expression contained in an EventAssignment defines the new
value of the variable being assigned by the Event.
As mentioned above, the time at which the expression in 'math' is
evaluated is determined by the attribute 'useValuesFromTriggerTime' on
Event. If the attribute value is True, the expression must be
evaluated when the event is triggered; more precisely, the values of
identifiers occurring in MathML elements in the EventAssignment's
'math' expression are the values they have at the point when the event
triggered. If, instead, 'useValuesFromTriggerTime''s value is False,
it means the values at execution time should be used; that is, the
values of identifiers occurring in MathML elements in the
EventAssignment's 'math' expression are the values they have at the
point when the event executed.
SBML Level/Version differences
======================================================================
Between Version 4 and previous versions of SBML Level 2, the
requirements regarding the matching of units between an
EvengAssignment's formula and the units of the object identified by
the 'variable' attribute changed. Previous versions required
consistency, but in SBML Level 2 Version 4 and in SBML Level 3, unit
consistency is only recommended. More precisely:
* In the case of a species, an EventAssignment sets the referenced
species' quantity (concentration or amount of substance) to the value
determined by the formula in the EventAssignment's 'math' subelement.
The units of the 'math' formula should (in SBML Level 2 Version 4 and
in Level 3) or must (in previous Versions of Level 2) be identical to
the units of the species.
* (SBML Level 3 only.) In the case of a species reference, an
EventAssignment sets the stoichiometry of the reactant or product
referenced by the SpeciesReference object to the value determined by
the formula in the 'math' element. The unit associated with the value
produced by the 'math' formula should be dimensionless, because
reactant and product stoichiometries in reactions are dimensionless
quantities.
* In the case of a compartment, an EventAssignment sets the referenced
compartment's size to the size determined by the formula in the 'math'
subelement of the EventAssignment. The overall units of the formula
should (in SBML Level 2 Version 4 and in Level 3) or must (in previous
Versions of Level 2) be identical to the units specified for the size
of the compartment identified by the EventAssignment's 'variable'
attribute.
* In the case of a parameter, an EventAssignment sets the referenced
parameter's value to that determined by the formula in 'math'. The
overall units of the formula should (in SBML Level 2 Version 4 and
Level 3) or must (in previous Versions of Level 2) be identical to the
units defined for the parameter. Note that the formula placed in the
'math' element has no assumed units. The consistency of the units of
the formula, and the units of the entity which the assignment affects,
must be explicitly established just as in the case of the value of the
Delay subelement. An approach similar to the one discussed in the
context of Delay may be used for the formula of an EventAssignment.
See also Event.
"""
__swig_setmethods__ = {}
for _s in [SBase]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, EventAssignment, name, value)
__swig_getmethods__ = {}
for _s in [SBase]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, EventAssignment, name)
__repr__ = _swig_repr
__swig_destroy__ = _libsbml.delete_EventAssignment
__del__ = lambda self: None
def __init__(self, *args):
"""
__init__(EventAssignment self, unsigned int level, unsigned int version) -> EventAssignment
__init__(EventAssignment self, SBMLNamespaces sbmlns) -> EventAssignment
__init__(EventAssignment self, EventAssignment orig) -> EventAssignment
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
EventAssignment(SBMLNamespaces sbmlns)
Creates a new EventAssignment using the given SBMLNamespaces object
'sbmlns'.
The SBMLNamespaces object encapsulates SBML Level/Version/namespaces
information. It is used to communicate the SBML Level, Version, and
(in Level 3) packages used in addition to SBML Level 3 Core. A common
approach to using libSBML's SBMLNamespaces facilities is to create an
SBMLNamespaces object somewhere in a program once, then hand that
object as needed to object constructors that accept SBMLNamespaces as
arguments.
Parameter 'sbmlns' is an SBMLNamespaces object.
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
______________________________________________________________________
Method variant with the following signature:
EventAssignment(long level, long version)
Creates a new EventAssignment using the given SBML 'level' and
'version' values.
Parameter 'level' is a long integer, the SBML Level to assign to this
EventAssignment
Parameter 'version' is a long integer, the SBML Version to assign to
this EventAssignment
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
______________________________________________________________________
Method variant with the following signature:
EventAssignment(EventAssignment orig)
Copy constructor; creates a copy of this EventAssignment.
Parameter 'orig' is the object to copy.
Throws SBMLConstructorException: Thrown if the argument 'orig' is
None.
"""
this = _libsbml.new_EventAssignment(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(EventAssignment self) -> EventAssignment
Creates and returns a deep copy of this EventAssignment object.
Returns the (deep) copy of this EventAssignment object.
"""
return _libsbml.EventAssignment_clone(self)
def getVariable(self):
"""
getVariable(EventAssignment self) -> string
Get the value of this EventAssignment's 'variable' attribute.
Returns the identifier stored in the 'variable' attribute of this
EventAssignment.
"""
return _libsbml.EventAssignment_getVariable(self)
def getMath(self):
"""
getMath(EventAssignment self) -> ASTNode
Get the mathematical expression in this EventAssignment's 'math'
subelement.
Returns the top ASTNode of an abstract syntax tree representing the
mathematical formula in this EventAssignment.
"""
return _libsbml.EventAssignment_getMath(self)
def isSetVariable(self):
"""
isSetVariable(EventAssignment self) -> bool
Predicate for testing whether the attribute 'variable' of this
EventAssignment is set.
Returns True if the 'variable' attribute of this EventAssignment is
set, False otherwise.
"""
return _libsbml.EventAssignment_isSetVariable(self)
def isSetMath(self):
"""
isSetMath(EventAssignment self) -> bool
Predicate for testing whether the 'math' subelement of this
EventAssignment is set.
Returns True if this EventAssignment has a 'math' subelement, False
otherwise.
"""
return _libsbml.EventAssignment_isSetMath(self)
def setVariable(self, sid):
"""
setVariable(EventAssignment self, string sid) -> int
Sets the attribute 'variable' of this EventAssignment to a copy of the
given identifier string.
Parameter 'sid' is the identifier of a Compartment, Species or
(global) Parameter defined in this model.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
"""
return _libsbml.EventAssignment_setVariable(self, sid)
def setMath(self, math):
"""
setMath(EventAssignment self, ASTNode math) -> int
Sets the 'math' subelement of this EventAssignment to a copy of the
given ASTNode.
Parameter 'math' is an ASTNode that will be copied and stored as the
mathematical formula for this EventAssignment.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_OBJECT
"""
return _libsbml.EventAssignment_setMath(self, math)
def getDerivedUnitDefinition(self, *args):
"""
getDerivedUnitDefinition(EventAssignment self) -> UnitDefinition
getDerivedUnitDefinition(EventAssignment self) -> UnitDefinition
Calculates and returns a UnitDefinition that expresses the units of
measurement assumed for the 'math' expression of this EventAssignment.
The units are calculated based on the mathematical expression in the
EventAssignment and the model quantities referenced by elements
used within that expression. The method
EventAssignment.getDerivedUnitDefinition() returns the calculated
units, to the extent that libSBML can compute them.
Note:
The functionality that facilitates unit analysis depends on the model
as a whole. Thus, in cases where the object has not been added to a
model or the model itself is incomplete, unit analysis is not possible
and this method will return None.
WARNING:
Note that it is possible the 'math' expression in the EventAssignment
contains literal numbers or parameters with undeclared units. In
those cases, it is not possible to calculate the units of the overall
expression without making assumptions. LibSBML does not make
assumptions about the units, and
EventAssignment.getDerivedUnitDefinition() only returns the units as
far as it is able to determine them. For example, in an expression X
+ Y, if X has unambiguously-defined units and Y does not, it will
return the units of X. When using this method, it is critical that
callers also invoke the method
EventAssignment.containsUndeclaredUnits() to determine whether this
situation holds. Callers should take suitable action in those
situations.
Returns a UnitDefinition that expresses the units of the math
expression of this EventAssignment, or None if one cannot be
constructed.
See also containsUndeclaredUnits().
"""
return _libsbml.EventAssignment_getDerivedUnitDefinition(self, *args)
def containsUndeclaredUnits(self, *args):
"""
containsUndeclaredUnits(EventAssignment self) -> bool
containsUndeclaredUnits(EventAssignment self) -> bool
Predicate returning True if the math expression of this
EventAssignment contains literal numbers or parameters with undeclared
units.
The units are calculated based on the mathematical expression in the
EventAssignment and the model quantities referenced by elements
used within that expression. The method
EventAssignment.getDerivedUnitDefinition() returns the calculated
units, to the extent that libSBML can compute them.
If the expression contains literal numbers or parameters with
undeclared units, libSBML may not be able to compute the full units of
the expression and will only return what it can compute. Callers
should always use EventAssignment.containsUndeclaredUnits() when using
EventAssignment.getDerivedUnitDefinition() to decide whether the
returned units may be incomplete.
Returns True if the math expression of this EventAssignment includes
parameters/numbers with undeclared units, False otherwise.
Note:
A return value of True indicates that the UnitDefinition returned by
EventAssignment.getDerivedUnitDefinition() may not accurately
represent the units of the expression.
See also getDerivedUnitDefinition().
"""
return _libsbml.EventAssignment_containsUndeclaredUnits(self, *args)
def getTypeCode(self):
"""
getTypeCode(EventAssignment self) -> int
Returns the libSBML type code of this object instance.
LibSBML attaches an identifying code to every kind of SBML object.
These are integer constants known as SBML type codes. The names of
all the codes begin with the characters SBML_. In the Python language
interface for libSBML, the type codes are defined as static integer
constants in the interface class 'libsbml'. Note that different Level
3 package plug-ins may use overlapping type codes; to identify the
package to which a given object belongs, call the getPackageName()
method on the object.
Returns the SBML type code for this object: SBML_EVENT_ASSIGNMENT
(default).
WARNING:
The specific integer values of the possible type codes may be reused
by different Level 3 package plug-ins. Thus, to identifiy the correct
code, it is necessary to invoke both getTypeCode() and
getPackageName().
See also getElementName(), getPackageName().
"""
return _libsbml.EventAssignment_getTypeCode(self)
def getElementName(self):
"""
getElementName(EventAssignment self) -> string
Returns the XML element name of this object, which for
EventAssignment, is always 'eventAssignment'.
Returns the name of this element, i.e., 'eventAssignment'.
"""
return _libsbml.EventAssignment_getElementName(self)
def hasRequiredAttributes(self):
"""
hasRequiredAttributes(EventAssignment self) -> bool
Predicate returning True if all the required attributes for this
EventAssignment object have been set.
The required attributes for a EventAssignment object are:
* 'variable'
Returns True if the required attributes have been set, False
otherwise.
"""
return _libsbml.EventAssignment_hasRequiredAttributes(self)
def hasRequiredElements(self):
"""
hasRequiredElements(EventAssignment self) -> bool
Predicate returning True if all the required elements for this
EventAssignment object have been set.
Note:
The required elements for a EventAssignment object are:
* 'math'
Returns a boolean value indicating whether all the required elements
for this object have been defined.
"""
return _libsbml.EventAssignment_hasRequiredElements(self)
def getId(self):
"""
getId(EventAssignment self) -> string
Internal implementation method.
"""
return _libsbml.EventAssignment_getId(self)
def renameSIdRefs(self, oldid, newid):
"""
renameSIdRefs(EventAssignment self, string oldid, string newid)
Replaces all uses of a given SIdRef type attribute value with another
value.
In SBML, object identifiers are of a data type called SId. In SBML
Level 3, an explicit data type called SIdRef was introduced for
attribute values that refer to SId values; in previous Levels of SBML,
this data type did not exist and attributes were simply described to
as 'referring to an identifier', but the effective data type was the
same as SIdRefin Level 3. These and other methods of libSBML refer to
the type SIdRef for all Levels of SBML, even if the corresponding SBML
specification did not explicitly name the data type.
This method works by looking at all attributes and (if appropriate)
mathematical formulas in MathML content, comparing the referenced
identifiers to the value of 'oldid'. If any matches are found, the
matching values are replaced with 'newid'. The method does not
descend into child elements.
Parameter 'oldid' is the old identifier Parameter 'newid' is the new
identifier
"""
return _libsbml.EventAssignment_renameSIdRefs(self, oldid, newid)
def renameUnitSIdRefs(self, oldid, newid):
"""
renameUnitSIdRefs(EventAssignment self, string oldid, string newid)
Replaces all uses of a given UnitSIdRef type attribute value with
another value.
In SBML, unit definitions have identifiers of type UnitSId. In SBML
Level 3, an explicit data type called UnitSIdRef was introduced for
attribute values that refer to UnitSId values; in previous Levels of
SBML, this data type did not exist and attributes were simply
described to as 'referring to a unit identifier', but the effective
data type was the same as UnitSIdRef in Level 3. These and other
methods of libSBML refer to the type UnitSIdRef for all Levels of
SBML, even if the corresponding SBML specification did not explicitly
name the data type.
This method works by looking at all unit identifier attribute values
(including, if appropriate, inside mathematical formulas), comparing
the referenced unit identifiers to the value of 'oldid'. If any
matches are found, the matching values are replaced with 'newid'. The
method does not descend into child elements.
Parameter 'oldid' is the old identifier Parameter 'newid' is the new
identifier
"""
return _libsbml.EventAssignment_renameUnitSIdRefs(self, oldid, newid)
def replaceSIDWithFunction(self, id, function):
"""
replaceSIDWithFunction(EventAssignment self, string id, ASTNode function)
Internal implementation method.
"""
return _libsbml.EventAssignment_replaceSIDWithFunction(self, id, function)
def divideAssignmentsToSIdByFunction(self, id, function):
"""
divideAssignmentsToSIdByFunction(EventAssignment self, string id, ASTNode function)
Internal implementation method.
"""
return _libsbml.EventAssignment_divideAssignmentsToSIdByFunction(self, id, function)
def multiplyAssignmentsToSIdByFunction(self, id, function):
"""
multiplyAssignmentsToSIdByFunction(EventAssignment self, string id, ASTNode function)
Internal implementation method.
"""
return _libsbml.EventAssignment_multiplyAssignmentsToSIdByFunction(self, id, function)
EventAssignment_swigregister = _libsbml.EventAssignment_swigregister
EventAssignment_swigregister(EventAssignment)
class ListOfEventAssignments(ListOf):
"""
A list of EventAssignment objects.
The various ListOf___ classes in SBML are merely containers used for
organizing the main components of an SBML model. In libSBML's
implementation, ListOf___ classes are derived from the intermediate
utility class ListOf, which is not defined by the SBML specifications
but serves as a useful programmatic construct. ListOf is itself is in
turn derived from SBase, which provides all of the various ListOf___
classes with common features defined by the SBML specification, such
as 'metaid' attributes and annotations.
The relationship between the lists and the rest of an SBML model is
illustrated by the following (for SBML Level 2 Version 4):
...
...
...
...
...
...
... elements of subclasses of Rule ...
...
...
...
Readers may wonder about the motivations for using the ListOf___
containers in SBML. A simpler approach in XML might be to place the
components all directly at the top level of the model definition. The
choice made in SBML is to group them within XML elements named after
ListOfClassname, in part because it helps organize the components.
More importantly, the fact that the container classes are derived from
SBase means that software tools can add information about the lists
themselves into each list container's 'annotation'.
See also ListOfFunctionDefinitions, ListOfUnitDefinitions,
ListOfCompartmentTypes, ListOfSpeciesTypes, ListOfCompartments,
ListOfSpecies, ListOfParameters, ListOfInitialAssignments,
ListOfRules, ListOfConstraints, ListOfReactions, ListOfEvents.
"""
__swig_setmethods__ = {}
for _s in [ListOf]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, ListOfEventAssignments, name, value)
__swig_getmethods__ = {}
for _s in [ListOf]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, ListOfEventAssignments, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(ListOfEventAssignments self, unsigned int level, unsigned int version) -> ListOfEventAssignments
__init__(ListOfEventAssignments self, SBMLNamespaces sbmlns) -> ListOfEventAssignments
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
ListOfEventAssignments(SBMLNamespaces sbmlns)
Creates a new ListOfEventAssignments object.
The object is constructed such that it is valid for the SBML Level and
Version combination determined by the SBMLNamespaces object in
'sbmlns'.
Parameter 'sbmlns' is an SBMLNamespaces object that is used to
determine the characteristics of the ListOfEventAssignments object to
be created.
______________________________________________________________________
Method variant with the following signature:
ListOfEventAssignments(long level, long version)
Creates a new ListOfEventAssignments object.
The object is constructed such that it is valid for the given SBML
Level and Version combination.
Parameter 'level' is the SBML Level
Parameter 'version' is the Version within the SBML Level
"""
this = _libsbml.new_ListOfEventAssignments(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(ListOfEventAssignments self) -> ListOfEventAssignments
Creates and returns a deep copy of this ListOfEventAssignments object.
Returns the (deep) copy of this ListOfEventAssignments object.
"""
return _libsbml.ListOfEventAssignments_clone(self)
def getItemTypeCode(self):
"""
getItemTypeCode(ListOfEventAssignments self) -> int
Returns the libSBML type code for the objects contained in this ListOf
(i.e., EventAssignment objects, if the list is non-empty).
LibSBML attaches an identifying code to every kind of SBML object.
These are integer constants known as SBML type codes. The names of
all the codes begin with the characters SBML_. In the Python language
interface for libSBML, the type codes are defined as static integer
constants in the interface class 'libsbml'. Note that different Level
3 package plug-ins may use overlapping type codes; to identify the
package to which a given object belongs, call the getPackageName()
method on the object.
Returns the SBML type code for the objects contained in this ListOf:
SBML_EVENT_ASSIGNMENT (default).
See also getElementName(), getPackageName().
"""
return _libsbml.ListOfEventAssignments_getItemTypeCode(self)
def getElementName(self):
"""
getElementName(ListOfEventAssignments self) -> string
Returns the XML element name of this object.
For ListOfEventAssignments, the XML element name is
'listOfEventAssignments'.
Returns the name of this element, i.e., 'listOfEventAssignments'.
"""
return _libsbml.ListOfEventAssignments_getElementName(self)
def get(self, *args):
"""
get(ListOfEventAssignments self, unsigned int n) -> EventAssignment
get(ListOfEventAssignments self, unsigned int n) -> EventAssignment
get(ListOfEventAssignments self, string sid) -> EventAssignment
get(ListOfEventAssignments self, string sid) -> EventAssignment
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
get(string sid)
Get a EventAssignment from the ListOfEventAssignments based on its
identifier.
Parameter 'sid' is a string representing the identifier of the
EventAssignment to get.
Returns EventAssignment in this ListOfEventAssignments with the given
'sid' or None if no such EventAssignment exists.
See also get(), size(), size().
"""
return _libsbml.ListOfEventAssignments_get(self, *args)
def remove(self, *args):
"""
remove(ListOfEventAssignments self, unsigned int n) -> EventAssignment
remove(ListOfEventAssignments self, string sid) -> EventAssignment
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
remove(string sid)
Removes item in this ListOfEventAssignments items with the given
identifier.
The caller owns the returned item and is responsible for deleting it.
If none of the items in this list have the identifier 'sid', then None
is returned.
Parameter 'sid' is the identifier of the item to remove
Returns the item removed. As mentioned above, the caller owns the
returned item.
______________________________________________________________________
Method variant with the following signature:
remove(long n)
Removes the nth item from this ListOfEventAssignments items and
returns a pointer to it.
The caller owns the returned item and is responsible for deleting it.
Parameter 'n' is the index of the item to remove
See also size().
"""
return _libsbml.ListOfEventAssignments_remove(self, *args)
def getElementBySId(self, id):
"""
getElementBySId(ListOfEventAssignments self, string id) -> SBase
Returns the first child element found that has the given 'id' in the
model-wide SId namespace, or None if no such object is found.
Note that EventAssignments do not actually have IDs, but the libsbml
interface pretends that they do: no event assignment is returned by
this function.
Parameter 'id' is string representing the id of objects to find
Returns pointer to the first element found with the given 'id'.
"""
return _libsbml.ListOfEventAssignments_getElementBySId(self, id)
__swig_destroy__ = _libsbml.delete_ListOfEventAssignments
__del__ = lambda self: None
ListOfEventAssignments_swigregister = _libsbml.ListOfEventAssignments_swigregister
ListOfEventAssignments_swigregister(ListOfEventAssignments)
class Trigger(SBase):
"""
The trigger expression for an SBML event.
An Event object defines when the event can occur, the variables that
are affected by the event, and how the variables are affected. The
Trigger construct in SBML is used to define a mathematical expression
that determines when an Event is triggered.
A Trigger object in SBML Level 2 and Level 3 contains one subelement
named 'math' containing a MathML expression. The expression must
evaluate to a value of type boolean. The exact moment at which the
expression evaluates to True is the time point when the Event is
triggered. In SBML Level 3, Trigger has additional attributes that
must be assigned values; they are discussed in a separate section
below.
An event only triggers when its Trigger expression makes the
transition in value from False to True. The event will also trigger
at any subsequent time points when the trigger makes this transition;
in other words, an event can be triggered multiple times during a
simulation if its trigger condition makes the transition from False to
True more than once. In SBML Level 3, the behavior at the very start
of simulation (i.e., at t = 0, where t stands for time) is determined
in part by the boolean flag 'initialValue'. This and other additional
features introduced in SBML Level 3 are discussed further below.
Version differences
======================================================================
SBML Level 3 Version 1 introduces two required attributes on the
Trigger object: 'persistent' and 'initialValue'. The rest of this
introduction describes these two attributes.
The 'persistent' attribute on Trigger
......................................................................
In the interval between when an Event object triggers (i.e., its
Trigger object expression transitions in value from False to True) and
when its assignments are to be executed, conditions in the model may
change such that the trigger expression transitions back from True to
False. Should the event's assignments still be made if this happens?
Answering this question is the purpose of the 'persistent' attribute
on Trigger.
If the boolean attribute 'persistent' has a value of True, then once
the event is triggered, all of its assignments are always performed
when the time of execution is reached. The name persistent is meant
to evoke the idea that the trigger expression does not have to be re-
checked after it triggers if 'persistent'=True. Conversely, if the
attribute value is False, then the trigger expression is not assumed
to persist: if the expression transitions in value back to False at
any time between when the event triggered and when it is to be
executed, the event is no longer considered to have triggered and its
assignments are not executed. (If the trigger expression transitions
once more to True after that point, then the event is triggered, but
this then constitutes a whole new event trigger-and-execute sequence.)
The 'persistent' attribute can be especially useful when Event objects
contain Delay objects, but it is relevant even in a model without
delays if the model contains two or more events. As explained in the
introduction to this section, the operation of all events in SBML
(delayed or not) is conceptually divided into two phases, triggering
and execution; however, unless events have priorities associated with
them, SBML does not mandate a particular ordering of event execution
in the case of simultaneous events. Models with multiple events can
lead to situations where the execution of one event affects another
event's trigger expression value. If that other event has
'persistent'=False, and its trigger expression evaluates to False
before it is to be executed, the event must not be executed after all.
The 'initialValue' attribute on Trigger
......................................................................
As mentioned above, an event triggers when the mathematical expression
in its Trigger object transitions in value from False to True. An
unanswered question concerns what happens at the start of a
simulation: can event triggers make this transition at t = 0, where t
stands for time?
In order to determine whether an event may trigger at t = 0, it is
necessary to know what value the Trigger object's 'math' expression
had immediately prior to t = 0. This starting value of the trigger
expression is determined by the value of the boolean attribute
'initialValue'. A value of True means the trigger expression is taken
to have the value True immediately prior to t = 0. In that case, the
trigger cannot transition in value from False to True at the moment
simulation begins (because it has the value True both before and after
t = 0), and can only make the transition from False to True sometime
after t = 0. (To do that, it would also first have to transition to
False before it could make the transition from False back to True.)
Conversely, if 'initialValue'=False, then the trigger expression is
assumed to start with the value False, and therefore may trigger at t
= 0 if the expression evaluates to True at that moment.
See also Event, Delay, EventAssignment.
"""
__swig_setmethods__ = {}
for _s in [SBase]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, Trigger, name, value)
__swig_getmethods__ = {}
for _s in [SBase]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, Trigger, name)
__repr__ = _swig_repr
__swig_destroy__ = _libsbml.delete_Trigger
__del__ = lambda self: None
def __init__(self, *args):
"""
__init__(Trigger self, unsigned int level, unsigned int version) -> Trigger
__init__(Trigger self, SBMLNamespaces sbmlns) -> Trigger
__init__(Trigger self, Trigger orig) -> Trigger
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
Trigger(SBMLNamespaces sbmlns)
Creates a new Trigger using the given SBMLNamespaces object 'sbmlns'.
The SBMLNamespaces object encapsulates SBML Level/Version/namespaces
information. It is used to communicate the SBML Level, Version, and
(in Level 3) packages used in addition to SBML Level 3 Core. A common
approach to using libSBML's SBMLNamespaces facilities is to create an
SBMLNamespaces object somewhere in a program once, then hand that
object as needed to object constructors that accept SBMLNamespaces as
arguments.
Parameter 'sbmlns' is an SBMLNamespaces object.
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
______________________________________________________________________
Method variant with the following signature:
Trigger(long level, long version)
Creates a new Trigger using the given SBML 'level' and 'version'
values.
Parameter 'level' is a long integer, the SBML Level to assign to this
Trigger
Parameter 'version' is a long integer, the SBML Version to assign to
this Trigger
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
______________________________________________________________________
Method variant with the following signature:
Trigger(Trigger orig)
Copy constructor; creates a copy of this Trigger.
Parameter 'orig' is the object to copy.
Throws SBMLConstructorException: Thrown if the argument 'orig' is
None.
"""
this = _libsbml.new_Trigger(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(Trigger self) -> Trigger
Creates and returns a deep copy of this Trigger object.
Returns the (deep) copy of this Trigger object.
"""
return _libsbml.Trigger_clone(self)
def getMath(self):
"""
getMath(Trigger self) -> ASTNode
Get the mathematical formula for the trigger and return it as an AST.
Returns the math of this Trigger.
"""
return _libsbml.Trigger_getMath(self)
def getInitialValue(self):
"""
getInitialValue(Trigger self) -> bool
(SBML Level 3 only) Get the value of the 'initialValue' attribute of
this Trigger.
Returns the boolean value stored as the 'initialValue' attribute value
in this Trigger.
Note:
The attribute 'initialValue' is available in SBML Level 3 Version 1
Core, but is not present in lower Levels of SBML.
"""
return _libsbml.Trigger_getInitialValue(self)
def getPersistent(self):
"""
getPersistent(Trigger self) -> bool
(SBML Level 3 only) Get the value of the 'persistent' attribute of
this Trigger.
Returns the boolean value stored as the 'persistent' attribute value
in this Trigger.
Note:
The attribute 'persistent' is available in SBML Level 3 Version 1
Core, but is not present in lower Levels of SBML.
"""
return _libsbml.Trigger_getPersistent(self)
def isSetMath(self):
"""
isSetMath(Trigger self) -> bool
Predicate to test whether the math for this trigger is set.
Returns True if the formula (meaning the 'math' subelement) of this
Trigger is set, False otherwise.
"""
return _libsbml.Trigger_isSetMath(self)
def isSetInitialValue(self):
"""
isSetInitialValue(Trigger self) -> bool
(SBML Level 3 only) Predicate to test whether the 'initialValue'
attribute for this trigger is set.
Returns True if the initialValue attribute of this Trigger is set,
False otherwise.
Note:
The attribute 'initialValue' is available in SBML Level 3 Version 1
Core, but is not present in lower Levels of SBML.
"""
return _libsbml.Trigger_isSetInitialValue(self)
def isSetPersistent(self):
"""
isSetPersistent(Trigger self) -> bool
(SBML Level 3 only) Predicate to test whether the 'persistent'
attribute for this trigger is set.
Returns True if the persistent attribute of this Trigger is set, False
otherwise.
Note:
The attribute 'persistent' is available in SBML Level 3 Version 1
Core, but is not present in lower Levels of SBML.
"""
return _libsbml.Trigger_isSetPersistent(self)
def setMath(self, math):
"""
setMath(Trigger self, ASTNode math) -> int
Sets the trigger expression of this Trigger instance to a copy of the
given ASTNode.
Parameter 'math' is an ASTNode representing a formula tree.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_OBJECT
"""
return _libsbml.Trigger_setMath(self, math)
def setInitialValue(self, initialValue):
"""
setInitialValue(Trigger self, bool initialValue) -> int
(SBML Level 3 only) Sets the 'initialValue' attribute of this Trigger
instance.
Parameter 'initialValue' is a boolean representing the initialValue to
be set.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_UNEXPECTED_ATTRIBUTE
Note:
The attribute 'initialValue' is available in SBML Level 3 Version 1
Core, but is not present in lower Levels of SBML.
"""
return _libsbml.Trigger_setInitialValue(self, initialValue)
def setPersistent(self, persistent):
"""
setPersistent(Trigger self, bool persistent) -> int
(SBML Level 3 only) Sets the 'persistent' attribute of this Trigger
instance.
Parameter 'persistent' is a boolean representing the persistent value
to be set.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_UNEXPECTED_ATTRIBUTE
Note:
The attribute 'persistent' is available in SBML Level 3 Version 1
Core, but is not present in lower Levels of SBML.
"""
return _libsbml.Trigger_setPersistent(self, persistent)
def getTypeCode(self):
"""
getTypeCode(Trigger self) -> int
Returns the libSBML type code of this object instance.
LibSBML attaches an identifying code to every kind of SBML object.
These are integer constants known as SBML type codes. The names of
all the codes begin with the characters SBML_. In the Python language
interface for libSBML, the type codes are defined as static integer
constants in the interface class 'libsbml'. Note that different Level
3 package plug-ins may use overlapping type codes; to identify the
package to which a given object belongs, call the getPackageName()
method on the object.
Returns the SBML type code for this object: SBML_TRIGGER (default).
WARNING:
The specific integer values of the possible type codes may be reused
by different Level 3 package plug-ins. Thus, to identifiy the correct
code, it is necessary to invoke both getTypeCode() and
getPackageName().
See also getElementName(), getPackageName().
"""
return _libsbml.Trigger_getTypeCode(self)
def getElementName(self):
"""
getElementName(Trigger self) -> string
Returns the XML element name of this object, which for Trigger, is
always 'trigger'.
Returns the name of this element, i.e., 'trigger'.
"""
return _libsbml.Trigger_getElementName(self)
def renameSIdRefs(self, oldid, newid):
"""
renameSIdRefs(Trigger self, string oldid, string newid)
Replaces all uses of a given SIdRef type attribute value with another
value.
In SBML, object identifiers are of a data type called SId. In SBML
Level 3, an explicit data type called SIdRef was introduced for
attribute values that refer to SId values; in previous Levels of SBML,
this data type did not exist and attributes were simply described to
as 'referring to an identifier', but the effective data type was the
same as SIdRefin Level 3. These and other methods of libSBML refer to
the type SIdRef for all Levels of SBML, even if the corresponding SBML
specification did not explicitly name the data type.
This method works by looking at all attributes and (if appropriate)
mathematical formulas in MathML content, comparing the referenced
identifiers to the value of 'oldid'. If any matches are found, the
matching values are replaced with 'newid'. The method does not
descend into child elements.
Parameter 'oldid' is the old identifier Parameter 'newid' is the new
identifier
"""
return _libsbml.Trigger_renameSIdRefs(self, oldid, newid)
def renameUnitSIdRefs(self, oldid, newid):
"""
renameUnitSIdRefs(Trigger self, string oldid, string newid)
Replaces all uses of a given UnitSIdRef type attribute value with
another value.
In SBML, unit definitions have identifiers of type UnitSId. In SBML
Level 3, an explicit data type called UnitSIdRef was introduced for
attribute values that refer to UnitSId values; in previous Levels of
SBML, this data type did not exist and attributes were simply
described to as 'referring to a unit identifier', but the effective
data type was the same as UnitSIdRef in Level 3. These and other
methods of libSBML refer to the type UnitSIdRef for all Levels of
SBML, even if the corresponding SBML specification did not explicitly
name the data type.
This method works by looking at all unit identifier attribute values
(including, if appropriate, inside mathematical formulas), comparing
the referenced unit identifiers to the value of 'oldid'. If any
matches are found, the matching values are replaced with 'newid'. The
method does not descend into child elements.
Parameter 'oldid' is the old identifier Parameter 'newid' is the new
identifier
"""
return _libsbml.Trigger_renameUnitSIdRefs(self, oldid, newid)
def replaceSIDWithFunction(self, id, function):
"""
replaceSIDWithFunction(Trigger self, string id, ASTNode function)
Internal implementation method.
"""
return _libsbml.Trigger_replaceSIDWithFunction(self, id, function)
def hasRequiredElements(self):
"""
hasRequiredElements(Trigger self) -> bool
Predicate returning True if all the required elements for this Trigger
object have been set.
Note:
The required elements for a Trigger object are:
* 'math'
Returns a boolean value indicating whether all the required elements
for this object have been defined.
"""
return _libsbml.Trigger_hasRequiredElements(self)
def hasRequiredAttributes(self):
"""
hasRequiredAttributes(Trigger self) -> bool
Predicate returning True if all the required attributes for this
Trigger object have been set.
The required attributes for a Trigger object are:
* 'persistent' (required in SBML Level 3)
* 'initialValue' (required in SBML Level 3)
Returns a boolean value indicating whether all the required attributes
for this object have been defined.
"""
return _libsbml.Trigger_hasRequiredAttributes(self)
def removeFromParentAndDelete(self):
"""
removeFromParentAndDelete(Trigger self) -> int
Finds this Trigger's Event parent and calls unsetTrigger() on it,
indirectly deleting itself. Overridden from the SBase function since
the parent is not a ListOf.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
"""
return _libsbml.Trigger_removeFromParentAndDelete(self)
Trigger_swigregister = _libsbml.Trigger_swigregister
Trigger_swigregister(Trigger)
class Delay(SBase):
"""
A delay on the time of execution of an SBML event.
An Event object defines when the event can occur, the variables that
are affected by the event, and how the variables are affected. The
effect of the event can optionally be delayed after the occurrence of
the condition which invokes it. An event delay is defined using an
object of class Delay.
The object class Delay is derived from SBase and adds a single
subelement called 'math'. This subelement is used to hold MathML
content. The mathematical formula represented by 'math' must evaluate
to a numerical value. It is used as the length of time between when
the event is triggered and when the event's assignments are actually
executed. If no delay is present on a given Event, a time delay of
zero is assumed.
The expression in 'math' must be evaluated at the time the event is
triggered. The expression must always evaluate to a nonnegative
number (otherwise, a nonsensical situation could arise where an event
is defined to execute before it is triggered!).
The units of the mathematical expression in a Delay
======================================================================
In SBML Level 2 versions before Version 4, the units of the numerical
value computed by the Delay's 'math' expression are required to be in
units of time, or the model is considered to have a unit consistency
error. In Level 2 Version 4 as well as SBML Level 3 Version 1 Core,
this requirement is relaxed; these specifications only stipulate that
the units of the numerical value computed by a Delay instance's 'math'
expression should match the model's units of time (meaning the
definition of the time units in the model). LibSBML respects these
requirements, and depending on whether an earlier Version of SBML
Level 2 is in use, libSBML may or may not flag unit inconsistencies as
errors or merely warnings.
Note that units are not predefined or assumed for the contents of
'math' in a Delay object; rather, they must be defined explicitly for
each instance of a Delay object in a model. This is an important
point to bear in mind when literal numbers are used in delay
expressions. For example, the following Event instance would result
in a warning logged by SBMLDocument.checkConsistency() about the fact
that libSBML cannot verify the consistency of the units of the
expression. The reason is that the formula inside the 'math' element
does not have any declared units, whereas what is expected in this
context is units of time:
...
...
1
...
...
The 1 within the mathematical formula of the delay above
has no units declared. To make the expression have the needed units
of time, literal numbers should be avoided in favor of defining
Parameter objects for each quantity, and declaring units for the
Parameter values. The following fragment of SBML illustrates this
approach:
...
...
...
transcriptionDelay
...
...
In SBML Level 3, an alternative approach is available in the form of
the units attribute, which SBML Level 3 allows to appear on MathML cn
elements. The value of this attribute can be used to indicate the
unit of measurement to be associated with the number in the content of
a cn element. The attribute is named units but, because it appears
inside MathML element (which is in the XML namespace for MathML and
not the namespace for SBML), it must always be prefixed with an XML
namespace prefix for the SBML Level 3 Version 1 namespace. The
following is an example of this approach:
...
...
10
...
...
"""
__swig_setmethods__ = {}
for _s in [SBase]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, Delay, name, value)
__swig_getmethods__ = {}
for _s in [SBase]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, Delay, name)
__repr__ = _swig_repr
__swig_destroy__ = _libsbml.delete_Delay
__del__ = lambda self: None
def __init__(self, *args):
"""
__init__(Delay self, unsigned int level, unsigned int version) -> Delay
__init__(Delay self, SBMLNamespaces sbmlns) -> Delay
__init__(Delay self, Delay orig) -> Delay
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
Delay(SBMLNamespaces sbmlns)
Creates a new Delay using the given SBMLNamespaces object 'sbmlns'.
The SBMLNamespaces object encapsulates SBML Level/Version/namespaces
information. It is used to communicate the SBML Level, Version, and
(in Level 3) packages used in addition to SBML Level 3 Core. A common
approach to using libSBML's SBMLNamespaces facilities is to create an
SBMLNamespaces object somewhere in a program once, then hand that
object as needed to object constructors that accept SBMLNamespaces as
arguments.
Parameter 'sbmlns' is an SBMLNamespaces object.
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
______________________________________________________________________
Method variant with the following signature:
Delay(long level, long version)
Creates a new Delay using the given SBML 'level' and 'version' values.
Parameter 'level' is a long integer, the SBML Level to assign to this
Delay
Parameter 'version' is a long integer, the SBML Version to assign to
this Delay
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
______________________________________________________________________
Method variant with the following signature:
Delay(Delay orig)
Copy constructor; creates a copy of this Delay.
Parameter 'orig' is the object to copy.
Throws SBMLConstructorException: Thrown if the argument 'orig' is
None.
"""
this = _libsbml.new_Delay(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(Delay self) -> Delay
Creates and returns a deep copy of this Delay object.
Returns the (deep) copy of this Delay object.
"""
return _libsbml.Delay_clone(self)
def getMath(self):
"""
getMath(Delay self) -> ASTNode
Get the mathematical formula for the delay and return it as an AST.
Returns the math of this Delay.
"""
return _libsbml.Delay_getMath(self)
def isSetMath(self):
"""
isSetMath(Delay self) -> bool
Predicate to test whether the formula for this delay is set.
Returns True if the formula (meaning the math subelement) of this
Delay is set, False otherwise.
"""
return _libsbml.Delay_isSetMath(self)
def setMath(self, math):
"""
setMath(Delay self, ASTNode math) -> int
Sets the delay expression of this Delay instance to a copy of the
given ASTNode.
Parameter 'math' is an ASTNode representing a formula tree.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_OBJECT
"""
return _libsbml.Delay_setMath(self, math)
def getDerivedUnitDefinition(self, *args):
"""
getDerivedUnitDefinition(Delay self) -> UnitDefinition
getDerivedUnitDefinition(Delay self) -> UnitDefinition
Calculates and returns a UnitDefinition that expresses the units of
measurement assumed for the 'math' expression of this Delay.
Delay elements in SBML express a time delay for an Event. Beginning
with SBML Level 2 Version 2, the units of that time are calculated
based on the mathematical expression and the model quantities
referenced by elements used within that expression. (In SBML
Level 2 Version 1, there exists an attribute on Event called
'timeUnits'. This attribute can be used to set the units of the Delay
expression explicitly.) The method Delay.getDerivedUnitDefinition()
returns what libSBML computes the units to be, to the extent that
libSBML can compute them.
Note:
The functionality that facilitates unit analysis depends on the model
as a whole. Thus, in cases where the object has not been added to a
model or the model itself is incomplete, unit analysis is not possible
and this method will return None.
WARNING:
Note that it is possible the 'math' expression in the Delay contains
literal numbers or parameters with undeclared units. In those cases,
it is not possible to calculate the units of the overall expression
without making assumptions. LibSBML does not make assumptions about
the units, and Delay.getDerivedUnitDefinition() only returns the units
as far as it is able to determine them. For example, in an expression
X + Y, if X has unambiguously-defined units and Y does not, it will
return the units of X. When using this method, it is critical that
callers also invoke the method Delay.containsUndeclaredUnits() to
determine whether this situation holds. Callers should take suitable
action in those situations.
Returns a UnitDefinition that expresses the units of the math
expression of this Delay, or None if one cannot be constructed.
See also containsUndeclaredUnits().
"""
return _libsbml.Delay_getDerivedUnitDefinition(self, *args)
def containsUndeclaredUnits(self, *args):
"""
containsUndeclaredUnits(Delay self) -> bool
containsUndeclaredUnits(Delay self) -> bool
Predicate returning True if the 'math' expression in this Delay
instance contains parameters with undeclared units or literal numbers.
Delay elements in SBML express a time delay for an Event. Beginning
with SBML Level 2 Version 2, the units of that time are calculated
based on the mathematical expression and the model quantities
referenced by elements used within that expression. (In SBML
Level 2 Version 1, there exists an attribute on Event called
'timeUnits'. This attribute can be used to set the units of the Delay
expression explicitly.) The method Delay.getDerivedUnitDefinition()
returns what libSBML computes the units to be, to the extent that
libSBML can compute them.
If the expression contains literal numbers or parameters with
undeclared units, libSBML may not be able to compute the full units of
the expression and will only return what it can compute. Callers
should always use Delay.containsUndeclaredUnits() when using
Delay.getDerivedUnitDefinition() to decide whether the returned units
may be incomplete.
Returns True if the math expression of this Delay includes
numbers/parameters with undeclared units, False otherwise.
Note:
A return value of True indicates that the UnitDefinition returned by
Delay.getDerivedUnitDefinition() may not accurately represent the
units of the expression.
See also getDerivedUnitDefinition().
"""
return _libsbml.Delay_containsUndeclaredUnits(self, *args)
def getTypeCode(self):
"""
getTypeCode(Delay self) -> int
Returns the libSBML type code of this object instance.
LibSBML attaches an identifying code to every kind of SBML object.
These are integer constants known as SBML type codes. The names of
all the codes begin with the characters SBML_. In the Python language
interface for libSBML, the type codes are defined as static integer
constants in the interface class 'libsbml'. Note that different Level
3 package plug-ins may use overlapping type codes; to identify the
package to which a given object belongs, call the getPackageName()
method on the object.
Returns the SBML type code for this object: SBML_DELAY (default).
WARNING:
The specific integer values of the possible type codes may be reused
by different Level 3 package plug-ins. Thus, to identifiy the correct
code, it is necessary to invoke both getTypeCode() and
getPackageName().
See also getElementName(), getPackageName().
"""
return _libsbml.Delay_getTypeCode(self)
def getElementName(self):
"""
getElementName(Delay self) -> string
Returns the XML element name of this object, which for Delay, is
always 'delay'.
Returns the name of this element, i.e., 'delay'.
See also getTypeCode().
"""
return _libsbml.Delay_getElementName(self)
def hasRequiredElements(self):
"""
hasRequiredElements(Delay self) -> bool
Predicate returning True if all the required elements for this Delay
object have been set.
Note:
The required elements for a Delay object are:
* 'math'
Returns a boolean value indicating whether all the required elements
for this object have been defined.
"""
return _libsbml.Delay_hasRequiredElements(self)
def removeFromParentAndDelete(self):
"""
removeFromParentAndDelete(Delay self) -> int
Finds this Delay's Event parent and calls unsetDelay() on it,
indirectly deleting itself.
Overridden from the SBase function since the parent is not a ListOf.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
"""
return _libsbml.Delay_removeFromParentAndDelete(self)
def renameSIdRefs(self, oldid, newid):
"""
renameSIdRefs(Delay self, string oldid, string newid)
Replaces all uses of a given SIdRef type attribute value with another
value.
In SBML, object identifiers are of a data type called SId. In SBML
Level 3, an explicit data type called SIdRef was introduced for
attribute values that refer to SId values; in previous Levels of SBML,
this data type did not exist and attributes were simply described to
as 'referring to an identifier', but the effective data type was the
same as SIdRefin Level 3. These and other methods of libSBML refer to
the type SIdRef for all Levels of SBML, even if the corresponding SBML
specification did not explicitly name the data type.
This method works by looking at all attributes and (if appropriate)
mathematical formulas in MathML content, comparing the referenced
identifiers to the value of 'oldid'. If any matches are found, the
matching values are replaced with 'newid'. The method does not
descend into child elements.
Parameter 'oldid' is the old identifier Parameter 'newid' is the new
identifier
"""
return _libsbml.Delay_renameSIdRefs(self, oldid, newid)
def renameUnitSIdRefs(self, oldid, newid):
"""
renameUnitSIdRefs(Delay self, string oldid, string newid)
Replaces all uses of a given UnitSIdRef type attribute value with
another value.
In SBML, unit definitions have identifiers of type UnitSId. In SBML
Level 3, an explicit data type called UnitSIdRef was introduced for
attribute values that refer to UnitSId values; in previous Levels of
SBML, this data type did not exist and attributes were simply
described to as 'referring to a unit identifier', but the effective
data type was the same as UnitSIdRef in Level 3. These and other
methods of libSBML refer to the type UnitSIdRef for all Levels of
SBML, even if the corresponding SBML specification did not explicitly
name the data type.
This method works by looking at all unit identifier attribute values
(including, if appropriate, inside mathematical formulas), comparing
the referenced unit identifiers to the value of 'oldid'. If any
matches are found, the matching values are replaced with 'newid'. The
method does not descend into child elements.
Parameter 'oldid' is the old identifier Parameter 'newid' is the new
identifier
"""
return _libsbml.Delay_renameUnitSIdRefs(self, oldid, newid)
def replaceSIDWithFunction(self, id, function):
"""
replaceSIDWithFunction(Delay self, string id, ASTNode function)
Internal implementation method.
"""
return _libsbml.Delay_replaceSIDWithFunction(self, id, function)
Delay_swigregister = _libsbml.Delay_swigregister
Delay_swigregister(Delay)
class Priority(SBase):
"""
The priority of execution of an SBML event.
The Priority object class (which was introduced in SBML Level 3
Version 1), like Delay, is derived from SBase and contains a MathML
formula stored in the element 'math'. This formula is used to compute
a dimensionless numerical value that influences the order in which a
simulator is to perform the assignments of two or more events that
happen to be executed simultaneously. The formula may evaluate to any
float value (and thus may be a positive or negative number, or zero),
with positive numbers taken to signifying a higher priority than zero
or negative numbers. If no Priority object is present on a given
Event object, no priority is defined for that event.
The interpretation of priorities on events in a model
======================================================================
For the purposes of SBML, simultaneous event execution is defined as
the situation in which multiple events have identical times of
execution. The time of execution is calculated as the sum of the time
at which a given event's Trigger is triggered plus its Delay duration,
if any. Here, identical times means mathematically equal instants in
time. (In practice, simulation software adhering to this
specification may have to rely on numerical equality instead of strict
mathematical equality; robust models will ensure that this difference
will not cause significant discrepancies from expected behavior.)
If no Priority subobjects are defined for two or more Event objects,
then those events are still executed simultaneously but their order of
execution is undefined by the SBML Level 3 Version 1 specification. A
software implementation may choose to execute such simultaneous events
in any order, as long as each event is executed only once and the
requirements of checking the 'persistent' attribute (and acting
accordingly) are satisfied.
If Priority subobjects are defined for two or more simultaneously-
triggered events, the order in which those particular events must be
executed is dictated by their Priority objects, as follows. If the
values calculated using the two Priority objects' 'math' expressions
differ, then the event having the higher priority value must be
executed before the event with the lower value. If, instead, the two
priority values are mathematically equal, then the two events must be
triggered in a random order. It is important to note that a random
order is not the same as an undefined order: given multiple runs of
the same model with identical conditions, an undefined ordering would
permit a system to execute the events in (for example) the same order
every time (according to whatever scheme may have been implemented by
the system), whereas the explicit requirement for random ordering
means that the order of execution in different simulation runs depends
on random chance. In other words, given two events A and B, a
randomly-determined order must lead to an equal chance of executing A
first or B first, every time those two events are executed
simultaneously.
A model may contain a mixture of events, some of which have Priority
subobjects and some do not. Should a combination of simultaneous
events arise in which some events have priorities defined and others
do not, the set of events with defined priorities must trigger in the
order determined by their Priority objects, and the set of events
without Priority objects must be executed in an undefined order with
respect to each other and with respect to the events with Priority
subobjects. (Note that undefined order does not necessarily mean
random order, although a random ordering would be a valid
implementation of this requirement.)
The following example may help further clarify these points. Suppose a
model contains four events that should be executed simultaneously,
with two of the events having Priority objects with the same value and
the other two events having Priority objects with the same, but
different, value. The two events with the higher priorities must be
executed first, in a random order with respect to each other, and the
remaining two events must be executed after them, again in a random
order, for a total of four possible and equally-likely event
executions: A-B-C-D, A-B-D-C, B-A-C-D, and B-A-D-C. If, instead, the
model contains four events all having the same Priority values, there
are 4! or 24 possible orderings, each of which must be equally likely
to be chosen. Finally, if none of the four events has a Priority
subobject defined, or even if exactly one of the four events has a
defined Priority, there are again 24 possible orderings, but the
likelihood of choosing any particular ordering is undefined; the
simulator can choose between events as it wishes. (The SBML
specification only defines the effects of priorities on Event objects
with respect to other Event objects with priorities. Putting a
priority on a single Event object in a model does not cause it to fall
within that scope.)
Evaluation of Priority expressions
======================================================================
An event's Priority object 'math' expression must be evaluated at the
time the Event is to be executed. During a simulation, all
simultaneous events have their Priority values calculated, and the
event with the highest priority is selected for next execution. Note
that it is possible for the execution of one Event object to cause the
Priority value of another simultaneously-executing Event object to
change (as well as to trigger other events, as already noted). Thus,
after executing one event, and checking whether any other events in
the model have been triggered, all remaining simultaneous events that
either (i) have Trigger objects with attributes 'persistent'=False or
(ii) have Trigger expressions that did not transition from True to
False, must have their Priority expression reevaluated. The highest-
priority remaining event must then be selected for execution next.
Units of Priority object's mathematical expressions
======================================================================
The unit associated with the value of a Priority object's 'math'
expression should be dimensionless. This is because the priority
expression only serves to provide a relative ordering between
different events, and only has meaning with respect to other Priority
object expressions. The value of Priority objects is not comparable
to any other kind of object in an SBML model.
Note:
The Priority construct exists only in SBML Level 3; it cannot be used
in SBML Level 2 or Level 1 models.
See also Event, Delay, EventAssignment.
"""
__swig_setmethods__ = {}
for _s in [SBase]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, Priority, name, value)
__swig_getmethods__ = {}
for _s in [SBase]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, Priority, name)
__repr__ = _swig_repr
__swig_destroy__ = _libsbml.delete_Priority
__del__ = lambda self: None
def __init__(self, *args):
"""
__init__(Priority self, unsigned int level, unsigned int version) -> Priority
__init__(Priority self, SBMLNamespaces sbmlns) -> Priority
__init__(Priority self, Priority orig) -> Priority
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
Priority(SBMLNamespaces sbmlns)
Creates a new Priority object using the given SBMLNamespaces object
'sbmlns'.
The SBMLNamespaces object encapsulates SBML Level/Version/namespaces
information. It is used to communicate the SBML Level, Version, and
(in Level 3) packages used in addition to SBML Level 3 Core. A common
approach to using libSBML's SBMLNamespaces facilities is to create an
SBMLNamespaces object somewhere in a program once, then hand that
object as needed to object constructors that accept SBMLNamespaces as
arguments.
Parameter 'sbmlns' is an SBMLNamespaces object.
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
Note:
The Priority construct exists only in SBML Level 3; it cannot be used
in SBML Level 2 or Level 1 models.
______________________________________________________________________
Method variant with the following signature:
Priority(long level, long version)
Creates a new Priority object using the given SBML 'level' and
'version' values.
Parameter 'level' is a long integer, the SBML Level to assign to this
Priority
Parameter 'version' is a long integer, the SBML Version to assign to
this Priority
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
Note:
The Priority construct exists only in SBML Level 3; it cannot be used
in SBML Level 2 or Level 1 models.
______________________________________________________________________
Method variant with the following signature:
Priority(Priority orig)
Copy constructor; creates a copy of this Priority.
Parameter 'orig' is the object to copy.
Throws SBMLConstructorException: Thrown if the argument 'orig' is
None.
"""
this = _libsbml.new_Priority(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(Priority self) -> Priority
Creates and returns a deep copy of this Priority object.
Returns the (deep) copy of this Priority object.
"""
return _libsbml.Priority_clone(self)
def getMath(self):
"""
getMath(Priority self) -> ASTNode
Get the mathematical formula for the priority and return it as an AST.
Returns the math of this Priority.
"""
return _libsbml.Priority_getMath(self)
def isSetMath(self):
"""
isSetMath(Priority self) -> bool
Predicate to test whether the formula for this delay is set.
Returns True if the formula (meaning the math subelement) of this
Priority is set, False otherwise.
"""
return _libsbml.Priority_isSetMath(self)
def setMath(self, math):
"""
setMath(Priority self, ASTNode math) -> int
Sets the math expression of this Priority instance to a copy of the
given ASTNode.
Parameter 'math' is an ASTNode representing a formula tree.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_OBJECT
"""
return _libsbml.Priority_setMath(self, math)
def getTypeCode(self):
"""
getTypeCode(Priority self) -> int
Returns the libSBML type code of this object instance.
LibSBML attaches an identifying code to every kind of SBML object.
These are integer constants known as SBML type codes. The names of
all the codes begin with the characters SBML_. In the Python language
interface for libSBML, the type codes are defined as static integer
constants in the interface class 'libsbml'. Note that different Level
3 package plug-ins may use overlapping type codes; to identify the
package to which a given object belongs, call the getPackageName()
method on the object.
Returns the SBML type code for this object: SBML_PRIORITY (default).
WARNING:
The specific integer values of the possible type codes may be reused
by different Level 3 package plug-ins. Thus, to identifiy the correct
code, it is necessary to invoke both getTypeCode() and
getPackageName().
See also getElementName(), getPackageName().
"""
return _libsbml.Priority_getTypeCode(self)
def getElementName(self):
"""
getElementName(Priority self) -> string
Returns the XML element name of this object, which for Priority, is
always 'priority'.
Returns the name of this element, i.e., 'priority'.
See also getTypeCode().
"""
return _libsbml.Priority_getElementName(self)
def hasRequiredElements(self):
"""
hasRequiredElements(Priority self) -> bool
Predicate returning True if all the required elements for this
Priority object have been set.
Note:
The required elements for a Priority object are:
* 'math'
Returns a boolean value indicating whether all the required elements
for this object have been defined.
"""
return _libsbml.Priority_hasRequiredElements(self)
def removeFromParentAndDelete(self):
"""
removeFromParentAndDelete(Priority self) -> int
Finds this Priority's Event parent and calls unsetPriority() on it,
indirectly deleting itself.
Overridden from the SBase function since the parent is not a ListOf.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
"""
return _libsbml.Priority_removeFromParentAndDelete(self)
def renameSIdRefs(self, oldid, newid):
"""
renameSIdRefs(Priority self, string oldid, string newid)
Replaces all uses of a given SIdRef type attribute value with another
value.
In SBML, object identifiers are of a data type called SId. In SBML
Level 3, an explicit data type called SIdRef was introduced for
attribute values that refer to SId values; in previous Levels of SBML,
this data type did not exist and attributes were simply described to
as 'referring to an identifier', but the effective data type was the
same as SIdRefin Level 3. These and other methods of libSBML refer to
the type SIdRef for all Levels of SBML, even if the corresponding SBML
specification did not explicitly name the data type.
This method works by looking at all attributes and (if appropriate)
mathematical formulas in MathML content, comparing the referenced
identifiers to the value of 'oldid'. If any matches are found, the
matching values are replaced with 'newid'. The method does not
descend into child elements.
Parameter 'oldid' is the old identifier Parameter 'newid' is the new
identifier
"""
return _libsbml.Priority_renameSIdRefs(self, oldid, newid)
def renameUnitSIdRefs(self, oldid, newid):
"""
renameUnitSIdRefs(Priority self, string oldid, string newid)
Replaces all uses of a given UnitSIdRef type attribute value with
another value.
In SBML, unit definitions have identifiers of type UnitSId. In SBML
Level 3, an explicit data type called UnitSIdRef was introduced for
attribute values that refer to UnitSId values; in previous Levels of
SBML, this data type did not exist and attributes were simply
described to as 'referring to a unit identifier', but the effective
data type was the same as UnitSIdRef in Level 3. These and other
methods of libSBML refer to the type UnitSIdRef for all Levels of
SBML, even if the corresponding SBML specification did not explicitly
name the data type.
This method works by looking at all unit identifier attribute values
(including, if appropriate, inside mathematical formulas), comparing
the referenced unit identifiers to the value of 'oldid'. If any
matches are found, the matching values are replaced with 'newid'. The
method does not descend into child elements.
Parameter 'oldid' is the old identifier Parameter 'newid' is the new
identifier
"""
return _libsbml.Priority_renameUnitSIdRefs(self, oldid, newid)
def replaceSIDWithFunction(self, id, function):
"""
replaceSIDWithFunction(Priority self, string id, ASTNode function)
Internal implementation method.
"""
return _libsbml.Priority_replaceSIDWithFunction(self, id, function)
Priority_swigregister = _libsbml.Priority_swigregister
Priority_swigregister(Priority)
class SBO(_object):
"""
Facilities for using the Systems Biology Ontology.
The values of 'id' attributes on SBML components allow the components
to be cross-referenced within a model. The values of 'name' attributes
on SBML components provide the opportunity to assign them meaningful
labels suitable for display to humans. The specific identifiers and
labels used in a model necessarily must be unrestricted by SBML, so
that software and users are free to pick whatever they need. However,
this freedom makes it more difficult for software tools to determine,
without additional human intervention, the semantics of models more
precisely than the semantics provided by the SBML object classes
defined in other sections of this document. For example, there is
nothing inherent in a parameter with identifier k that would indicate
to a software tool it is a first-order rate constant (if that's what k
happened to be in some given model). However, one may need to convert
a model between different representations (e.g., Henri-Michaelis-
Menten versus elementary steps), or to use it with different modeling
approaches (discrete or continuous). One may also need to relate the
model components with other description formats such as SBGN
(http://www.sbgn.org/) using deeper semantics. Although an advanced
software tool might be able to deduce the semantics of some model
components through detailed analysis of the kinetic rate expressions
and other parts of the model, this quickly becomes infeasible for any
but the simplest of models.
An approach to solving this problem is to associate model components
with terms from carefully curated controlled vocabularies (CVs). This
is the purpose of the optional 'sboTerm' attribute provided on the
SBML class SBase. The 'sboTerm' attribute always refers to terms
belonging to the Systems Biology Ontology (SBO).
Use of SBO
======================================================================
Labeling model components with terms from shared controlled
vocabularies allows a software tool to identify each component using
identifiers that are not tool-specific. An example of where this is
useful is the desire by many software developers to provide users with
meaningful names for reaction rate equations. Software tools with
editing interfaces frequently provide these names in menus or lists of
choices for users. However, without a standardized set of names or
identifiers shared between developers, a given software package cannot
reliably interpret the names or identifiers of reactions used in
models written by other tools.
The first solution that might come to mind is to stipulate that
certain common reactions always have the same name (e.g., 'Michaelis-
Menten'), but this is simply impossible to do: not only do humans
often disagree on the names themselves, but it would not allow for
correction of errors or updates to the list of predefined names except
by issuing new releases of the SBML specification---to say nothing of
many other limitations with this approach. Moreover, the parameters
and variables that appear in rate expressions also need to be
identified in a way that software tools can interpret mechanically,
implying that the names of these entities would also need to be
regulated.
The Systems Biology Ontology (SBO) provides terms for identifying most
elements of SBML. The relationship implied by an 'sboTerm' on an SBML
model component is is-a between the characteristic of the component
meant to be described by SBO on this element and the SBO term
identified by the value of the 'sboTerm'. By adding SBO term
references on the components of a model, a software tool can provide
additional details using independent, shared vocabularies that can
enable other software tools to recognize precisely what the component
is meant to be. Those tools can then act on that information. For
example, if the SBO identifier 'SBO:0000049' is assigned to the
concept of 'first-order irreversible mass-action kinetics, continuous
framework', and a given KineticLaw object in a model has an 'sboTerm'
attribute with this value, then regardless of the identifier and name
given to the reaction itself, a software tool could use this to inform
users that the reaction is a first-order irreversible mass-action
reaction. This kind of reverse engineering of the meaning of
reactions in a model would be difficult to do otherwise, especially
for more complex reaction types.
The presence of SBO labels on Compartment, Species, and Reaction
objects in SBML can help map those entities to equivalent concepts in
other standards, such as (but not limited to) BioPAX
(http://www.biopax.org/), PSI-MI (http://www.psidev.info), or the
Systems Biology Graphical Notation (SBGN, http://www.sbgn.org/). Such
mappings can be used in conversion procedures, or to build interfaces,
with SBO becoming a kind of 'glue' between standards of
representation.
The presence of the label on a kinetic expression can also allow
software tools to make more intelligent decisions about reaction rate
expressions. For example, an application could recognize certain
types of reaction formulas as being ones it knows how to solve with
optimized procedures. The application could then use internal,
optimized code implementing the rate formula indexed by identifiers
such as 'SBO:0000049' appearing in SBML models.
Finally, SBO labels may be very valuable when it comes to model
integration, by helping identify interfaces, convert mathematical
expressions and parameters etc.
Although the use of SBO can be beneficial, it is critical to keep in
mind that the presence of an 'sboTerm' value on an object must not
change the fundamental mathematical meaning of the model. An SBML
model must be defined such that it stands on its own and does not
depend on additional information added by SBO terms for a correct
mathematical interpretation. SBO term definitions will not imply any
alternative mathematical semantics for any SBML object labeled with
that term. Two important reasons motivate this principle. First, it
would be too limiting to require all software tools to be able to
understand the SBO vocabularies in addition to understanding SBML.
Supporting SBO is not only additional work for the software developer;
for some kinds of applications, it may not make sense. If SBO terms
on a model are optional, it follows that the SBML model must remain
unambiguous and fully interpretable without them, because an
application reading the model may ignore the terms. Second, we
believe allowing the use of 'sboTerm' to alter the mathematical
meaning of a model would allow too much leeway to shoehorn
inconsistent concepts into SBML objects, ultimately reducing the
interoperability of the models.
Relationships between SBO and SBML
======================================================================
The goal of SBO labeling for SBML is to clarify to the fullest extent
possible the nature of each element in a model. The approach taken in
SBO begins with a hierarchically-structured set of controlled
vocabularies with six main divisions: (1) entity, (2) participant
role, (3) quantitative parameter, (4) modeling framework, (5)
mathematical expression, and (6) interaction. The web site for SBO
(http://biomodels.net) should be consulted for the current version of
the ontology.
The Systems Biology Ontology (SBO) is not part of SBML; it is being
developed separately, to allow the modeling community to evolve the
ontology independently of SBML. However, the terms in the ontology
are being designed keeping SBML components in mind, and are classified
into subsets that can be directly related with SBML components such as
reaction rate expressions, parameters, and others. The use of
'sboTerm' attributes is optional, and the presence of 'sboTerm' on an
element does not change the way the model is interpreted. Annotating
SBML elements with SBO terms adds additional semantic information that
may be used to convert the model into another model, or another
format. Although SBO support provides an important source of
information to understand the meaning of a model, software does not
need to support 'sboTerm' to be considered SBML-compliant.
"""
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, SBO, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, SBO, name)
__repr__ = _swig_repr
def isQuantitativeParameter(term):
"""
isQuantitativeParameter(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'quantiative parameter', False
otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isQuantitativeParameter(term)
if _newclass:
isQuantitativeParameter = staticmethod(isQuantitativeParameter)
__swig_getmethods__["isQuantitativeParameter"] = lambda x: isQuantitativeParameter
def isParticipantRole(term):
"""
isParticipantRole(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'participant role', False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isParticipantRole(term)
if _newclass:
isParticipantRole = staticmethod(isParticipantRole)
__swig_getmethods__["isParticipantRole"] = lambda x: isParticipantRole
def isModellingFramework(term):
"""
isModellingFramework(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'modeling framework', False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isModellingFramework(term)
if _newclass:
isModellingFramework = staticmethod(isModellingFramework)
__swig_getmethods__["isModellingFramework"] = lambda x: isModellingFramework
def isMathematicalExpression(term):
"""
isMathematicalExpression(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'mathematical expression', False
otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isMathematicalExpression(term)
if _newclass:
isMathematicalExpression = staticmethod(isMathematicalExpression)
__swig_getmethods__["isMathematicalExpression"] = lambda x: isMathematicalExpression
def isKineticConstant(term):
"""
isKineticConstant(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'kinetic constant', False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isKineticConstant(term)
if _newclass:
isKineticConstant = staticmethod(isKineticConstant)
__swig_getmethods__["isKineticConstant"] = lambda x: isKineticConstant
def isReactant(term):
"""
isReactant(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'reactant', False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isReactant(term)
if _newclass:
isReactant = staticmethod(isReactant)
__swig_getmethods__["isReactant"] = lambda x: isReactant
def isProduct(term):
"""
isProduct(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'product', False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isProduct(term)
if _newclass:
isProduct = staticmethod(isProduct)
__swig_getmethods__["isProduct"] = lambda x: isProduct
def isModifier(term):
"""
isModifier(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'modifier', False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isModifier(term)
if _newclass:
isModifier = staticmethod(isModifier)
__swig_getmethods__["isModifier"] = lambda x: isModifier
def isRateLaw(term):
"""
isRateLaw(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'rate law', False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isRateLaw(term)
if _newclass:
isRateLaw = staticmethod(isRateLaw)
__swig_getmethods__["isRateLaw"] = lambda x: isRateLaw
def isEvent(term):
"""
isEvent(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'event', False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isEvent(term)
if _newclass:
isEvent = staticmethod(isEvent)
__swig_getmethods__["isEvent"] = lambda x: isEvent
def isPhysicalParticipant(term):
"""
isPhysicalParticipant(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'physical participant, False
otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isPhysicalParticipant(term)
if _newclass:
isPhysicalParticipant = staticmethod(isPhysicalParticipant)
__swig_getmethods__["isPhysicalParticipant"] = lambda x: isPhysicalParticipant
def isParticipant(term):
"""
isParticipant(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'participant', False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isParticipant(term)
if _newclass:
isParticipant = staticmethod(isParticipant)
__swig_getmethods__["isParticipant"] = lambda x: isParticipant
def isInteraction(term):
"""
isInteraction(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'interaction', False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isInteraction(term)
if _newclass:
isInteraction = staticmethod(isInteraction)
__swig_getmethods__["isInteraction"] = lambda x: isInteraction
def isEntity(term):
"""
isEntity(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'entity', False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isEntity(term)
if _newclass:
isEntity = staticmethod(isEntity)
__swig_getmethods__["isEntity"] = lambda x: isEntity
def isFunctionalEntity(term):
"""
isFunctionalEntity(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'functional entity', False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isFunctionalEntity(term)
if _newclass:
isFunctionalEntity = staticmethod(isFunctionalEntity)
__swig_getmethods__["isFunctionalEntity"] = lambda x: isFunctionalEntity
def isMaterialEntity(term):
"""
isMaterialEntity(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'material entity', False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isMaterialEntity(term)
if _newclass:
isMaterialEntity = staticmethod(isMaterialEntity)
__swig_getmethods__["isMaterialEntity"] = lambda x: isMaterialEntity
def isConservationLaw(term):
"""
isConservationLaw(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'conservation law', False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isConservationLaw(term)
if _newclass:
isConservationLaw = staticmethod(isConservationLaw)
__swig_getmethods__["isConservationLaw"] = lambda x: isConservationLaw
def isSteadyStateExpression(term):
"""
isSteadyStateExpression(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'steady state expression', False
otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isSteadyStateExpression(term)
if _newclass:
isSteadyStateExpression = staticmethod(isSteadyStateExpression)
__swig_getmethods__["isSteadyStateExpression"] = lambda x: isSteadyStateExpression
def isFunctionalCompartment(term):
"""
isFunctionalCompartment(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'functional compartment', False
otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isFunctionalCompartment(term)
if _newclass:
isFunctionalCompartment = staticmethod(isFunctionalCompartment)
__swig_getmethods__["isFunctionalCompartment"] = lambda x: isFunctionalCompartment
def isContinuousFramework(term):
"""
isContinuousFramework(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'continuous framework', False
otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isContinuousFramework(term)
if _newclass:
isContinuousFramework = staticmethod(isContinuousFramework)
__swig_getmethods__["isContinuousFramework"] = lambda x: isContinuousFramework
def isDiscreteFramework(term):
"""
isDiscreteFramework(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'discrete framework', False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isDiscreteFramework(term)
if _newclass:
isDiscreteFramework = staticmethod(isDiscreteFramework)
__swig_getmethods__["isDiscreteFramework"] = lambda x: isDiscreteFramework
def isLogicalFramework(term):
"""
isLogicalFramework(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'logical framework', False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isLogicalFramework(term)
if _newclass:
isLogicalFramework = staticmethod(isLogicalFramework)
__swig_getmethods__["isLogicalFramework"] = lambda x: isLogicalFramework
def isMetadataRepresentation(term):
"""
isMetadataRepresentation(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'metadata representation', False
otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isMetadataRepresentation(term)
if _newclass:
isMetadataRepresentation = staticmethod(isMetadataRepresentation)
__swig_getmethods__["isMetadataRepresentation"] = lambda x: isMetadataRepresentation
def isOccurringEntityRepresentation(term):
"""
isOccurringEntityRepresentation(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'occurring entity representation',
False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isOccurringEntityRepresentation(term)
if _newclass:
isOccurringEntityRepresentation = staticmethod(isOccurringEntityRepresentation)
__swig_getmethods__["isOccurringEntityRepresentation"] = lambda x: isOccurringEntityRepresentation
def isPhysicalEntityRepresentation(term):
"""
isPhysicalEntityRepresentation(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'physical entity representation',
False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isPhysicalEntityRepresentation(term)
if _newclass:
isPhysicalEntityRepresentation = staticmethod(isPhysicalEntityRepresentation)
__swig_getmethods__["isPhysicalEntityRepresentation"] = lambda x: isPhysicalEntityRepresentation
def isSystemsDescriptionParameter(term):
"""
isSystemsDescriptionParameter(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'systems description parameter', False
otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isSystemsDescriptionParameter(term)
if _newclass:
isSystemsDescriptionParameter = staticmethod(isSystemsDescriptionParameter)
__swig_getmethods__["isSystemsDescriptionParameter"] = lambda x: isSystemsDescriptionParameter
def isObselete(term):
"""
isObselete(unsigned int term) -> bool
Predicate for checking whether the given term is obsolete.
Returns True if 'term' is-a SBO 'obsolete' term, False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isObselete(term)
if _newclass:
isObselete = staticmethod(isObselete)
__swig_getmethods__["isObselete"] = lambda x: isObselete
def intToString(sboTerm):
"""
intToString(int sboTerm) -> string
Returns the integer as a correctly formatted SBO identifier string.
Returns the given integer sboTerm as a zero-padded seven digit string.
Note:
If the sboTerm is not in the correct range (0000000-9999999), an empty
string is returned.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_intToString(sboTerm)
if _newclass:
intToString = staticmethod(intToString)
__swig_getmethods__["intToString"] = lambda x: intToString
def stringToInt(sboTerm):
"""
stringToInt(string sboTerm) -> int
Returns the string as a correctly formatted SBO integer portion.
Returns the given string sboTerm as an integer. If the sboTerm is not
in the correct format (a zero-padded, seven digit string), -1 is
returned.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_stringToInt(sboTerm)
if _newclass:
stringToInt = staticmethod(stringToInt)
__swig_getmethods__["stringToInt"] = lambda x: stringToInt
def checkTerm(*args):
"""
checkTerm(string sboTerm) -> bool
checkTerm(int sboTerm) -> bool
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
checkTerm(string sboTerm)
Checks the format of the given SBO identifier string.
Returns True if sboTerm is in the correct format (a zero-padded, seven
digit string), False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
______________________________________________________________________
Method variant with the following signature:
checkTerm(int sboTerm)
Checks the format of the given SBO identifier, given in the form of
the integer portion alone.
Returns True if sboTerm is in the range (0000000-9999999), False
otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_checkTerm(*args)
if _newclass:
checkTerm = staticmethod(checkTerm)
__swig_getmethods__["checkTerm"] = lambda x: checkTerm
def __init__(self):
"""
__init__(SBO self) -> SBO
@internal
"""
this = _libsbml.new_SBO()
try:
self.this.append(this)
except:
self.this = this
__swig_destroy__ = _libsbml.delete_SBO
__del__ = lambda self: None
SBO_swigregister = _libsbml.SBO_swigregister
SBO_swigregister(SBO)
def SBO_isQuantitativeParameter(term):
"""
SBO_isQuantitativeParameter(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'quantiative parameter', False
otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isQuantitativeParameter(term)
def SBO_isParticipantRole(term):
"""
SBO_isParticipantRole(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'participant role', False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isParticipantRole(term)
def SBO_isModellingFramework(term):
"""
SBO_isModellingFramework(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'modeling framework', False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isModellingFramework(term)
def SBO_isMathematicalExpression(term):
"""
SBO_isMathematicalExpression(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'mathematical expression', False
otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isMathematicalExpression(term)
def SBO_isKineticConstant(term):
"""
SBO_isKineticConstant(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'kinetic constant', False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isKineticConstant(term)
def SBO_isReactant(term):
"""
SBO_isReactant(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'reactant', False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isReactant(term)
def SBO_isProduct(term):
"""
SBO_isProduct(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'product', False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isProduct(term)
def SBO_isModifier(term):
"""
SBO_isModifier(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'modifier', False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isModifier(term)
def SBO_isRateLaw(term):
"""
SBO_isRateLaw(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'rate law', False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isRateLaw(term)
def SBO_isEvent(term):
"""
SBO_isEvent(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'event', False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isEvent(term)
def SBO_isPhysicalParticipant(term):
"""
SBO_isPhysicalParticipant(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'physical participant, False
otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isPhysicalParticipant(term)
def SBO_isParticipant(term):
"""
SBO_isParticipant(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'participant', False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isParticipant(term)
def SBO_isInteraction(term):
"""
SBO_isInteraction(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'interaction', False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isInteraction(term)
def SBO_isEntity(term):
"""
SBO_isEntity(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'entity', False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isEntity(term)
def SBO_isFunctionalEntity(term):
"""
SBO_isFunctionalEntity(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'functional entity', False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isFunctionalEntity(term)
def SBO_isMaterialEntity(term):
"""
SBO_isMaterialEntity(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'material entity', False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isMaterialEntity(term)
def SBO_isConservationLaw(term):
"""
SBO_isConservationLaw(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'conservation law', False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isConservationLaw(term)
def SBO_isSteadyStateExpression(term):
"""
SBO_isSteadyStateExpression(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'steady state expression', False
otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isSteadyStateExpression(term)
def SBO_isFunctionalCompartment(term):
"""
SBO_isFunctionalCompartment(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'functional compartment', False
otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isFunctionalCompartment(term)
def SBO_isContinuousFramework(term):
"""
SBO_isContinuousFramework(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'continuous framework', False
otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isContinuousFramework(term)
def SBO_isDiscreteFramework(term):
"""
SBO_isDiscreteFramework(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'discrete framework', False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isDiscreteFramework(term)
def SBO_isLogicalFramework(term):
"""
SBO_isLogicalFramework(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'logical framework', False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isLogicalFramework(term)
def SBO_isMetadataRepresentation(term):
"""
SBO_isMetadataRepresentation(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'metadata representation', False
otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isMetadataRepresentation(term)
def SBO_isOccurringEntityRepresentation(term):
"""
SBO_isOccurringEntityRepresentation(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'occurring entity representation',
False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isOccurringEntityRepresentation(term)
def SBO_isPhysicalEntityRepresentation(term):
"""
SBO_isPhysicalEntityRepresentation(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'physical entity representation',
False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isPhysicalEntityRepresentation(term)
def SBO_isSystemsDescriptionParameter(term):
"""
SBO_isSystemsDescriptionParameter(unsigned int term) -> bool
Returns True if the given term identifier comes from the stated branch
of SBO.
Returns True if 'term' is-a SBO 'systems description parameter', False
otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isSystemsDescriptionParameter(term)
def SBO_isObselete(term):
"""
SBO_isObselete(unsigned int term) -> bool
Predicate for checking whether the given term is obsolete.
Returns True if 'term' is-a SBO 'obsolete' term, False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_isObselete(term)
def SBO_intToString(sboTerm):
"""
SBO_intToString(int sboTerm) -> string
Returns the integer as a correctly formatted SBO identifier string.
Returns the given integer sboTerm as a zero-padded seven digit string.
Note:
If the sboTerm is not in the correct range (0000000-9999999), an empty
string is returned.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_intToString(sboTerm)
def SBO_stringToInt(sboTerm):
"""
SBO_stringToInt(string sboTerm) -> int
Returns the string as a correctly formatted SBO integer portion.
Returns the given string sboTerm as an integer. If the sboTerm is not
in the correct format (a zero-padded, seven digit string), -1 is
returned.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_stringToInt(sboTerm)
def SBO_checkTerm(*args):
"""
checkTerm(string sboTerm) -> bool
SBO_checkTerm(int sboTerm) -> bool
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
checkTerm(string sboTerm)
Checks the format of the given SBO identifier string.
Returns True if sboTerm is in the correct format (a zero-padded, seven
digit string), False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
______________________________________________________________________
Method variant with the following signature:
checkTerm(int sboTerm)
Checks the format of the given SBO identifier, given in the form of
the integer portion alone.
Returns True if sboTerm is in the range (0000000-9999999), False
otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBO_checkTerm(*args)
class SyntaxChecker(_object):
"""
Methods for checking the validity of SBML identifiers.
This utility class provides static methods for checking the syntax of
identifiers and other text used in an SBML model. The methods allow
callers to verify that strings such as SBML identifiers and XHTML
notes text conform to the SBML specifications.
"""
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, SyntaxChecker, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, SyntaxChecker, name)
__repr__ = _swig_repr
def isValidSBMLSId(sid):
"""
isValidSBMLSId(string sid) -> bool
Returns true True or False depending on whether the argument string
conforms to the syntax of SBML identifiers.
In SBML, identifiers that are the values of 'id' attributes on
objects must conform to a data type called SId in the SBML
specifications. LibSBML does not provide an explicit SId data type;
it uses ordinary character strings, which is easier for applications
to support. (LibSBML does, however, test for identifier validity at
various times, such as when reading in models from files and data
streams.)
This method provides programs with the ability to test explicitly that
the identifier strings they create conform to the SBML identifier
syntax.
Parameter 'sid' is string to be checked for conformance to SBML
identifier syntax.
Returns True if the string conforms to type SBML data type SId, False
otherwise.
SBML has strict requirements for the syntax of identifiers, that is,
the values of the 'id' attribute present on most types of SBML
objects. The following is a summary of the definition of the SBML
identifier type SId, which defines the permitted syntax of
identifiers. We express the syntax using an extended form of BNF
notation:
letter ::= 'a'..'z','A'..'Z'
digit ::= '0'..'9'
idChar ::= letter | digit | '_'
SId ::= ( letter | '_' ) idChar*
The characters ( and ) are used for grouping, the character * 'zero or
more times', and the character | indicates logical 'or'. The equality
of SBML identifiers is determined by an exact character sequence
match; i.e., comparisons must be performed in a case-sensitive manner.
In addition, there are a few conditions for the uniqueness of
identifiers in an SBML model. Please consult the SBML specifications
for the exact details of the uniqueness requirements.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
See also SyntaxChecker.isValidUnitSId() , SyntaxChecker.isValidXMLID()
.
"""
return _libsbml.SyntaxChecker_isValidSBMLSId(sid)
if _newclass:
isValidSBMLSId = staticmethod(isValidSBMLSId)
__swig_getmethods__["isValidSBMLSId"] = lambda x: isValidSBMLSId
def isValidXMLID(id):
"""
isValidXMLID(string id) -> bool
Returns True or False depending on whether the argument string
conforms to the XML data type ID.
The optional attribute named 'metaid', present on every major SBML
component type, is for supporting metadata annotations using RDF
(Resource Description Format). The attribute value has the data type
XML ID, the XML identifier type, which means each 'metaid' value must
be globally unique within an SBML file. The latter point is
important, because the uniqueness criterion applies across any
attribute with type ID anywhere in the file, not just the 'metaid'
attribute used by SBML---something to be aware of if your application-
specific XML content inside the 'annotation' subelement happens to use
the XML ID type. Although SBML itself specifies the use of XML ID
only for the 'metaid' attribute, SBML-compatible applications should
be careful if they use XML ID's in XML portions of a model that are
not defined by SBML, such as in the application-specific content of
the 'annotation' subelement. Finally, note that LibSBML does not
provide an explicit XML ID data type; it uses ordinary character
strings, which is easier for applications to support.
This method provides programs with the ability to test explicitly that
the identifier strings they create conform to the SBML identifier
syntax.
Parameter 'id' is string to be checked for conformance to the syntax
of XML ID.
Returns True if the string is a syntactically-valid value for the XML
type ID, False otherwise.
Note:
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
See also SyntaxChecker.isValidSBMLSId() ,
SyntaxChecker.isValidUnitSId() .
"""
return _libsbml.SyntaxChecker_isValidXMLID(id)
if _newclass:
isValidXMLID = staticmethod(isValidXMLID)
__swig_getmethods__["isValidXMLID"] = lambda x: isValidXMLID
def isValidXMLanyURI(uri):
"""
isValidXMLanyURI(string uri) -> bool
Returns True or False depending on whether the 'uri' argument string
conforms to the XML data type anyURI.
Type anyURI is defined by XML Schema 1.0. It is a character string
data type whose values are interpretable as URIs (Universal Resource
Identifiers) as described by the W3C document RFC 3986. LibSBML does
not provide an explicit XML anyURI data type; it uses ordinary
character strings, which is easier for applications to support.
LibSBML does, however, test for anyURI validity at various times, such
as when reading in models from files and data streams.
This method provides programs with the ability to test explicitly that
the strings they create conform to the XML anyURI syntax.
Parameter 'uri' is string to be checked for conformance to the syntax
of anyURI.
Returns True if the string is a syntactically-valid value for the XML
type anyURI, False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SyntaxChecker_isValidXMLanyURI(uri)
if _newclass:
isValidXMLanyURI = staticmethod(isValidXMLanyURI)
__swig_getmethods__["isValidXMLanyURI"] = lambda x: isValidXMLanyURI
def isValidUnitSId(units):
"""
isValidUnitSId(string units) -> bool
Returns True or False depending on whether the argument string
conforms to the syntax of SBML unit identifiers.
In SBML, the identifiers of units (of both the predefined units and
user-defined units) must conform to a data type called UnitSId in the
SBML specifications. LibSBML does not provide an explicit UnitSId
data type; it uses ordinary character strings, which is easier for
applications to support. LibSBML does, however, test for identifier
validity at various times, such as when reading in models from files
and data streams.
This method provides programs with the ability to test explicitly that
the identifier strings they create conform to the SBML identifier
syntax.
Parameter 'units' is string to be checked for conformance to SBML unit
identifier syntax.
Returns True if the string conforms to type SBML data type UnitSId,
False otherwise.
Note:
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
See also SyntaxChecker.isValidSBMLSId() , SyntaxChecker.isValidXMLID()
.
"""
return _libsbml.SyntaxChecker_isValidUnitSId(units)
if _newclass:
isValidUnitSId = staticmethod(isValidUnitSId)
__swig_getmethods__["isValidUnitSId"] = lambda x: isValidUnitSId
def hasExpectedXHTMLSyntax(xhtml, sbmlns=None):
"""
hasExpectedXHTMLSyntax(XMLNode xhtml, SBMLNamespaces sbmlns=None) -> bool
hasExpectedXHTMLSyntax(XMLNode xhtml) -> bool
Returns True or False depending on whether the given XMLNode object
contains valid XHTML content.
The optional SBML element named 'notes', present on every major SBML
component type (and in SBML Level 3, the 'message' subelement of
Constraint), is intended as a place for storing optional information
intended to be seen by humans. An example use of the 'notes' element
would be to contain formatted user comments about the model element in
which the 'notes' element is enclosed. Every object derived directly
or indirectly from type SBase can have a separate value for 'notes',
allowing users considerable freedom when adding comments to their
models.
The format of 'notes' elements conform to the definition of XHTML 1.0.
However, the content cannot be entirely free-form; it must satisfy
certain requirements defined in the SBML specifications for specific
SBML Levels. To help verify the formatting of 'notes' content,
libSBML provides the static utility method
SyntaxChecker.hasExpectedXHTMLSyntax(); this method implements a
verification process that lets callers check whether the content of a
given XMLNode object conforms to the SBML requirements for 'notes' and
'message' structure. Developers are urged to consult the appropriate
SBML specification document for the Level and Version of their model
for more in-depth explanations of using 'notes' in SBML. The SBML
Level 2 and 3 specifications have considerable detail about how
'notes' element content must be structured.
An aspect of XHTML validity is that the content is declared to be in
the XML namespace for XHTML 1.0. There is more than one way in which
this can be done in XML. In particular, a model might not contain the
declaration within the 'notes' or 'message' subelement itself, but
might instead place the declaration on an enclosing element and use an
XML namespace prefix within the 'notes' element to refer to it. In
other words, the following is valid:
A Simple Mitotic Oscillator
A minimal cascade model for the mitotic oscillator.
... rest of model ...
Contrast the above with the following, self-contained version, which
places the XML namespace declaration within the element
itself:
A Simple Mitotic Oscillator
A minimal cascade model for the mitotic oscillator.
... rest of model ...
Both of the above are valid XML. The purpose of the 'sbmlns' argument
to this method is to allow callers to check the validity of 'notes'
and 'message' subelements whose XML namespace declarations have been
put elsewhere in the manner illustrated above. Callers can can pass
in the SBMLNamespaces object of a higher-level model component if the
XMLNode object does not itself have the XML namespace declaration for
XHTML 1.0.
Parameter 'xhtml' is the XMLNode to be checked for conformance.
Parameter 'sbmlns' is the SBMLNamespaces associated with the object.
Returns True if the XMLNode content conforms, False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SyntaxChecker_hasExpectedXHTMLSyntax(xhtml, sbmlns)
if _newclass:
hasExpectedXHTMLSyntax = staticmethod(hasExpectedXHTMLSyntax)
__swig_getmethods__["hasExpectedXHTMLSyntax"] = lambda x: hasExpectedXHTMLSyntax
def isValidInternalSId(sid):
"""
isValidInternalSId(string sid) -> bool
Internal implementation method.
"""
return _libsbml.SyntaxChecker_isValidInternalSId(sid)
if _newclass:
isValidInternalSId = staticmethod(isValidInternalSId)
__swig_getmethods__["isValidInternalSId"] = lambda x: isValidInternalSId
def isValidInternalUnitSId(sid):
"""
isValidInternalUnitSId(string sid) -> bool
Internal implementation method.
"""
return _libsbml.SyntaxChecker_isValidInternalUnitSId(sid)
if _newclass:
isValidInternalUnitSId = staticmethod(isValidInternalUnitSId)
__swig_getmethods__["isValidInternalUnitSId"] = lambda x: isValidInternalUnitSId
def __init__(self):
"""
__init__(SyntaxChecker self) -> SyntaxChecker
@internal
"""
this = _libsbml.new_SyntaxChecker()
try:
self.this.append(this)
except:
self.this = this
__swig_destroy__ = _libsbml.delete_SyntaxChecker
__del__ = lambda self: None
SyntaxChecker_swigregister = _libsbml.SyntaxChecker_swigregister
SyntaxChecker_swigregister(SyntaxChecker)
def SyntaxChecker_isValidSBMLSId(sid):
"""
SyntaxChecker_isValidSBMLSId(string sid) -> bool
Returns true True or False depending on whether the argument string
conforms to the syntax of SBML identifiers.
In SBML, identifiers that are the values of 'id' attributes on
objects must conform to a data type called SId in the SBML
specifications. LibSBML does not provide an explicit SId data type;
it uses ordinary character strings, which is easier for applications
to support. (LibSBML does, however, test for identifier validity at
various times, such as when reading in models from files and data
streams.)
This method provides programs with the ability to test explicitly that
the identifier strings they create conform to the SBML identifier
syntax.
Parameter 'sid' is string to be checked for conformance to SBML
identifier syntax.
Returns True if the string conforms to type SBML data type SId, False
otherwise.
SBML has strict requirements for the syntax of identifiers, that is,
the values of the 'id' attribute present on most types of SBML
objects. The following is a summary of the definition of the SBML
identifier type SId, which defines the permitted syntax of
identifiers. We express the syntax using an extended form of BNF
notation:
letter ::= 'a'..'z','A'..'Z'
digit ::= '0'..'9'
idChar ::= letter | digit | '_'
SId ::= ( letter | '_' ) idChar*
The characters ( and ) are used for grouping, the character * 'zero or
more times', and the character | indicates logical 'or'. The equality
of SBML identifiers is determined by an exact character sequence
match; i.e., comparisons must be performed in a case-sensitive manner.
In addition, there are a few conditions for the uniqueness of
identifiers in an SBML model. Please consult the SBML specifications
for the exact details of the uniqueness requirements.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
See also SyntaxChecker.isValidUnitSId() , SyntaxChecker.isValidXMLID()
.
"""
return _libsbml.SyntaxChecker_isValidSBMLSId(sid)
def SyntaxChecker_isValidXMLID(id):
"""
SyntaxChecker_isValidXMLID(string id) -> bool
Returns True or False depending on whether the argument string
conforms to the XML data type ID.
The optional attribute named 'metaid', present on every major SBML
component type, is for supporting metadata annotations using RDF
(Resource Description Format). The attribute value has the data type
XML ID, the XML identifier type, which means each 'metaid' value must
be globally unique within an SBML file. The latter point is
important, because the uniqueness criterion applies across any
attribute with type ID anywhere in the file, not just the 'metaid'
attribute used by SBML---something to be aware of if your application-
specific XML content inside the 'annotation' subelement happens to use
the XML ID type. Although SBML itself specifies the use of XML ID
only for the 'metaid' attribute, SBML-compatible applications should
be careful if they use XML ID's in XML portions of a model that are
not defined by SBML, such as in the application-specific content of
the 'annotation' subelement. Finally, note that LibSBML does not
provide an explicit XML ID data type; it uses ordinary character
strings, which is easier for applications to support.
This method provides programs with the ability to test explicitly that
the identifier strings they create conform to the SBML identifier
syntax.
Parameter 'id' is string to be checked for conformance to the syntax
of XML ID.
Returns True if the string is a syntactically-valid value for the XML
type ID, False otherwise.
Note:
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
See also SyntaxChecker.isValidSBMLSId() ,
SyntaxChecker.isValidUnitSId() .
"""
return _libsbml.SyntaxChecker_isValidXMLID(id)
def SyntaxChecker_isValidXMLanyURI(uri):
"""
SyntaxChecker_isValidXMLanyURI(string uri) -> bool
Returns True or False depending on whether the 'uri' argument string
conforms to the XML data type anyURI.
Type anyURI is defined by XML Schema 1.0. It is a character string
data type whose values are interpretable as URIs (Universal Resource
Identifiers) as described by the W3C document RFC 3986. LibSBML does
not provide an explicit XML anyURI data type; it uses ordinary
character strings, which is easier for applications to support.
LibSBML does, however, test for anyURI validity at various times, such
as when reading in models from files and data streams.
This method provides programs with the ability to test explicitly that
the strings they create conform to the XML anyURI syntax.
Parameter 'uri' is string to be checked for conformance to the syntax
of anyURI.
Returns True if the string is a syntactically-valid value for the XML
type anyURI, False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SyntaxChecker_isValidXMLanyURI(uri)
def SyntaxChecker_isValidUnitSId(units):
"""
SyntaxChecker_isValidUnitSId(string units) -> bool
Returns True or False depending on whether the argument string
conforms to the syntax of SBML unit identifiers.
In SBML, the identifiers of units (of both the predefined units and
user-defined units) must conform to a data type called UnitSId in the
SBML specifications. LibSBML does not provide an explicit UnitSId
data type; it uses ordinary character strings, which is easier for
applications to support. LibSBML does, however, test for identifier
validity at various times, such as when reading in models from files
and data streams.
This method provides programs with the ability to test explicitly that
the identifier strings they create conform to the SBML identifier
syntax.
Parameter 'units' is string to be checked for conformance to SBML unit
identifier syntax.
Returns True if the string conforms to type SBML data type UnitSId,
False otherwise.
Note:
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
See also SyntaxChecker.isValidSBMLSId() , SyntaxChecker.isValidXMLID()
.
"""
return _libsbml.SyntaxChecker_isValidUnitSId(units)
def SyntaxChecker_hasExpectedXHTMLSyntax(xhtml, sbmlns=None):
"""
hasExpectedXHTMLSyntax(XMLNode xhtml, SBMLNamespaces sbmlns=None) -> bool
SyntaxChecker_hasExpectedXHTMLSyntax(XMLNode xhtml) -> bool
Returns True or False depending on whether the given XMLNode object
contains valid XHTML content.
The optional SBML element named 'notes', present on every major SBML
component type (and in SBML Level 3, the 'message' subelement of
Constraint), is intended as a place for storing optional information
intended to be seen by humans. An example use of the 'notes' element
would be to contain formatted user comments about the model element in
which the 'notes' element is enclosed. Every object derived directly
or indirectly from type SBase can have a separate value for 'notes',
allowing users considerable freedom when adding comments to their
models.
The format of 'notes' elements conform to the definition of XHTML 1.0.
However, the content cannot be entirely free-form; it must satisfy
certain requirements defined in the SBML specifications for specific
SBML Levels. To help verify the formatting of 'notes' content,
libSBML provides the static utility method
SyntaxChecker.hasExpectedXHTMLSyntax(); this method implements a
verification process that lets callers check whether the content of a
given XMLNode object conforms to the SBML requirements for 'notes' and
'message' structure. Developers are urged to consult the appropriate
SBML specification document for the Level and Version of their model
for more in-depth explanations of using 'notes' in SBML. The SBML
Level 2 and 3 specifications have considerable detail about how
'notes' element content must be structured.
An aspect of XHTML validity is that the content is declared to be in
the XML namespace for XHTML 1.0. There is more than one way in which
this can be done in XML. In particular, a model might not contain the
declaration within the 'notes' or 'message' subelement itself, but
might instead place the declaration on an enclosing element and use an
XML namespace prefix within the 'notes' element to refer to it. In
other words, the following is valid:
A Simple Mitotic Oscillator
A minimal cascade model for the mitotic oscillator.
... rest of model ...
Contrast the above with the following, self-contained version, which
places the XML namespace declaration within the element
itself:
A Simple Mitotic Oscillator
A minimal cascade model for the mitotic oscillator.
... rest of model ...
Both of the above are valid XML. The purpose of the 'sbmlns' argument
to this method is to allow callers to check the validity of 'notes'
and 'message' subelements whose XML namespace declarations have been
put elsewhere in the manner illustrated above. Callers can can pass
in the SBMLNamespaces object of a higher-level model component if the
XMLNode object does not itself have the XML namespace declaration for
XHTML 1.0.
Parameter 'xhtml' is the XMLNode to be checked for conformance.
Parameter 'sbmlns' is the SBMLNamespaces associated with the object.
Returns True if the XMLNode content conforms, False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SyntaxChecker_hasExpectedXHTMLSyntax(xhtml, sbmlns)
def SyntaxChecker_isValidInternalSId(sid):
"""
SyntaxChecker_isValidInternalSId(string sid) -> bool
Internal implementation method.
"""
return _libsbml.SyntaxChecker_isValidInternalSId(sid)
def SyntaxChecker_isValidInternalUnitSId(sid):
"""
SyntaxChecker_isValidInternalUnitSId(string sid) -> bool
Internal implementation method.
"""
return _libsbml.SyntaxChecker_isValidInternalUnitSId(sid)
class StoichiometryMath(SBase):
"""
Stochiometry expressions in SBML Level 2 reactions.
Stoichiometries in SBML Level 2
======================================================================
In SBML Level 2, product and reactant stoichiometries can be specified
using either the 'stoichiometry' attribute or a 'stoichiometryMath'
element in a SpeciesReference object. The 'stoichiometry' attribute
is of type float and should contain values greater than zero (0). The
'stoichiometryMath' element is implemented as an element containing a
MathML expression. These two are mutually exclusive; only one of
'stoichiometry' or 'stoichiometryMath' should be defined in a given
SpeciesReference instance. When neither the attribute nor the element
is present, the value of 'stoichiometry' in the enclosing
SpeciesReference instance defaults to 1.
For maximum interoperability, SpeciesReference's 'stoichiometry'
attribute should be used in preference to 'stoichiometryMath' when a
species' stoichiometry is a simple scalar number (integer or decimal).
When the stoichiometry is a rational number, or when it is a more
complicated formula, 'stoichiometryMath' must be used. The MathML
expression in 'stoichiometryMath' may also refer to identifiers of
entities in a model (except reaction identifiers). However, the only
species identifiers that can be used in 'stoichiometryMath' are those
referenced in the enclosing Reaction's list of reactants, products and
modifiers.
The 'stoichiometry' attribute and the 'stoichiometryMath' element,
when either is used, is each interpreted as a factor applied to the
reaction rate to produce the rate of change of the species identified
by the 'species' attribute in the enclosing SpeciesReference. This is
the normal interpretation of a stoichiometry, but in SBML, one
additional consideration has to be taken into account. The reaction
rate, which is the result of the KineticLaw's 'math' element, is
always in the model's substance per time units. However, the rate of
change of the species will involve the species' substance units (i.e.,
the units identified by the Species object's 'substanceUnits'
attribute), and these units may be different from the model's default
substance units. If the units are different, the stoichiometry must
incorporate a conversion factor for converting the model's substance
units to the species' substance units. The conversion factor is
assumed to be included in the scalar value of the 'stoichiometry'
attribute if 'stoichiometry' is used. If instead 'stoichiometryMath'
is used, then the product of the model's 'substance' units times the
'stoichiometryMath' units must match the substance units of the
species. Note that in either case, if the species' units and the
model's default substance units are the same, the stoichiometry ends
up being a dimensionless number and equivalent to the standard
chemical stoichiometry found in textbooks. Examples and more
explanations of this are given in the SBML specification.
The following is a simple example of a species reference for species
'X0', with stoichiometry 2, in a list of reactants within a reaction
having the identifier 'J1':
...
...
...
...
The following is a more complex example of a species reference for
species 'X0', with a stoichiometry formula consisting of a rational
number:
...
3 2
...
...
...
Additional discussions of stoichiometries and implications for species
and reactions are included in the documentation of SpeciesReference
class.
Stoichiometries in SBML Level 3
======================================================================
The StoichiometryMath construct is not defined in SBML Level 3 Version
1 Core. Instead, Level 3 defines the identifier of SpeciesReference
objects as a stand-in for the stoichiometry of the reactant or product
being referenced, and allows that identifier to be used elsewhere in
SBML models, including (for example) InitialAssignment objects. This
makes it possible to achieve the same effect as StoichiometryMath, but
with other SBML objects. For instance, to produce a stoichiometry
value that is a rational number, a model can use InitialAssignment to
assign the identifier of a SpeciesReference object to a MathML
expression evaluating to a rational number. This is analogous to the
same way that, in Level 2, the model would use StoichiometryMath with
a MathML expression evaluating to a rational number.
In SBML Level 2, the stoichiometry of a reactant or product is a
combination of both a biochemical stoichiometry (meaning, the standard
stoichiometry of a species in a reaction) and any necessary unit
conversion factors. The introduction of an explicit attribute on the
Species object for a conversion factor allows Level 3 to avoid having
to overload the meaning of stoichiometry. In Level 3, the
stoichiometry given by a SpeciesReference object in a reaction is a
'proper' biochemical stoichiometry, meaning a dimensionless number
free of unit conversions.
See also SpeciesReference, Reaction.
"""
__swig_setmethods__ = {}
for _s in [SBase]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, StoichiometryMath, name, value)
__swig_getmethods__ = {}
for _s in [SBase]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, StoichiometryMath, name)
__repr__ = _swig_repr
__swig_destroy__ = _libsbml.delete_StoichiometryMath
__del__ = lambda self: None
def __init__(self, *args):
"""
__init__(StoichiometryMath self, unsigned int level, unsigned int version) -> StoichiometryMath
__init__(StoichiometryMath self, SBMLNamespaces sbmlns) -> StoichiometryMath
__init__(StoichiometryMath self, StoichiometryMath orig) -> StoichiometryMath
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
StoichiometryMath(SBMLNamespaces sbmlns)
Creates a new StoichiometryMath object using the given SBMLNamespaces
object 'sbmlns'.
The SBMLNamespaces object encapsulates SBML Level/Version/namespaces
information. It is used to communicate the SBML Level, Version, and
(in Level 3) packages used in addition to SBML Level 3 Core. A common
approach to using libSBML's SBMLNamespaces facilities is to create an
SBMLNamespaces object somewhere in a program once, then hand that
object as needed to object constructors that accept SBMLNamespaces as
arguments.
Parameter 'sbmlns' is an SBMLNamespaces object.
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
Note:
The StoichiometryMath construct exists only in SBML Level 2. It is an
optional construct available for defining the stoichiometries of
reactants and products in Reaction objects. Note that a different
mechanism is used in SBML Level 3, where StoichiometryMath is not
available. Please consult the top of this libSBML StoichiometryMath
documentation for more information about the differences between SBML
Level 2 and 3 with respect to stoichiometries.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
______________________________________________________________________
Method variant with the following signature:
StoichiometryMath(long level, long version)
Creates a new StoichiometryMath object using the given SBML 'level'
values.
Parameter 'level' is a long integer, the SBML Level to assign to this
StoichiometryMath
Parameter 'version' is a long integer, the SBML Version to assign to
this StoichiometryMath
Throws SBMLConstructorException: Thrown if the given 'level' and
'version' combination, or this kind of SBML object, are either invalid
or mismatched with respect to the parent SBMLDocument object.
Note:
The StoichiometryMath construct exists only in SBML Level 2. It is an
optional construct available for defining the stoichiometries of
reactants and products in Reaction objects. Note that a different
mechanism is used in SBML Level 3, where StoichiometryMath is not
available. Please consult the top of this libSBML StoichiometryMath
documentation for more information about the differences between SBML
Level 2 and 3 with respect to stoichiometries.
Note:
Attempting to add an object to an SBMLDocument having a different
combination of SBML Level, Version and XML namespaces than the object
itself will result in an error at the time a caller attempts to make
the addition. A parent object must have compatible Level, Version and
XML namespaces. (Strictly speaking, a parent may also have more XML
namespaces than a child, but the reverse is not permitted.) The
restriction is necessary to ensure that an SBML model has a consistent
overall structure. This requires callers to manage their objects
carefully, but the benefit is increased flexibility in how models can
be created by permitting callers to create objects bottom-up if
desired. In situations where objects are not yet attached to parents
(e.g., SBMLDocument), knowledge of the intented SBML Level and Version
help libSBML determine such things as whether it is valid to assign a
particular value to an attribute.
______________________________________________________________________
Method variant with the following signature:
StoichiometryMath(StoichiometryMath orig)
Copy constructor; creates a copy of this StoichiometryMath.
Parameter 'orig' is the object to copy.
Throws SBMLConstructorException: Thrown if the argument 'orig' is
None.
"""
this = _libsbml.new_StoichiometryMath(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(StoichiometryMath self) -> StoichiometryMath
Creates and returns a deep copy of this StoichiometryMath object.
Returns the (deep) copy of this StoichiometryMath object.
"""
return _libsbml.StoichiometryMath_clone(self)
def getMath(self):
"""
getMath(StoichiometryMath self) -> ASTNode
Retrieves the mathematical formula within this StoichiometryMath and
return it as an AST.
Returns the math of this StoichiometryMath.
Note:
The StoichiometryMath construct exists only in SBML Level 2. It is an
optional construct available for defining the stoichiometries of
reactants and products in Reaction objects. Note that a different
mechanism is used in SBML Level 3, where StoichiometryMath is not
available. Please consult the top of this libSBML StoichiometryMath
documentation for more information about the differences between SBML
Level 2 and 3 with respect to stoichiometries.
"""
return _libsbml.StoichiometryMath_getMath(self)
def isSetMath(self):
"""
isSetMath(StoichiometryMath self) -> bool
Predicate to test whether the math for this StoichiometryMath object
is set.
Returns True if the formula (meaning the math subelement) of this
StoichiometryMath is set, False otherwise.
Note:
The StoichiometryMath construct exists only in SBML Level 2. It is an
optional construct available for defining the stoichiometries of
reactants and products in Reaction objects. Note that a different
mechanism is used in SBML Level 3, where StoichiometryMath is not
available. Please consult the top of this libSBML StoichiometryMath
documentation for more information about the differences between SBML
Level 2 and 3 with respect to stoichiometries.
"""
return _libsbml.StoichiometryMath_isSetMath(self)
def setMath(self, math):
"""
setMath(StoichiometryMath self, ASTNode math) -> int
Sets the 'math' expression of this StoichiometryMath instance to a
copy of the given ASTNode.
Parameter 'math' is an ASTNode representing a formula tree.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_OBJECT
Note:
The StoichiometryMath construct exists only in SBML Level 2. It is an
optional construct available for defining the stoichiometries of
reactants and products in Reaction objects. Note that a different
mechanism is used in SBML Level 3, where StoichiometryMath is not
available. Please consult the top of this libSBML StoichiometryMath
documentation for more information about the differences between SBML
Level 2 and 3 with respect to stoichiometries.
"""
return _libsbml.StoichiometryMath_setMath(self, math)
def getDerivedUnitDefinition(self, *args):
"""
getDerivedUnitDefinition(StoichiometryMath self) -> UnitDefinition
getDerivedUnitDefinition(StoichiometryMath self) -> UnitDefinition
Calculates and returns a UnitDefinition object that expresses the
units returned by the math expression in this StoichiometryMath
object.
The units are calculated based on the mathematical expression in the
StoichiometryMath and the model quantities referenced by elements
used within that expression. The
StoichiometryMath.getDerivedUnitDefinition() method returns the
calculated units.
Note that the functionality that facilitates unit analysis depends on
the model as a whole. Thus, in cases where the object has not been
added to a model or the model itself is incomplete, unit analysis is
not possible and this method will return None.
Returns a UnitDefinition that expresses the units of the math, or
None if one cannot be constructed.
WARNING:
Note that it is possible the 'math' expression in the
StoichiometryMath instance contains literal numbers or parameters with
undeclared units. In those cases, it is not possible to calculate the
units of the overall expression without making assumptions. LibSBML
does not make assumptions about the units, and
StoichiometryMath.getDerivedUnitDefinition() only returns the units as
far as it is able to determine them. For example, in an expression X
+ Y, if X has unambiguously-defined units and Y does not, it will
return the units of X. When using this method, it is critical that
callers also invoke the method
StoichiometryMath.containsUndeclaredUnits() to determine whether this
situation holds. Callers should take suitable action in those
situations.
See also containsUndeclaredUnits().
"""
return _libsbml.StoichiometryMath_getDerivedUnitDefinition(self, *args)
def containsUndeclaredUnits(self, *args):
"""
containsUndeclaredUnits(StoichiometryMath self) -> bool
containsUndeclaredUnits(StoichiometryMath self) -> bool
Predicate returning True if the math expression of this
StoichiometryMath object contains literal numbers or parameters with
undeclared units.
The StoichiometryMath.getDerivedUnitDefinition() method returns what
libSBML computes the units of the Stoichiometry to be, to the extent
that libSBML can compute them. However, if the expression contains
literal numbers or parameters with undeclared units, libSBML may not
be able to compute the full units of the expression and will only
return what it can compute. Callers should always use
StoichiometryMath.containsUndeclaredUnits() when using
StoichiometryMath.getDerivedUnitDefinition() to decide whether the
returned units may be incomplete.
Returns True if the math expression of this StoichiometryMath includes
numbers/parameters with undeclared units, False otherwise.
Note:
A return value of True indicates that the UnitDefinition returned by
StoichiometryMath.getDerivedUnitDefinition() may not accurately
represent the units of the expression.
See also getDerivedUnitDefinition().
"""
return _libsbml.StoichiometryMath_containsUndeclaredUnits(self, *args)
def getTypeCode(self):
"""
getTypeCode(StoichiometryMath self) -> int
Returns the libSBML type code of this object instance.
LibSBML attaches an identifying code to every kind of SBML object.
These are integer constants known as SBML type codes. The names of
all the codes begin with the characters SBML_. In the Python language
interface for libSBML, the type codes are defined as static integer
constants in the interface class 'libsbml'. Note that different Level
3 package plug-ins may use overlapping type codes; to identify the
package to which a given object belongs, call the getPackageName()
method on the object.
Returns the SBML type code for this object: SBML_STOICHIOMETRY_MATH
(default).
WARNING:
The specific integer values of the possible type codes may be reused
by different Level 3 package plug-ins. Thus, to identifiy the correct
code, it is necessary to invoke both getTypeCode() and
getPackageName().
See also getElementName(), getPackageName().
"""
return _libsbml.StoichiometryMath_getTypeCode(self)
def getElementName(self):
"""
getElementName(StoichiometryMath self) -> string
Returns the XML element name of this object, which for
StoichiometryMath, is always 'stoichiometryMath'.
Returns the name of this element, i.e., 'stoichiometryMath'.
"""
return _libsbml.StoichiometryMath_getElementName(self)
def hasRequiredElements(self):
"""
hasRequiredElements(StoichiometryMath self) -> bool
Predicate returning True if all the required elements for this
StoichiometryMath object have been set.
Note:
The required elements for a StoichiometryMath object are:
* 'math'
Returns a boolean value indicating whether all the required elements
for this object have been defined.
"""
return _libsbml.StoichiometryMath_hasRequiredElements(self)
def removeFromParentAndDelete(self):
"""
removeFromParentAndDelete(StoichiometryMath self) -> int
Finds this StoichiometryMath's SpeciesReference parent and calls
unsetStoichiometryMath() on it, indirectly deleting itself.
Overridden from the SBase function since the parent is not a ListOf.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
"""
return _libsbml.StoichiometryMath_removeFromParentAndDelete(self)
def renameSIdRefs(self, oldid, newid):
"""
renameSIdRefs(StoichiometryMath self, string oldid, string newid)
Replaces all uses of a given SIdRef type attribute value with another
value.
In SBML, object identifiers are of a data type called SId. In SBML
Level 3, an explicit data type called SIdRef was introduced for
attribute values that refer to SId values; in previous Levels of SBML,
this data type did not exist and attributes were simply described to
as 'referring to an identifier', but the effective data type was the
same as SIdRefin Level 3. These and other methods of libSBML refer to
the type SIdRef for all Levels of SBML, even if the corresponding SBML
specification did not explicitly name the data type.
This method works by looking at all attributes and (if appropriate)
mathematical formulas in MathML content, comparing the referenced
identifiers to the value of 'oldid'. If any matches are found, the
matching values are replaced with 'newid'. The method does not
descend into child elements.
Parameter 'oldid' is the old identifier Parameter 'newid' is the new
identifier
"""
return _libsbml.StoichiometryMath_renameSIdRefs(self, oldid, newid)
def renameUnitSIdRefs(self, oldid, newid):
"""
renameUnitSIdRefs(StoichiometryMath self, string oldid, string newid)
Replaces all uses of a given UnitSIdRef type attribute value with
another value.
In SBML, unit definitions have identifiers of type UnitSId. In SBML
Level 3, an explicit data type called UnitSIdRef was introduced for
attribute values that refer to UnitSId values; in previous Levels of
SBML, this data type did not exist and attributes were simply
described to as 'referring to a unit identifier', but the effective
data type was the same as UnitSIdRef in Level 3. These and other
methods of libSBML refer to the type UnitSIdRef for all Levels of
SBML, even if the corresponding SBML specification did not explicitly
name the data type.
This method works by looking at all unit identifier attribute values
(including, if appropriate, inside mathematical formulas), comparing
the referenced unit identifiers to the value of 'oldid'. If any
matches are found, the matching values are replaced with 'newid'. The
method does not descend into child elements.
Parameter 'oldid' is the old identifier Parameter 'newid' is the new
identifier
"""
return _libsbml.StoichiometryMath_renameUnitSIdRefs(self, oldid, newid)
def replaceSIDWithFunction(self, id, function):
"""
replaceSIDWithFunction(StoichiometryMath self, string id, ASTNode function)
Internal implementation method.
"""
return _libsbml.StoichiometryMath_replaceSIDWithFunction(self, id, function)
StoichiometryMath_swigregister = _libsbml.StoichiometryMath_swigregister
StoichiometryMath_swigregister(StoichiometryMath)
class SBMLNamespaces(_object):
"""
Set of SBML Level + Version + namespace triples.
There are differences in the definitions of components between
different SBML Levels, as well as Versions within Levels. For
example, the 'sboTerm' attribute was not introduced until Level 2
Version 2, and then only on certain component classes; the SBML Level
2 Version 3 specification moved the 'sboTerm' attribute to the SBase
class, thereby allowing nearly all components to have SBO annotations.
As a result of differences such as those, libSBML needs to track the
SBML Level and Version of every object created.
The purpose of the SBMLNamespaces object class is to make it easier to
communicate SBML Level and Version data between libSBML constructors
and other methods. The SBMLNamespaces object class tracks 3-tuples
(triples) consisting of SBML Level, Version, and the corresponding
SBML XML namespace.
The plural name (SBMLNamespaces) is not a mistake, because in SBML
Level 3, objects may have extensions added by Level 3 packages used by
a given model and therefore may have multiple namespaces associated
with them; however, until the introduction of SBML Level 3, the
SBMLNamespaces object only records one SBML Level/Version/namespace
combination at a time. Most constructors for SBML objects in libSBML
take a SBMLNamespaces object as an argument, thereby allowing the
constructor to produce the proper combination of attributes and other
internal data structures for the given SBML Level and Version.
"""
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, SBMLNamespaces, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, SBMLNamespaces, name)
__repr__ = _swig_repr
__swig_destroy__ = _libsbml.delete_SBMLNamespaces
__del__ = lambda self: None
def __init__(self, *args):
"""
__init__(SBMLNamespaces self, unsigned int level, unsigned int version) -> SBMLNamespaces
__init__(SBMLNamespaces self, unsigned int level) -> SBMLNamespaces
__init__(SBMLNamespaces self) -> SBMLNamespaces
__init__(SBMLNamespaces self, unsigned int level, unsigned int version, string pkgName, unsigned int pkgVersion, string pkgPrefix) -> SBMLNamespaces
__init__(SBMLNamespaces self, unsigned int level, unsigned int version, string pkgName, unsigned int pkgVersion) -> SBMLNamespaces
__init__(SBMLNamespaces self, SBMLNamespaces orig) -> SBMLNamespaces
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
SBMLNamespaces(long level, long version, string &pkgName, long
pkgVersion, string pkgPrefix = '')
(For extensions) Creates a new SBMLNamespaces object corresponding to
the combination of (1) the given SBML 'level' and 'version', and (2)
the given 'package' with the 'package' 'version'.
SBMLNamespaces objects are used in libSBML to communicate SBML Level
and Version data between constructors and other methods. The
SBMLNamespaces object class holds triples consisting of SBML Level,
Version, and the corresponding SBML XML namespace. Most constructors
for SBML objects in libSBML take a SBMLNamespaces object as an
argument, thereby allowing the constructor to produce the proper
combination of attributes and other internal data structures for the
given SBML Level and Version.
The plural name (SBMLNamespaces) is not a mistake, because in SBML
Level 3, objects may have extensions added by Level 3 packages used by
a given model and therefore may have multiple namespaces associated
with them. In SBML Levels below Level 3, the SBMLNamespaces object
only records one SBML Level/Version/namespace combination at a time.
Most constructors for SBML objects in libSBML take a SBMLNamespaces
object as an argument, thereby allowing the constructor to produce the
proper combination of attributes and other internal data structures
for the given SBML Level and Version.
Parameter 'level' is the SBML Level Parameter 'version' is the SBML
Version Parameter 'pkgName' is the string of package name (e.g.
'layout', 'multi') Parameter 'pkgVersion' is the package version
Parameter 'pkgPrefix' is the prefix of the package namespace (e.g.
'layout', 'multi') to be added. The package's name will be used if the
given string is empty (default).
Throws SBMLExtensionException: if the extension module that supports
the combination of the given SBML Level, SBML Version, package name,
and package version has not been registered with libSBML.
______________________________________________________________________
Method variant with the following signature:
SBMLNamespaces(SBMLNamespaces orig)
Copy constructor; creates a copy of a SBMLNamespaces.
Parameter 'orig' is the SBMLNamespaces instance to copy.
Throws SBMLConstructorException: Thrown if the argument 'orig' is
None.
______________________________________________________________________
Method variant with the following signature:
SBMLNamespaces(long level = SBML_DEFAULT_LEVEL, long version =
SBML_DEFAULT_VERSION)
Creates a new SBMLNamespaces object corresponding to the given SBML
'level' and 'version'.
SBMLNamespaces objects are used in libSBML to communicate SBML Level
and Version data between constructors and other methods. The
SBMLNamespaces object class holds triples consisting of SBML Level,
Version, and the corresponding SBML XML namespace. Most constructors
for SBML objects in libSBML take a SBMLNamespaces object as an
argument, thereby allowing the constructor to produce the proper
combination of attributes and other internal data structures for the
given SBML Level and Version.
The plural name (SBMLNamespaces) is not a mistake, because in SBML
Level 3, objects may have extensions added by Level 3 packages used by
a given model and therefore may have multiple namespaces associated
with them. In SBML Levels below Level 3, the SBMLNamespaces object
only records one SBML Level/Version/namespace combination at a time.
Most constructors for SBML objects in libSBML take a SBMLNamespaces
object as an argument, thereby allowing the constructor to produce the
proper combination of attributes and other internal data structures
for the given SBML Level and Version.
Parameter 'level' is the SBML level Parameter 'version' is the SBML
version
"""
this = _libsbml.new_SBMLNamespaces(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(SBMLNamespaces self) -> SBMLNamespaces
Creates and returns a deep copy of this SBMLNamespaces object.
Returns the (deep) copy of this SBMLNamespaces object.
"""
return _libsbml.SBMLNamespaces_clone(self)
def getSBMLNamespaceURI(level, version):
"""
getSBMLNamespaceURI(unsigned int level, unsigned int version) -> string
Returns a string representing the SBML XML namespace for the given
'level' and 'version' of SBML.
Parameter 'level' is the SBML level Parameter 'version' is the SBML
version
Returns a string representing the SBML namespace that reflects the
SBML Level and Version specified.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBMLNamespaces_getSBMLNamespaceURI(level, version)
if _newclass:
getSBMLNamespaceURI = staticmethod(getSBMLNamespaceURI)
__swig_getmethods__["getSBMLNamespaceURI"] = lambda x: getSBMLNamespaceURI
def getSupportedNamespaces():
"""
getSupportedNamespaces() -> List const *
Returns a list of all supported SBMLNamespaces in this version of
libsbml.
Returns a list with supported SBML namespaces.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBMLNamespaces_getSupportedNamespaces()
if _newclass:
getSupportedNamespaces = staticmethod(getSupportedNamespaces)
__swig_getmethods__["getSupportedNamespaces"] = lambda x: getSupportedNamespaces
def freeSBMLNamespaces(supportedNS):
"""
freeSBMLNamespaces(List * supportedNS)
Frees the list of supported namespaces as generated by
getSupportedNamespaces().
Parameter 'supportedNS' is the list to be freed.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBMLNamespaces_freeSBMLNamespaces(supportedNS)
if _newclass:
freeSBMLNamespaces = staticmethod(freeSBMLNamespaces)
__swig_getmethods__["freeSBMLNamespaces"] = lambda x: freeSBMLNamespaces
def getURI(self):
"""
getURI(SBMLNamespaces self) -> string
Returns a string representing the SBML XML namespace of this object.
Returns a string representing the SBML namespace that reflects the
SBML Level and Version of this object.
"""
return _libsbml.SBMLNamespaces_getURI(self)
def getLevel(self, *args):
"""
getLevel(SBMLNamespaces self) -> unsigned int
getLevel(SBMLNamespaces self) -> unsigned int
Get the SBML Level of this SBMLNamespaces object.
Returns the SBML Level of this SBMLNamespaces object.
"""
return _libsbml.SBMLNamespaces_getLevel(self, *args)
def getVersion(self, *args):
"""
getVersion(SBMLNamespaces self) -> unsigned int
getVersion(SBMLNamespaces self) -> unsigned int
Get the SBML Version of this SBMLNamespaces object.
Returns the SBML Version of this SBMLNamespaces object.
"""
return _libsbml.SBMLNamespaces_getVersion(self, *args)
def getNamespaces(self, *args):
"""
getNamespaces(SBMLNamespaces self) -> XMLNamespaces
getNamespaces(SBMLNamespaces self) -> XMLNamespaces
Get the XML namespaces list for this SBMLNamespaces object.
SBMLNamespaces objects are used in libSBML to communicate SBML Level
and Version data between constructors and other methods. The
SBMLNamespaces object class holds triples consisting of SBML Level,
Version, and the corresponding SBML XML namespace. Most constructors
for SBML objects in libSBML take a SBMLNamespaces object as an
argument, thereby allowing the constructor to produce the proper
combination of attributes and other internal data structures for the
given SBML Level and Version.
The plural name (SBMLNamespaces) is not a mistake, because in SBML
Level 3, objects may have extensions added by Level 3 packages used by
a given model and therefore may have multiple namespaces associated
with them. In SBML Levels below Level 3, the SBMLNamespaces object
only records one SBML Level/Version/namespace combination at a time.
Most constructors for SBML objects in libSBML take a SBMLNamespaces
object as an argument, thereby allowing the constructor to produce the
proper combination of attributes and other internal data structures
for the given SBML Level and Version.
Returns the XML namespaces of this SBMLNamespaces object.
"""
return _libsbml.SBMLNamespaces_getNamespaces(self, *args)
def addNamespaces(self, xmlns):
"""
addNamespaces(SBMLNamespaces self, XMLNamespaces xmlns) -> int
Add the given XML namespaces list to the set of namespaces within this
SBMLNamespaces object.
The following code gives an example of how one could add the XHTML
namespace to the list of namespaces recorded by the top-level
element of a model. It gives the new namespace a prefix of html.
sbmlDoc = None
try:
sbmlDoc = SBMLDocument(3, 1)
except ValueError:
# Do something to handle exceptional situation. Candidate
# causes include invalid combinations of SBML Level and Version
# (impossible if hardwired as given here), running out of memory, and
# unknown system exceptions.
namespaces = sbmlDoc.getNamespaces()
if namespaces == None:
# Do something to handle case of no namespaces.
status = namespaces.add('http://www.w3.org/1999/xhtml', 'html')
if status != LIBSBML_OPERATION_SUCCESS:
# Do something to handle failure.
Parameter 'xmlns' is the XML namespaces to be added.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
* LIBSBML_INVALID_OBJECT
"""
return _libsbml.SBMLNamespaces_addNamespaces(self, xmlns)
def addNamespace(self, uri, prefix):
"""
addNamespace(SBMLNamespaces self, string uri, string prefix) -> int
Add an XML namespace (a pair of URI and prefix) to the set of
namespaces within this SBMLNamespaces object.
Parameter 'uri' is the XML namespace to be added. Parameter 'prefix'
is the prefix of the namespace to be added.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
* LIBSBML_INVALID_OBJECT
"""
return _libsbml.SBMLNamespaces_addNamespace(self, uri, prefix)
def removeNamespace(self, uri):
"""
removeNamespace(SBMLNamespaces self, string uri) -> int
Removes an XML namespace from the set of namespaces within this
SBMLNamespaces object.
Parameter 'uri' is the XML namespace to be added.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INDEX_EXCEEDS_SIZE
"""
return _libsbml.SBMLNamespaces_removeNamespace(self, uri)
def addPackageNamespace(self, *args):
"""
addPackageNamespace(SBMLNamespaces self, string pkgName, unsigned int pkgVersion, string prefix) -> int
addPackageNamespace(SBMLNamespaces self, string pkgName, unsigned int pkgVersion) -> int
Add an XML namespace (a pair of URI and prefix) of a package extension
to the set of namespaces within this SBMLNamespaces object.
The SBML Level and SBML Version of this object is used.
Parameter 'pkgName' is the string of package name (e.g. 'layout',
'multi') Parameter 'pkgVersion' is the package version Parameter
'prefix' is the prefix of the package namespace to be added. The
package's name will be used if the given string is empty (default).
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
Note:
An XML namespace of a non-registered package extension can't be added
by this function (LIBSBML_INVALID_ATTRIBUTE_VALUE will be returned).
See also addNamespace().
"""
return _libsbml.SBMLNamespaces_addPackageNamespace(self, *args)
def addPackageNamespaces(self, xmlns):
"""
addPackageNamespaces(SBMLNamespaces self, XMLNamespaces xmlns) -> int
Add the XML namespaces of package extensions in the given XMLNamespace
object to the set of namespaces within this SBMLNamespaces object
(Non-package XML namespaces are not added by this function).
Parameter 'xmlns' is the XML namespaces to be added.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
Note:
XML namespaces of a non-registered package extensions are not added
(just ignored) by this function. LIBSBML_INVALID_ATTRIBUTE_VALUE will
be returned if the given xmlns is null.
"""
return _libsbml.SBMLNamespaces_addPackageNamespaces(self, xmlns)
def removePackageNamespace(self, level, version, pkgName, pkgVersion):
"""
removePackageNamespace(SBMLNamespaces self, unsigned int level, unsigned int version, string pkgName, unsigned int pkgVersion) -> int
Removes an XML namespace of a package extension from the set of
namespaces within this SBMLNamespaces object.
Parameter 'level' is the SBML level Parameter 'version' is the SBML
version Parameter 'pkgName' is the string of package name (e.g.
'layout', 'multi') Parameter 'pkgVersion' is the package version
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_ATTRIBUTE_VALUE
* LIBSBML_INDEX_EXCEEDS_SIZE
"""
return _libsbml.SBMLNamespaces_removePackageNamespace(self, level, version, pkgName, pkgVersion)
def addPkgNamespace(self, *args):
"""
addPkgNamespace(SBMLNamespaces self, string pkgName, unsigned int pkgVersion, string prefix) -> int
addPkgNamespace(SBMLNamespaces self, string pkgName, unsigned int pkgVersion) -> int
Internal implementation method.
"""
return _libsbml.SBMLNamespaces_addPkgNamespace(self, *args)
def addPkgNamespaces(self, xmlns):
"""
addPkgNamespaces(SBMLNamespaces self, XMLNamespaces xmlns) -> int
Internal implementation method.
"""
return _libsbml.SBMLNamespaces_addPkgNamespaces(self, xmlns)
def removePkgNamespace(self, level, version, pkgName, pkgVersion):
"""
removePkgNamespace(SBMLNamespaces self, unsigned int level, unsigned int version, string pkgName, unsigned int pkgVersion) -> int
Internal implementation method.
"""
return _libsbml.SBMLNamespaces_removePkgNamespace(self, level, version, pkgName, pkgVersion)
def isSBMLNamespace(uri):
"""
isSBMLNamespace(string uri) -> bool
Predicate returning True if the given URL is one of SBML XML
namespaces.
Parameter 'uri' is the URI of namespace
Returns True if the 'uri' is one of SBML namespaces, False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBMLNamespaces_isSBMLNamespace(uri)
if _newclass:
isSBMLNamespace = staticmethod(isSBMLNamespace)
__swig_getmethods__["isSBMLNamespace"] = lambda x: isSBMLNamespace
def isValidCombination(self):
"""
isValidCombination(SBMLNamespaces self) -> bool
Predicate returning True if the given set of namespaces represent a
valid set
Returns True if the set of namespaces is valid, False otherwise.
"""
return _libsbml.SBMLNamespaces_isValidCombination(self)
def getPackageName(self):
"""
getPackageName(SBMLNamespaces self) -> string
Returns the name of the main package for this namespace.
Returns the name of the main package for this namespace. 'core' will
be returned if this namespace is defined in the SBML core.
"""
return _libsbml.SBMLNamespaces_getPackageName(self)
def __eq__(self, rhs):
if ((self is None) and (rhs is None)): return True
if ((self is None) or (rhs is None)): return False
if (hasattr(self, 'this') and hasattr(rhs, 'this')):
if (self.this == rhs.this): return True
return False
def __ne__(self, rhs):
if ((self is None) and (rhs is None)): return False
if ((self is None) or (rhs is None)): return True
if (hasattr(self, 'this') and hasattr(rhs, 'this')):
if (self.this == rhs.this): return False
return True
SBMLNamespaces_swigregister = _libsbml.SBMLNamespaces_swigregister
SBMLNamespaces_swigregister(SBMLNamespaces)
def SBMLNamespaces_getSBMLNamespaceURI(level, version):
"""
SBMLNamespaces_getSBMLNamespaceURI(unsigned int level, unsigned int version) -> string
Returns a string representing the SBML XML namespace for the given
'level' and 'version' of SBML.
Parameter 'level' is the SBML level Parameter 'version' is the SBML
version
Returns a string representing the SBML namespace that reflects the
SBML Level and Version specified.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBMLNamespaces_getSBMLNamespaceURI(level, version)
def SBMLNamespaces_getSupportedNamespaces():
"""
SBMLNamespaces_getSupportedNamespaces() -> List const *
Returns a list of all supported SBMLNamespaces in this version of
libsbml.
Returns a list with supported SBML namespaces.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBMLNamespaces_getSupportedNamespaces()
def SBMLNamespaces_freeSBMLNamespaces(supportedNS):
"""
SBMLNamespaces_freeSBMLNamespaces(List * supportedNS)
Frees the list of supported namespaces as generated by
getSupportedNamespaces().
Parameter 'supportedNS' is the list to be freed.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBMLNamespaces_freeSBMLNamespaces(supportedNS)
def SBMLNamespaces_isSBMLNamespace(uri):
"""
SBMLNamespaces_isSBMLNamespace(string uri) -> bool
Predicate returning True if the given URL is one of SBML XML
namespaces.
Parameter 'uri' is the URI of namespace
Returns True if the 'uri' is one of SBML namespaces, False otherwise.
Note:
Because this is a static method on a class, the Python language
interface for libSBML will contain two variants. One will be the
expected, normal static method on the class (i.e., a regular
methodName), and the other will be a standalone top-level function
with the name ClassName_methodName(). This is merely an artifact of
how the language interfaces are created in libSBML. The methods are
functionally identical.
"""
return _libsbml.SBMLNamespaces_isSBMLNamespace(uri)
class SBMLTransforms(_object):
"""
Internal implementation method.
"""
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, SBMLTransforms, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, SBMLTransforms, name)
__repr__ = _swig_repr
def replaceFD(*args):
"""
replaceFD(ASTNode math, FunctionDefinition fd, IdList idsToExclude=None)
replaceFD(ASTNode math, FunctionDefinition fd)
replaceFD(ASTNode math, ListOfFunctionDefinitions lofd, IdList idsToExclude=None)
replaceFD(ASTNode math, ListOfFunctionDefinitions lofd)
"""
return _libsbml.SBMLTransforms_replaceFD(*args)
if _newclass:
replaceFD = staticmethod(replaceFD)
__swig_getmethods__["replaceFD"] = lambda x: replaceFD
def expandInitialAssignments(m):
"""
expandInitialAssignments(Model m) -> bool
Internal implementation method.
"""
return _libsbml.SBMLTransforms_expandInitialAssignments(m)
if _newclass:
expandInitialAssignments = staticmethod(expandInitialAssignments)
__swig_getmethods__["expandInitialAssignments"] = lambda x: expandInitialAssignments
def evaluateASTNode(node, m=None):
"""
evaluateASTNode(ASTNode node, Model m=None) -> double
evaluateASTNode(ASTNode node) -> double
Internal implementation method.
"""
return _libsbml.SBMLTransforms_evaluateASTNode(node, m)
if _newclass:
evaluateASTNode = staticmethod(evaluateASTNode)
__swig_getmethods__["evaluateASTNode"] = lambda x: evaluateASTNode
def mapComponentValues(m):
"""mapComponentValues(Model m) -> IdList"""
return _libsbml.SBMLTransforms_mapComponentValues(m)
if _newclass:
mapComponentValues = staticmethod(mapComponentValues)
__swig_getmethods__["mapComponentValues"] = lambda x: mapComponentValues
def clearComponentValues():
"""clearComponentValues()"""
return _libsbml.SBMLTransforms_clearComponentValues()
if _newclass:
clearComponentValues = staticmethod(clearComponentValues)
__swig_getmethods__["clearComponentValues"] = lambda x: clearComponentValues
def __init__(self):
"""
__init__(SBMLTransforms self) -> SBMLTransforms
Internal implementation method.
"""
this = _libsbml.new_SBMLTransforms()
try:
self.this.append(this)
except:
self.this = this
__swig_destroy__ = _libsbml.delete_SBMLTransforms
__del__ = lambda self: None
SBMLTransforms_swigregister = _libsbml.SBMLTransforms_swigregister
SBMLTransforms_swigregister(SBMLTransforms)
def SBMLTransforms_replaceFD(*args):
"""
replaceFD(ASTNode math, FunctionDefinition fd, IdList idsToExclude=None)
replaceFD(ASTNode math, FunctionDefinition fd)
replaceFD(ASTNode math, ListOfFunctionDefinitions lofd, IdList idsToExclude=None)
SBMLTransforms_replaceFD(ASTNode math, ListOfFunctionDefinitions lofd)
"""
return _libsbml.SBMLTransforms_replaceFD(*args)
def SBMLTransforms_expandInitialAssignments(m):
"""
SBMLTransforms_expandInitialAssignments(Model m) -> bool
Internal implementation method.
"""
return _libsbml.SBMLTransforms_expandInitialAssignments(m)
def SBMLTransforms_evaluateASTNode(node, m=None):
"""
evaluateASTNode(ASTNode node, Model m=None) -> double
SBMLTransforms_evaluateASTNode(ASTNode node) -> double
Internal implementation method.
"""
return _libsbml.SBMLTransforms_evaluateASTNode(node, m)
def SBMLTransforms_mapComponentValues(m):
"""SBMLTransforms_mapComponentValues(Model m) -> IdList"""
return _libsbml.SBMLTransforms_mapComponentValues(m)
def SBMLTransforms_clearComponentValues():
"""SBMLTransforms_clearComponentValues()"""
return _libsbml.SBMLTransforms_clearComponentValues()
_libsbml.CNV_TYPE_BOOL_swigconstant(_libsbml)
CNV_TYPE_BOOL = _libsbml.CNV_TYPE_BOOL
_libsbml.CNV_TYPE_DOUBLE_swigconstant(_libsbml)
CNV_TYPE_DOUBLE = _libsbml.CNV_TYPE_DOUBLE
_libsbml.CNV_TYPE_INT_swigconstant(_libsbml)
CNV_TYPE_INT = _libsbml.CNV_TYPE_INT
_libsbml.CNV_TYPE_SINGLE_swigconstant(_libsbml)
CNV_TYPE_SINGLE = _libsbml.CNV_TYPE_SINGLE
_libsbml.CNV_TYPE_STRING_swigconstant(_libsbml)
CNV_TYPE_STRING = _libsbml.CNV_TYPE_STRING
class ConversionOption(_object):
"""
A single configuration setting for an SBML converter.
LibSBML provides a number of converters that can perform
transformations on SBML documents. These converters allow their
behaviors to be controlled by setting property values. Converter
properties are communicated using objects of class
ConversionProperties, and within such objects, individual options are
encapsulated using ConversionOption objects.
A ConversionOption object consists of four parts:
* A key, acting as the name of the option.
* A value of this option.
* A type for the value; the type code is chosen from a set of
integer constants whose names all begin with the prefix CNV_TYPE_.
(See the separate subsection below for more information.)
* A description consisting of a text string that describes the
option in some way.
There are no constraints on the values of keys or descriptions;
authors of SBML converters are free to choose them as they see fit.
Conversion option data types
======================================================================
An option in ConversionOption must have a data type declared, to
indicate whether it is a string value, an integer, and so forth. The
possible types of values are taken from a set of constants whose
symbol names begin with the prefix CNV_TYPE_. The following are the
possible values:
Enumerator Meaning
CNV_TYPE_BOOL Indicates the value type is a Boolean.
CNV_TYPE_DOUBLE Indicates the value type is a double-sized float.
CNV_TYPE_INT Indicates the value type is an integer.
CNV_TYPE_SINGLE Indicates the value type is a float.
CNV_TYPE_STRING Indicates the value type is a string.
See also ConversionProperties.
"""
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, ConversionOption, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, ConversionOption, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(ConversionOption self, string key, string value, ConversionOptionType_t type=CNV_TYPE_STRING, string description) -> ConversionOption
__init__(ConversionOption self, string key, string value, ConversionOptionType_t type=CNV_TYPE_STRING) -> ConversionOption
__init__(ConversionOption self, string key, string value) -> ConversionOption
__init__(ConversionOption self, string key) -> ConversionOption
__init__(ConversionOption self, string key, char const * value, string description) -> ConversionOption
__init__(ConversionOption self, string key, char const * value) -> ConversionOption
__init__(ConversionOption self, string key, bool value, string description) -> ConversionOption
__init__(ConversionOption self, string key, bool value) -> ConversionOption
__init__(ConversionOption self, string key, double value, string description) -> ConversionOption
__init__(ConversionOption self, string key, double value) -> ConversionOption
__init__(ConversionOption self, string key, float value, string description) -> ConversionOption
__init__(ConversionOption self, string key, float value) -> ConversionOption
__init__(ConversionOption self, string key, int value, string description) -> ConversionOption
__init__(ConversionOption self, string key, int value) -> ConversionOption
__init__(ConversionOption self, ConversionOption orig) -> ConversionOption
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
ConversionOption(string key, float value, string description='')
Creates a new ConversionOption specialized for float-type options.
Parameter 'key' is the key for this option Parameter 'value' is the
value for this option Parameter 'description' is an optional
description
______________________________________________________________________
Method variant with the following signature:
ConversionOption(string key, string value, string description='')
Creates a new ConversionOption specialized for string-type options.
Parameter 'key' is the key for this option Parameter 'value' is the
value for this option Parameter 'description' is an optional
description
______________________________________________________________________
Method variant with the following signature:
ConversionOption(ConversionOption orig)
Copy constructor; creates a copy of an ConversionOption object.
Parameter 'orig' is the ConversionOption object to copy.
Throws SBMLConstructorException: Thrown if the argument 'orig' is
None.
______________________________________________________________________
Method variant with the following signature:
ConversionOption(string key, string value='',
ConversionOptionType_t type=CNV_TYPE_STRING, string description='')
Creates a new ConversionOption.
This is the general constructor, taking arguments for all aspects of
an option. Other constructors exist with different arguments.
The conversion 'type' argument value must be one of the constants
whose names begin with the characters CNV_TYPE_ in the interface class
libsbml.
Parameter 'key' is the key for this option Parameter 'value' is an
optional value for this option Parameter 'type' is the type of this
option Parameter 'description' is the description for this option
______________________________________________________________________
Method variant with the following signature:
ConversionOption(string key, bool value, string description='')
Creates a new ConversionOption specialized for Boolean-type options.
Parameter 'key' is the key for this option Parameter 'value' is the
value for this option Parameter 'description' is an optional
description
______________________________________________________________________
Method variant with the following signature:
ConversionOption(string key, int value, string description='')
Creates a new ConversionOption specialized for integer-type options.
Parameter 'key' is the key for this option Parameter 'value' is the
value for this option Parameter 'description' is an optional
description
______________________________________________________________________
Method variant with the following signature:
ConversionOption(string key, double value, string description='')
Creates a new ConversionOption specialized for double-type options.
Parameter 'key' is the key for this option Parameter 'value' is the
value for this option Parameter 'description' is an optional
description
"""
this = _libsbml.new_ConversionOption(*args)
try:
self.this.append(this)
except:
self.this = this
__swig_destroy__ = _libsbml.delete_ConversionOption
__del__ = lambda self: None
def clone(self):
"""
clone(ConversionOption self) -> ConversionOption
Creates and returns a deep copy of this ConversionOption object.
Returns the (deep) copy of this ConversionOption object.
"""
return _libsbml.ConversionOption_clone(self)
def getKey(self):
"""
getKey(ConversionOption self) -> string
Returns the key for this option.
Returns the key, as a string.
"""
return _libsbml.ConversionOption_getKey(self)
def setKey(self, key):
"""
setKey(ConversionOption self, string key)
Sets the key for this option.
Parameter 'key' is a string representing the key to set.
"""
return _libsbml.ConversionOption_setKey(self, key)
def getValue(self):
"""
getValue(ConversionOption self) -> string
Returns the value of this option.
Returns the value of this option, as a string.
"""
return _libsbml.ConversionOption_getValue(self)
def setValue(self, value):
"""
setValue(ConversionOption self, string value)
Sets the value for this option.
Parameter 'value' is the value to set, as a string.
"""
return _libsbml.ConversionOption_setValue(self, value)
def getDescription(self):
"""
getDescription(ConversionOption self) -> string
Returns the description string for this option.
Returns the description of this option.
"""
return _libsbml.ConversionOption_getDescription(self)
def setDescription(self, description):
"""
setDescription(ConversionOption self, string description)
Sets the description text for this option.
Parameter 'description' is the description to set for this option.
"""
return _libsbml.ConversionOption_setDescription(self, description)
def getType(self):
"""
getType(ConversionOption self) -> ConversionOptionType_t
Returns the type of this option
Returns the type of this option.
"""
return _libsbml.ConversionOption_getType(self)
def setType(self, type):
"""
setType(ConversionOption self, ConversionOptionType_t type)
Sets the type of this option.
The conversion 'type' argument value must be one of the constants
whose names begin with the characters CNV_TYPE_ in the interface class
libsbml.
Parameter 'type' is the type value to use.
"""
return _libsbml.ConversionOption_setType(self, type)
def getBoolValue(self):
"""
getBoolValue(ConversionOption self) -> bool
Returns the value of this option as a Boolean.
Returns the value of this option.
"""
return _libsbml.ConversionOption_getBoolValue(self)
def setBoolValue(self, value):
"""
setBoolValue(ConversionOption self, bool value)
Set the value of this option to a given Boolean value.
Invoking this method will also set the type of the option to
CNV_TYPE_BOOL.
Parameter 'value' is the Boolean value to set
"""
return _libsbml.ConversionOption_setBoolValue(self, value)
def getDoubleValue(self):
"""
getDoubleValue(ConversionOption self) -> double
Returns the value of this option as a float.
Returns the value of this option.
"""
return _libsbml.ConversionOption_getDoubleValue(self)
def setDoubleValue(self, value):
"""
setDoubleValue(ConversionOption self, double value)
Set the value of this option to a given float value.
Invoking this method will also set the type of the option to
CNV_TYPE_DOUBLE.
Parameter 'value' is the value to set
"""
return _libsbml.ConversionOption_setDoubleValue(self, value)
def getFloatValue(self):
"""
getFloatValue(ConversionOption self) -> float
Returns the value of this option as a float.
Returns the value of this option as a float
"""
return _libsbml.ConversionOption_getFloatValue(self)
def setFloatValue(self, value):
"""
setFloatValue(ConversionOption self, float value)
Set the value of this option to a given float value.
Invoking this method will also set the type of the option to
CNV_TYPE_SINGLE.
Parameter 'value' is the value to set
"""
return _libsbml.ConversionOption_setFloatValue(self, value)
def getIntValue(self):
"""
getIntValue(ConversionOption self) -> int
Returns the value of this option as an integer.
Returns the value of this option, as an int
"""
return _libsbml.ConversionOption_getIntValue(self)
def setIntValue(self, value):
"""
setIntValue(ConversionOption self, int value)
Set the value of this option to a given int value.
Invoking this method will also set the type of the option to
CNV_TYPE_INT.
Parameter 'value' is the value to set
"""
return _libsbml.ConversionOption_setIntValue(self, value)
ConversionOption_swigregister = _libsbml.ConversionOption_swigregister
ConversionOption_swigregister(ConversionOption)
class ConversionProperties(_object):
"""
Set of configuration option values for a converter.
LibSBML provides a number of converters that can perform
transformations on SBML documents. The properties of SBML converters
are communicated using objects of class ConversionProperties, and
within such objects, individual options are encapsulated using
ConversionOption objects. The ConversionProperties class provides
numerous methods for setting and getting options.
ConversionProperties objects are also used to determine the target
SBML namespace when an SBML converter's behavior depends on the
intended Level+Version combination of SBML. In addition, it is
conceivable that conversions may be affected by SBML Level 3 packages
being used by an SBML document; consequently, the packages in use are
also communicated by the values of the SBML namespaces set on a
ConversionProperties object.
General information about the use of SBML converters
======================================================================
The use of all the converters follows a similar approach. First, one
creates a ConversionProperties object and calls
ConversionProperties.addOption() on this object with one arguments: a
text string that identifies the desired converter. (The text string
is specific to each converter; consult the documentation for a given
converter to find out how it should be enabled.)
Next, for some converters, the caller can optionally set some
converter-specific properties using additional calls to
ConversionProperties.addOption(). Many converters provide the ability
to configure their behavior to some extent; this is realized through
the use of properties that offer different options. The default
property values for each converter can be interrogated using the
method SBMLConverter.getDefaultProperties() on the converter class in
question .
Finally, the caller should invoke the method SBMLDocument.convert()
with the ConversionProperties object as an argument.
Example of invoking an SBML converter
......................................................................
The following code fragment illustrates an example using
SBMLReactionConverter, which is invoked using the option string
'replaceReactions':
config = ConversionProperties()
if config != None:
config.addOption('replaceReactions')
In the case of SBMLReactionConverter, there are no options to affect
its behavior, so the next step is simply to invoke the converter on an
SBMLDocument object. Continuing the example code:
# Assume that the variable 'document' has been set to an SBMLDocument object.
status = document.convert(config)
if status != LIBSBML_OPERATION_SUCCESS:
# Handle error somehow.
print('Error: conversion failed due to the following:')
document.printErrors()
Here is an example of using a converter that offers an option. The
following code invokes SBMLStripPackageConverter to remove the SBML
Level 3 Layout package from a model. It sets the name of the package
to be removed by adding a value for the option named 'package' defined
by that converter:
def strip_layout_example(document):
config = ConversionProperties()
if config != None:
config.addOption('stripPackage')
config.addOption('package', 'layout')
status = document.convert(config)
if status != LIBSBML_OPERATION_SUCCESS:
# Handle error somehow.
print('Error: unable to strip the Layout package.')
print('LibSBML returned error: ' + OperationReturnValue_toString(status).strip())
else:
# Handle error somehow.
print('Error: unable to create ConversionProperties object')
Available SBML converters in libSBML
......................................................................
LibSBML provides a number of built-in converters; by convention, their
names end in Converter. The following are the built-in converters
provided by libSBML :
@copydetails doc_list_of_libsbml_converters
See also ConversionOption, SBMLNamespaces.
"""
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, ConversionProperties, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, ConversionProperties, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(ConversionProperties self, SBMLNamespaces targetNS=None) -> ConversionProperties
__init__(ConversionProperties self) -> ConversionProperties
__init__(ConversionProperties self, ConversionProperties orig) -> ConversionProperties
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
ConversionProperties(SBMLNamespaces targetNS=None)
Constructor that initializes the conversion properties with a specific
SBML target namespace.
Parameter 'targetNS' is the target namespace to convert to
______________________________________________________________________
Method variant with the following signature:
ConversionProperties(ConversionProperties orig)
Copy constructor.
Parameter 'orig' is the object to copy.
Throws SBMLConstructorException: Thrown if the argument 'orig' is
None.
"""
this = _libsbml.new_ConversionProperties(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(ConversionProperties self) -> ConversionProperties
Creates and returns a deep copy of this ConversionProperties object.
Returns the (deep) copy of this ConversionProperties object.
"""
return _libsbml.ConversionProperties_clone(self)
__swig_destroy__ = _libsbml.delete_ConversionProperties
__del__ = lambda self: None
def getTargetNamespaces(self):
"""
getTargetNamespaces(ConversionProperties self) -> SBMLNamespaces
Returns the current target SBML namespace.
Returns the SBMLNamepaces object expressing the target namespace.
"""
return _libsbml.ConversionProperties_getTargetNamespaces(self)
def hasTargetNamespaces(self):
"""
hasTargetNamespaces(ConversionProperties self) -> bool
Returns True if the target SBML namespace has been set.
Returns True if the target namespace has been set, False otherwise.
"""
return _libsbml.ConversionProperties_hasTargetNamespaces(self)
def setTargetNamespaces(self, targetNS):
"""
setTargetNamespaces(ConversionProperties self, SBMLNamespaces targetNS)
Sets the target namespace.
Parameter 'targetNS' is the target namespace to use.
"""
return _libsbml.ConversionProperties_setTargetNamespaces(self, targetNS)
def getDescription(self, key):
"""
getDescription(ConversionProperties self, string key) -> string
Returns the description string for a given option in this properties
object.
Parameter 'key' is the key for the option.
Returns the description text of the option with the given key.
"""
return _libsbml.ConversionProperties_getDescription(self, key)
def getType(self, key):
"""
getType(ConversionProperties self, string key) -> ConversionOptionType_t
Returns the type of a given option in this properties object.
Parameter 'key' is the key for the option.
Returns the type of the option with the given key.
"""
return _libsbml.ConversionProperties_getType(self, key)
def getOption(self, *args):
"""
getOption(ConversionProperties self, string key) -> ConversionOption
getOption(ConversionProperties self, int index) -> ConversionOption
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
getOption(int index)
Returns the ConversionOption object for the given index.
Parameter 'index' is the index for the option.
Returns the option with the given index.
______________________________________________________________________
Method variant with the following signature:
getOption(string key)
Returns the ConversionOption object for a given key.
Parameter 'key' is the key for the option.
Returns the option with the given key.
"""
return _libsbml.ConversionProperties_getOption(self, *args)
def addOption(self, *args):
"""
addOption(ConversionProperties self, ConversionOption option)
addOption(ConversionProperties self, string key, string value, ConversionOptionType_t type=CNV_TYPE_STRING, string description)
addOption(ConversionProperties self, string key, string value, ConversionOptionType_t type=CNV_TYPE_STRING)
addOption(ConversionProperties self, string key, string value)
addOption(ConversionProperties self, string key)
addOption(ConversionProperties self, string key, char const * value, string description)
addOption(ConversionProperties self, string key, char const * value)
addOption(ConversionProperties self, string key, bool value, string description)
addOption(ConversionProperties self, string key, bool value)
addOption(ConversionProperties self, string key, double value, string description)
addOption(ConversionProperties self, string key, double value)
addOption(ConversionProperties self, string key, float value, string description)
addOption(ConversionProperties self, string key, float value)
addOption(ConversionProperties self, string key, int value, string description)
addOption(ConversionProperties self, string key, int value)
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
addOption(string key, float value, string description='')
Adds a new ConversionOption object with the given parameters.
Parameter 'key' is the key for the new option Parameter 'value' is the
float value of that option Parameter 'description' is (optional) the
description for the option
______________________________________________________________________
Method variant with the following signature:
addOption(string key, string value, string description='')
Adds a new ConversionOption object with the given parameters.
Parameter 'key' is the key for the new option Parameter 'value' is the
string value of that option Parameter 'description' is (optional) the
description for the option
______________________________________________________________________
Method variant with the following signature:
addOption(string key, string value='', ConversionOptionType_t
type=CNV_TYPE_STRING, string description='')
Adds a new ConversionOption object with the given parameters.
Parameter 'key' is the key for the new option Parameter 'value' is
(optional) the value of that option Parameter 'type' is (optional) the
type of the option (see the documentation for ConversionOption for
more information about the types) Parameter 'description' is
(optional) the description for the option
______________________________________________________________________
Method variant with the following signature:
addOption(string key, bool value, string description='')
Adds a new ConversionOption object with the given parameters.
Parameter 'key' is the key for the new option Parameter 'value' is the
boolean value of that option Parameter 'description' is (optional) the
description for the option
______________________________________________________________________
Method variant with the following signature:
addOption(string key, int value, string description='')
Adds a new ConversionOption object with the given parameters.
Parameter 'key' is the key for the new option Parameter 'value' is the
integer value of that option Parameter 'description' is (optional) the
description for the option
______________________________________________________________________
Method variant with the following signature:
addOption(string key, double value, string description='')
Adds a new ConversionOption object with the given parameters.
Parameter 'key' is the key for the new option Parameter 'value' is the
double value of that option Parameter 'description' is (optional) the
description for the option
______________________________________________________________________
Method variant with the following signature:
addOption(ConversionOption option)
Adds a copy of the given option to this properties object.
Parameter 'option' is the option to add
"""
return _libsbml.ConversionProperties_addOption(self, *args)
def removeOption(self, key):
"""
removeOption(ConversionProperties self, string key) -> ConversionOption
Removes the option with the given key from this properties object.
Parameter 'key' is the key for the new option to remove Returns the
removed option
"""
return _libsbml.ConversionProperties_removeOption(self, key)
def hasOption(self, key):
"""
hasOption(ConversionProperties self, string key) -> bool
Returns True if this properties object contains an option with the
given key.
Parameter 'key' is the key of the option to find.
Returns True if an option with the given 'key' exists in this
properties object, False otherwise.
"""
return _libsbml.ConversionProperties_hasOption(self, key)
def getValue(self, key):
"""
getValue(ConversionProperties self, string key) -> string
Returns the value of the given option as a string.
Parameter 'key' is the key for the option.
Returns the string value of the option with the given key.
"""
return _libsbml.ConversionProperties_getValue(self, key)
def setValue(self, key, value):
"""
setValue(ConversionProperties self, string key, string value)
Sets the value of the given option to a string.
Parameter 'key' is the key for the option Parameter 'value' is the new
value
"""
return _libsbml.ConversionProperties_setValue(self, key, value)
def getBoolValue(self, key):
"""
getBoolValue(ConversionProperties self, string key) -> bool
Returns the value of the given option as a Boolean.
Parameter 'key' is the key for the option.
Returns the boolean value of the option with the given key.
"""
return _libsbml.ConversionProperties_getBoolValue(self, key)
def setBoolValue(self, key, value):
"""
setBoolValue(ConversionProperties self, string key, bool value)
Sets the value of the given option to a Boolean.
Parameter 'key' is the key for the option.
Parameter 'value' is the new Boolean value.
"""
return _libsbml.ConversionProperties_setBoolValue(self, key, value)
def getDoubleValue(self, key):
"""
getDoubleValue(ConversionProperties self, string key) -> double
Returns the value of the given option as a float.
Parameter 'key' is the key for the option.
Returns the double value of the option with the given key.
"""
return _libsbml.ConversionProperties_getDoubleValue(self, key)
def setDoubleValue(self, key, value):
"""
setDoubleValue(ConversionProperties self, string key, double value)
Sets the value of the given option to a float.
Parameter 'key' is the key for the option.
Parameter 'value' is the new double value.
"""
return _libsbml.ConversionProperties_setDoubleValue(self, key, value)
def getFloatValue(self, key):
"""
getFloatValue(ConversionProperties self, string key) -> float
Returns the value of the given option as a float.
Parameter 'key' is the key for the option.
Returns the float value of the option with the given key.
"""
return _libsbml.ConversionProperties_getFloatValue(self, key)
def setFloatValue(self, key, value):
"""
setFloatValue(ConversionProperties self, string key, float value)
Sets the value of the given option to a float.
Parameter 'key' is the key for the option.
Parameter 'value' is the new float value.
"""
return _libsbml.ConversionProperties_setFloatValue(self, key, value)
def getIntValue(self, key):
"""
getIntValue(ConversionProperties self, string key) -> int
Returns the value of the given option as an integer.
Parameter 'key' is the key for the option.
Returns the int value of the option with the given key.
"""
return _libsbml.ConversionProperties_getIntValue(self, key)
def setIntValue(self, key, value):
"""
setIntValue(ConversionProperties self, string key, int value)
Sets the value of the given option to an integer.
Parameter 'key' is the key for the option.
Parameter 'value' is the new integer value.
"""
return _libsbml.ConversionProperties_setIntValue(self, key, value)
def getNumOptions(self):
"""
getNumOptions(ConversionProperties self) -> int
Returns the number of options in this Conversion Properties object
Returns the number of options in this properties object
"""
return _libsbml.ConversionProperties_getNumOptions(self)
ConversionProperties_swigregister = _libsbml.ConversionProperties_swigregister
ConversionProperties_swigregister(ConversionProperties)
class SBMLConverter(_object):
"""
Base class for SBML converters.
The SBMLConverter class is the base class for the various SBML
converters: classes of objects that transform or convert SBML
documents. These transformations can involve essentially anything that
can be written algorithmically; examples include converting the units
of measurement in a model, or converting from one Level+Version
combination of SBML to another. Applications can also create their
own converters by subclassing SBMLConverter and following the examples
of the existing converters.
General information about the use of SBML converters
======================================================================
The use of all the converters follows a similar approach. First, one
creates a ConversionProperties object and calls
ConversionProperties.addOption() on this object with one arguments: a
text string that identifies the desired converter. (The text string
is specific to each converter; consult the documentation for a given
converter to find out how it should be enabled.)
Next, for some converters, the caller can optionally set some
converter-specific properties using additional calls to
ConversionProperties.addOption(). Many converters provide the ability
to configure their behavior to some extent; this is realized through
the use of properties that offer different options. The default
property values for each converter can be interrogated using the
method SBMLConverter.getDefaultProperties() on the converter class in
question .
Finally, the caller should invoke the method SBMLDocument.convert()
with the ConversionProperties object as an argument.
Example of invoking an SBML converter
......................................................................
The following code fragment illustrates an example using
SBMLReactionConverter, which is invoked using the option string
'replaceReactions':
config = ConversionProperties()
if config != None:
config.addOption('replaceReactions')
In the case of SBMLReactionConverter, there are no options to affect
its behavior, so the next step is simply to invoke the converter on an
SBMLDocument object. Continuing the example code:
# Assume that the variable 'document' has been set to an SBMLDocument object.
status = document.convert(config)
if status != LIBSBML_OPERATION_SUCCESS:
# Handle error somehow.
print('Error: conversion failed due to the following:')
document.printErrors()
Here is an example of using a converter that offers an option. The
following code invokes SBMLStripPackageConverter to remove the SBML
Level 3 Layout package from a model. It sets the name of the package
to be removed by adding a value for the option named 'package' defined
by that converter:
def strip_layout_example(document):
config = ConversionProperties()
if config != None:
config.addOption('stripPackage')
config.addOption('package', 'layout')
status = document.convert(config)
if status != LIBSBML_OPERATION_SUCCESS:
# Handle error somehow.
print('Error: unable to strip the Layout package.')
print('LibSBML returned error: ' + OperationReturnValue_toString(status).strip())
else:
# Handle error somehow.
print('Error: unable to create ConversionProperties object')
Available SBML converters in libSBML
......................................................................
LibSBML provides a number of built-in converters; by convention, their
names end in Converter. The following are the built-in converters
provided by libSBML :
@copydetails doc_list_of_libsbml_converters
"""
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, SBMLConverter, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, SBMLConverter, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(SBMLConverter self) -> SBMLConverter
__init__(SBMLConverter self, string name) -> SBMLConverter
__init__(SBMLConverter self, SBMLConverter orig) -> SBMLConverter
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
SBMLConverter()
Creates a new SBMLConverter object.
______________________________________________________________________
Method variant with the following signature:
SBMLConverter(SBMLConverter orig)
Copy constructor.
This creates a copy of an SBMLConverter object.
Parameter 'orig' is the SBMLConverter object to copy.
Throws SBMLConstructorException: Thrown if the argument 'orig' is
None.
______________________________________________________________________
Method variant with the following signature:
SBMLConverter(string name)
Creates a new SBMLConverter object with a given name.
Parameter 'name' is the name for the converter to create
"""
if self.__class__ == SBMLConverter:
_self = None
else:
_self = self
this = _libsbml.new_SBMLConverter(_self, *args)
try:
self.this.append(this)
except:
self.this = this
__swig_destroy__ = _libsbml.delete_SBMLConverter
__del__ = lambda self: None
def clone(self):
"""
clone(SBMLConverter self) -> SBMLConverter
Creates and returns a deep copy of this SBMLConverter object.
Returns the (deep) copy of this SBMLConverter object.
"""
return _libsbml.SBMLConverter_clone(self)
def getDocument(self, *args):
"""
getDocument(SBMLConverter self) -> SBMLDocument
getDocument(SBMLConverter self) -> SBMLDocument
Returns the SBML document that is the subject of the conversions.
Returns the current SBMLDocument object.
"""
return _libsbml.SBMLConverter_getDocument(self, *args)
def getDefaultProperties(self):
"""
getDefaultProperties(SBMLConverter self) -> ConversionProperties
Returns the default properties of this converter.
A given converter exposes one or more properties that can be adjusted
in order to influence the behavior of the converter. This method
returns the default property settings for this converter. It is meant
to be called in order to discover all the settings for the converter
object. The run-time properties of the converter object can be
adjusted by using the method SBMLConverter.setProperties().
Returns the default properties for the converter.
See also setProperties(), matchesProperties().
"""
return _libsbml.SBMLConverter_getDefaultProperties(self)
def getTargetNamespaces(self):
"""
getTargetNamespaces(SBMLConverter self) -> SBMLNamespaces
Returns the target SBML namespaces of the currently set properties.
SBML namespaces are used by libSBML to express the Level+Version of
the SBML document (and, possibly, any SBML Level 3 packages in use).
Some converters' behavior is affected by the SBML namespace configured
in the converter. For example, in SBMLLevelVersionConverter (the
converter for converting SBML documents from one Level+Version
combination to another), the actions are fundamentally dependent on
the SBML namespaces targeted.
Returns the SBMLNamespaces object that describes the SBML namespaces
in effect, or None if none are set.
"""
return _libsbml.SBMLConverter_getTargetNamespaces(self)
def matchesProperties(self, props):
"""
matchesProperties(SBMLConverter self, ConversionProperties props) -> bool
Returns True if this converter matches the given properties.
Given a ConversionProperties object 'props', this method checks that
'props' possesses an option value to enable this converter. If it
does, this method returns True.
Parameter 'props' is the properties to match.
Returns True if the properties 'props' would match the necessary
properties for this type of converter, False otherwise.
"""
return _libsbml.SBMLConverter_matchesProperties(self, props)
def setDocument(self, doc):
"""
setDocument(SBMLConverter self, SBMLDocument doc) -> int
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
setDocument(SBMLDocument doc)
Sets the SBML document to be converted.
Parameter 'doc' is the document to use for this conversion.
Returns integer value indicating the success/failure of the operation.
The set of possible values that may be returned ultimately depends on
the specific subclass of SBMLConverter being used, but the default
method can return the following:
* LIBSBML_OPERATION_SUCCESS
______________________________________________________________________
Method variant with the following signature:
setDocument(SBMLDocument doc)
Sets the SBML document to be converted.
Parameter 'doc' is the document to use for this conversion.
Returns integer value indicating the success/failure of the operation.
The set of possible values that may be returned ultimately depends on
the specific subclass of SBMLConverter being used, but the default
method can return the following:
* LIBSBML_OPERATION_SUCCESS
"""
return _libsbml.SBMLConverter_setDocument(self, doc)
def setProperties(self, props):
"""
setProperties(SBMLConverter self, ConversionProperties props) -> int
Sets the configuration properties to be used by this converter.
Parameter 'props' is the ConversionProperties object defining the
properties to set.
Returns integer value indicating the success/failure of the operation.
The set of possible values that may be returned ultimately depends on
the specific subclass of SBMLConverter being used, but the default
method can return the following values:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
See also getProperties(), matchesProperties().
"""
return _libsbml.SBMLConverter_setProperties(self, props)
def getProperties(self):
"""
getProperties(SBMLConverter self) -> ConversionProperties
Returns the current properties in effect for this converter.
A given converter exposes one or more properties that can be adjusted
in order to influence the behavior of the converter. This method
returns the current properties for this converter; in other words, the
settings in effect at this moment. To change the property values, you
can use SBMLConverter.setProperties().
Returns the currently set configuration properties.
See also setProperties(), matchesProperties().
"""
return _libsbml.SBMLConverter_getProperties(self)
def convert(self):
"""
convert(SBMLConverter self) -> int
Perform the conversion.
This method causes the converter to do the actual conversion work,
that is, to convert the SBMLDocument object set by
SBMLConverter.setDocument() and with the configuration options set by
SBMLConverter.setProperties().
Returns integer value indicating the success/failure of the operation.
The set of possible values that may be returned depends on the
converter subclass; please consult the documentation for the relevant
class to find out what the possibilities are.
"""
return _libsbml.SBMLConverter_convert(self)
def getName(self):
"""
getName(SBMLConverter self) -> string
Returns the name of this converter.
Returns a string, the name of this converter.
"""
return _libsbml.SBMLConverter_getName(self)
def __disown__(self):
self.this.disown()
_libsbml.disown_SBMLConverter(self)
return weakref_proxy(self)
SBMLConverter_swigregister = _libsbml.SBMLConverter_swigregister
SBMLConverter_swigregister(SBMLConverter)
class SBMLConverterRegistry(_object):
"""
Registry of all libSBML SBML converters.
LibSBML provides facilities for transforming and converting SBML
documents in various ways. These transformations can involve
essentially anything that can be written algorithmically; examples
include converting the units of measurement in a model, or converting
from one Level+Version combination of SBML to another. Converters are
implemented as objects derived from the class SBMLConverter.
The converter registry, implemented as a singleton object of class
SBMLConverterRegistry, maintains a list of known converters and
provides methods for discovering them. Callers can use the method
SBMLConverterRegistry.getNumConverters() to find out how many
converters are registered, then use
SBMLConverterRegistry.getConverterByIndex() to iterate over each one;
alternatively, callers can use SBMLConverterRegistry.getConverterFor()
to search for a converter having specific properties.
"""
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, SBMLConverterRegistry, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, SBMLConverterRegistry, name)
def __init__(self, *args, **kwargs):
raise AttributeError("No constructor defined")
__repr__ = _swig_repr
def getInstance():
"""
getInstance() -> SBMLConverterRegistry
Returns the singleton instance for the converter registry.
Prior to using the registry, callers have to obtain a copy of the
registry. This static method provides the means for doing that.
Returns the singleton for the converter registry.
"""
return _libsbml.SBMLConverterRegistry_getInstance()
if _newclass:
getInstance = staticmethod(getInstance)
__swig_getmethods__["getInstance"] = lambda x: getInstance
def addConverter(self, converter):
"""
addConverter(SBMLConverterRegistry self, SBMLConverter converter) -> int
Adds the given converter to the registry of SBML converters.
Parameter 'converter' is the converter to add to the registry.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_OBJECT
"""
return _libsbml.SBMLConverterRegistry_addConverter(self, converter)
def getConverterByIndex(self, index):
"""
getConverterByIndex(SBMLConverterRegistry self, int index) -> SBMLConverter
Returns the converter with the given index number.
Converters are given arbitrary index numbers by the registry. Callers
can use the method SBMLConverterRegistry.getNumConverters() to find
out how many converters are registered, then use this method to
iterate over the list and obtain each one in turn.
Parameter 'index' is the zero-based index of the converter to fetch.
Returns the converter with the given index number, or None if the
number is less than 0 or there is no converter at the given index
position.
"""
return _libsbml.SBMLConverterRegistry_getConverterByIndex(self, index)
def getConverterFor(self, props):
"""
getConverterFor(SBMLConverterRegistry self, ConversionProperties props) -> SBMLConverter
Returns the converter that best matches the given configuration
properties.
Many converters provide the ability to configure their behavior. This
is realized through the use of properties that offer different
options. The present method allows callers to search for converters
that have specific property values. Callers can do this by creating a
ConversionProperties object, adding the desired option(s) to the
object, then passing the object to this method.
Parameter 'props' is a ConversionProperties object defining the
properties to match against.
Returns the converter matching the properties, or None if no suitable
converter is found.
See also getConverterByIndex().
"""
return _libsbml.SBMLConverterRegistry_getConverterFor(self, props)
def getNumConverters(self):
"""
getNumConverters(SBMLConverterRegistry self) -> int
Returns the number of converters known by the registry.
Returns the number of registered converters.
See also getConverterByIndex().
"""
return _libsbml.SBMLConverterRegistry_getNumConverters(self)
__swig_destroy__ = _libsbml.delete_SBMLConverterRegistry
__del__ = lambda self: None
SBMLConverterRegistry_swigregister = _libsbml.SBMLConverterRegistry_swigregister
SBMLConverterRegistry_swigregister(SBMLConverterRegistry)
def SBMLConverterRegistry_getInstance():
"""
SBMLConverterRegistry_getInstance() -> SBMLConverterRegistry
Returns the singleton instance for the converter registry.
Prior to using the registry, callers have to obtain a copy of the
registry. This static method provides the means for doing that.
Returns the singleton for the converter registry.
"""
return _libsbml.SBMLConverterRegistry_getInstance()
class SBMLFunctionDefinitionConverter(SBMLConverter):
"""
Converter to expand user-defined functions in-line.
This converter manipulates user-defined functions in an SBML file.
When invoked on a model, it performs the following operations:
* Reads the list of user-defined functions in the model (i.e., the
list of FunctionDefinition objects);
* Looks for invocations of the function in mathematical expressions
throughout the model; and
* For each invocation found, replaces the invocation with a in-line
copy of the function's body, similar to how macro expansions might be
performed in scripting and programming languages.
For example, suppose the model contains a function definition
representing the function f(x, y) = x * y. Further suppose this
functions invoked somewhere else in the model, in a mathematical
formula, as f(s, p). The outcome of running
SBMLFunctionDefinitionConverter on the model will be to replace the
call to f with the expression s * p.
Configuration and use of SBMLFunctionDefinitionConverter
======================================================================
SBMLFunctionDefinitionConverter is enabled by creating a
ConversionProperties object with the option
'expandFunctionDefinitions', and passing this properties object to
SBMLDocument.convert(). The converter accepts one option:
* 'skipIds': if set, it should be a string containing a comma-
separated list of identifiers (SBML 'id' values) that are to be
skipped during function conversion. Functions whose identifiers are
found in this list will not be converted.
General information about the use of SBML converters
======================================================================
The use of all the converters follows a similar approach. First, one
creates a ConversionProperties object and calls
ConversionProperties.addOption() on this object with one arguments: a
text string that identifies the desired converter. (The text string
is specific to each converter; consult the documentation for a given
converter to find out how it should be enabled.)
Next, for some converters, the caller can optionally set some
converter-specific properties using additional calls to
ConversionProperties.addOption(). Many converters provide the ability
to configure their behavior to some extent; this is realized through
the use of properties that offer different options. The default
property values for each converter can be interrogated using the
method SBMLConverter.getDefaultProperties() on the converter class in
question .
Finally, the caller should invoke the method SBMLDocument.convert()
with the ConversionProperties object as an argument.
Example of invoking an SBML converter
......................................................................
The following code fragment illustrates an example using
SBMLReactionConverter, which is invoked using the option string
'replaceReactions':
config = ConversionProperties()
if config != None:
config.addOption('replaceReactions')
In the case of SBMLReactionConverter, there are no options to affect
its behavior, so the next step is simply to invoke the converter on an
SBMLDocument object. Continuing the example code:
# Assume that the variable 'document' has been set to an SBMLDocument object.
status = document.convert(config)
if status != LIBSBML_OPERATION_SUCCESS:
# Handle error somehow.
print('Error: conversion failed due to the following:')
document.printErrors()
Here is an example of using a converter that offers an option. The
following code invokes SBMLStripPackageConverter to remove the SBML
Level 3 Layout package from a model. It sets the name of the package
to be removed by adding a value for the option named 'package' defined
by that converter:
def strip_layout_example(document):
config = ConversionProperties()
if config != None:
config.addOption('stripPackage')
config.addOption('package', 'layout')
status = document.convert(config)
if status != LIBSBML_OPERATION_SUCCESS:
# Handle error somehow.
print('Error: unable to strip the Layout package.')
print('LibSBML returned error: ' + OperationReturnValue_toString(status).strip())
else:
# Handle error somehow.
print('Error: unable to create ConversionProperties object')
Available SBML converters in libSBML
......................................................................
LibSBML provides a number of built-in converters; by convention, their
names end in Converter. The following are the built-in converters
provided by libSBML :
@copydetails doc_list_of_libsbml_converters
"""
__swig_setmethods__ = {}
for _s in [SBMLConverter]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, SBMLFunctionDefinitionConverter, name, value)
__swig_getmethods__ = {}
for _s in [SBMLConverter]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, SBMLFunctionDefinitionConverter, name)
__repr__ = _swig_repr
def init():
"""
init()
Internal implementation method.
"""
return _libsbml.SBMLFunctionDefinitionConverter_init()
if _newclass:
init = staticmethod(init)
__swig_getmethods__["init"] = lambda x: init
def __init__(self, *args):
"""
__init__(SBMLFunctionDefinitionConverter self) -> SBMLFunctionDefinitionConverter
__init__(SBMLFunctionDefinitionConverter self, SBMLFunctionDefinitionConverter obj) -> SBMLFunctionDefinitionConverter
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
SBMLFunctionDefinitionConverter()
Creates a new SBMLFunctionDefinitionConverter object.
______________________________________________________________________
Method variant with the following signature:
SBMLFunctionDefinitionConverter(SBMLFunctionDefinitionConverter
obj)
Copy constructor; creates a copy of an SBMLFunctionDefinitionConverter
object.
Parameter 'obj' is the SBMLFunctionDefinitionConverter object to copy.
"""
this = _libsbml.new_SBMLFunctionDefinitionConverter(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(SBMLFunctionDefinitionConverter self) -> SBMLFunctionDefinitionConverter
Creates and returns a deep copy of this
SBMLFunctionDefinitionConverter object.
Returns a (deep) copy of this converter.
"""
return _libsbml.SBMLFunctionDefinitionConverter_clone(self)
__swig_destroy__ = _libsbml.delete_SBMLFunctionDefinitionConverter
__del__ = lambda self: None
def matchesProperties(self, props):
"""
matchesProperties(SBMLFunctionDefinitionConverter self, ConversionProperties props) -> bool
Returns True if this converter object's properties match the given
properties.
A typical use of this method involves creating a ConversionProperties
object, setting the options desired, and then calling this method on
an SBMLFunctionDefinitionConverter object to find out if the object's
property values match the given ones. This method is also used by
SBMLConverterRegistry.getConverterFor() to search across all
registered converters for one matching particular properties.
Parameter 'props' is the properties to match.
Returns True if this converter's properties match, False otherwise.
"""
return _libsbml.SBMLFunctionDefinitionConverter_matchesProperties(self, props)
def convert(self):
"""
convert(SBMLFunctionDefinitionConverter self) -> int
Perform the conversion.
This method causes the converter to do the actual conversion work,
that is, to convert the SBMLDocument object set by
SBMLConverter.setDocument() and with the configuration options set by
SBMLConverter.setProperties().
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
* LIBSBML_INVALID_OBJECT
* LIBSBML_CONV_INVALID_SRC_DOCUMENT
"""
return _libsbml.SBMLFunctionDefinitionConverter_convert(self)
def getDefaultProperties(self):
"""
getDefaultProperties(SBMLFunctionDefinitionConverter self) -> ConversionProperties
Returns the default properties of this converter.
A given converter exposes one or more properties that can be adjusted
in order to influence the behavior of the converter. This method
returns the default property settings for this converter. It is meant
to be called in order to discover all the settings for the converter
object.
Returns the ConversionProperties object describing the default
properties for this converter.
"""
return _libsbml.SBMLFunctionDefinitionConverter_getDefaultProperties(self)
SBMLFunctionDefinitionConverter_swigregister = _libsbml.SBMLFunctionDefinitionConverter_swigregister
SBMLFunctionDefinitionConverter_swigregister(SBMLFunctionDefinitionConverter)
def SBMLFunctionDefinitionConverter_init():
"""
SBMLFunctionDefinitionConverter_init()
Internal implementation method.
"""
return _libsbml.SBMLFunctionDefinitionConverter_init()
class SBMLIdConverter(SBMLConverter):
"""
Converter for replacing object identifiers.
This converter translates all instances of a given identifier (i.e.,
SBML object 'id' attribute value) of type 'SId' in a Model to another
identifier. It does this based on a list of source identifiers,
translating each one to its corresponding replacement value in a list
of replacement identifiers. It also updates all references to the
identifiers so replaced. (More technically, it replaces all values
known as type SIdRef in the SBML Level 3 specifications.)
This converter only searches the global SId namespace for the Model
child of the SBMLDocument. It does not replace any IDs or SIdRefs
for LocalParameters, nor does it replace any UnitSIds or UnitSIdRefs.
It likewise does not replace any IDs in a new namespace introduced by
a package, such as the PortSId namespace from the Hierarchical Model
Composition package, nor any Model objects that are not the direct
child of the SBMLDocument, such as the ModelDefinitions from the
Hierarchical Model Composition package.
If, however, a package introduces a new element with an 'id' attribute
of type SId, any attribute of type SIdRef, or child of type SIdRef
(such as a new Math child of a package element), those IDs will be
replaced if they match a source identifier.
Configuration and use of SBMLIdConverter
======================================================================
SBMLIdConverter is enabled by creating a ConversionProperties object
with the option 'renameSIds', and passing this properties object to
SBMLDocument.convert(). The converter accepts two options, and both
must be set or else no conversion is performed:
* 'currentIds': A comma-separated list of identifiers to replace.
* 'newIds': A comma-separated list of identifiers to use as the
replacements. The values should correspond one-to-one with the
identifiers in 'currentIds' that should be replaced.
General information about the use of SBML converters
======================================================================
The use of all the converters follows a similar approach. First, one
creates a ConversionProperties object and calls
ConversionProperties.addOption() on this object with one arguments: a
text string that identifies the desired converter. (The text string
is specific to each converter; consult the documentation for a given
converter to find out how it should be enabled.)
Next, for some converters, the caller can optionally set some
converter-specific properties using additional calls to
ConversionProperties.addOption(). Many converters provide the ability
to configure their behavior to some extent; this is realized through
the use of properties that offer different options. The default
property values for each converter can be interrogated using the
method SBMLConverter.getDefaultProperties() on the converter class in
question .
Finally, the caller should invoke the method SBMLDocument.convert()
with the ConversionProperties object as an argument.
Example of invoking an SBML converter
......................................................................
The following code fragment illustrates an example using
SBMLReactionConverter, which is invoked using the option string
'replaceReactions':
config = ConversionProperties()
if config != None:
config.addOption('replaceReactions')
In the case of SBMLReactionConverter, there are no options to affect
its behavior, so the next step is simply to invoke the converter on an
SBMLDocument object. Continuing the example code:
# Assume that the variable 'document' has been set to an SBMLDocument object.
status = document.convert(config)
if status != LIBSBML_OPERATION_SUCCESS:
# Handle error somehow.
print('Error: conversion failed due to the following:')
document.printErrors()
Here is an example of using a converter that offers an option. The
following code invokes SBMLStripPackageConverter to remove the SBML
Level 3 Layout package from a model. It sets the name of the package
to be removed by adding a value for the option named 'package' defined
by that converter:
def strip_layout_example(document):
config = ConversionProperties()
if config != None:
config.addOption('stripPackage')
config.addOption('package', 'layout')
status = document.convert(config)
if status != LIBSBML_OPERATION_SUCCESS:
# Handle error somehow.
print('Error: unable to strip the Layout package.')
print('LibSBML returned error: ' + OperationReturnValue_toString(status).strip())
else:
# Handle error somehow.
print('Error: unable to create ConversionProperties object')
Available SBML converters in libSBML
......................................................................
LibSBML provides a number of built-in converters; by convention, their
names end in Converter. The following are the built-in converters
provided by libSBML :
@copydetails doc_list_of_libsbml_converters
"""
__swig_setmethods__ = {}
for _s in [SBMLConverter]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, SBMLIdConverter, name, value)
__swig_getmethods__ = {}
for _s in [SBMLConverter]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, SBMLIdConverter, name)
__repr__ = _swig_repr
def init():
"""
init()
Internal implementation method.
"""
return _libsbml.SBMLIdConverter_init()
if _newclass:
init = staticmethod(init)
__swig_getmethods__["init"] = lambda x: init
def __init__(self, *args):
"""
__init__(SBMLIdConverter self) -> SBMLIdConverter
__init__(SBMLIdConverter self, SBMLIdConverter obj) -> SBMLIdConverter
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
SBMLIdConverter()
Creates a new SBMLIdConverter object.
______________________________________________________________________
Method variant with the following signature:
SBMLIdConverter(SBMLIdConverter obj)
Copy constructor; creates a copy of an SBMLIdConverter object.
Parameter 'obj' is the SBMLIdConverter object to copy.
"""
this = _libsbml.new_SBMLIdConverter(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(SBMLIdConverter self) -> SBMLIdConverter
Creates and returns a deep copy of this SBMLIdConverter object.
Returns a (deep) copy of this converter.
"""
return _libsbml.SBMLIdConverter_clone(self)
__swig_destroy__ = _libsbml.delete_SBMLIdConverter
__del__ = lambda self: None
def matchesProperties(self, props):
"""
matchesProperties(SBMLIdConverter self, ConversionProperties props) -> bool
Returns True if this converter object's properties match the given
properties.
A typical use of this method involves creating a ConversionProperties
object, setting the options desired, and then calling this method on
an SBMLIdConverter object to find out if the object's property values
match the given ones. This method is also used by
SBMLConverterRegistry.getConverterFor() to search across all
registered converters for one matching particular properties.
Parameter 'props' is the properties to match.
Returns True if this converter's properties match, False otherwise.
"""
return _libsbml.SBMLIdConverter_matchesProperties(self, props)
def convert(self):
"""
convert(SBMLIdConverter self) -> int
Perform the conversion.
This method causes the converter to do the actual conversion work,
that is, to convert the SBMLDocument object set by
SBMLConverter.setDocument() and with the configuration options set by
SBMLConverter.setProperties().
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
* LIBSBML_INVALID_OBJECT
* LIBSBML_UNEXPECTED_ATTRIBUTE
* LIBSBML_INVALID_ATTRIBUTE_VALUE
"""
return _libsbml.SBMLIdConverter_convert(self)
def getDefaultProperties(self):
"""
getDefaultProperties(SBMLIdConverter self) -> ConversionProperties
Returns the default properties of this converter.
A given converter exposes one or more properties that can be adjusted
in order to influence the behavior of the converter. This method
returns the default property settings for this converter. It is meant
to be called in order to discover all the settings for the converter
object.
Returns the ConversionProperties object describing the default
properties for this converter.
"""
return _libsbml.SBMLIdConverter_getDefaultProperties(self)
SBMLIdConverter_swigregister = _libsbml.SBMLIdConverter_swigregister
SBMLIdConverter_swigregister(SBMLIdConverter)
def SBMLIdConverter_init():
"""
SBMLIdConverter_init()
Internal implementation method.
"""
return _libsbml.SBMLIdConverter_init()
class SBMLInferUnitsConverter(SBMLConverter):
"""
Converter for inferring and setting parameter units.
This SBML converter takes an SBML document and attempts to infer
units for any Parameter objects whose units are undeclared. It then
sets the 'units' attribute of those parameters to the units inferred
(if necessary, creating new UnitDefinition objects on the model in the
process).
Configuration and use of SBMLInferUnitsConverter
======================================================================
SBMLInferUnitsConverter is enabled by creating a ConversionProperties
object with the option 'inferUnits', and passing this properties
object to SBMLDocument.convert(). The converter offers no other
options.
General information about the use of SBML converters
======================================================================
The use of all the converters follows a similar approach. First, one
creates a ConversionProperties object and calls
ConversionProperties.addOption() on this object with one arguments: a
text string that identifies the desired converter. (The text string
is specific to each converter; consult the documentation for a given
converter to find out how it should be enabled.)
Next, for some converters, the caller can optionally set some
converter-specific properties using additional calls to
ConversionProperties.addOption(). Many converters provide the ability
to configure their behavior to some extent; this is realized through
the use of properties that offer different options. The default
property values for each converter can be interrogated using the
method SBMLConverter.getDefaultProperties() on the converter class in
question .
Finally, the caller should invoke the method SBMLDocument.convert()
with the ConversionProperties object as an argument.
Example of invoking an SBML converter
......................................................................
The following code fragment illustrates an example using
SBMLReactionConverter, which is invoked using the option string
'replaceReactions':
config = ConversionProperties()
if config != None:
config.addOption('replaceReactions')
In the case of SBMLReactionConverter, there are no options to affect
its behavior, so the next step is simply to invoke the converter on an
SBMLDocument object. Continuing the example code:
# Assume that the variable 'document' has been set to an SBMLDocument object.
status = document.convert(config)
if status != LIBSBML_OPERATION_SUCCESS:
# Handle error somehow.
print('Error: conversion failed due to the following:')
document.printErrors()
Here is an example of using a converter that offers an option. The
following code invokes SBMLStripPackageConverter to remove the SBML
Level 3 Layout package from a model. It sets the name of the package
to be removed by adding a value for the option named 'package' defined
by that converter:
def strip_layout_example(document):
config = ConversionProperties()
if config != None:
config.addOption('stripPackage')
config.addOption('package', 'layout')
status = document.convert(config)
if status != LIBSBML_OPERATION_SUCCESS:
# Handle error somehow.
print('Error: unable to strip the Layout package.')
print('LibSBML returned error: ' + OperationReturnValue_toString(status).strip())
else:
# Handle error somehow.
print('Error: unable to create ConversionProperties object')
Available SBML converters in libSBML
......................................................................
LibSBML provides a number of built-in converters; by convention, their
names end in Converter. The following are the built-in converters
provided by libSBML :
@copydetails doc_list_of_libsbml_converters
"""
__swig_setmethods__ = {}
for _s in [SBMLConverter]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, SBMLInferUnitsConverter, name, value)
__swig_getmethods__ = {}
for _s in [SBMLConverter]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, SBMLInferUnitsConverter, name)
__repr__ = _swig_repr
def init():
"""
init()
Internal implementation method.
"""
return _libsbml.SBMLInferUnitsConverter_init()
if _newclass:
init = staticmethod(init)
__swig_getmethods__["init"] = lambda x: init
def __init__(self, *args):
"""
__init__(SBMLInferUnitsConverter self) -> SBMLInferUnitsConverter
__init__(SBMLInferUnitsConverter self, SBMLInferUnitsConverter obj) -> SBMLInferUnitsConverter
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
SBMLInferUnitsConverter()
Creates a new SBMLInferUnitsConverter object.
______________________________________________________________________
Method variant with the following signature:
SBMLInferUnitsConverter(SBMLInferUnitsConverter obj)
Copy constructor; creates a copy of an SBMLInferUnitsConverter object.
Parameter 'obj' is the SBMLInferUnitsConverter object to copy.
"""
this = _libsbml.new_SBMLInferUnitsConverter(*args)
try:
self.this.append(this)
except:
self.this = this
__swig_destroy__ = _libsbml.delete_SBMLInferUnitsConverter
__del__ = lambda self: None
def clone(self):
"""
clone(SBMLInferUnitsConverter self) -> SBMLInferUnitsConverter
Creates and returns a deep copy of this SBMLInferUnitsConverter
object.
Returns a (deep) copy of this converter.
"""
return _libsbml.SBMLInferUnitsConverter_clone(self)
def matchesProperties(self, props):
"""
matchesProperties(SBMLInferUnitsConverter self, ConversionProperties props) -> bool
Returns True if this converter object's properties match the given
properties.
A typical use of this method involves creating a ConversionProperties
object, setting the options desired, and then calling this method on
an SBMLInferUnitsConverter object to find out if the object's property
values match the given ones. This method is also used by
SBMLConverterRegistry.getConverterFor() to search across all
registered converters for one matching particular properties.
Parameter 'props' is the properties to match.
Returns True if this converter's properties match, False otherwise.
"""
return _libsbml.SBMLInferUnitsConverter_matchesProperties(self, props)
def convert(self):
"""
convert(SBMLInferUnitsConverter self) -> int
Perform the conversion.
This method causes the converter to do the actual conversion work,
that is, to convert the SBMLDocument object set by
SBMLConverter.setDocument() and with the configuration options set by
SBMLConverter.setProperties().
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
* LIBSBML_INVALID_OBJECT
* LIBSBML_CONV_INVALID_SRC_DOCUMENT
"""
return _libsbml.SBMLInferUnitsConverter_convert(self)
def getDefaultProperties(self):
"""
getDefaultProperties(SBMLInferUnitsConverter self) -> ConversionProperties
Returns the default properties of this converter.
A given converter exposes one or more properties that can be adjusted
in order to influence the behavior of the converter. This method
returns the default property settings for this converter. It is meant
to be called in order to discover all the settings for the converter
object.
Returns the ConversionProperties object describing the default
properties for this converter.
"""
return _libsbml.SBMLInferUnitsConverter_getDefaultProperties(self)
SBMLInferUnitsConverter_swigregister = _libsbml.SBMLInferUnitsConverter_swigregister
SBMLInferUnitsConverter_swigregister(SBMLInferUnitsConverter)
def SBMLInferUnitsConverter_init():
"""
SBMLInferUnitsConverter_init()
Internal implementation method.
"""
return _libsbml.SBMLInferUnitsConverter_init()
class SBMLInitialAssignmentConverter(SBMLConverter):
"""
Converter that removes SBML initial assignments.
This is an SBML converter for replacing InitialAssignment objects,
when possible, by setting the initial value attributes on the model
objects being assigned. In other words, for every object that is the
target of an initial assignment in the model, the converter evaluates
the mathematical expression of the assignment to get a numerical
value, and then sets the corresponding attribute of the object to the
value. The effects for different kinds of SBML components are as
follows:
+------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|Component |Effect |
+------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|Compartment |Sets the value of the size attribute. |
|Species |Sets the value of either the initialAmount or the initialConcentration attributes, depending on the value of the Species object's hasOnlySubstanceUnits attribute. |
|Parameter |Sets the value of the value attribute. |
|SpeciesReference |Sets the value of the stoichiometry attribute in the Reaction object where the SpeciesReference object appears. |
+------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Configuration and use of SBMLInitialAssignmentConverter
======================================================================
SBMLInitialAssignmentConverter is enabled by creating a
ConversionProperties object with the option
'expandInitialAssignments', and passing this properties object to
SBMLDocument.convert(). The converter offers no other options.
General information about the use of SBML converters
======================================================================
The use of all the converters follows a similar approach. First, one
creates a ConversionProperties object and calls
ConversionProperties.addOption() on this object with one arguments: a
text string that identifies the desired converter. (The text string
is specific to each converter; consult the documentation for a given
converter to find out how it should be enabled.)
Next, for some converters, the caller can optionally set some
converter-specific properties using additional calls to
ConversionProperties.addOption(). Many converters provide the ability
to configure their behavior to some extent; this is realized through
the use of properties that offer different options. The default
property values for each converter can be interrogated using the
method SBMLConverter.getDefaultProperties() on the converter class in
question .
Finally, the caller should invoke the method SBMLDocument.convert()
with the ConversionProperties object as an argument.
Example of invoking an SBML converter
......................................................................
The following code fragment illustrates an example using
SBMLReactionConverter, which is invoked using the option string
'replaceReactions':
config = ConversionProperties()
if config != None:
config.addOption('replaceReactions')
In the case of SBMLReactionConverter, there are no options to affect
its behavior, so the next step is simply to invoke the converter on an
SBMLDocument object. Continuing the example code:
# Assume that the variable 'document' has been set to an SBMLDocument object.
status = document.convert(config)
if status != LIBSBML_OPERATION_SUCCESS:
# Handle error somehow.
print('Error: conversion failed due to the following:')
document.printErrors()
Here is an example of using a converter that offers an option. The
following code invokes SBMLStripPackageConverter to remove the SBML
Level 3 Layout package from a model. It sets the name of the package
to be removed by adding a value for the option named 'package' defined
by that converter:
def strip_layout_example(document):
config = ConversionProperties()
if config != None:
config.addOption('stripPackage')
config.addOption('package', 'layout')
status = document.convert(config)
if status != LIBSBML_OPERATION_SUCCESS:
# Handle error somehow.
print('Error: unable to strip the Layout package.')
print('LibSBML returned error: ' + OperationReturnValue_toString(status).strip())
else:
# Handle error somehow.
print('Error: unable to create ConversionProperties object')
Available SBML converters in libSBML
......................................................................
LibSBML provides a number of built-in converters; by convention, their
names end in Converter. The following are the built-in converters
provided by libSBML :
@copydetails doc_list_of_libsbml_converters
"""
__swig_setmethods__ = {}
for _s in [SBMLConverter]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, SBMLInitialAssignmentConverter, name, value)
__swig_getmethods__ = {}
for _s in [SBMLConverter]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, SBMLInitialAssignmentConverter, name)
__repr__ = _swig_repr
def init():
"""
init()
Internal implementation method.
"""
return _libsbml.SBMLInitialAssignmentConverter_init()
if _newclass:
init = staticmethod(init)
__swig_getmethods__["init"] = lambda x: init
def __init__(self, *args):
"""
__init__(SBMLInitialAssignmentConverter self) -> SBMLInitialAssignmentConverter
__init__(SBMLInitialAssignmentConverter self, SBMLInitialAssignmentConverter obj) -> SBMLInitialAssignmentConverter
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
SBMLInitialAssignmentConverter()
Creates a new SBMLInitialAssignmentConverter object.
______________________________________________________________________
Method variant with the following signature:
SBMLInitialAssignmentConverter(SBMLInitialAssignmentConverter obj)
Copy constructor; creates a copy of an SBMLInitialAssignmentConverter
object.
Parameter 'obj' is the SBMLInitialAssignmentConverter object to copy.
"""
this = _libsbml.new_SBMLInitialAssignmentConverter(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(SBMLInitialAssignmentConverter self) -> SBMLInitialAssignmentConverter
Creates and returns a deep copy of this SBMLInitialAssignmentConverter
object.
Returns a (deep) copy of this converter.
"""
return _libsbml.SBMLInitialAssignmentConverter_clone(self)
__swig_destroy__ = _libsbml.delete_SBMLInitialAssignmentConverter
__del__ = lambda self: None
def matchesProperties(self, props):
"""
matchesProperties(SBMLInitialAssignmentConverter self, ConversionProperties props) -> bool
Returns True if this converter object's properties match the given
properties.
A typical use of this method involves creating a ConversionProperties
object, setting the options desired, and then calling this method on
an SBMLInitialAssignmentConverter object to find out if the object's
property values match the given ones. This method is also used by
SBMLConverterRegistry.getConverterFor() to search across all
registered converters for one matching particular properties.
Parameter 'props' is the properties to match.
Returns True if this converter's properties match, False otherwise.
"""
return _libsbml.SBMLInitialAssignmentConverter_matchesProperties(self, props)
def convert(self):
"""
convert(SBMLInitialAssignmentConverter self) -> int
Perform the conversion.
This method causes the converter to do the actual conversion work,
that is, to convert the SBMLDocument object set by
SBMLConverter.setDocument() and with the configuration options set by
SBMLConverter.setProperties().
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
* LIBSBML_INVALID_OBJECT
"""
return _libsbml.SBMLInitialAssignmentConverter_convert(self)
def getDefaultProperties(self):
"""
getDefaultProperties(SBMLInitialAssignmentConverter self) -> ConversionProperties
Returns the default properties of this converter.
A given converter exposes one or more properties that can be adjusted
in order to influence the behavior of the converter. This method
returns the default property settings for this converter. It is meant
to be called in order to discover all the settings for the converter
object.
Returns the ConversionProperties object describing the default
properties for this converter.
"""
return _libsbml.SBMLInitialAssignmentConverter_getDefaultProperties(self)
SBMLInitialAssignmentConverter_swigregister = _libsbml.SBMLInitialAssignmentConverter_swigregister
SBMLInitialAssignmentConverter_swigregister(SBMLInitialAssignmentConverter)
def SBMLInitialAssignmentConverter_init():
"""
SBMLInitialAssignmentConverter_init()
Internal implementation method.
"""
return _libsbml.SBMLInitialAssignmentConverter_init()
class SBMLLevelVersionConverter(SBMLConverter):
"""
Whole-document SBML Level/Version converter.
This SBML converter takes an SBML document having one SBML
Level+Version combination, and attempts to convert it to an SBML
document having a different Level+Version combination.
This class is also the basis for SBMLDocument.setLevelAndVersion().
Configuration and use of SBMLLevelVersionConverter
======================================================================
SBMLLevelVersionConverter is enabled by creating a
ConversionProperties object with the option 'setLevelAndVersion', and
passing this properties object to SBMLDocument.convert(). The target
SBML Level and Version combination are determined by the value of the
SBML namespace set on the ConversionProperties object (using
ConversionProperties.setTargetNamespaces()).
In addition, this converter offers one option:
* 'strict': if this option has the value True, then the validity
of the SBML document will be strictly preserved. This means that SBML
validation will be performed, and if the original model is not valid
or semantics cannot be preserved in the converted model, then
conversion will not be performed. Conversely, if this option is set
to False, model conversion will always be performed; if any errors are
detected related to altered semantics, the errors will be logged in
the usual way (i.e., the error log on the SBMLDocument object).
General information about the use of SBML converters
======================================================================
The use of all the converters follows a similar approach. First, one
creates a ConversionProperties object and calls
ConversionProperties.addOption() on this object with one arguments: a
text string that identifies the desired converter. (The text string
is specific to each converter; consult the documentation for a given
converter to find out how it should be enabled.)
Next, for some converters, the caller can optionally set some
converter-specific properties using additional calls to
ConversionProperties.addOption(). Many converters provide the ability
to configure their behavior to some extent; this is realized through
the use of properties that offer different options. The default
property values for each converter can be interrogated using the
method SBMLConverter.getDefaultProperties() on the converter class in
question .
Finally, the caller should invoke the method SBMLDocument.convert()
with the ConversionProperties object as an argument.
Example of invoking an SBML converter
......................................................................
The following code fragment illustrates an example using
SBMLReactionConverter, which is invoked using the option string
'replaceReactions':
config = ConversionProperties()
if config != None:
config.addOption('replaceReactions')
In the case of SBMLReactionConverter, there are no options to affect
its behavior, so the next step is simply to invoke the converter on an
SBMLDocument object. Continuing the example code:
# Assume that the variable 'document' has been set to an SBMLDocument object.
status = document.convert(config)
if status != LIBSBML_OPERATION_SUCCESS:
# Handle error somehow.
print('Error: conversion failed due to the following:')
document.printErrors()
Here is an example of using a converter that offers an option. The
following code invokes SBMLStripPackageConverter to remove the SBML
Level 3 Layout package from a model. It sets the name of the package
to be removed by adding a value for the option named 'package' defined
by that converter:
def strip_layout_example(document):
config = ConversionProperties()
if config != None:
config.addOption('stripPackage')
config.addOption('package', 'layout')
status = document.convert(config)
if status != LIBSBML_OPERATION_SUCCESS:
# Handle error somehow.
print('Error: unable to strip the Layout package.')
print('LibSBML returned error: ' + OperationReturnValue_toString(status).strip())
else:
# Handle error somehow.
print('Error: unable to create ConversionProperties object')
Available SBML converters in libSBML
......................................................................
LibSBML provides a number of built-in converters; by convention, their
names end in Converter. The following are the built-in converters
provided by libSBML :
@copydetails doc_list_of_libsbml_converters
"""
__swig_setmethods__ = {}
for _s in [SBMLConverter]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, SBMLLevelVersionConverter, name, value)
__swig_getmethods__ = {}
for _s in [SBMLConverter]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, SBMLLevelVersionConverter, name)
__repr__ = _swig_repr
def init():
"""
init()
Internal implementation method.
"""
return _libsbml.SBMLLevelVersionConverter_init()
if _newclass:
init = staticmethod(init)
__swig_getmethods__["init"] = lambda x: init
def __init__(self, *args):
"""
__init__(SBMLLevelVersionConverter self) -> SBMLLevelVersionConverter
__init__(SBMLLevelVersionConverter self, SBMLLevelVersionConverter obj) -> SBMLLevelVersionConverter
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
SBMLLevelVersionConverter()
Creates a new SBMLLevelVersionConverter object.
______________________________________________________________________
Method variant with the following signature:
SBMLLevelVersionConverter(SBMLLevelVersionConverter obj)
Copy constructor; creates a copy of an SBMLLevelVersionConverter
object.
Parameter 'obj' is the SBMLLevelVersionConverter object to copy.
"""
this = _libsbml.new_SBMLLevelVersionConverter(*args)
try:
self.this.append(this)
except:
self.this = this
__swig_destroy__ = _libsbml.delete_SBMLLevelVersionConverter
__del__ = lambda self: None
def clone(self):
"""
clone(SBMLLevelVersionConverter self) -> SBMLLevelVersionConverter
Creates and returns a deep copy of this SBMLLevelVersionConverter
object.
Returns a (deep) copy of this converter.
"""
return _libsbml.SBMLLevelVersionConverter_clone(self)
def matchesProperties(self, props):
"""
matchesProperties(SBMLLevelVersionConverter self, ConversionProperties props) -> bool
Returns True if this converter object's properties match the given
properties.
A typical use of this method involves creating a ConversionProperties
object, setting the options desired, and then calling this method on
an SBMLLevelVersionConverter object to find out if the object's
property values match the given ones. This method is also used by
SBMLConverterRegistry.getConverterFor() to search across all
registered converters for one matching particular properties.
Parameter 'props' is the properties to match.
Returns True if this converter's properties match, False otherwise.
"""
return _libsbml.SBMLLevelVersionConverter_matchesProperties(self, props)
def convert(self):
"""
convert(SBMLLevelVersionConverter self) -> int
Perform the conversion.
This method causes the converter to do the actual conversion work,
that is, to convert the SBMLDocument object set by
SBMLConverter.setDocument() and with the configuration options set by
SBMLConverter.setProperties().
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
* LIBSBML_CONV_INVALID_TARGET_NAMESPACE
* LIBSBML_CONV_PKG_CONVERSION_NOT_AVAILABLE
* LIBSBML_CONV_INVALID_SRC_DOCUMENT
"""
return _libsbml.SBMLLevelVersionConverter_convert(self)
def getDefaultProperties(self):
"""
getDefaultProperties(SBMLLevelVersionConverter self) -> ConversionProperties
Returns the default properties of this converter.
A given converter exposes one or more properties that can be adjusted
in order to influence the behavior of the converter. This method
returns the default property settings for this converter. It is meant
to be called in order to discover all the settings for the converter
object.
Returns the ConversionProperties object describing the default
properties for this converter.
"""
return _libsbml.SBMLLevelVersionConverter_getDefaultProperties(self)
def getTargetLevel(self):
"""
getTargetLevel(SBMLLevelVersionConverter self) -> unsigned int
Returns the target SBML Level for the conversion.
Returns an integer indicating the SBML Level.
"""
return _libsbml.SBMLLevelVersionConverter_getTargetLevel(self)
def getTargetVersion(self):
"""
getTargetVersion(SBMLLevelVersionConverter self) -> unsigned int
Returns the target SBML Version for the conversion.
Returns an integer indicating the Version within the SBML Level.
"""
return _libsbml.SBMLLevelVersionConverter_getTargetVersion(self)
def getValidityFlag(self):
"""
getValidityFlag(SBMLLevelVersionConverter self) -> bool
Returns the flag indicating whether the conversion has been set to
'strict'.
Returns True if strict validity has been requested, False otherwise.
"""
return _libsbml.SBMLLevelVersionConverter_getValidityFlag(self)
SBMLLevelVersionConverter_swigregister = _libsbml.SBMLLevelVersionConverter_swigregister
SBMLLevelVersionConverter_swigregister(SBMLLevelVersionConverter)
def SBMLLevelVersionConverter_init():
"""
SBMLLevelVersionConverter_init()
Internal implementation method.
"""
return _libsbml.SBMLLevelVersionConverter_init()
class SBMLLocalParameterConverter(SBMLConverter):
"""
Converter to turn local parameters into global ones.
This converter essentially promotes local parameters to global
parameters. It works by examining every Reaction object for
LocalParameter objects, then creating Parameter objects on the model
for each one found, and finally removing the original LocalParameter
objects. It creates new identifiers for the fresh Parameter objects
by concatenating the identifier of the reaction with the identifier of
the original LocalParameter object.
This converter can be useful for software applications that do not
have the ability to handle local parameters on reactions. Such
applications could check incoming models for local parameters and run
those models through this converter before proceeding with other
steps.
Configuration and use of SBMLLocalParameterConverter
======================================================================
SBMLLocalParameterConverter is enabled by creating a
ConversionProperties object with the option 'promoteLocalParameters',
and passing this properties object to SBMLDocument.convert(). The
converter offers no other options.
General information about the use of SBML converters
======================================================================
The use of all the converters follows a similar approach. First, one
creates a ConversionProperties object and calls
ConversionProperties.addOption() on this object with one arguments: a
text string that identifies the desired converter. (The text string
is specific to each converter; consult the documentation for a given
converter to find out how it should be enabled.)
Next, for some converters, the caller can optionally set some
converter-specific properties using additional calls to
ConversionProperties.addOption(). Many converters provide the ability
to configure their behavior to some extent; this is realized through
the use of properties that offer different options. The default
property values for each converter can be interrogated using the
method SBMLConverter.getDefaultProperties() on the converter class in
question .
Finally, the caller should invoke the method SBMLDocument.convert()
with the ConversionProperties object as an argument.
Example of invoking an SBML converter
......................................................................
The following code fragment illustrates an example using
SBMLReactionConverter, which is invoked using the option string
'replaceReactions':
config = ConversionProperties()
if config != None:
config.addOption('replaceReactions')
In the case of SBMLReactionConverter, there are no options to affect
its behavior, so the next step is simply to invoke the converter on an
SBMLDocument object. Continuing the example code:
# Assume that the variable 'document' has been set to an SBMLDocument object.
status = document.convert(config)
if status != LIBSBML_OPERATION_SUCCESS:
# Handle error somehow.
print('Error: conversion failed due to the following:')
document.printErrors()
Here is an example of using a converter that offers an option. The
following code invokes SBMLStripPackageConverter to remove the SBML
Level 3 Layout package from a model. It sets the name of the package
to be removed by adding a value for the option named 'package' defined
by that converter:
def strip_layout_example(document):
config = ConversionProperties()
if config != None:
config.addOption('stripPackage')
config.addOption('package', 'layout')
status = document.convert(config)
if status != LIBSBML_OPERATION_SUCCESS:
# Handle error somehow.
print('Error: unable to strip the Layout package.')
print('LibSBML returned error: ' + OperationReturnValue_toString(status).strip())
else:
# Handle error somehow.
print('Error: unable to create ConversionProperties object')
Available SBML converters in libSBML
......................................................................
LibSBML provides a number of built-in converters; by convention, their
names end in Converter. The following are the built-in converters
provided by libSBML :
@copydetails doc_list_of_libsbml_converters
"""
__swig_setmethods__ = {}
for _s in [SBMLConverter]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, SBMLLocalParameterConverter, name, value)
__swig_getmethods__ = {}
for _s in [SBMLConverter]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, SBMLLocalParameterConverter, name)
__repr__ = _swig_repr
def init():
"""
init()
Internal implementation method.
"""
return _libsbml.SBMLLocalParameterConverter_init()
if _newclass:
init = staticmethod(init)
__swig_getmethods__["init"] = lambda x: init
def __init__(self, *args):
"""
__init__(SBMLLocalParameterConverter self) -> SBMLLocalParameterConverter
__init__(SBMLLocalParameterConverter self, SBMLLocalParameterConverter obj) -> SBMLLocalParameterConverter
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
SBMLLocalParameterConverter()
Creates a new SBMLLocalParameterConverter object.
______________________________________________________________________
Method variant with the following signature:
SBMLLocalParameterConverter(SBMLLocalParameterConverter obj)
Copy constructor; creates a copy of an SBMLLocalParameterConverter
object.
Parameter 'obj' is the SBMLLocalParameterConverter object to copy.
"""
this = _libsbml.new_SBMLLocalParameterConverter(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(SBMLLocalParameterConverter self) -> SBMLLocalParameterConverter
Creates and returns a deep copy of this SBMLLocalParameterConverter
object.
Returns a (deep) copy of this converter.
"""
return _libsbml.SBMLLocalParameterConverter_clone(self)
__swig_destroy__ = _libsbml.delete_SBMLLocalParameterConverter
__del__ = lambda self: None
def matchesProperties(self, props):
"""
matchesProperties(SBMLLocalParameterConverter self, ConversionProperties props) -> bool
Returns True if this converter object's properties match the given
properties.
A typical use of this method involves creating a ConversionProperties
object, setting the options desired, and then calling this method on
an SBMLLocalParameterConverter object to find out if the object's
property values match the given ones. This method is also used by
SBMLConverterRegistry.getConverterFor() to search across all
registered converters for one matching particular properties.
Parameter 'props' is the properties to match.
Returns True if this converter's properties match, False otherwise.
"""
return _libsbml.SBMLLocalParameterConverter_matchesProperties(self, props)
def convert(self):
"""
convert(SBMLLocalParameterConverter self) -> int
Perform the conversion.
This method causes the converter to do the actual conversion work,
that is, to convert the SBMLDocument object set by
SBMLConverter.setDocument() and with the configuration options set by
SBMLConverter.setProperties().
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
* LIBSBML_INVALID_OBJECT
"""
return _libsbml.SBMLLocalParameterConverter_convert(self)
def getDefaultProperties(self):
"""
getDefaultProperties(SBMLLocalParameterConverter self) -> ConversionProperties
Returns the default properties of this converter.
A given converter exposes one or more properties that can be adjusted
in order to influence the behavior of the converter. This method
returns the default property settings for this converter. It is meant
to be called in order to discover all the settings for the converter
object.
Returns the ConversionProperties object describing the default
properties for this converter.
"""
return _libsbml.SBMLLocalParameterConverter_getDefaultProperties(self)
SBMLLocalParameterConverter_swigregister = _libsbml.SBMLLocalParameterConverter_swigregister
SBMLLocalParameterConverter_swigregister(SBMLLocalParameterConverter)
def SBMLLocalParameterConverter_init():
"""
SBMLLocalParameterConverter_init()
Internal implementation method.
"""
return _libsbml.SBMLLocalParameterConverter_init()
class SBMLReactionConverter(SBMLConverter):
"""
Converter to replace reactions with SBML rate rules.
This converter will take an SBML model and replace the definitions of
reactions in the model with definitions of SBML rate rules.
Equivalent RateRule objects are only created for species mentioned in
reactions that have KineticLaw subobjects, since those are the only
reactions that have an effect on the rates of change of species in the
model; however, the converter removes all Reaction objects in the
model after it is done.
Configuration and use of SBMLReactionConverter
======================================================================
SBMLReactionConverter is enabled by creating a ConversionProperties
object with the option 'replaceReactions', and passing this properties
object to SBMLDocument.convert(). This converter does not offer any
additional configuration options.
General information about the use of SBML converters
======================================================================
The use of all the converters follows a similar approach. First, one
creates a ConversionProperties object and calls
ConversionProperties.addOption() on this object with one arguments: a
text string that identifies the desired converter. (The text string
is specific to each converter; consult the documentation for a given
converter to find out how it should be enabled.)
Next, for some converters, the caller can optionally set some
converter-specific properties using additional calls to
ConversionProperties.addOption(). Many converters provide the ability
to configure their behavior to some extent; this is realized through
the use of properties that offer different options. The default
property values for each converter can be interrogated using the
method SBMLConverter.getDefaultProperties() on the converter class in
question .
Finally, the caller should invoke the method SBMLDocument.convert()
with the ConversionProperties object as an argument.
Example of invoking an SBML converter
......................................................................
The following code fragment illustrates an example using
SBMLReactionConverter, which is invoked using the option string
'replaceReactions':
config = ConversionProperties()
if config != None:
config.addOption('replaceReactions')
In the case of SBMLReactionConverter, there are no options to affect
its behavior, so the next step is simply to invoke the converter on an
SBMLDocument object. Continuing the example code:
# Assume that the variable 'document' has been set to an SBMLDocument object.
status = document.convert(config)
if status != LIBSBML_OPERATION_SUCCESS:
# Handle error somehow.
print('Error: conversion failed due to the following:')
document.printErrors()
Here is an example of using a converter that offers an option. The
following code invokes SBMLStripPackageConverter to remove the SBML
Level 3 Layout package from a model. It sets the name of the package
to be removed by adding a value for the option named 'package' defined
by that converter:
def strip_layout_example(document):
config = ConversionProperties()
if config != None:
config.addOption('stripPackage')
config.addOption('package', 'layout')
status = document.convert(config)
if status != LIBSBML_OPERATION_SUCCESS:
# Handle error somehow.
print('Error: unable to strip the Layout package.')
print('LibSBML returned error: ' + OperationReturnValue_toString(status).strip())
else:
# Handle error somehow.
print('Error: unable to create ConversionProperties object')
Available SBML converters in libSBML
......................................................................
LibSBML provides a number of built-in converters; by convention, their
names end in Converter. The following are the built-in converters
provided by libSBML :
@copydetails doc_list_of_libsbml_converters
"""
__swig_setmethods__ = {}
for _s in [SBMLConverter]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, SBMLReactionConverter, name, value)
__swig_getmethods__ = {}
for _s in [SBMLConverter]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, SBMLReactionConverter, name)
__repr__ = _swig_repr
def init():
"""
init()
Internal implementation method.
"""
return _libsbml.SBMLReactionConverter_init()
if _newclass:
init = staticmethod(init)
__swig_getmethods__["init"] = lambda x: init
def __init__(self, *args):
"""
__init__(SBMLReactionConverter self) -> SBMLReactionConverter
__init__(SBMLReactionConverter self, SBMLReactionConverter obj) -> SBMLReactionConverter
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
SBMLReactionConverter()
Creates a new SBMLReactionConverter object.
______________________________________________________________________
Method variant with the following signature:
SBMLReactionConverter(SBMLReactionConverter obj)
Copy constructor; creates a copy of an SBMLReactionConverter object.
Parameter 'obj' is the SBMLReactionConverter object to copy.
"""
this = _libsbml.new_SBMLReactionConverter(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(SBMLReactionConverter self) -> SBMLReactionConverter
Creates and returns a deep copy of this SBMLReactionConverter object.
Returns a (deep) copy of this converter.
"""
return _libsbml.SBMLReactionConverter_clone(self)
__swig_destroy__ = _libsbml.delete_SBMLReactionConverter
__del__ = lambda self: None
def matchesProperties(self, props):
"""
matchesProperties(SBMLReactionConverter self, ConversionProperties props) -> bool
Returns True if this converter object's properties match the given
properties.
A typical use of this method involves creating a ConversionProperties
object, setting the options desired, and then calling this method on
an SBMLReactionConverter object to find out if the object's property
values match the given ones. This method is also used by
SBMLConverterRegistry.getConverterFor() to search across all
registered converters for one matching particular properties.
Parameter 'props' is the properties to match.
Returns True if this converter's properties match, False otherwise.
"""
return _libsbml.SBMLReactionConverter_matchesProperties(self, props)
def convert(self):
"""
convert(SBMLReactionConverter self) -> int
Perform the conversion.
This method causes the converter to do the actual conversion work,
that is, to convert the SBMLDocument object set by
SBMLConverter.setDocument() and with the configuration options set by
SBMLConverter.setProperties().
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
* LIBSBML_INVALID_OBJECT
* LIBSBML_CONV_INVALID_SRC_DOCUMENT
"""
return _libsbml.SBMLReactionConverter_convert(self)
def getDefaultProperties(self):
"""
getDefaultProperties(SBMLReactionConverter self) -> ConversionProperties
Returns the default properties of this converter.
A given converter exposes one or more properties that can be adjusted
in order to influence the behavior of the converter. This method
returns the default property settings for this converter. It is meant
to be called in order to discover all the settings for the converter
object.
Returns the ConversionProperties object describing the default
properties for this converter.
"""
return _libsbml.SBMLReactionConverter_getDefaultProperties(self)
def setDocument(self, doc):
"""
setDocument(SBMLReactionConverter self, SBMLDocument doc) -> int
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
setDocument(SBMLDocument doc)
Sets the current SBML document to the given SBMLDocument object.
Parameter 'doc' is the document to use for this conversion.
WARNING:
Even though the 'doc' is '', it is immediately cast to a non- version,
which is then usually changed by the converter upon a successful
conversion. This function is here solely to preserve backwards
compatibility.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
______________________________________________________________________
Method variant with the following signature:
setDocument(SBMLDocument doc)
Sets the current SBML document to the given SBMLDocument object.
Parameter 'doc' is the document to use for this conversion.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
"""
return _libsbml.SBMLReactionConverter_setDocument(self, doc)
SBMLReactionConverter_swigregister = _libsbml.SBMLReactionConverter_swigregister
SBMLReactionConverter_swigregister(SBMLReactionConverter)
def SBMLReactionConverter_init():
"""
SBMLReactionConverter_init()
Internal implementation method.
"""
return _libsbml.SBMLReactionConverter_init()
class SBMLRuleConverter(SBMLConverter):
"""
Converter that sorts SBML rules and assignments.
This converter reorders assignments in a model. Specifically, it
sorts the list of assignment rules (i.e., the AssignmentRule objects
contained in the ListOfAssignmentRules within the Model object) and
the initial assignments (i.e., the InitialAssignment objects contained
in the ListOfInitialAssignments) such that, within each set,
assignments that depend on prior values are placed after the values
are set. For example, if there is an assignment rule stating a = b +
1, and another rule stating b = 3, the list of rules is sorted and the
rules are arranged so that the rule for b = 3 appears before the rule
for a = b + 1. Similarly, if dependencies of this sort exist in the
list of initial assignments in the model, the initial assignments are
sorted as well.
Beginning with SBML Level 2, assignment rules have no ordering
required---the order in which the rules appear in an SBML file has no
significance. Software tools, however, may need to reorder
assignments for purposes of evaluating them. For example, for
simulators that use time integration methods, it would be a good idea
to reorder assignment rules such as the following,
b = a + 10 seconds a = time
so that the evaluation of the rules is independent of integrator step
sizes. (This is due to the fact that, in this case, the order in which
the rules are evaluated changes the result.) SBMLRuleConverter can be
used to reorder the SBML objects regardless of whether the input file
contained them in the desired order.
Note that the two sets of SBML assignments (list of assignment rules
on the one hand, and list of initial assignments on the other hand)
are handled independently. In an SBML model, these entities are
treated differently and no amount of sorting can deal with inter-
dependencies between assignments of the two kinds. Configuration and use of SBMLRuleConverter
======================================================================
SBMLRuleConverter is enabled by creating a ConversionProperties object
with the option 'sortRules', and passing this properties object to
SBMLDocument.convert(). This converter offers no other options.
General information about the use of SBML converters
======================================================================
The use of all the converters follows a similar approach. First, one
creates a ConversionProperties object and calls
ConversionProperties.addOption() on this object with one arguments: a
text string that identifies the desired converter. (The text string
is specific to each converter; consult the documentation for a given
converter to find out how it should be enabled.)
Next, for some converters, the caller can optionally set some
converter-specific properties using additional calls to
ConversionProperties.addOption(). Many converters provide the ability
to configure their behavior to some extent; this is realized through
the use of properties that offer different options. The default
property values for each converter can be interrogated using the
method SBMLConverter.getDefaultProperties() on the converter class in
question .
Finally, the caller should invoke the method SBMLDocument.convert()
with the ConversionProperties object as an argument.
Example of invoking an SBML converter
......................................................................
The following code fragment illustrates an example using
SBMLReactionConverter, which is invoked using the option string
'replaceReactions':
config = ConversionProperties()
if config != None:
config.addOption('replaceReactions')
In the case of SBMLReactionConverter, there are no options to affect
its behavior, so the next step is simply to invoke the converter on an
SBMLDocument object. Continuing the example code:
# Assume that the variable 'document' has been set to an SBMLDocument object.
status = document.convert(config)
if status != LIBSBML_OPERATION_SUCCESS:
# Handle error somehow.
print('Error: conversion failed due to the following:')
document.printErrors()
Here is an example of using a converter that offers an option. The
following code invokes SBMLStripPackageConverter to remove the SBML
Level 3 Layout package from a model. It sets the name of the package
to be removed by adding a value for the option named 'package' defined
by that converter:
def strip_layout_example(document):
config = ConversionProperties()
if config != None:
config.addOption('stripPackage')
config.addOption('package', 'layout')
status = document.convert(config)
if status != LIBSBML_OPERATION_SUCCESS:
# Handle error somehow.
print('Error: unable to strip the Layout package.')
print('LibSBML returned error: ' + OperationReturnValue_toString(status).strip())
else:
# Handle error somehow.
print('Error: unable to create ConversionProperties object')
Available SBML converters in libSBML
......................................................................
LibSBML provides a number of built-in converters; by convention, their
names end in Converter. The following are the built-in converters
provided by libSBML :
@copydetails doc_list_of_libsbml_converters
"""
__swig_setmethods__ = {}
for _s in [SBMLConverter]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, SBMLRuleConverter, name, value)
__swig_getmethods__ = {}
for _s in [SBMLConverter]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, SBMLRuleConverter, name)
__repr__ = _swig_repr
def init():
"""
init()
Internal implementation method.
"""
return _libsbml.SBMLRuleConverter_init()
if _newclass:
init = staticmethod(init)
__swig_getmethods__["init"] = lambda x: init
def __init__(self, *args):
"""
__init__(SBMLRuleConverter self) -> SBMLRuleConverter
__init__(SBMLRuleConverter self, SBMLRuleConverter obj) -> SBMLRuleConverter
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
SBMLRuleConverter()
Creates a new SBMLLevelVersionConverter object.
______________________________________________________________________
Method variant with the following signature:
SBMLRuleConverter(SBMLRuleConverter obj)
Copy constructor; creates a copy of an SBMLLevelVersionConverter
object.
Parameter 'obj' is the SBMLLevelVersionConverter object to copy.
"""
this = _libsbml.new_SBMLRuleConverter(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(SBMLRuleConverter self) -> SBMLRuleConverter
Creates and returns a deep copy of this SBMLLevelVersionConverter
object.
Returns a (deep) copy of this converter.
"""
return _libsbml.SBMLRuleConverter_clone(self)
__swig_destroy__ = _libsbml.delete_SBMLRuleConverter
__del__ = lambda self: None
def matchesProperties(self, props):
"""
matchesProperties(SBMLRuleConverter self, ConversionProperties props) -> bool
Returns True if this converter object's properties match the given
properties.
A typical use of this method involves creating a ConversionProperties
object, setting the options desired, and then calling this method on
an SBMLLevelVersionConverter object to find out if the object's
property values match the given ones. This method is also used by
SBMLConverterRegistry.getConverterFor() to search across all
registered converters for one matching particular properties.
Parameter 'props' is the properties to match.
Returns True if this converter's properties match, False otherwise.
"""
return _libsbml.SBMLRuleConverter_matchesProperties(self, props)
def convert(self):
"""
convert(SBMLRuleConverter self) -> int
Perform the conversion.
This method causes the converter to do the actual conversion work,
that is, to convert the SBMLDocument object set by
SBMLConverter.setDocument() and with the configuration options set by
SBMLConverter.setProperties().
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_OBJECT
* LIBSBML_CONV_INVALID_SRC_DOCUMENT
"""
return _libsbml.SBMLRuleConverter_convert(self)
def getDefaultProperties(self):
"""
getDefaultProperties(SBMLRuleConverter self) -> ConversionProperties
Returns the default properties of this converter.
A given converter exposes one or more properties that can be adjusted
in order to influence the behavior of the converter. This method
returns the default property settings for this converter. It is meant
to be called in order to discover all the settings for the converter
object.
Returns the ConversionProperties object describing the default
properties for this converter.
"""
return _libsbml.SBMLRuleConverter_getDefaultProperties(self)
SBMLRuleConverter_swigregister = _libsbml.SBMLRuleConverter_swigregister
SBMLRuleConverter_swigregister(SBMLRuleConverter)
def SBMLRuleConverter_init():
"""
SBMLRuleConverter_init()
Internal implementation method.
"""
return _libsbml.SBMLRuleConverter_init()
class SBMLStripPackageConverter(SBMLConverter):
"""
Converter that removes SBML Level 3 packages.
This SBML converter takes an SBML document and removes (strips) an
SBML Level 3 package from it. No conversion is performed; the package
constructs are simply removed from the SBML document. The package to
be stripped is determined by the value of the option 'package' on the
conversion properties.
Configuration and use of SBMLStripPackageConverter
======================================================================
SBMLStripPackageConverter is enabled by creating a
ConversionProperties object with the option 'stripPackage', and
passing this properties object to SBMLDocument.convert(). This
converter takes one required option:
* 'package': the value of this option should be a text string, the
nickname of the SBML Level 3 package to be stripped from the model.
General information about the use of SBML converters
======================================================================
The use of all the converters follows a similar approach. First, one
creates a ConversionProperties object and calls
ConversionProperties.addOption() on this object with one arguments: a
text string that identifies the desired converter. (The text string
is specific to each converter; consult the documentation for a given
converter to find out how it should be enabled.)
Next, for some converters, the caller can optionally set some
converter-specific properties using additional calls to
ConversionProperties.addOption(). Many converters provide the ability
to configure their behavior to some extent; this is realized through
the use of properties that offer different options. The default
property values for each converter can be interrogated using the
method SBMLConverter.getDefaultProperties() on the converter class in
question .
Finally, the caller should invoke the method SBMLDocument.convert()
with the ConversionProperties object as an argument.
Example of invoking an SBML converter
......................................................................
The following code fragment illustrates an example using
SBMLReactionConverter, which is invoked using the option string
'replaceReactions':
config = ConversionProperties()
if config != None:
config.addOption('replaceReactions')
In the case of SBMLReactionConverter, there are no options to affect
its behavior, so the next step is simply to invoke the converter on an
SBMLDocument object. Continuing the example code:
# Assume that the variable 'document' has been set to an SBMLDocument object.
status = document.convert(config)
if status != LIBSBML_OPERATION_SUCCESS:
# Handle error somehow.
print('Error: conversion failed due to the following:')
document.printErrors()
Here is an example of using a converter that offers an option. The
following code invokes SBMLStripPackageConverter to remove the SBML
Level 3 Layout package from a model. It sets the name of the package
to be removed by adding a value for the option named 'package' defined
by that converter:
def strip_layout_example(document):
config = ConversionProperties()
if config != None:
config.addOption('stripPackage')
config.addOption('package', 'layout')
status = document.convert(config)
if status != LIBSBML_OPERATION_SUCCESS:
# Handle error somehow.
print('Error: unable to strip the Layout package.')
print('LibSBML returned error: ' + OperationReturnValue_toString(status).strip())
else:
# Handle error somehow.
print('Error: unable to create ConversionProperties object')
Available SBML converters in libSBML
......................................................................
LibSBML provides a number of built-in converters; by convention, their
names end in Converter. The following are the built-in converters
provided by libSBML :
@copydetails doc_list_of_libsbml_converters
"""
__swig_setmethods__ = {}
for _s in [SBMLConverter]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, SBMLStripPackageConverter, name, value)
__swig_getmethods__ = {}
for _s in [SBMLConverter]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, SBMLStripPackageConverter, name)
__repr__ = _swig_repr
def init():
"""
init()
Internal implementation method.
"""
return _libsbml.SBMLStripPackageConverter_init()
if _newclass:
init = staticmethod(init)
__swig_getmethods__["init"] = lambda x: init
def __init__(self, *args):
"""
__init__(SBMLStripPackageConverter self) -> SBMLStripPackageConverter
__init__(SBMLStripPackageConverter self, SBMLStripPackageConverter obj) -> SBMLStripPackageConverter
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
SBMLStripPackageConverter()
Creates a new SBMLStripPackageConverter object.
______________________________________________________________________
Method variant with the following signature:
SBMLStripPackageConverter(SBMLStripPackageConverter obj)
Copy constructor; creates a copy of an SBMLStripPackageConverter
object.
Parameter 'obj' is the SBMLStripPackageConverter object to copy.
"""
this = _libsbml.new_SBMLStripPackageConverter(*args)
try:
self.this.append(this)
except:
self.this = this
__swig_destroy__ = _libsbml.delete_SBMLStripPackageConverter
__del__ = lambda self: None
def clone(self):
"""
clone(SBMLStripPackageConverter self) -> SBMLStripPackageConverter
Creates and returns a deep copy of this SBMLStripPackageConverter
object.
Returns the (deep) copy of this converter object.
"""
return _libsbml.SBMLStripPackageConverter_clone(self)
def matchesProperties(self, props):
"""
matchesProperties(SBMLStripPackageConverter self, ConversionProperties props) -> bool
Returns True if this converter object's properties match the given
properties.
A typical use of this method involves creating a ConversionProperties
object, setting the options desired, and then calling this method on
an SBMLStripPackageConverter object to find out if the object's
property values match the given ones. This method is also used by
SBMLConverterRegistry.getConverterFor() to search across all
registered converters for one matching particular properties.
Parameter 'props' is the properties to match.
Returns True if this converter's properties match, False otherwise.
"""
return _libsbml.SBMLStripPackageConverter_matchesProperties(self, props)
def convert(self):
"""
convert(SBMLStripPackageConverter self) -> int
Perform the conversion.
This method causes the converter to do the actual conversion work,
that is, to convert the SBMLDocument object set by
SBMLConverter.setDocument() and with the configuration options set by
SBMLConverter.setProperties().
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
* LIBSBML_INVALID_ATTRIBUTE_VALUE
* LIBSBML_CONV_PKG_CONSIDERED_UNKNOWN
"""
return _libsbml.SBMLStripPackageConverter_convert(self)
def getDefaultProperties(self):
"""
getDefaultProperties(SBMLStripPackageConverter self) -> ConversionProperties
Returns the default properties of this converter.
A given converter exposes one or more properties that can be adjusted
in order to influence the behavior of the converter. This method
returns the default property settings for this converter. It is meant
to be called in order to discover all the settings for the converter
object.
Returns the ConversionProperties object describing the default
properties for this converter.
"""
return _libsbml.SBMLStripPackageConverter_getDefaultProperties(self)
SBMLStripPackageConverter_swigregister = _libsbml.SBMLStripPackageConverter_swigregister
SBMLStripPackageConverter_swigregister(SBMLStripPackageConverter)
def SBMLStripPackageConverter_init():
"""
SBMLStripPackageConverter_init()
Internal implementation method.
"""
return _libsbml.SBMLStripPackageConverter_init()
class SBMLUnitsConverter(SBMLConverter):
"""
Converts a model's existing units to SI units.
This SBML converter converts the units in a model to base SI units,
that is, using only the units metre, kilogram, second, ampere, kelvin,
mole and candela.
Unit conversion will only be performed on models that are fully unit
consistent, meaning that all objects have units associated with them
and there are no literal numbers with unspecified units. In the case
of an SBML Level 3 model involving math expressions, this means that
the timeUnits attribute on the Model object must be set, and if there
are any reactions in the model, the extentUnits attribute on the Model
object must also be set.
Configuration and use of SBMLUnitsConverter
======================================================================
SBMLUnitsConverter is enabled by creating a ConversionProperties
object with the option 'units', and passing this properties object to
SBMLDocument.convert(). This converter takes one optional option:
* 'removeUnusedUnits': the value of this property should be a
Boolean. If it is True, it tells the unit convert to remove any
unused UnitDefinition objects after conversion is complete. ('Unused'
units are units that are not referenced by any object in the model.)
If the value is False, unused UnitDefinition objects are not removed
from the model. The default is True.
General information about the use of SBML converters
======================================================================
The use of all the converters follows a similar approach. First, one
creates a ConversionProperties object and calls
ConversionProperties.addOption() on this object with one arguments: a
text string that identifies the desired converter. (The text string
is specific to each converter; consult the documentation for a given
converter to find out how it should be enabled.)
Next, for some converters, the caller can optionally set some
converter-specific properties using additional calls to
ConversionProperties.addOption(). Many converters provide the ability
to configure their behavior to some extent; this is realized through
the use of properties that offer different options. The default
property values for each converter can be interrogated using the
method SBMLConverter.getDefaultProperties() on the converter class in
question .
Finally, the caller should invoke the method SBMLDocument.convert()
with the ConversionProperties object as an argument.
Example of invoking an SBML converter
......................................................................
The following code fragment illustrates an example using
SBMLReactionConverter, which is invoked using the option string
'replaceReactions':
config = ConversionProperties()
if config != None:
config.addOption('replaceReactions')
In the case of SBMLReactionConverter, there are no options to affect
its behavior, so the next step is simply to invoke the converter on an
SBMLDocument object. Continuing the example code:
# Assume that the variable 'document' has been set to an SBMLDocument object.
status = document.convert(config)
if status != LIBSBML_OPERATION_SUCCESS:
# Handle error somehow.
print('Error: conversion failed due to the following:')
document.printErrors()
Here is an example of using a converter that offers an option. The
following code invokes SBMLStripPackageConverter to remove the SBML
Level 3 Layout package from a model. It sets the name of the package
to be removed by adding a value for the option named 'package' defined
by that converter:
def strip_layout_example(document):
config = ConversionProperties()
if config != None:
config.addOption('stripPackage')
config.addOption('package', 'layout')
status = document.convert(config)
if status != LIBSBML_OPERATION_SUCCESS:
# Handle error somehow.
print('Error: unable to strip the Layout package.')
print('LibSBML returned error: ' + OperationReturnValue_toString(status).strip())
else:
# Handle error somehow.
print('Error: unable to create ConversionProperties object')
Available SBML converters in libSBML
......................................................................
LibSBML provides a number of built-in converters; by convention, their
names end in Converter. The following are the built-in converters
provided by libSBML :
@copydetails doc_list_of_libsbml_converters
"""
__swig_setmethods__ = {}
for _s in [SBMLConverter]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, SBMLUnitsConverter, name, value)
__swig_getmethods__ = {}
for _s in [SBMLConverter]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, SBMLUnitsConverter, name)
__repr__ = _swig_repr
def init():
"""
init()
Internal implementation method.
"""
return _libsbml.SBMLUnitsConverter_init()
if _newclass:
init = staticmethod(init)
__swig_getmethods__["init"] = lambda x: init
def __init__(self, *args):
"""
__init__(SBMLUnitsConverter self) -> SBMLUnitsConverter
__init__(SBMLUnitsConverter self, SBMLUnitsConverter obj) -> SBMLUnitsConverter
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
SBMLUnitsConverter()
Creates a new SBMLUnitsConverter object.
______________________________________________________________________
Method variant with the following signature:
SBMLUnitsConverter(SBMLUnitsConverter obj)
Copy constructor; creates a copy of an SBMLUnitsConverter object.
Parameter 'obj' is the SBMLUnitsConverter object to copy.
"""
this = _libsbml.new_SBMLUnitsConverter(*args)
try:
self.this.append(this)
except:
self.this = this
__swig_destroy__ = _libsbml.delete_SBMLUnitsConverter
__del__ = lambda self: None
def clone(self):
"""
clone(SBMLUnitsConverter self) -> SBMLUnitsConverter
Creates and returns a deep copy of this SBMLUnitsConverter object.
Returns a (deep) copy of this converter.
"""
return _libsbml.SBMLUnitsConverter_clone(self)
def matchesProperties(self, props):
"""
matchesProperties(SBMLUnitsConverter self, ConversionProperties props) -> bool
Returns True if this converter object's properties match the given
properties.
A typical use of this method involves creating a ConversionProperties
object, setting the options desired, and then calling this method on
an SBMLUnitsConverter object to find out if the object's property
values match the given ones. This method is also used by
SBMLConverterRegistry.getConverterFor() to search across all
registered converters for one matching particular properties.
Parameter 'props' is the properties to match.
Returns True if this converter's properties match, False otherwise.
"""
return _libsbml.SBMLUnitsConverter_matchesProperties(self, props)
def convert(self):
"""
convert(SBMLUnitsConverter self) -> int
Perform the conversion.
This method causes the converter to do the actual conversion work,
that is, to convert the SBMLDocument object set by
SBMLConverter.setDocument() and with the configuration options set by
SBMLConverter.setProperties().
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
* LIBSBML_INVALID_OBJECT
* LIBSBML_CONV_CONVERSION_NOT_AVAILABLE
* LIBSBML_CONV_INVALID_SRC_DOCUMENT
"""
return _libsbml.SBMLUnitsConverter_convert(self)
def getDefaultProperties(self):
"""
getDefaultProperties(SBMLUnitsConverter self) -> ConversionProperties
Returns the default properties of this converter.
A given converter exposes one or more properties that can be adjusted
in order to influence the behavior of the converter. This method
returns the default property settings for this converter. It is meant
to be called in order to discover all the settings for the converter
object.
Returns the ConversionProperties object describing the default
properties for this converter.
"""
return _libsbml.SBMLUnitsConverter_getDefaultProperties(self)
SBMLUnitsConverter_swigregister = _libsbml.SBMLUnitsConverter_swigregister
SBMLUnitsConverter_swigregister(SBMLUnitsConverter)
def SBMLUnitsConverter_init():
"""
SBMLUnitsConverter_init()
Internal implementation method.
"""
return _libsbml.SBMLUnitsConverter_init()
class SBMLValidator(_object):
"""
Base class for SBML validators.
LibSBML implements facilities for verifying that a given SBML
document is valid according to the SBML specifications; it also
exposes the validation interface so that user programs and SBML Level
3 package authors may use the facilities to implement new validators.
There are two main interfaces to libSBML's validation facilities,
based on the classes Validator and SBMLValidator.
The Validator class is the basis of the system for validating an SBML
document against the validation rules defined in the SBML
specifications. The scheme used by Validator relies is compact and
uses the visitor programming pattern, but it relies on C/C++ features
and is not directly accessible from language bindings. SBMLValidator
offers a framework for straightforward class-based extensibility, so
that user code can subclass SBMLValidator to implement new validation
systems, different validators can be introduced or turned off at run-
time, and interfaces can be provided in the libSBML language bindings.
SBMLValidator can call Validator functionality internally (as is the
case in the current implementation of SBMLInternalValidator) or use
entirely different implementation approaches, as necessary.
Users of libSBML may already be familiar with the facilities
encompassed by the validation system, in the form of the consistency-
checking methods defined on SBMLDocument. The methods
SBMLDocument.setConsistencyChecks(), SBMLDocument.checkConsistency(),
SBMLDocument.checkInternalConsistency() and other method of that sort
are in fact implemented via SBMLValidator, specifically as methods on
the class SBMLInternalValidator.
Authors may use SBMLValidator as the base class for their own
validator extensions to libSBML. The class SBMLInternalValidator may
serve as a code example for how to implement such things.
"""
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, SBMLValidator, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, SBMLValidator, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(SBMLValidator self) -> SBMLValidator
__init__(SBMLValidator self, SBMLValidator orig) -> SBMLValidator
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
SBMLValidator()
Creates a new SBMLValidator.
______________________________________________________________________
Method variant with the following signature:
SBMLValidator(SBMLValidator orig)
Copy constructor; creates a copy of an SBMLValidator object.
Parameter 'orig' is the object to copy.
Throws SBMLConstructorException: Thrown if the argument 'orig' is
None.
"""
if self.__class__ == SBMLValidator:
_self = None
else:
_self = self
this = _libsbml.new_SBMLValidator(_self, *args)
try:
self.this.append(this)
except:
self.this = this
__swig_destroy__ = _libsbml.delete_SBMLValidator
__del__ = lambda self: None
def clone(self):
"""
clone(SBMLValidator self) -> SBMLValidator
Creates and returns a deep copy of this SBMLValidator object.
Returns the (deep) copy of this SBMLValidator object.
"""
return _libsbml.SBMLValidator_clone(self)
def getDocument(self, *args):
"""
getDocument(SBMLValidator self) -> SBMLDocument
getDocument(SBMLValidator self) -> SBMLDocument
Returns the current SBML document in use by this validator.
Returns the current SBML document
See also setDocument().
"""
return _libsbml.SBMLValidator_getDocument(self, *args)
def setDocument(self, doc):
"""
setDocument(SBMLValidator self, SBMLDocument doc) -> int
Sets the current SBML document to the given SBMLDocument object.
Parameter 'doc' is the document to use for this validation
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
See also getDocument().
"""
return _libsbml.SBMLValidator_setDocument(self, doc)
def clearFailures(self):
"""
clearFailures(SBMLValidator self)
Clears this validator's list of failures.
If you are validating multiple SBML documents with the same validator,
call this method after you have processed the list of failures from
the last validation run and before validating the next document.
"""
return _libsbml.SBMLValidator_clearFailures(self)
def logFailure(self, err):
"""
logFailure(SBMLValidator self, SBMLError err)
Adds the given failure to this list of Validators failures.
Parameter 'err' is an SBMLError object representing an error or
warning
"""
return _libsbml.SBMLValidator_logFailure(self, err)
def validate(self, *args):
"""
validate(SBMLValidator self) -> unsigned int
validate(SBMLValidator self, SBMLDocument d) -> unsigned int
validate(SBMLValidator self, string filename) -> unsigned int
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
validate()
Runs this validator on the current SBML document.
Returns an integer value indicating the success/failure of the
validation. The possible values returned by this function are
determined by the specific subclasses of this class.
______________________________________________________________________
Method variant with the following signature:
validate(string filename)
Validates the SBML document located at the given 'filename'.
This is a convenience method that saves callers the trouble of using
SBMLReader to read the document first.
Parameter 'filename' is the path to the file to be read and validated.
Returns the number of validation failures that occurred. The objects
describing the actual failures can be retrieved using getFailures().
______________________________________________________________________
Method variant with the following signature:
validate(SBMLDocument d)
Validates the given SBMLDocument object.
This is identical to calling setDocument() followed by validate().
Parameter 'd' is the SBML document to validate
Returns the number of validation failures that occurred. The objects
describing the actual failures can be retrieved using getFailures().
"""
return _libsbml.SBMLValidator_validate(self, *args)
def getErrorLog(self):
"""
getErrorLog(SBMLValidator self) -> SBMLErrorLog
Returns the list of errors or warnings logged during parsing,
consistency checking, or attempted translation of this model.
Note that this refers to the SBMLDocument object's error log (i.e.,
the list returned by SBMLDocument.getErrorLog()). That list of errors
and warnings is separate from the validation failures tracked by this
validator (i.e., the list returned by getFailures()).
Returns the SBMLErrorLog used for the SBMLDocument
"""
return _libsbml.SBMLValidator_getErrorLog(self)
def getModel(self, *args):
"""
getModel(SBMLValidator self) -> Model
getModel(SBMLValidator self) -> Model
Returns the Model object stored in the SBMLDocument.
It is important to note that this method does not create a Model
instance. The model in the SBMLDocument must have been created at
some prior time, for example using SBMLDocument.createModel() or
SBMLDocument.setModel(). This method returns None if a model does not
yet exist.
Returns the Model contained in this validator's SBMLDocument object.
See also SBMLDocument.setModel(), SBMLDocument.createModel().
"""
return _libsbml.SBMLValidator_getModel(self, *args)
def getNumFailures(self):
"""
getNumFailures(SBMLValidator self) -> unsigned int
Returns the number of failures encountered in the last validation run.
This method returns the number of failures logged by this validator.
This number only reflects this validator's actions; the number may not
be the same as the number of errors and warnings logged on the
SBMLDocument object's error log (i.e., the object returned by
SBMLDocument.getErrorLog()), because other parts of libSBML may log
errors and warnings beyond those found by this validator.
Returns the number of errors logged by this validator.
"""
return _libsbml.SBMLValidator_getNumFailures(self)
def getFailure(self, n):
"""
getFailure(SBMLValidator self, unsigned int n) -> SBMLError
Returns the failure object at index n in this validator's list of
failures logged during the last run.
Callers should use getNumFailures() first, to find out the number of
entries in this validator's list of failures.
Parameter 'n' is an integer indicating the index of the object to
return from the failures list; index values start at 0.
Returns the failure at the given index number.
See also getNumFailures().
"""
return _libsbml.SBMLValidator_getFailure(self, n)
def __disown__(self):
self.this.disown()
_libsbml.disown_SBMLValidator(self)
return weakref_proxy(self)
SBMLValidator_swigregister = _libsbml.SBMLValidator_swigregister
SBMLValidator_swigregister(SBMLValidator)
class SBMLExternalValidator(SBMLValidator):
"""
Internal implementation method.
"""
__swig_setmethods__ = {}
for _s in [SBMLValidator]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, SBMLExternalValidator, name, value)
__swig_getmethods__ = {}
for _s in [SBMLValidator]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, SBMLExternalValidator, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(SBMLExternalValidator self) -> SBMLExternalValidator
__init__(SBMLExternalValidator self, SBMLExternalValidator arg2) -> SBMLExternalValidator
Internal implementation method.
"""
this = _libsbml.new_SBMLExternalValidator(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(SBMLExternalValidator self) -> SBMLValidator
Internal implementation method.
"""
return _libsbml.SBMLExternalValidator_clone(self)
__swig_destroy__ = _libsbml.delete_SBMLExternalValidator
__del__ = lambda self: None
def validate(self):
"""
validate(SBMLExternalValidator self) -> unsigned int
Internal implementation method.
"""
return _libsbml.SBMLExternalValidator_validate(self)
def getProgram(self):
"""
getProgram(SBMLExternalValidator self) -> string
Internal implementation method.
"""
return _libsbml.SBMLExternalValidator_getProgram(self)
def setProgram(self, program):
"""
setProgram(SBMLExternalValidator self, string program)
Internal implementation method.
"""
return _libsbml.SBMLExternalValidator_setProgram(self, program)
def getOutputFileName(self):
"""
getOutputFileName(SBMLExternalValidator self) -> string
Internal implementation method.
"""
return _libsbml.SBMLExternalValidator_getOutputFileName(self)
def setOutputFileName(self, outputFileName):
"""
setOutputFileName(SBMLExternalValidator self, string outputFileName)
Internal implementation method.
"""
return _libsbml.SBMLExternalValidator_setOutputFileName(self, outputFileName)
def getSBMLFileName(self):
"""
getSBMLFileName(SBMLExternalValidator self) -> string
Internal implementation method.
"""
return _libsbml.SBMLExternalValidator_getSBMLFileName(self)
def setSBMLFileName(self, sbmlFileName):
"""
setSBMLFileName(SBMLExternalValidator self, string sbmlFileName)
Internal implementation method.
"""
return _libsbml.SBMLExternalValidator_setSBMLFileName(self, sbmlFileName)
def clearArguments(self):
"""
clearArguments(SBMLExternalValidator self)
Internal implementation method.
"""
return _libsbml.SBMLExternalValidator_clearArguments(self)
def addArgument(self, arg):
"""
addArgument(SBMLExternalValidator self, string arg)
Internal implementation method.
"""
return _libsbml.SBMLExternalValidator_addArgument(self, arg)
def getNumArguments(self):
"""
getNumArguments(SBMLExternalValidator self) -> unsigned int
Internal implementation method.
"""
return _libsbml.SBMLExternalValidator_getNumArguments(self)
def getArgument(self, n):
"""
getArgument(SBMLExternalValidator self, unsigned int n) -> string
Internal implementation method.
"""
return _libsbml.SBMLExternalValidator_getArgument(self, n)
SBMLExternalValidator_swigregister = _libsbml.SBMLExternalValidator_swigregister
SBMLExternalValidator_swigregister(SBMLExternalValidator)
class XMLAttributes(_object):
"""
A list of attributes on an XML element.
In libSBML's XML interface layer, attributes on an element are stored
as a list of values kept in an XMLAttributes object. XMLAttributes
has methods for adding and removing individual attributes as well as
performing other actions on the list of attributes. Classes in
libSBML that represent nodes in an XML document (i.e., XMLNode and its
parent class, XMLToken) use XMLAttributes objects to manage attributes
on XML elements.
Attributes on an XML element can be written in one of two forms:
* name='value'
* prefix:name='value'
An attribute in XML must always have a value, and the value must
always be a quoted string; i.e., it is always name='value' and not
name=value. An empty value is represented simply as an empty string;
i.e., name=''.
In cases when a prefix is provided with an attribute name, general XML
validity rules require that the prefix is an XML namespace prefix that
has been declared somewhere else (possibly as an another attribute on
the same element). However, the XMLAttributes class does not test for
the proper existence or declaration of XML namespaces -- callers must
arrange to do this themselves in some other way. This class only
provides facilities for tracking and manipulating attributes and their
prefix/URI/name/value components.
Note:
Note that although XMLAttributes provides operations that can
manipulate attributes based on a numerical index, XML attributes are
in fact unordered when they appear in files and data streams. The
XMLAttributes class provides some list-like facilities, but it is only
for the convenience of callers. (For example, it permits callers to
loop across all attributes more easily.) Users should keep in mind
that the order in which attributes are stored in XMLAttributes objects
has no real impact on the order in which the attributes are read or
written from an XML file or data stream.
See also XMLTriple, XMLNode, XMLToken.
"""
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, XMLAttributes, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, XMLAttributes, name)
__repr__ = _swig_repr
__swig_destroy__ = _libsbml.delete_XMLAttributes
__del__ = lambda self: None
def __init__(self, *args):
"""
__init__(XMLAttributes self) -> XMLAttributes
__init__(XMLAttributes self, XMLAttributes orig) -> XMLAttributes
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
XMLAttributes()
Creates a new, empty XMLAttributes object.
______________________________________________________________________
Method variant with the following signature:
XMLAttributes(XMLAttributes orig)
Copy constructor; creates a copy of this XMLAttributes object.
'orig' the XMLAttributes object to copy.
Throws XMLConstructorException: Thrown if the argument 'orig' is None.
"""
this = _libsbml.new_XMLAttributes(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(XMLAttributes self) -> XMLAttributes
Creates and returns a deep copy of this XMLAttributes object.
Returns the (deep) copy of this XMLAttributes object.
"""
return _libsbml.XMLAttributes_clone(self)
def add(self, *args):
"""
add(XMLAttributes self, string name, string value, string namespaceURI, string prefix) -> int
add(XMLAttributes self, string name, string value, string namespaceURI) -> int
add(XMLAttributes self, string name, string value) -> int
add(XMLAttributes self, XMLTriple triple, string value) -> int
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
add( string name , string value , string namespaceURI = '' ,
string prefix = '')
Adds an attribute to this list of attributes.
Some explanations are in order about the behavior of XMLAttributes
with respect to namespace prefixes and namespace URIs. XMLAttributes
does not verify the consistency of different uses of an XML namespace
and the prefix used to refer to it in a given context. It cannot,
because the prefix used for a given XML namespace in an XML document
may intentionally be different on different elements in the document.
Consequently, callers need to manage their own prefix-to-namespace
mappings, and need to ensure that the desired prefix is used in any
given context.
When called with attribute names, prefixes and namespace URIs,
XMLAttributes pays attention to the namespace URIs and not the
prefixes: a match is established by a combination of attribute name
and namespace URI, and if on different occasions a different prefix is
used for the same name/namespace combination, the prefix associated
with the namespace on that attribute is overwritten.
Some examples will hopefully clarify this. Here are the results of a
sequence of calls to the XMLAttributes add methods with different
argument combinations. First, we create the object and add one
attribute:
XMLAttributes att = new XMLAttributes();
att->add('myattribute', '1', 'myuri');
The above adds an attribute named myattribute in the namespace myuri,
and with the attribute value 1. No namespace prefix is associated
with the attribute (but the attribute is recorded to exist in the
namespace myuri). If this attribute object were written out in XML,
it would look like the following (and note that, since no namespace
prefix was assigned, none is written out):
myattribute='1'
Continuing with this series of examples, suppose we invoke the add
method again as follows:
att->add('myattribute', '2');
The above adds a new attribute also named myattribute, but in a
different XML namespace: it is placed in the namespace with no URI,
which is to say, the default XML namespace. Both attributes coexist
on this XMLAttributes object; both can be independently retrieved.
att->add('myattribute', '3');
The code above now replaces the value of the attribute myattribute
that resides in the default namespace. The attribute in the namespace
myuri remains untouched.
att->add('myattribute', '4', 'myuri');
The code above replaces the value of the attribute myattribute that
resides in the myuri namespace. The attribute in the default namespace
remains untouched.
att->add('myattribute', '5', 'myuri', 'foo');
The code above replaces the value of the attribute myattribute that
resides in the myuri namespace. It also now assigns a namespace
prefix, foo, to the attribute. The attribute myattribute in the
default namespace remains untouched. If this XMLAttributes object were
written out in XML, it would look like the following:
myattribute='3'
foo:myattribute='5'
Pressing on, now suppose we call the add method as follows:
att->add('myattribute', '6', 'myuri', 'bar');
The code above replaces the value of the attribute myattribute that
resides in the myuri namespace. It also assigns a different prefix to
the attribute. The namespace of the attribute remains myuri.
att->add('myattribute', '7', '', 'foo');
The code above replaces the value of the attribute myattribute that
resides in the default namespace. It also now assigns a namespace
prefix, foo, to that attribute. If this XMLAttributes object were
written out in XML, it would look like the following:
bar:myattribute='6'
foo:myattribute='7'
Parameter 'name' is a string, the unprefixed name of the attribute.
Parameter 'value' is a string, the value of the attribute. Parameter
'namespaceURI' is a string, the namespace URI of the attribute.
Parameter 'prefix' is a string, a prefix for the XML namespace.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_OBJECT. This value is returned if any of the
arguments are None. To set an empty 'prefix' and/or 'name' value, use
an empty string rather than None.
Note:
If an attribute with the same name and XML namespace URI already
exists in the list of attributes held by this XMLAttributes object,
then the previous value of that attribute will be replaced with the
new value provided to this method.
See also add(), getIndex(), getIndex(), hasAttribute(),
hasAttribute(), add(), getIndex(), getIndex(), hasAttribute(),
hasAttribute().
"""
return _libsbml.XMLAttributes_add(self, *args)
def removeResource(self, n):
"""
removeResource(XMLAttributes self, int n) -> int
Internal implementation method.
"""
return _libsbml.XMLAttributes_removeResource(self, n)
def remove(self, *args):
"""
remove(XMLAttributes self, int n) -> int
remove(XMLAttributes self, string name, string uri) -> int
remove(XMLAttributes self, string name) -> int
remove(XMLAttributes self, XMLTriple triple) -> int
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
remove(int n)
Removes the nth attribute from this list of attributes.
Parameter 'n' is an integer the index of the resource to be deleted
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INDEX_EXCEEDS_SIZE
The value LIBSBML_INDEX_EXCEEDS_SIZE is returned if there is no
attribute at the given index 'n'.
Note:
Note that although XMLAttributes provides operations that can
manipulate attributes based on a numerical index, XML attributes are
in fact unordered when they appear in files and data streams. The
XMLAttributes class provides some list-like facilities, but it is only
for the convenience of callers. (For example, it permits callers to
loop across all attributes more easily.) Users should keep in mind
that the order in which attributes are stored in XMLAttributes objects
has no real impact on the order in which the attributes are read or
written from an XML file or data stream.
See also getLength(), remove(), remove(), remove(), remove(),
remove(), remove().
"""
return _libsbml.XMLAttributes_remove(self, *args)
def clear(self):
"""
clear(XMLAttributes self) -> int
Removes all attributes in this XMLAttributes object.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
See also remove(), remove(), remove().
"""
return _libsbml.XMLAttributes_clear(self)
def getIndex(self, *args):
"""
getIndex(XMLAttributes self, string name) -> int
getIndex(XMLAttributes self, string name, string uri) -> int
getIndex(XMLAttributes self, XMLTriple triple) -> int
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
getIndex(string name, string uri)
Returns the index of the attribute having a given name and XML
namespace URI.
Parameter 'name' is a string, the name of the attribute being sought.
Parameter 'uri' is a string, the namespace URI of the attribute being
sought.
Returns the index of an attribute with the given local name and
namespace URI, or -1 if no such attribute is present.
See also hasAttribute(), hasAttribute(), hasAttribute(),
hasAttribute(), hasAttribute(), hasAttribute().
"""
return _libsbml.XMLAttributes_getIndex(self, *args)
def getLength(self):
"""
getLength(XMLAttributes self) -> int
Returns the number of attributes in this list of attributes.
Returns the number of attributes contained in this XMLAttributes
object.
"""
return _libsbml.XMLAttributes_getLength(self)
def getNumAttributes(self):
"""
getNumAttributes(XMLAttributes self) -> int
Returns the number of attributes in this list of attributes.
This function is merely an alias of XMLAttributes.getLength()
introduced for consistency with other libXML classes.
Returns the number of attributes contained in this XMLAttributes
object.
"""
return _libsbml.XMLAttributes_getNumAttributes(self)
def getName(self, index):
"""
getName(XMLAttributes self, int index) -> string
Returns the name of the nth attribute in this list of attributes.
Parameter 'index' is an integer, the position of the attribute whose
name is being sought.
Returns the local name of the nth attribute.
Note:
If 'index' is out of range, this method will return an empty string.
Callers should use XMLAttributes.getLength() to check the number of
attributes contained in this object or XMLAttributes.hasAttribute()
to test for the existence of an attribute at a given position.
Note:
Note that although XMLAttributes provides operations that can
manipulate attributes based on a numerical index, XML attributes are
in fact unordered when they appear in files and data streams. The
XMLAttributes class provides some list-like facilities, but it is only
for the convenience of callers. (For example, it permits callers to
loop across all attributes more easily.) Users should keep in mind
that the order in which attributes are stored in XMLAttributes objects
has no real impact on the order in which the attributes are read or
written from an XML file or data stream.
See also getLength(), hasAttribute().
"""
return _libsbml.XMLAttributes_getName(self, index)
def getPrefix(self, index):
"""
getPrefix(XMLAttributes self, int index) -> string
Returns the namespace prefix of the nth attribute in this attribute
set.
Parameter 'index' is an integer, the position of the attribute whose
namespace prefix is being sought.
Returns the XML namespace prefix of the nth attribute.
Note:
If 'index' is out of range, this method will return an empty string.
Callers should use XMLAttributes.getLength() to check the number of
attributes contained in this object or XMLAttributes.hasAttribute()
to test for the existence of an attribute at a given position.
Note:
Note that although XMLAttributes provides operations that can
manipulate attributes based on a numerical index, XML attributes are
in fact unordered when they appear in files and data streams. The
XMLAttributes class provides some list-like facilities, but it is only
for the convenience of callers. (For example, it permits callers to
loop across all attributes more easily.) Users should keep in mind
that the order in which attributes are stored in XMLAttributes objects
has no real impact on the order in which the attributes are read or
written from an XML file or data stream.
See also getLength(), hasAttribute().
"""
return _libsbml.XMLAttributes_getPrefix(self, index)
def getPrefixedName(self, index):
"""
getPrefixedName(XMLAttributes self, int index) -> string
Returns the prefix name of the nth attribute in this attribute set.
Parameter 'index' is an integer, the position of the attribute whose
prefixed name is being sought.
Returns the prefixed name of the nth attribute.
Note:
If 'index' is out of range, this method will return an empty string.
Callers should use XMLAttributes.getLength() to check the number of
attributes contained in this object or XMLAttributes.hasAttribute()
to test for the existence of an attribute at a given position.
Note:
Note that although XMLAttributes provides operations that can
manipulate attributes based on a numerical index, XML attributes are
in fact unordered when they appear in files and data streams. The
XMLAttributes class provides some list-like facilities, but it is only
for the convenience of callers. (For example, it permits callers to
loop across all attributes more easily.) Users should keep in mind
that the order in which attributes are stored in XMLAttributes objects
has no real impact on the order in which the attributes are read or
written from an XML file or data stream.
See also getLength(), hasAttribute().
"""
return _libsbml.XMLAttributes_getPrefixedName(self, index)
def getURI(self, index):
"""
getURI(XMLAttributes self, int index) -> string
Returns the XML namespace URI of the nth attribute in this attribute
set.
Parameter 'index' is an integer, the position of the attribute whose
namespace URI is being sought.
Returns the XML namespace URI of the nth attribute.
Note:
If 'index' is out of range, this method will return an empty string.
Callers should use XMLAttributes.getLength() to check the number of
attributes contained in this object or XMLAttributes.hasAttribute()
to test for the existence of an attribute at a given position.
Note:
Note that although XMLAttributes provides operations that can
manipulate attributes based on a numerical index, XML attributes are
in fact unordered when they appear in files and data streams. The
XMLAttributes class provides some list-like facilities, but it is only
for the convenience of callers. (For example, it permits callers to
loop across all attributes more easily.) Users should keep in mind
that the order in which attributes are stored in XMLAttributes objects
has no real impact on the order in which the attributes are read or
written from an XML file or data stream.
See also getLength(), hasAttribute().
"""
return _libsbml.XMLAttributes_getURI(self, index)
def getValue(self, *args):
"""
getValue(XMLAttributes self, int index) -> string
getValue(XMLAttributes self, string name) -> string
getValue(XMLAttributes self, string name, string uri) -> string
getValue(XMLAttributes self, XMLTriple triple) -> string
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
getValue(string name, string uri)
Returns a named attribute's value.
Parameter 'name' is a string, the name of the attribute whose value is
being sought. Parameter 'uri' is a string, the XML namespace URI of
the attribute.
Returns The attribute value as a string.
Note:
If an attribute with the given 'name' and namespace 'uri' does not
exist in this XMLAttributes object, this method will return an empty
string. Callers can use XMLAttributes.hasAttribute() to test for an
attribute's existence.
See also hasAttribute(), hasAttribute(), hasAttribute(),
hasAttribute(), getLength(), hasAttribute(), hasAttribute(),
hasAttribute().
"""
return _libsbml.XMLAttributes_getValue(self, *args)
def hasAttribute(self, *args):
"""
hasAttribute(XMLAttributes self, int index) -> bool
hasAttribute(XMLAttributes self, string name, string uri) -> bool
hasAttribute(XMLAttributes self, string name) -> bool
hasAttribute(XMLAttributes self, XMLTriple triple) -> bool
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
hasAttribute(int index)
Returns True if an attribute exists at a given index.
Parameter 'index' is an integer, the position of the attribute to be
tested.
Returns True if an attribute with the given index exists in this
XMLAttributes object, False otherwise.
Note:
Note that although XMLAttributes provides operations that can
manipulate attributes based on a numerical index, XML attributes are
in fact unordered when they appear in files and data streams. The
XMLAttributes class provides some list-like facilities, but it is only
for the convenience of callers. (For example, it permits callers to
loop across all attributes more easily.) Users should keep in mind
that the order in which attributes are stored in XMLAttributes objects
has no real impact on the order in which the attributes are read or
written from an XML file or data stream.
______________________________________________________________________
Method variant with the following signature:
hasAttribute(string name, string uri='')
Returns True if an attribute with a given name and namespace URI
exists.
Parameter 'name' is a string, the unprefixed name of the attribute.
Parameter 'uri' is a string, the XML namespace URI of the attribute.
Returns True if an attribute with the given local name and XML
namespace URI exists in this XMLAttributes object, False otherwise.
See also add(), add(), add(), add().
"""
return _libsbml.XMLAttributes_hasAttribute(self, *args)
def isEmpty(self):
"""
isEmpty(XMLAttributes self) -> bool
Returns True if this list of attributes is empty.
Returns True if this XMLAttributes object is empty, False otherwise.
"""
return _libsbml.XMLAttributes_isEmpty(self)
def __eq__(self, rhs):
if ((self is None) and (rhs is None)): return True
if ((self is None) or (rhs is None)): return False
if (hasattr(self, 'this') and hasattr(rhs, 'this')):
if (self.this == rhs.this): return True
return False
def __ne__(self, rhs):
if ((self is None) and (rhs is None)): return False
if ((self is None) or (rhs is None)): return True
if (hasattr(self, 'this') and hasattr(rhs, 'this')):
if (self.this == rhs.this): return False
return True
XMLAttributes_swigregister = _libsbml.XMLAttributes_swigregister
XMLAttributes_swigregister(XMLAttributes)
class XMLNamespaces(_object):
"""
An XML Namespace.
This class serves to organize functionality for tracking XML
namespaces in a document or data stream. The namespace declarations
are stored as a list of pairs of XML namespace URIs and prefix
strings. These correspond to the parts of a namespace declaration on
an XML element. For example, in the following XML fragment,
there is one namespace declaration. Its URI is urn:lsid:mysim.org and
its prefix is mysim. This pair could be stored as one item in an
XMLNamespaces list.
XMLNamespaces provides various methods for manipulating the list of
prefix-URI pairs. Individual namespaces stored in a given
XMLNamespace object instance can be retrieved based on their index
using XMLNamespaces.getPrefix(), or by their characteristics such as
their URI or position in the list.
"""
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, XMLNamespaces, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, XMLNamespaces, name)
__repr__ = _swig_repr
__swig_destroy__ = _libsbml.delete_XMLNamespaces
__del__ = lambda self: None
def __init__(self, *args):
"""
__init__(XMLNamespaces self) -> XMLNamespaces
__init__(XMLNamespaces self, XMLNamespaces orig) -> XMLNamespaces
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
XMLNamespaces()
Creates a new empty list of XML namespace declarations.
______________________________________________________________________
Method variant with the following signature:
XMLNamespaces(XMLNamespaces orig)
Copy constructor; creates a copy of this XMLNamespaces list.
Parameter 'orig' is the XMLNamespaces object to copy
Throws XMLConstructorException: Thrown if the argument 'orig' is None.
"""
this = _libsbml.new_XMLNamespaces(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(XMLNamespaces self) -> XMLNamespaces
Creates and returns a deep copy of this XMLNamespaces object.
Returns the (deep) copy of this XMLNamespaces object.
"""
return _libsbml.XMLNamespaces_clone(self)
def add(self, *args):
"""
add(XMLNamespaces self, string uri, string prefix) -> int
add(XMLNamespaces self, string uri) -> int
Appends an XML namespace prefix and URI pair to this list of namespace
declarations.
An XMLNamespaces object stores a list of pairs of namespaces and their
prefixes. If there is an XML namespace with the given 'uri' prefix in
this list, then its corresponding URI will be overwritten by the new
'uri' unless the uri represents the core sbml namespace. Calling
programs could use one of the other XMLNamespaces methods, such as
XMLNamespaces.hasPrefix() and XMLNamespaces.hasURI() to inquire
whether a given prefix and/or URI is already present in this
XMLNamespaces object. If the 'uri' represents the sbml namespaces then
it will not be overwritten, as this has potentially serious
consequences. If it is necessary to replace the sbml namespace the
namespace should be removed prior to adding the new namespace.
Parameter 'uri' is a string, the uri for the namespace Parameter
'prefix' is a string, the prefix for the namespace
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_OBJECT
* LIBSBML_OPERATION_FAILED
"""
return _libsbml.XMLNamespaces_add(self, *args)
def remove(self, *args):
"""
remove(XMLNamespaces self, int index) -> int
remove(XMLNamespaces self, string prefix) -> int
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
remove(int index)
Removes an XML Namespace stored in the given position of this list.
Parameter 'index' is an integer, position of the namespace to remove.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INDEX_EXCEEDS_SIZE
______________________________________________________________________
Method variant with the following signature:
remove(string prefix)
Removes an XML Namespace with the given prefix.
Parameter 'prefix' is a string, prefix of the required namespace.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INDEX_EXCEEDS_SIZE
See also remove().
"""
return _libsbml.XMLNamespaces_remove(self, *args)
def clear(self):
"""
clear(XMLNamespaces self) -> int
Clears (deletes) all XML namespace declarations in this XMLNamespaces
object.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
See also remove().
"""
return _libsbml.XMLNamespaces_clear(self)
def getIndex(self, uri):
"""
getIndex(XMLNamespaces self, string uri) -> int
Look up the index of an XML namespace declaration by URI.
An XMLNamespaces object stores a list of pairs of namespaces and their
prefixes. If this XMLNamespaces object contains a pair with the given
URI 'uri', this method returns its index in the list.
Parameter 'uri' is a string, the URI of the sought-after namespace.
Returns the index of the given declaration, or -1 if not present.
"""
return _libsbml.XMLNamespaces_getIndex(self, uri)
def containsUri(self, uri):
"""
containsUri(XMLNamespaces self, string uri) -> bool
Tests whether the given uri is contained in this set of namespaces.
"""
return _libsbml.XMLNamespaces_containsUri(self, uri)
def getIndexByPrefix(self, prefix):
"""
getIndexByPrefix(XMLNamespaces self, string prefix) -> int
Look up the index of an XML namespace declaration by prefix.
An XMLNamespaces object stores a list of pairs of namespaces and their
prefixes. If this XMLNamespaces object contains a pair with the given
prefix 'prefix', this method returns its index in the list.
Parameter 'prefix' is a string, the prefix string of the sought-after
namespace
Returns the index of the given declaration, or -1 if not present.
"""
return _libsbml.XMLNamespaces_getIndexByPrefix(self, prefix)
def getLength(self):
"""
getLength(XMLNamespaces self) -> int
Returns the total number of URI-and-prefix pairs stored in this
particular XMLNamespaces instance.
Returns the number of namespaces in this list.
"""
return _libsbml.XMLNamespaces_getLength(self)
def getNumNamespaces(self):
"""
getNumNamespaces(XMLNamespaces self) -> int
Returns the total number of URI-and-prefix pairs stored in this
particular XMLNamespaces instance.
Returns the number of namespaces in this list.
This function is an alias for getLength introduced for consistency
with other XML classes.
"""
return _libsbml.XMLNamespaces_getNumNamespaces(self)
def getPrefix(self, *args):
"""
getPrefix(XMLNamespaces self, int index) -> string
getPrefix(XMLNamespaces self, string uri) -> string
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
getPrefix(string uri)
Look up the prefix of an XML namespace declaration by its URI.
An XMLNamespaces object stores a list of pairs of namespaces and their
prefixes. This method returns the prefix for a pair that has the
given 'uri'.
Parameter 'uri' is a string, the URI of the prefix being sought
Returns the prefix of an XML namespace declaration given its URI, or
an empty string if no such 'uri' exists in this XMLNamespaces object
______________________________________________________________________
Method variant with the following signature:
getPrefix(int index)
Look up the prefix of an XML namespace declaration by its position.
An XMLNamespaces object stores a list of pairs of namespaces and their
prefixes. This method returns the prefix of the nth element in that
list (if it exists). Callers should use XMLAttributes.getLength()
first to find out how many namespaces are stored in the list.
Parameter 'index' is an integer, position of the sought-after prefix
Returns the prefix of an XML namespace declaration in this list (by
position), or an empty string if the 'index' is out of range
See also getLength().
"""
return _libsbml.XMLNamespaces_getPrefix(self, *args)
def getURI(self, *args):
"""
getURI(XMLNamespaces self, int index) -> string
getURI(XMLNamespaces self, string prefix) -> string
getURI(XMLNamespaces self) -> string
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
getURI(int index)
Look up the URI of an XML namespace declaration by its position.
An XMLNamespaces object stores a list of pairs of namespaces and their
prefixes. This method returns the URI of the nth element in that list
(if it exists). Callers should use XMLAttributes.getLength() first to
find out how many namespaces are stored in the list.
Parameter 'index' is an integer, position of the required URI.
Returns the URI of an XML namespace declaration in this list (by
position), or an empty string if the 'index' is out of range.
See also getLength(), getURI().
"""
return _libsbml.XMLNamespaces_getURI(self, *args)
def isEmpty(self):
"""
isEmpty(XMLNamespaces self) -> bool
Predicate returning True or False depending on whether this
XMLNamespaces list is empty.
Returns True if this XMLNamespaces list is empty, False otherwise.
"""
return _libsbml.XMLNamespaces_isEmpty(self)
def hasURI(self, uri):
"""
hasURI(XMLNamespaces self, string uri) -> bool
Predicate returning True or False depending on whether an XML
Namespace with the given URI is contained in this XMLNamespaces list.
Parameter 'uri' is a string, the uri for the namespace
Returns True if an XML Namespace with the given URI is contained in
this XMLNamespaces list, False otherwise.
"""
return _libsbml.XMLNamespaces_hasURI(self, uri)
def hasPrefix(self, prefix):
"""
hasPrefix(XMLNamespaces self, string prefix) -> bool
Predicate returning True or False depending on whether an XML
Namespace with the given prefix is contained in this XMLNamespaces
list.
Parameter 'prefix' is a string, the prefix for the namespace
Returns True if an XML Namespace with the given URI is contained in
this XMLNamespaces list, False otherwise.
"""
return _libsbml.XMLNamespaces_hasPrefix(self, prefix)
def hasNS(self, uri, prefix):
"""
hasNS(XMLNamespaces self, string uri, string prefix) -> bool
Predicate returning True or False depending on whether an XML
Namespace with the given URI and prefix pair is contained in this
XMLNamespaces list.
Parameter 'uri' is a string, the URI for the namespace Parameter
'prefix' is a string, the prefix for the namespace
Returns True if an XML Namespace with the given uri/prefix pair is
contained in this XMLNamespaces list, False otherwise.
"""
return _libsbml.XMLNamespaces_hasNS(self, uri, prefix)
def __eq__(self, rhs):
if ((self is None) and (rhs is None)): return True
if ((self is None) or (rhs is None)): return False
if (hasattr(self, 'this') and hasattr(rhs, 'this')):
if (self.this == rhs.this): return True
return False
def __ne__(self, rhs):
if ((self is None) and (rhs is None)): return False
if ((self is None) or (rhs is None)): return True
if (hasattr(self, 'this') and hasattr(rhs, 'this')):
if (self.this == rhs.this): return False
return True
XMLNamespaces_swigregister = _libsbml.XMLNamespaces_swigregister
XMLNamespaces_swigregister(XMLNamespaces)
class XMLToken(_object):
"""
A token in an XML stream.
The libSBML XML parser interface can read an XML file or data stream
and convert the contents into tokens. The tokens represent items in
the XML stream, either XML elements (start or end tags) or text that
appears as content inside an element. The XMLToken class is libSBML's
low-level representation of these entities.
Each XMLToken has the following information associated with it:
* Qualified name: every XML element or XML attribute has a name
(e.g., for the element , the name is 'mytag'), but this name
may be qualified with a namespace (e.g., it may appear as
in the input). An XMLToken stores the name of a
token, along with any namespace qualification present, through the use
of an XMLTriple object. This object stores the bare name of the
element, its XML namespace prefix (if any), and the XML namespace with
which that prefix is associated.
* Namespaces: An XML token can have one or more XML namespaces
associated with it. These namespaces may be specified explicitly on
the element or inherited from parent elements. In libSBML, a list of
namespaces is stored in an XMLNamespaces object. An XMLToken
possesses a field for storing an XMLNamespaces object.
* Attributes: XML elements can have attributes associated with
them, and these attributes can have values assigned to them. The set
of attribute-value pairs is stored in an XMLAttributes object stored
in an XMLToken object. (Note: only elements can have attributes --
text blocks cannot have them in XML.)
* Line number: the line number in the input where the token
appears.
* Column number: the column number in the input where the token
appears.
The XMLToken class serves as base class for XMLNode. XML lends itself
to a tree-structured representation, and in libSBML, the nodes in an
XML document tree are XMLNode objects. Most higher-level libSBML
classes and methods that offer XML-level functionality (such as the
methods on SBase for interacting with annotations) work with XMLNode
objects rather than XMLToken objects directly.
See also XMLNode, XMLTriple, XMLAttributes, XMLNamespaces.
"""
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, XMLToken, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, XMLToken, name)
__repr__ = _swig_repr
__swig_destroy__ = _libsbml.delete_XMLToken
__del__ = lambda self: None
def __init__(self, *args):
"""
__init__(XMLToken self) -> XMLToken
__init__(XMLToken self, XMLTriple triple, XMLAttributes attributes, XMLNamespaces namespaces, unsigned int const line=0, unsigned int const column=0) -> XMLToken
__init__(XMLToken self, XMLTriple triple, XMLAttributes attributes, XMLNamespaces namespaces, unsigned int const line=0) -> XMLToken
__init__(XMLToken self, XMLTriple triple, XMLAttributes attributes, XMLNamespaces namespaces) -> XMLToken
__init__(XMLToken self, XMLTriple triple, XMLAttributes attributes, unsigned int const line=0, unsigned int const column=0) -> XMLToken
__init__(XMLToken self, XMLTriple triple, XMLAttributes attributes, unsigned int const line=0) -> XMLToken
__init__(XMLToken self, XMLTriple triple, XMLAttributes attributes) -> XMLToken
__init__(XMLToken self, XMLTriple triple, unsigned int const line=0, unsigned int const column=0) -> XMLToken
__init__(XMLToken self, XMLTriple triple, unsigned int const line=0) -> XMLToken
__init__(XMLToken self, XMLTriple triple) -> XMLToken
__init__(XMLToken self, string chars, unsigned int const line=0, unsigned int const column=0) -> XMLToken
__init__(XMLToken self, string chars, unsigned int const line=0) -> XMLToken
__init__(XMLToken self, string chars) -> XMLToken
__init__(XMLToken self, XMLToken orig) -> XMLToken
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
XMLToken( XMLTriple triple , XMLAttributes attributes ,
XMLNamespaces namespaces , long line = 0 , long column = 0
)
Creates an XML start element with attributes and namespace
declarations.
Parameter 'triple' is an XMLTriple object describing the start tag.
Parameter 'attributes' is XMLAttributes, the attributes to set on the
element to be created.
Parameter 'namespaces' is XMLNamespaces, the namespaces to set on the
element to be created.
Parameter 'line' is a long integer, the line number to associate with
the token (default = 0).
Parameter 'column' is a long integer, the column number to associate
with the token (default = 0).
______________________________________________________________________
Method variant with the following signature:
XMLToken( XMLTriple triple , long line = 0 , long column
= 0 )
Creates an XML end element.
Parameter 'triple' is an XMLTriple object describing the end tag.
Parameter 'line' is a long integer, the line number to associate with
the token (default = 0).
Parameter 'column' is a long integer, the column number to associate
with the token (default = 0).
______________________________________________________________________
Method variant with the following signature:
XMLToken()
Creates a new empty XMLToken object.
______________________________________________________________________
Method variant with the following signature:
XMLToken(XMLToken orig)
Copy constructor; creates a copy of this XMLToken object.
Parameter 'orig' is the XMLToken object to copy.
Throws XMLConstructorException: Thrown if the argument 'orig' is None.
______________________________________________________________________
Method variant with the following signature:
XMLToken( XMLTriple triple , XMLAttributes attributes ,
long line = 0 , long column = 0 )
Creates an XML start element with attributes.
Parameter 'triple' is an XMLTriple object describing the start tag.
Parameter 'attributes' is XMLAttributes, the attributes to set on the
element to be created.
Parameter 'line' is a long integer, the line number to associate with
the token (default = 0).
Parameter 'column' is a long integer, the column number to associate
with the token (default = 0).
The XML namespace component of this XMLToken object will be left
empty. See the other variants of the XMLToken constructors for
versions that take namespace arguments.
______________________________________________________________________
Method variant with the following signature:
XMLToken( string chars , long line = 0 , long column = 0 )
Creates a text object.
Parameter 'chars' is a string, the text to be added to the XMLToken
object.
Parameter 'line' is a long integer, the line number to associate with
the token (default = 0).
Parameter 'column' is a long integer, the column number to associate
with the token (default = 0).
Throws XMLConstructorException: Thrown if the argument 'chars' is
None.
"""
this = _libsbml.new_XMLToken(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(XMLToken self) -> XMLToken
Creates and returns a deep copy of this XMLToken object.
Returns the (deep) copy of this XMLToken object.
"""
return _libsbml.XMLToken_clone(self)
def getAttributes(self):
"""
getAttributes(XMLToken self) -> XMLAttributes
Returns the attributes of the XML element represented by this token.
Returns the attributes of this XML element, stored in an XMLAttributes
object.
"""
return _libsbml.XMLToken_getAttributes(self)
def setAttributes(self, attributes):
"""
setAttributes(XMLToken self, XMLAttributes attributes) -> int
Sets the attributes on the XML element represented by this token.
This operation only makes sense for XML start elements. This method
will return LIBSBML_INVALID_XML_OPERATION if this XMLToken object is
not an XML start element.
Parameter 'attributes' is an XMLAttributes object to be assigned to
this XMLToken object, thereby setting the XML attributes associated
with this token.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
* LIBSBML_INVALID_XML_OPERATION
* LIBSBML_INVALID_OBJECT
Note:
This function replaces any existing XMLAttributes object on this
XMLToken object with the one given by 'attributes'.
"""
return _libsbml.XMLToken_setAttributes(self, attributes)
def addAttr(self, *args):
"""
addAttr(XMLToken self, string name, string value, string namespaceURI, string prefix) -> int
addAttr(XMLToken self, string name, string value, string namespaceURI) -> int
addAttr(XMLToken self, string name, string value) -> int
addAttr(XMLToken self, XMLTriple triple, string value) -> int
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
addAttr( string name , string value , string namespaceURI = '' ,
string prefix = '')
Adds an attribute to the XML element represented by this token.
This operation only makes sense for XML start elements. This method
will return LIBSBML_INVALID_XML_OPERATION if this XMLToken object is
not an XML start element.
Parameter 'name' is a string, the so-called 'local part' of the
attribute name; that is, the attribute name without any namespace
qualifier or prefix.
Parameter 'value' is a string, the value assigned to the attribute.
Parameter 'namespaceURI' is a string, the XML namespace URI of the
attribute.
Parameter 'prefix' is a string, the prefix for the XML namespace.
Recall that in XML, the complete form of an attribute on an XML
element is the following: prefix:name='value' The
name part is the name of the attribute, the 'value' part is the value
assigned to the attribute (and it is always a quoted string), and the
prefix part is an optional XML namespace prefix. Internally in
libSBML, this data is stored in an XMLAttributes object associated
with this XMLToken.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_OBJECT
* LIBSBML_INVALID_XML_OPERATION
Note:
If an attribute with the same name and XML namespace URI already
exists on this XMLToken object, then the previous value will be
replaced with the new value provided to this method.
______________________________________________________________________
Method variant with the following signature:
addAttr( XMLTriple triple, string value)
Adds an attribute to the XML element represented by this token.
This operation only makes sense for XML start elements. This method
will return LIBSBML_INVALID_XML_OPERATION if this XMLToken object is
not an XML start element.
Parameter 'triple' is an XMLTriple object defining the attribute, its
value, and optionally its XML namespace (if any is provided).
Parameter 'value' is a string, the value assigned to the attribute.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_OBJECT
* LIBSBML_INVALID_XML_OPERATION
Note:
If an attribute with the same name and XML namespace URI already
exists on this XMLToken object, then the previous value will be
replaced with the new value provided to this method.
"""
return _libsbml.XMLToken_addAttr(self, *args)
def removeAttr(self, *args):
"""
removeAttr(XMLToken self, int n) -> int
removeAttr(XMLToken self, string name, string uri) -> int
removeAttr(XMLToken self, string name) -> int
removeAttr(XMLToken self, XMLTriple triple) -> int
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
removeAttr(int n)
Removes the nth attribute from the XML element represented by this
token.
This operation only makes sense for XML start elements. This method
will return LIBSBML_INVALID_XML_OPERATION if this XMLToken object is
not an XML start element.
Parameter 'n' is an integer the index of the resource to be deleted
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_XML_OPERATION
* LIBSBML_INDEX_EXCEEDS_SIZE
The value LIBSBML_INDEX_EXCEEDS_SIZE is returned if there is no
attribute on this element at the given index 'n'.
See also getAttrIndex(), getAttrIndex(), getAttributesLength(),
hasAttr(), hasAttr().
"""
return _libsbml.XMLToken_removeAttr(self, *args)
def clearAttributes(self):
"""
clearAttributes(XMLToken self) -> int
Removes all attributes of this XMLToken object.
This operation only makes sense for XML start elements. This method
will return LIBSBML_INVALID_XML_OPERATION if this XMLToken object is
not an XML start element.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_XML_OPERATION
"""
return _libsbml.XMLToken_clearAttributes(self)
def getAttrIndex(self, *args):
"""
getAttrIndex(XMLToken self, string name, string uri) -> int
getAttrIndex(XMLToken self, string name) -> int
getAttrIndex(XMLToken self, XMLTriple triple) -> int
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
getAttrIndex(string name, string uri='')
Returns the index of the attribute with the given name and namespace
URI.
Parameter 'name' is a string, the name of the attribute. Parameter
'uri' is a string, the namespace URI of the attribute.
Returns the index of an attribute with the given local name and
namespace URI, or -1 if it is not present on this token.
______________________________________________________________________
Method variant with the following signature:
getAttrIndex(XMLTriple triple)
Returns the index of the attribute defined by the given XMLTriple
object.
Parameter 'triple' is the XMLTriple object that defines the attribute
whose index is being sought.
Returns the index of an attribute with the given XMLTriple object, or
-1 if no such attribute is present on this token.
"""
return _libsbml.XMLToken_getAttrIndex(self, *args)
def getAttributesLength(self):
"""
getAttributesLength(XMLToken self) -> int
Returns the number of attributes on this XMLToken object.
Returns the number of attributes possessed by this token.
See also hasAttr().
"""
return _libsbml.XMLToken_getAttributesLength(self)
def getAttrName(self, index):
"""
getAttrName(XMLToken self, int index) -> string
Returns the name of the nth attribute in this token's list of
attributes.
Parameter 'index' is an integer, the position of the attribute whose
name is being sought.
Returns the name of the attribute located at position 'n' in the list
of attributes possessed by this XMLToken object.
Note:
If 'index' is out of range, this method will return an empty string.
XMLToken.hasAttr() can be used to test for an attribute's existence
explicitly, and XMLToken.getAttributesLength() can be used to find out
the number of attributes possessed by this token.
See also hasAttr(), getAttributesLength().
"""
return _libsbml.XMLToken_getAttrName(self, index)
def getAttrPrefix(self, index):
"""
getAttrPrefix(XMLToken self, int index) -> string
Returns the prefix of the nth attribute in this token's list of
attributes.
Parameter 'index' is an integer, the position of the attribute whose
prefix is being sought.
Returns the XML namespace prefix of the attribute located at position
'n' in the list of attributes possessed by this XMLToken object.
Note:
If 'index' is out of range, this method will return an empty string.
XMLToken.hasAttr() can be used to test for an attribute's existence
explicitly, and XMLToken.getAttributesLength() can be used to find out
the number of attributes possessed by this token.
See also hasAttr(), getAttributesLength().
"""
return _libsbml.XMLToken_getAttrPrefix(self, index)
def getAttrPrefixedName(self, index):
"""
getAttrPrefixedName(XMLToken self, int index) -> string
Returns the prefixed name of the nth attribute in this token's list of
attributes.
In this context, prefixed name means the name of the attribute
prefixed with the XML namespace prefix assigned to the attribute.
This will be a string of the form prefix:name.
Parameter 'index' is an integer, the position of the attribute whose
prefixed name is being sought.
Returns the prefixed name of the attribute located at position 'n' in
the list of attributes possessed by this XMLToken object.
Note:
If 'index' is out of range, this method will return an empty string.
XMLToken.hasAttr() can be used to test for an attribute's existence
explicitly, and XMLToken.getAttributesLength() can be used to find out
the number of attributes possessed by this token.
"""
return _libsbml.XMLToken_getAttrPrefixedName(self, index)
def getAttrURI(self, index):
"""
getAttrURI(XMLToken self, int index) -> string
Returns the XML namespace URI of the nth attribute in this token's
list of attributes.
Parameter 'index' is an integer, the position of the attribute whose
namespace URI is being sought.
Returns the XML namespace URI of the attribute located at position 'n'
in the list of attributes possessed by this XMLToken object.
Note:
If 'index' is out of range, this method will return an empty string.
XMLToken.hasAttr() can be used to test for an attribute's existence
explicitly, and XMLToken.getAttributesLength() can be used to find out
the number of attributes possessed by this token.
"""
return _libsbml.XMLToken_getAttrURI(self, index)
def getAttrValue(self, *args):
"""
getAttrValue(XMLToken self, int index) -> string
getAttrValue(XMLToken self, string name, string uri) -> string
getAttrValue(XMLToken self, string name) -> string
getAttrValue(XMLToken self, XMLTriple triple) -> string
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
getAttrValue(int index)
Returns the value of the nth attribute in this token's list of
attributes.
Parameter 'index' is an integer, the position of the attribute whose
value is required.
Returns the value of the attribute located at position 'n' in the list
of attributes possessed by this XMLToken object.
Note:
If 'index' is out of range, this method will return an empty string.
XMLToken.hasAttr() can be used to test for an attribute's existence
explicitly, and XMLToken.getAttributesLength() can be used to find out
the number of attributes possessed by this token.
______________________________________________________________________
Method variant with the following signature:
getAttrValue(string name, string uri='')
Returns the value of the attribute with a given name and XML namespace
URI.
Parameter 'name' is a string, the name of the attribute whose value is
being sought.
Parameter 'uri' is a string, the XML namespace URI of the attribute.
Returns The value of the attribute, as a string.
Note:
If an attribute with the given 'name' and 'uri' does not exist on this
token object, this method will return an empty string.
XMLToken.hasAttr() can be used to test explicitly for the presence of
an attribute with a given name and namespace.
______________________________________________________________________
Method variant with the following signature:
getAttrValue(XMLTriple triple)
Returns the value of the attribute specified by a given XMLTriple
object.
Parameter 'triple' is an XMLTriple describing the attribute whose
value is being sought.
Returns The value of the attribute, as a string.
Note:
If an attribute defined by the given 'triple' does not exist on this
token object, this method will return an empty string.
XMLToken.hasAttr() can be used to test explicitly for the existence of
an attribute with the properties of a given triple.
"""
return _libsbml.XMLToken_getAttrValue(self, *args)
def hasAttr(self, *args):
"""
hasAttr(XMLToken self, int index) -> bool
hasAttr(XMLToken self, string name, string uri) -> bool
hasAttr(XMLToken self, string name) -> bool
hasAttr(XMLToken self, XMLTriple triple) -> bool
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
hasAttr(int index)
Returns True if an attribute with the given index exists.
Parameter 'index' is an integer, the position of the attribute.
Returns True if this token object possesses an attribute with the
given index, False otherwise.
______________________________________________________________________
Method variant with the following signature:
hasAttr(string name, string uri='')
Returns True if an attribute with a given name and namespace URI
exists.
Parameter 'name' is a string, the name of the attribute being sought.
Parameter 'uri' is a string, the XML namespace URI of the attribute
being sought.
Returns True if an attribute with the given local name and namespace
URI exists in the list of attributes on this token object, False
otherwise.
______________________________________________________________________
Method variant with the following signature:
hasAttr(XMLTriple triple)
Returns True if an attribute defined by a given XMLTriple object
exists.
Parameter 'triple' is an XMLTriple object describing the attribute
being sought.
Returns True if an attribute matching the properties of the given
XMLTriple object exists in the list of attributes on this token, False
otherwise.
"""
return _libsbml.XMLToken_hasAttr(self, *args)
def isAttributesEmpty(self):
"""
isAttributesEmpty(XMLToken self) -> bool
Returns True if this token has no attributes.
Returns True if the list of attributes on XMLToken object is empty,
False otherwise.
"""
return _libsbml.XMLToken_isAttributesEmpty(self)
def getNamespaces(self):
"""
getNamespaces(XMLToken self) -> XMLNamespaces
Returns the XML namespaces declared for this token.
Returns the XML namespace declarations for this XML element.
"""
return _libsbml.XMLToken_getNamespaces(self)
def setNamespaces(self, namespaces):
"""
setNamespaces(XMLToken self, XMLNamespaces namespaces) -> int
Sets the XML namespaces on this XML element.
This operation only makes sense for XML start elements. This method
will return LIBSBML_INVALID_XML_OPERATION if this XMLToken object is
not an XML start element.
Parameter 'namespaces' is the XMLNamespaces object to be assigned to
this XMLToken object.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
* LIBSBML_INVALID_XML_OPERATION
* LIBSBML_INVALID_OBJECT
Note:
This function replaces any existing XMLNamespaces object on this
XMLToken object with the new one given by 'namespaces'.
"""
return _libsbml.XMLToken_setNamespaces(self, namespaces)
def addNamespace(self, *args):
"""
addNamespace(XMLToken self, string uri, string prefix) -> int
addNamespace(XMLToken self, string uri) -> int
Appends an XML namespace declaration to this token.
The namespace added will be defined by the given XML namespace URI and
an optional prefix. If this XMLToken object already possesses an XML
namespace declaration with the given 'prefix', then the existing XML
namespace URI will be overwritten by the new one given by 'uri'.
This operation only makes sense for XML start elements. This method
will return LIBSBML_INVALID_XML_OPERATION if this XMLToken object is
not an XML start element.
Parameter 'uri' is a string, the XML namespace URI for the namespace.
Parameter 'prefix' is a string, the namespace prefix to use.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_XML_OPERATION
"""
return _libsbml.XMLToken_addNamespace(self, *args)
def removeNamespace(self, *args):
"""
removeNamespace(XMLToken self, int index) -> int
removeNamespace(XMLToken self, string prefix) -> int
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
removeNamespace(int index)
Removes the nth XML namespace declaration.
This operation only makes sense for XML start elements. This method
will return LIBSBML_INVALID_XML_OPERATION if this XMLToken object is
not an XML start element.
Parameter 'index' is an integer, the position of the namespace to be
removed. The position in this context refers to the position of the
namespace in the XMLNamespaces object stored in this XMLToken object.
Callers can use one of the getNamespace___() methods to find the index
number of a given namespace.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_XML_OPERATION
* LIBSBML_INDEX_EXCEEDS_SIZE
See also getNamespaceIndex(), getNamespaceIndexByPrefix(),
getNamespacesLength(), getNamespaceIndexByPrefix().
"""
return _libsbml.XMLToken_removeNamespace(self, *args)
def clearNamespaces(self):
"""
clearNamespaces(XMLToken self) -> int
Removes all XML namespace declarations from this token.
This operation only makes sense for XML start elements. This method
will return LIBSBML_INVALID_XML_OPERATION if this XMLToken object is
not an XML start element.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_INVALID_XML_OPERATION
* LIBSBML_OPERATION_FAILED
"""
return _libsbml.XMLToken_clearNamespaces(self)
def getNamespaceIndex(self, uri):
"""
getNamespaceIndex(XMLToken self, string uri) -> int
Returns the index of an XML namespace declaration based on its URI.
Parameter 'uri' is a string, the XML namespace URI of the sought-after
namespace.
Returns the index of the given declaration, or -1 if no such namespace
URI is present on this XMLToken object.
"""
return _libsbml.XMLToken_getNamespaceIndex(self, uri)
def getNamespaceIndexByPrefix(self, prefix):
"""
getNamespaceIndexByPrefix(XMLToken self, string prefix) -> int
Returns the index of an XML namespace declaration based on its prefix.
Parameter 'prefix' is a string, the prefix of the sought-after XML
namespace.
Returns the index of the given declaration, or -1 if no such namespace
URI is present on this XMLToken object.
"""
return _libsbml.XMLToken_getNamespaceIndexByPrefix(self, prefix)
def getNamespacesLength(self):
"""
getNamespacesLength(XMLToken self) -> int
Returns the number of XML namespaces declared on this token.
Returns the number of XML namespaces stored in the XMLNamespaces
object of this XMLToken object.
"""
return _libsbml.XMLToken_getNamespacesLength(self)
def getNamespacePrefix(self, *args):
"""
getNamespacePrefix(XMLToken self, int index) -> string
getNamespacePrefix(XMLToken self, string uri) -> string
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
getNamespacePrefix(string uri)
Returns the prefix associated with a given XML namespace URI on this
token.
Parameter 'uri' is a string, the URI of the namespace whose prefix is
being sought.
Returns the prefix of an XML namespace declaration on this XMLToken
object.
Note:
If there is no XML namespace with the given 'uri' declared on this
XMLToken object, this method will return an empty string.
______________________________________________________________________
Method variant with the following signature:
getNamespacePrefix(int index)
Returns the prefix of the nth XML namespace declaration.
Parameter 'index' is an integer, position of the required prefix.
Returns the prefix of an XML namespace declaration in the
XMLNamespaces (by position).
Note:
If 'index' is out of range, this method will return an empty string.
XMLToken.getNamespacesLength() can be used to find out how many
namespaces are defined on this XMLToken object.
See also getNamespacesLength().
"""
return _libsbml.XMLToken_getNamespacePrefix(self, *args)
def getNamespaceURI(self, *args):
"""
getNamespaceURI(XMLToken self, int index) -> string
getNamespaceURI(XMLToken self, string prefix) -> string
getNamespaceURI(XMLToken self) -> string
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
getNamespaceURI(int index)
Returns the URI of the nth XML namespace declared on this token.
Parameter 'index' is an integer, the position of the sought-after XML
namespace URI.
Returns the URI of the nth XML namespace stored in the XMLNamespaces
object in this XMLToken object.
Note:
If 'index' is out of range, this method will return an empty string.
See also getNamespacesLength().
______________________________________________________________________
Method variant with the following signature:
getNamespaceURI(string prefix = '')
Returns the URI of an XML namespace with a given prefix.
Parameter 'prefix' is a string, the prefix of the sought-after XML
namespace URI.
Returns the URI of an XML namespace declaration given its prefix.
Note:
If there is no XML namespace with the given 'prefix' stored in the
XMLNamespaces object of this XMLToken object, this method will return
an empty string.
"""
return _libsbml.XMLToken_getNamespaceURI(self, *args)
def isNamespacesEmpty(self):
"""
isNamespacesEmpty(XMLToken self) -> bool
Returns True if there are no namespaces declared on this token.
Returns True if the XMLNamespaces object stored in this XMLToken token
is empty, False otherwise.
"""
return _libsbml.XMLToken_isNamespacesEmpty(self)
def hasNamespaceURI(self, uri):
"""
hasNamespaceURI(XMLToken self, string uri) -> bool
Returns True if this token has an XML namespace with a given URI.
Parameter 'uri' is a string, the URI of the XML namespace.
Returns True if an XML namespace with the given URI is contained in
the XMLNamespaces object of this XMLToken object, False otherwise.
"""
return _libsbml.XMLToken_hasNamespaceURI(self, uri)
def hasNamespacePrefix(self, prefix):
"""
hasNamespacePrefix(XMLToken self, string prefix) -> bool
Returns True if this token has an XML namespace with a given prefix.
Parameter 'prefix' is a string, the prefix for the XML namespace.
Returns True if an XML Namespace with the given URI is contained in
the XMLNamespaces of this XMLToken, False otherwise.
"""
return _libsbml.XMLToken_hasNamespacePrefix(self, prefix)
def hasNamespaceNS(self, uri, prefix):
"""
hasNamespaceNS(XMLToken self, string uri, string prefix) -> bool
Returns True if this token has an XML namespace with a given prefix
and URI combination.
Parameter 'uri' is a string, the URI for the namespace. Parameter
'prefix' is a string, the prefix for the namespace.
Returns True if an XML namespace with the given URI/prefix pair is
contained in the XMLNamespaces object of this XMLToken object, False
otherwise.
"""
return _libsbml.XMLToken_hasNamespaceNS(self, uri, prefix)
def setTriple(self, triple):
"""
setTriple(XMLToken self, XMLTriple triple) -> int
Sets the name, namespace prefix and namespace URI of this token.
This operation only makes sense for XML start elements. This method
will return LIBSBML_INVALID_XML_OPERATION if this XMLToken object is
not an XML start element.
Parameter 'triple' is the new XMLTriple to use for this XMLToken
object. If this XMLToken already had an XMLTriple object stored
within it, that object will be replaced.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
* LIBSBML_INVALID_XML_OPERATION
* LIBSBML_INVALID_OBJECT
"""
return _libsbml.XMLToken_setTriple(self, triple)
def getName(self):
"""
getName(XMLToken self) -> string
Returns the (unqualified) name of token.
Returns the (unqualified) name of token.
"""
return _libsbml.XMLToken_getName(self)
def getPrefix(self):
"""
getPrefix(XMLToken self) -> string
Returns the XML namespace prefix of token.
Returns the XML namespace prefix of token.
Note:
If no XML namespace prefix has been assigned to this token, this
method will return an empty string.
"""
return _libsbml.XMLToken_getPrefix(self)
def getURI(self):
"""
getURI(XMLToken self) -> string
Returns the XML namespace URI of token.
Returns the XML namespace URI of token.
"""
return _libsbml.XMLToken_getURI(self)
def getCharacters(self):
"""
getCharacters(XMLToken self) -> string
Returns the character text of token.
Returns the characters of this XML token. If this token is not a text
token (i.e., it's an XML element and not character content), then this
will return an empty string.
See also isText(), isElement().
"""
return _libsbml.XMLToken_getCharacters(self)
def append(self, chars):
"""
append(XMLToken self, string chars) -> int
Appends characters to the text content of token.
This method only makes sense for XMLToken objects that contains text.
If this method is called on a token that represents an XML start or
end tag, it will return the code LIBSBML_OPERATION_FAILED.
Parameter 'chars' is string, characters to append to the text of this
token.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
See also isText(), isElement().
"""
return _libsbml.XMLToken_append(self, chars)
def getColumn(self):
"""
getColumn(XMLToken self) -> unsigned int
Returns the column number at which this token occurs in the input.
Returns the column at which this XMLToken occurred.
"""
return _libsbml.XMLToken_getColumn(self)
def getLine(self):
"""
getLine(XMLToken self) -> unsigned int
Returns the line number at which this token occurs in the input.
Returns the line at which this XMLToken occurred.
"""
return _libsbml.XMLToken_getLine(self)
def isElement(self):
"""
isElement(XMLToken self) -> bool
Returns True if this token represents an XML element.
This generic predicate returns True if the element is either a start
or end tag, and False if it's a text object. The related methods
XMLToken:isStart(), XMLToken.isEnd() and XMLToken.isText() are more
specific predicates.
Returns True if this XMLToken object represents an XML element, False
otherwise.
See also isStart(), isEnd(), isText().
"""
return _libsbml.XMLToken_isElement(self)
def isEnd(self):
"""
isEnd(XMLToken self) -> bool
Returns True if this token represents an XML end element.
Returns True if this XMLToken object represents an XML end element,
False otherwise.
See also isStart(), isElement(), isText().
"""
return _libsbml.XMLToken_isEnd(self)
def isEndFor(self, element):
"""
isEndFor(XMLToken self, XMLToken element) -> bool
Returns True if this token represents an XML end element for a
particular start element.
Parameter 'element' is XMLToken, the element with which the current
object should be compared to determined whether the current object is
a start element for the given one.
Returns True if this XMLToken object represents an XML end tag for the
start tag given by 'element', False otherwise.
See also isElement(), isStart(), isEnd(), isText().
"""
return _libsbml.XMLToken_isEndFor(self, element)
def isEOF(self):
"""
isEOF(XMLToken self) -> bool
Returns True if this token is an end of file marker.
Returns True if this XMLToken object represents the end of the input,
False otherwise.
See also setEOF().
"""
return _libsbml.XMLToken_isEOF(self)
def isStart(self):
"""
isStart(XMLToken self) -> bool
Returns True if this token represents an XML start element.
Returns True if this XMLToken is an XML start element, False
otherwise.
See also isElement(), isEnd(), isText().
"""
return _libsbml.XMLToken_isStart(self)
def isText(self):
"""
isText(XMLToken self) -> bool
Returns True if this token represents an XML text element.
Returns True if this XMLToken is an XML text element, False otherwise.
See also isElement(), isStart(), isEnd().
"""
return _libsbml.XMLToken_isText(self)
def setEnd(self):
"""
setEnd(XMLToken self) -> int
Declares that this token represents an XML element end tag.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
See also isStart(), isEnd().
"""
return _libsbml.XMLToken_setEnd(self)
def setEOF(self):
"""
setEOF(XMLToken self) -> int
Declares that this token is an end-of-file/input marker.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
See also isEOF().
"""
return _libsbml.XMLToken_setEOF(self)
def unsetEnd(self):
"""
unsetEnd(XMLToken self) -> int
Declares that this token no longer represents an XML start/end
element.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
"""
return _libsbml.XMLToken_unsetEnd(self)
def toString(self):
"""
toString(XMLToken self) -> string
Prints a string representation of the underlying token stream.
This method is intended for debugging purposes.
Returns a text string representing this XMLToken object.
"""
return _libsbml.XMLToken_toString(self)
def __eq__(self, rhs):
if ((self is None) and (rhs is None)): return True
if ((self is None) or (rhs is None)): return False
if (hasattr(self, 'this') and hasattr(rhs, 'this')):
if (self.this == rhs.this): return True
return False
def __ne__(self, rhs):
if ((self is None) and (rhs is None)): return False
if ((self is None) or (rhs is None)): return True
if (hasattr(self, 'this') and hasattr(rhs, 'this')):
if (self.this == rhs.this): return False
return True
XMLToken_swigregister = _libsbml.XMLToken_swigregister
XMLToken_swigregister(XMLToken)
class XMLNode(XMLToken):
"""
A node in libSBML's XML document tree.
LibSBML implements an XML abstraction layer. This layer presents a
uniform XML interface to calling programs regardless of which
underlying XML parser libSBML has actually been configured to use.
The basic data object in the XML abstraction is a node, represented by
XMLNode.
An XMLNode can contain any number of children. Each child is another
XMLNode, thereby forming a tree. The methods XMLNode.getNumChildren()
and XMLNode.getChild() can be used to access the tree structure
starting from a given node.
Each XMLNode is subclassed from XMLToken, and thus has the same
methods available as XMLToken. These methods include
XMLToken.getNamespaces(), XMLToken.getPrefix(), XMLToken.getName(),
XMLToken.getURI(), and XMLToken.getAttributes().
Conversion between an XML string and an XMLNode
======================================================================
LibSBML provides the following utility functions for converting an XML
string (e.g., ... ) to/from an XMLNode object.
* XMLNode.toXMLString() returns a string representation of the
XMLNode object.
* XMLNode.convertXMLNodeToString() (static function) returns a
string representation of the given XMLNode object.
* XMLNode.convertStringToXMLNode() (static function) returns an
XMLNode object converted from the given XML string.
The returned XMLNode object by XMLNode.convertStringToXMLNode() is a
dummy root (container) XMLNode if the given XML string has two or more
top-level elements (e.g., " ... ..."). In the dummy root node, each
top-level element in the given XML string is contained as a child
XMLNode. XMLToken.isEOF() can be used to identify if the returned
XMLNode object is a dummy node or not. Here is an example:
xn = XMLNode.convertStringToXMLNode('
')
if xn == None:
# Do something to handle exceptional situation.
elif xn.isEOF():
# Node is a dummy node.
else:
# None is not a dummy node.
"""
__swig_setmethods__ = {}
for _s in [XMLToken]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, XMLNode, name, value)
__swig_getmethods__ = {}
for _s in [XMLToken]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, XMLNode, name)
__repr__ = _swig_repr
__swig_destroy__ = _libsbml.delete_XMLNode
__del__ = lambda self: None
def __init__(self, *args):
"""
__init__(XMLNode self) -> XMLNode
__init__(XMLNode self, XMLToken token) -> XMLNode
__init__(XMLNode self, XMLTriple triple, XMLAttributes attributes, XMLNamespaces namespaces, unsigned int const line=0, unsigned int const column=0) -> XMLNode
__init__(XMLNode self, XMLTriple triple, XMLAttributes attributes, XMLNamespaces namespaces, unsigned int const line=0) -> XMLNode
__init__(XMLNode self, XMLTriple triple, XMLAttributes attributes, XMLNamespaces namespaces) -> XMLNode
__init__(XMLNode self, XMLTriple triple, XMLAttributes attributes, unsigned int const line=0, unsigned int const column=0) -> XMLNode
__init__(XMLNode self, XMLTriple triple, XMLAttributes attributes, unsigned int const line=0) -> XMLNode
__init__(XMLNode self, XMLTriple triple, XMLAttributes attributes) -> XMLNode
__init__(XMLNode self, XMLTriple triple, unsigned int const line=0, unsigned int const column=0) -> XMLNode
__init__(XMLNode self, XMLTriple triple, unsigned int const line=0) -> XMLNode
__init__(XMLNode self, XMLTriple triple) -> XMLNode
__init__(XMLNode self, string chars, unsigned int const line=0, unsigned int const column=0) -> XMLNode
__init__(XMLNode self, string chars, unsigned int const line=0) -> XMLNode
__init__(XMLNode self, string chars) -> XMLNode
__init__(XMLNode self, XMLInputStream stream) -> XMLNode
__init__(XMLNode self, XMLNode orig) -> XMLNode
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
XMLNode( XMLTriple triple , XMLAttributes attributes ,
XMLNamespaces namespaces , long line = 0 , long column = 0 )
Creates a new start element XMLNode with the given set of attributes
and namespace declarations.
Parameter 'triple' is XMLTriple. Parameter 'attributes' is
XMLAttributes, the attributes to set. Parameter 'namespaces' is
XMLNamespaces, the namespaces to set. Parameter 'line' is a long
integer, the line number (default = 0). Parameter 'column' is a long
integer, the column number (default = 0).
______________________________________________________________________
Method variant with the following signature:
XMLNode( string chars , long line = 0 , long column = 0 )
Creates a text XMLNode.
Parameter 'chars' is a string, the text to be added to the XMLToken
Parameter 'line' is a long integer, the line number (default = 0).
Parameter 'column' is a long integer, the column number (default = 0).
______________________________________________________________________
Method variant with the following signature:
XMLNode(XMLNode orig)
Copy constructor; creates a copy of this XMLNode.
Parameter 'orig' is the XMLNode instance to copy.
Throws XMLConstructorException: Thrown if the argument 'orig' is None.
______________________________________________________________________
Method variant with the following signature:
XMLNode()
Creates a new empty XMLNode with no children.
______________________________________________________________________
Method variant with the following signature:
XMLNode(XMLToken token)
Creates a new XMLNode by copying an XMLToken object.
Parameter 'token' is XMLToken to be copied to XMLNode
______________________________________________________________________
Method variant with the following signature:
XMLNode( XMLTriple triple , XMLAttributes attributes ,
long line = 0 , long column = 0 )
Creates a start element XMLNode with the given set of attributes.
Parameter 'triple' is XMLTriple. Parameter 'attributes' is
XMLAttributes, the attributes to set. Parameter 'line' is a long
integer, the line number (default = 0). Parameter 'column' is a long
integer, the column number (default = 0).
______________________________________________________________________
Method variant with the following signature:
XMLNode( XMLTriple triple , long line = 0 , long column
= 0 )
Creates an end element XMLNode.
Parameter 'triple' is XMLTriple. Parameter 'line' is a long integer,
the line number (default = 0). Parameter 'column' is a long integer,
the column number (default = 0).
"""
this = _libsbml.new_XMLNode(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(XMLNode self) -> XMLNode
Creates and returns a deep copy of this XMLNode object.
Returns the (deep) copy of this XMLNode object.
"""
return _libsbml.XMLNode_clone(self)
def addChild(self, node):
"""
addChild(XMLNode self, XMLNode node) -> int
Adds a copy of 'node' as a child of this XMLNode.
The given 'node' is added at the end of the list of children.
Parameter 'node' is the XMLNode to be added as child.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
* LIBSBML_INVALID_XML_OPERATION
Note:
The given node is added at the end of the children list.
"""
return _libsbml.XMLNode_addChild(self, node)
def insertChild(self, n, node):
"""
insertChild(XMLNode self, unsigned int n, XMLNode node) -> XMLNode
Inserts a copy of the given node as the nth child of this XMLNode.
If the given index 'n' is out of range for this XMLNode instance, the
'node' is added at the end of the list of children. Even in that
situation, this method does not throw an error.
Parameter 'n' is an integer, the index at which the given node is
inserted Parameter 'node' is an XMLNode to be inserted as nth child.
Returns a reference to the newly-inserted child 'node'
"""
return _libsbml.XMLNode_insertChild(self, n, node)
def removeChild(self, n):
"""
removeChild(XMLNode self, unsigned int n) -> XMLNode
Removes the nth child of this XMLNode and returns the removed node.
It is important to keep in mind that a given XMLNode may have more
than one child. Calling this method erases all existing references to
child nodes after the given position 'n'. If the index 'n' is greater
than the number of child nodes in this XMLNode, this method takes no
action (and returns None).
Parameter 'n' is an integer, the index of the node to be removed
Returns the removed child, or None if 'n' is greater than the number
of children in this node
Note:
The caller owns the returned node and is responsible for deleting it.
"""
return _libsbml.XMLNode_removeChild(self, n)
def removeChildren(self):
"""
removeChildren(XMLNode self) -> int
Removes all children from this node. Returns integer value indicating
success/failure of the function. The possible values returned by
this function are:
* LIBSBML_OPERATION_SUCCESS
"""
return _libsbml.XMLNode_removeChildren(self)
def getChild(self, *args):
"""
getChild(XMLNode self, unsigned int n) -> XMLNode
getChild(XMLNode self, unsigned int n) -> XMLNode
getChild(XMLNode self, string name) -> XMLNode
getChild(XMLNode self, string name) -> XMLNode
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
getChild(string name)
Returns the first child of this XMLNode with the corresponding name.
If no child with corrsponding name can be found, this method returns
an empty node.
Parameter 'name' is the name of the node to return
Returns the first child of this XMLNode with given name.
______________________________________________________________________
Method variant with the following signature:
getChild(long n)
Returns the nth child of this XMLNode.
If the index 'n' is greater than the number of child nodes, this
method returns an empty node.
Parameter 'n' is a long integereger, the index of the node to return
Returns the nth child of this XMLNode.
"""
return _libsbml.XMLNode_getChild(self, *args)
def getIndex(self, name):
"""
getIndex(XMLNode self, string name) -> int
Return the index of the first child of this XMLNode with the given
name.
Parameter 'name' is a string, the name of the child for which the
index is required.
Returns the index of the first child of this XMLNode with the given
name, or -1 if not present.
"""
return _libsbml.XMLNode_getIndex(self, name)
def hasChild(self, name):
"""
hasChild(XMLNode self, string name) -> bool
Return a boolean indicating whether this XMLNode has a child with the
given name.
Parameter 'name' is a string, the name of the child to be checked.
Returns boolean indicating whether this XMLNode has a child with the
given name.
"""
return _libsbml.XMLNode_hasChild(self, name)
def equals(self, other, ignoreURI=False):
"""
equals(XMLNode self, XMLNode other, bool ignoreURI=False) -> bool
equals(XMLNode self, XMLNode other) -> bool
Compare this XMLNode against another XMLNode returning true if both
nodes represent the same XML tree, or false otherwise.
Parameter 'other' is another XMLNode to compare against.
Parameter 'ignoreURI' is whether to ignore the namespace URI when
doing the comparison.
Returns boolean indicating whether this XMLNode represents the same
XML tree as another.
"""
return _libsbml.XMLNode_equals(self, other, ignoreURI)
def getNumChildren(self):
"""
getNumChildren(XMLNode self) -> unsigned int
Returns the number of children for this XMLNode.
Returns the number of children for this XMLNode.
"""
return _libsbml.XMLNode_getNumChildren(self)
def toXMLString(self):
"""
toXMLString(XMLNode self) -> string
Returns a string representation of this XMLNode.
Returns a string derived from this XMLNode.
"""
return _libsbml.XMLNode_toXMLString(self)
def convertXMLNodeToString(node):
"""
convertXMLNodeToString(XMLNode node) -> string
Returns a string representation of a given XMLNode.
Parameter 'node' is the XMLNode to be represented as a string
Returns a string-form representation of 'node'
"""
return _libsbml.XMLNode_convertXMLNodeToString(node)
if _newclass:
convertXMLNodeToString = staticmethod(convertXMLNodeToString)
__swig_getmethods__["convertXMLNodeToString"] = lambda x: convertXMLNodeToString
def convertStringToXMLNode(xmlstr, xmlns=None):
"""
convertStringToXMLNode(string xmlstr, XMLNamespaces xmlns=None) -> XMLNode
convertStringToXMLNode(string xmlstr) -> XMLNode
Returns an XMLNode which is derived from a string containing XML
content.
The XML namespace must be defined using argument 'xmlns' if the
corresponding XML namespace attribute is not part of the string of the
first argument.
Parameter 'xmlstr' is string to be converted to a XML node. Parameter
'xmlns' is XMLNamespaces the namespaces to set (default value is
None).
Note:
The caller owns the returned XMLNode and is reponsible for deleting
it. The returned XMLNode object is a dummy root (container) XMLNode
if the top-level element in the given XML string is NOT ,
, , or . In the dummy root node, each top-
level element in the given XML string is contained as a child XMLNode.
XMLToken.isEOF() can be used to identify if the returned XMLNode
object is a dummy node.
Returns a XMLNode which is converted from string 'xmlstr'. If the
conversion failed, this method returns None.
"""
return _libsbml.XMLNode_convertStringToXMLNode(xmlstr, xmlns)
if _newclass:
convertStringToXMLNode = staticmethod(convertStringToXMLNode)
__swig_getmethods__["convertStringToXMLNode"] = lambda x: convertStringToXMLNode
XMLNode_swigregister = _libsbml.XMLNode_swigregister
XMLNode_swigregister(XMLNode)
def XMLNode_convertXMLNodeToString(node):
"""
XMLNode_convertXMLNodeToString(XMLNode node) -> string
Returns a string representation of a given XMLNode.
Parameter 'node' is the XMLNode to be represented as a string
Returns a string-form representation of 'node'
"""
return _libsbml.XMLNode_convertXMLNodeToString(node)
def XMLNode_convertStringToXMLNode(xmlstr, xmlns=None):
"""
convertStringToXMLNode(string xmlstr, XMLNamespaces xmlns=None) -> XMLNode
XMLNode_convertStringToXMLNode(string xmlstr) -> XMLNode
Returns an XMLNode which is derived from a string containing XML
content.
The XML namespace must be defined using argument 'xmlns' if the
corresponding XML namespace attribute is not part of the string of the
first argument.
Parameter 'xmlstr' is string to be converted to a XML node. Parameter
'xmlns' is XMLNamespaces the namespaces to set (default value is
None).
Note:
The caller owns the returned XMLNode and is reponsible for deleting
it. The returned XMLNode object is a dummy root (container) XMLNode
if the top-level element in the given XML string is NOT ,
, , or . In the dummy root node, each top-
level element in the given XML string is contained as a child XMLNode.
XMLToken.isEOF() can be used to identify if the returned XMLNode
object is a dummy node.
Returns a XMLNode which is converted from string 'xmlstr'. If the
conversion failed, this method returns None.
"""
return _libsbml.XMLNode_convertStringToXMLNode(xmlstr, xmlns)
class XMLTriple(_object):
"""
A qualified XML name.
A 'triple' in the libSBML XML layer encapsulates the notion of
qualified name, meaning an element name or an attribute name with an
optional namespace qualifier. Triples by themselves are not entities
in an XML stream -- they are not, for example, elements or attributes;
rather, XMLTriple is used in libSBML to construct these other kinds of
objects.
An XMLTriple instance carries up to three data items:
* The name of the attribute or element; that is, the attribute name
as it appears in an XML document or data stream;
* The XML namespace prefix (if any) of the attribute. For example,
in the following fragment of XML, the namespace prefix is the string
mysim and it appears on both the element someelement and the attribute
attribA. When both the element and the attribute are stored as
XMLTriple objects, their prefix is mysim.
* The XML namespace URI with which the prefix is associated. In XML,
every namespace used must be declared and mapped to a URI.
XMLTriple objects are the lowest-level data item in the XML layer of
libSBML. Other objects such as XMLToken make use of XMLTriple
objects.
See also XMLToken, XMLNode, XMLAttributes, XMLNamespaces.
"""
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, XMLTriple, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, XMLTriple, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(XMLTriple self) -> XMLTriple
__init__(XMLTriple self, string name, string uri, string prefix) -> XMLTriple
__init__(XMLTriple self, string triplet, char const sepchar) -> XMLTriple
__init__(XMLTriple self, string triplet) -> XMLTriple
__init__(XMLTriple self, XMLTriple orig) -> XMLTriple
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
XMLTriple()
Creates a new, empty XMLTriple object.
______________________________________________________________________
Method variant with the following signature:
XMLTriple(XMLTriple orig)
Copy constructor; creates a copy of this XMLTriple object.
Parameter 'orig' is the XMLTriple object to copy.
Throws XMLConstructorException: Thrown if the argument 'orig' is None.
______________________________________________________________________
Method variant with the following signature:
XMLTriple( string name , string uri , string prefix )
Creates a new XMLTriple object with a given 'name', 'uri' and and
'prefix'.
Parameter 'name' is a string, the name for the entity represented by
this object. Parameter 'uri' is a string, the XML namespace URI
associated with the prefix. Parameter 'prefix' is a string, the XML
namespace prefix for this triple.
Throws XMLConstructorException: Thrown if any of the arguments are
None.
______________________________________________________________________
Method variant with the following signature:
XMLTriple(string triplet, char sepchar = ' ')
Creates an XMLTriple object by splitting a given string at a given
separator character.
The 'triplet' in this case is a string that may be in one of the
following three possible formats:
* name * URIxname* URIxnamexprefix
where x represents the separator character, 'sepchar'.
Parameter 'triplet' is a string representing the triplet as shown
above Parameter 'sepchar' is a character, the sepchar used in the
triplet
Throws XMLConstructorException: Thrown if the argument 'triplet' is
None.
"""
this = _libsbml.new_XMLTriple(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(XMLTriple self) -> XMLTriple
Creates and returns a deep copy of this XMLTriple object.
Returns the (deep) copy of this XMLTriple object.
"""
return _libsbml.XMLTriple_clone(self)
def getName(self):
"""
getName(XMLTriple self) -> string
Returns the name portion of this XMLTriple object.
Returns a string, the name portion of this XMLTriple object.
"""
return _libsbml.XMLTriple_getName(self)
def getPrefix(self):
"""
getPrefix(XMLTriple self) -> string
Returns the prefix portion of this XMLTriple object.
Returns a string, the prefix portion of this XMLTriple object.
"""
return _libsbml.XMLTriple_getPrefix(self)
def getURI(self):
"""
getURI(XMLTriple self) -> string
Returns the URI portion of this XMLTriple object.
Returns URI a string, the URI portion of this XMLTriple object.
"""
return _libsbml.XMLTriple_getURI(self)
def getPrefixedName(self):
"""
getPrefixedName(XMLTriple self) -> string
Returns the prefixed name from this XMLTriple.
Returns a string, the prefixed name from this XMLTriple. This is
constructed by concatenating the prefix stored in this XMLTriple
object, followed by a colon character ':', followed by the name stored
in this XMLTriple object.
"""
return _libsbml.XMLTriple_getPrefixedName(self)
def isEmpty(self):
"""
isEmpty(XMLTriple self) -> bool
Returns True if this XMLTriple object is empty.
Returns True if this XMLTriple is empty, False otherwise.
"""
return _libsbml.XMLTriple_isEmpty(self)
def __eq__(self, rhs):
if ((self is None) and (rhs is None)): return True
if ((self is None) or (rhs is None)): return False
if (hasattr(self, 'this') and hasattr(rhs, 'this')):
if (self.this == rhs.this): return True
return False
def __ne__(self, rhs):
if ((self is None) and (rhs is None)): return False
if ((self is None) or (rhs is None)): return True
if (hasattr(self, 'this') and hasattr(rhs, 'this')):
if (self.this == rhs.this): return False
return True
__swig_destroy__ = _libsbml.delete_XMLTriple
__del__ = lambda self: None
XMLTriple_swigregister = _libsbml.XMLTriple_swigregister
XMLTriple_swigregister(XMLTriple)
class XMLOutputStream(_object):
"""
Interface to an XML output stream.
SBML content is serialized using XML; the resulting data can be
stored and read to/from a file or data stream. Low-level XML parsers
such as Xerces provide facilities to read XML data. To permit the use
of different XML parsers (Xerces, Expat or libxml2), libSBML
implements an abstraction layer. XMLInputStream and XMLOutputStream
are two parts of that abstraction layer.
XMLOutputStream provides a wrapper above output streams to facilitate
writing XML. XMLOutputStream keeps track of start and end elements,
indentation, XML namespace prefixes, and more. The interface provides
features for converting non-text data types into appropriate textual
form; this takes the form of overloaded writeAttribute(...) methods
that allow users to simply use the same method with any data type.
For example, suppose an element testElement has two attributes, size
and id, and the attributes are variables in your code as follows:
size = 3.2;
id = 'id';
Then, the element and the attributes can be written to the standard
output stream (provided as cout in the libSBML language bindings) as
follows:
from libsbml import *
size = 3.2;
id = 'id';
# Create an XMLOutputStream object that will write to the standard
# output stream, which is provide in libSBML's Python language
# interface as the object 'libsbml.cout'. Since we imported * from
# the libsbml module, we can simply refer to it as 'cout' here:
output_stream = XMLOutputStream(cout)
# Create the start element, write the attributes, and close the
# element. The output is written immediately by each method.
output_stream.startElement('testElement')
output_stream.writeAttribute('size', size)
output_stream.writeAttribute('id', id)
output_stream.endElement('testElement')
Other classes in SBML take XMLOutputStream objects as arguments, and
use that to write elements and attributes seamlessly to the XML output
stream.
It is also worth noting that unlike XMLInputStream, XMLOutputStream is
actually independent of the underlying XML parsers. It does not use
the XML parser libraries at all.
Note:
The convenience of the XMLInputStream and XMLOutputStream abstraction
may be useful for developers interested in creating parsers for other
XML formats besides SBML. It can provide developers with a layer
above more basic XML parsers, as well as some useful programmatic
elements such as XMLToken, XMLError, etc.
See also XMLInputStream.
"""
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, XMLOutputStream, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, XMLOutputStream, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(XMLOutputStream self, ostream stream, string encoding, bool writeXMLDecl=True, string programName, string programVersion) -> XMLOutputStream
__init__(XMLOutputStream self, ostream stream, string encoding, bool writeXMLDecl=True, string programName) -> XMLOutputStream
__init__(XMLOutputStream self, ostream stream, string encoding, bool writeXMLDecl=True) -> XMLOutputStream
__init__(XMLOutputStream self, ostream stream, string encoding) -> XMLOutputStream
__init__(XMLOutputStream self, ostream stream) -> XMLOutputStream
Creates a new XMLOutputStream that wraps the given @p stream.
@copydetails doc_programname_arguments
@copydetails doc_xml_declaration
@param stream the input stream to wrap.
@param encoding the XML encoding to declare in the output. This value should
be "UTF-8"
for SBML documents. The default value is
"UTF-8"
if no value is supplied for this parameter.
@param writeXMLDecl whether to write a standard XML declaration at
the beginning of the content written on @p stream. The default is
@c true.
@param programName an optional program name to write as a comment
in the output stream.
@param programVersion an optional version identification string to write
as a comment in the output stream.
@htmlinclude warn-default-args-in-docs.html
"""
this = _libsbml.new_XMLOutputStream(*args)
try:
self.this.append(this)
except:
self.this = this
__swig_destroy__ = _libsbml.delete_XMLOutputStream
__del__ = lambda self: None
def endElement(self, *args):
"""
endElement(XMLOutputStream self, string name, string prefix)
endElement(XMLOutputStream self, string name)
endElement(XMLOutputStream self, XMLTriple triple)
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
endElement(string name, string prefix = '')
Writes the given XML end element name to this XMLOutputStream.
Parameter 'name' is the name of the element.
Parameter 'prefix' is an optional XML namespace prefix to write in
front of the 'element' name. (The result has the form prefix:name.)
______________________________________________________________________
Method variant with the following signature:
endElement(XMLTriple triple)
Writes the given element to the stream.
Parameter 'triple' is the XML element to write.
"""
return _libsbml.XMLOutputStream_endElement(self, *args)
def setAutoIndent(self, indent):
"""
setAutoIndent(XMLOutputStream self, bool indent)
Turns automatic indentation on or off for this XMLOutputStream.
Parameter 'indent' is if True, automatic indentation is turned on.
"""
return _libsbml.XMLOutputStream_setAutoIndent(self, indent)
def startElement(self, *args):
"""
startElement(XMLOutputStream self, string name, string prefix)
startElement(XMLOutputStream self, string name)
startElement(XMLOutputStream self, XMLTriple triple)
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
startElement(string name, string prefix = '')
Writes the given XML start element name to this XMLOutputStream.
Parameter 'name' is the name of the element.
Parameter 'prefix' is an optional XML namespace prefix to write in
front of the 'element' name. (The result has the form prefix:name.)
______________________________________________________________________
Method variant with the following signature:
startElement(XMLTriple triple)
Writes the given XML start element prefix:name on this output stream.
Parameter 'triple' is the start element to write.
"""
return _libsbml.XMLOutputStream_startElement(self, *args)
def startEndElement(self, *args):
"""
startEndElement(XMLOutputStream self, string name, string prefix)
startEndElement(XMLOutputStream self, string name)
startEndElement(XMLOutputStream self, XMLTriple triple)
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
startEndElement(string name, string prefix = '')
Writes the given XML start and end element name to this
XMLOutputStream.
Parameter 'name' is the name of the element.
Parameter 'prefix' is an optional XML namespace prefix to write in
front of the 'element' name. (The result has the form prefix:name.)
______________________________________________________________________
Method variant with the following signature:
startEndElement(XMLTriple triple)
Writes the given start element to this output stream.
Parameter 'triple' is the XML element to write.
"""
return _libsbml.XMLOutputStream_startEndElement(self, *args)
def writeAttribute(self, *args):
"""
writeAttribute(XMLOutputStream self, string name, string value)
writeAttribute(XMLOutputStream self, string name, string prefix, string value)
writeAttribute(XMLOutputStream self, XMLTriple triple, string value)
writeAttribute(XMLOutputStream self, string name, char const * value)
writeAttribute(XMLOutputStream self, string name, string prefix, char const * value)
writeAttribute(XMLOutputStream self, XMLTriple triple, char const * value)
writeAttribute(XMLOutputStream self, string name, bool const & value)
writeAttribute(XMLOutputStream self, string name, string prefix, bool const & value)
writeAttribute(XMLOutputStream self, XMLTriple triple, bool const & value)
writeAttribute(XMLOutputStream self, string name, double const & value)
writeAttribute(XMLOutputStream self, string name, string prefix, double const & value)
writeAttribute(XMLOutputStream self, XMLTriple triple, double const & value)
writeAttribute(XMLOutputStream self, string name, long const & value)
writeAttribute(XMLOutputStream self, string name, string prefix, long const & value)
writeAttribute(XMLOutputStream self, XMLTriple triple, long const & value)
writeAttribute(XMLOutputStream self, string name, int const & value)
writeAttribute(XMLOutputStream self, string name, string prefix, int const & value)
writeAttribute(XMLOutputStream self, XMLTriple triple, int const & value)
writeAttribute(XMLOutputStream self, string name, string prefix, unsigned int const & value)
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
writeAttribute(string name, int& value)
Writes the given attribute and value to this output stream.
Parameter 'name' is the name of the attribute.
Parameter 'value' is the value of the attribute.
______________________________________________________________________
Method variant with the following signature:
writeAttribute(string name, string prefix, long& value)
Writes the given namespace-prefixed attribute value to this output
stream.
Parameter 'name' is the name of the attribute.
Parameter 'prefix' is an XML namespace prefix to write in front of the
'element' name. (The result has the form prefix:name.) See other
versions of this method for a variant that does not require a prefix.
Parameter 'value' is the value of the attribute.
______________________________________________________________________
Method variant with the following signature:
writeAttribute(string name, long& value)
Writes the given attribute and value to this output stream.
Parameter 'name' is the name of the attribute.
Parameter 'value' is the value of the attribute.
______________________________________________________________________
Method variant with the following signature:
writeAttribute(XMLTriple triple, double& value)
Writes the given attribute and value to this output stream.
Parameter 'triple' is the attribute, in the form of an XMLTriple.
Parameter 'value' is the value of the attribute.
______________________________________________________________________
Method variant with the following signature:
writeAttribute(XMLTriple triple, string value)
Writes the given attribute and value to this output stream.
Parameter 'triple' is the attribute, in the form of an XMLTriple.
Parameter 'value' is the value of the attribute.
______________________________________________________________________
Method variant with the following signature:
writeAttribute(XMLTriple triple, string value)
Writes the given attribute and value to this output stream.
Parameter 'triple' is the attribute, in the form of an XMLTriple.
Parameter 'value' is the value of the attribute.
______________________________________________________________________
Method variant with the following signature:
writeAttribute(string name, string value)
Writes the given attribute and value to this output stream.
Parameter 'name' is the name of the attribute.
Parameter 'value' is the value of the attribute.
______________________________________________________________________
Method variant with the following signature:
writeAttribute(XMLTriple triple, long& value)
Writes the given attribute and value to this output stream.
Parameter 'triple' is the attribute, in the form of an XMLTriple.
Parameter 'value' is the value of the attribute.
______________________________________________________________________
Method variant with the following signature:
writeAttribute(XMLTriple triple, bool& value)
Writes the given attribute and value to this output stream.
Parameter 'triple' is the attribute, in the form of an XMLTriple.
Parameter 'value' is the value of the attribute.
______________________________________________________________________
Method variant with the following signature:
writeAttribute(string name, double& value)
Writes the given attribute and value to this output stream.
Parameter 'name' is the name of the attribute.
Parameter 'value' is the value of the attribute.
______________________________________________________________________
Method variant with the following signature:
writeAttribute(string name, string prefix, string value)
Writes the given namespace-prefixed attribute value to this output
stream.
Parameter 'name' is the name of the attribute.
Parameter 'prefix' is an XML namespace prefix to write in front of the
'element' name. (The result has the form prefix:name.) See other
versions of this method for a variant that does not require a prefix.
Parameter 'value' is the value of the attribute.
______________________________________________________________________
Method variant with the following signature:
writeAttribute(string name, bool& value)
Writes the given attribute and value to this output stream.
Parameter 'name' is the name of the attribute.
Parameter 'value' is the value of the attribute.
______________________________________________________________________
Method variant with the following signature:
writeAttribute(string name, string prefix, long& value)
Writes the given namespace-prefixed attribute value to this output
stream.
Parameter 'name' is the name of the attribute.
Parameter 'prefix' is an XML namespace prefix to write in front of the
'element' name. (The result has the form prefix:name.) See other
versions of this method for a variant that does not require a prefix.
Parameter 'value' is the value of the attribute.
______________________________________________________________________
Method variant with the following signature:
writeAttribute(string name, string prefix, string value)
Writes the given namespace-prefixed attribute value to this output
stream.
Parameter 'name' is the name of the attribute.
Parameter 'prefix' is an XML namespace prefix to write in front of the
'element' name. (The result has the form prefix:name.) See other
versions of this method for a variant that does not require a prefix.
Parameter 'value' is the value of the attribute.
______________________________________________________________________
Method variant with the following signature:
writeAttribute(string name, string &prefix, bool& value)
Writes the given namespace-prefixed attribute value to this output
stream.
Parameter 'name' is the name of the attribute.
Parameter 'prefix' is an XML namespace prefix to write in front of the
'element' name. (The result has the form prefix:name.) See other
versions of this method for a variant that does not require a prefix.
Parameter 'value' is the value of the attribute.
______________________________________________________________________
Method variant with the following signature:
writeAttribute(string name, string prefix, int& value)
Writes the given namespace-prefixed attribute value to this output
stream.
Parameter 'name' is the name of the attribute.
Parameter 'prefix' is an XML namespace prefix to write in front of the
'element' name. (The result has the form prefix:name.) See other
versions of this method for a variant that does not require a prefix.
Parameter 'value' is the value of the attribute.
______________________________________________________________________
Method variant with the following signature:
writeAttribute(string name, long& value)
Writes the given attribute and value to this output stream.
Parameter 'name' is the name of the attribute.
Parameter 'value' is the value of the attribute.
______________________________________________________________________
Method variant with the following signature:
writeAttribute(string name, string prefix, double& value)
Writes the given namespace-prefixed attribute value to this output
stream.
Parameter 'name' is the name of the attribute.
Parameter 'prefix' is an XML namespace prefix to write in front of the
'element' name. (The result has the form prefix:name.) See other
versions of this method for a variant that does not require a prefix.
Parameter 'value' is the value of the attribute.
______________________________________________________________________
Method variant with the following signature:
writeAttribute(string name, string value)
Writes the given attribute and value to this output stream.
Parameter 'name' is the name of the attribute.
Parameter 'value' is the value of the attribute.
______________________________________________________________________
Method variant with the following signature:
writeAttribute(XMLTriple triple, int& value)
Writes the given attribute and value to this output stream.
Parameter 'triple' is the attribute, in the form of an XMLTriple.
Parameter 'value' is the value of the attribute.
______________________________________________________________________
Method variant with the following signature:
writeAttribute(XMLTriple triple, long& value)
Writes the given attribute and value to this output stream.
Parameter 'triple' is the attribute, in the form of an XMLTriple.
Parameter 'value' is the value of the attribute.
"""
if type(args[1]) == type(True): return _libsbml.XMLOutputStream_writeAttributeBool(self, *args)
return _libsbml.XMLOutputStream_writeAttribute(self, *args)
def writeXMLDecl(self):
"""
writeXMLDecl(XMLOutputStream self)
Writes a standard XML declaration to this output stream.
The XML declaration has the form
Note that the SBML specifications require the use of UTF-8 encoding
and version 1.0, so for SBML documents, the above is the standard XML
declaration.
"""
return _libsbml.XMLOutputStream_writeXMLDecl(self)
def writeComment(self, programName, programVersion):
"""
writeComment(XMLOutputStream self, string programName, string programVersion)
Writes an XML comment with the name and version of this program.
The XML comment has the following form:
See the class constructor for more information about this program
comment.
Parameter 'programName' is an optional program name to write as a
comment in the output stream.
Parameter 'programVersion' is an optional version identification
string to write as a comment in the output stream.
"""
return _libsbml.XMLOutputStream_writeComment(self, programName, programVersion)
def downIndent(self):
"""
downIndent(XMLOutputStream self)
Decreases the indentation level for this XMLOutputStream.
LibSBML tries to produce human-readable XML output by automatically
indenting the bodies of elements. Callers can manually control
indentation further by using the XMLOutputStream.upIndent() and
XMLOutputStream.downIndent() methods to increase and decrease,
respectively, the current level of indentation in the XML output.
See also upIndent().
"""
return _libsbml.XMLOutputStream_downIndent(self)
def upIndent(self):
"""
upIndent(XMLOutputStream self)
Increases the indentation level for this XMLOutputStream.
LibSBML tries to produce human-readable XML output by automatically
indenting the bodies of elements. Callers can manually control
indentation further by using the XMLOutputStream.upIndent() and
XMLOutputStream.downIndent() methods to increase and decrease,
respectively, the current level of indentation in the XML output.
See also downIndent().
"""
return _libsbml.XMLOutputStream_upIndent(self)
def getSBMLNamespaces(self):
"""
getSBMLNamespaces(XMLOutputStream self) -> SBMLNamespaces
Returns the SBMLNamespaces object attached to this output stream.
Returns the SBMLNamespaces object, or None if none has been set.
"""
return _libsbml.XMLOutputStream_getSBMLNamespaces(self)
def setSBMLNamespaces(self, sbmlns):
"""
setSBMLNamespaces(XMLOutputStream self, SBMLNamespaces sbmlns)
Sets the SBMLNamespaces object associated with this output stream.
Parameter 'sbmlns' is the namespace object.
"""
return _libsbml.XMLOutputStream_setSBMLNamespaces(self, sbmlns)
def writeAttributeBool(self, *args):
"""
writeAttributeBool(XMLOutputStream self, string name, bool const & value)
writeAttributeBool(XMLOutputStream self, XMLTriple name, bool const & value)
@internal
"""
return _libsbml.XMLOutputStream_writeAttributeBool(self, *args)
def __eq__(self, rhs):
if ((self is None) and (rhs is None)): return True
if ((self is None) or (rhs is None)): return False
if (hasattr(self, 'this') and hasattr(rhs, 'this')):
if (self.this == rhs.this): return True
return False
def __ne__(self, rhs):
if ((self is None) and (rhs is None)): return False
if ((self is None) or (rhs is None)): return True
if (hasattr(self, 'this') and hasattr(rhs, 'this')):
if (self.this == rhs.this): return False
return True
XMLOutputStream_swigregister = _libsbml.XMLOutputStream_swigregister
XMLOutputStream_swigregister(XMLOutputStream)
class XMLOwningOutputStringStream(_object):
"""Proxy of C++ XMLOwningOutputStringStream class"""
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, XMLOwningOutputStringStream, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, XMLOwningOutputStringStream, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(XMLOwningOutputStringStream self, string encoding, bool writeXMLDecl=True, string programName, string programVersion) -> XMLOwningOutputStringStream
__init__(XMLOwningOutputStringStream self, string encoding, bool writeXMLDecl=True, string programName) -> XMLOwningOutputStringStream
__init__(XMLOwningOutputStringStream self, string encoding, bool writeXMLDecl=True) -> XMLOwningOutputStringStream
__init__(XMLOwningOutputStringStream self, string encoding) -> XMLOwningOutputStringStream
__init__(XMLOwningOutputStringStream self) -> XMLOwningOutputStringStream
Internal implementation method.
"""
this = _libsbml.new_XMLOwningOutputStringStream(*args)
try:
self.this.append(this)
except:
self.this = this
__swig_destroy__ = _libsbml.delete_XMLOwningOutputStringStream
__del__ = lambda self: None
XMLOwningOutputStringStream_swigregister = _libsbml.XMLOwningOutputStringStream_swigregister
XMLOwningOutputStringStream_swigregister(XMLOwningOutputStringStream)
class XMLOwningOutputFileStream(_object):
"""Proxy of C++ XMLOwningOutputFileStream class"""
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, XMLOwningOutputFileStream, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, XMLOwningOutputFileStream, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(XMLOwningOutputFileStream self, string filename, string encoding, bool writeXMLDecl=True, string programName, string programVersion) -> XMLOwningOutputFileStream
__init__(XMLOwningOutputFileStream self, string filename, string encoding, bool writeXMLDecl=True, string programName) -> XMLOwningOutputFileStream
__init__(XMLOwningOutputFileStream self, string filename, string encoding, bool writeXMLDecl=True) -> XMLOwningOutputFileStream
__init__(XMLOwningOutputFileStream self, string filename, string encoding) -> XMLOwningOutputFileStream
__init__(XMLOwningOutputFileStream self, string filename) -> XMLOwningOutputFileStream
Internal implementation method.
"""
this = _libsbml.new_XMLOwningOutputFileStream(*args)
try:
self.this.append(this)
except:
self.this = this
__swig_destroy__ = _libsbml.delete_XMLOwningOutputFileStream
__del__ = lambda self: None
XMLOwningOutputFileStream_swigregister = _libsbml.XMLOwningOutputFileStream_swigregister
XMLOwningOutputFileStream_swigregister(XMLOwningOutputFileStream)
class XMLInputStream(_object):
"""
An interface to an XML input stream.
SBML content is serialized using XML; the resulting data can be
stored and read to/from a file or data stream. Low-level XML parsers
such as Xerces provide facilities to read XML data. To permit the use
of different XML parsers (Xerces, Expat or libxml2), libSBML
implements an abstraction layer. XMLInputStream and XMLOutputStream
are two parts of that abstraction layer.
XMLInputStream is an interface to a file or text string containing
XML. It wraps the content to be read, as well as the low-level XML
parser to be used and an XMLErrorLog to record errors and other issues
(if any arise). Internally, the content will be in the form of either
a pointer to a file name or a character string; XMLInputStream knows
the form of the content and acts appropriately. Other libSBML object
classes use XMLInputStream as their interface for all read operations
on the XML data. XMLInputStream provides the functionality to extract
data in the form of XMLToken objects. It logs any errors encountered
while reading. It also keeps track of whether a read operation has
failed irrecoverably or determines whether it is safe to continue
reading.
SBMLNamespaces objects can be associated with an XMLInputStream; this
facilitates logging errors related to reading XML attributes and
elements that may only be relevant to particular Level and Version
combinations of SBML.
Note:
The convenience of the XMLInputStream and XMLOutputStream abstraction
may be useful for developers interested in creating parsers for other
XML formats besides SBML. It can provide developers with a layer
above more basic XML parsers, as well as some useful programmatic
elements such as XMLToken, XMLError, etc.
See also XMLOutputStream.
"""
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, XMLInputStream, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, XMLInputStream, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(XMLInputStream self, char const * content, bool isFile=True, string library, XMLErrorLog errorLog=None) -> XMLInputStream
__init__(XMLInputStream self, char const * content, bool isFile=True, string library) -> XMLInputStream
__init__(XMLInputStream self, char const * content, bool isFile=True) -> XMLInputStream
__init__(XMLInputStream self, char const * content) -> XMLInputStream
Creates a new XMLInputStream.
@param content the source of the stream.
@param isFile a boolean flag to indicate whether @p content is a file
name. If @c true, @p content is assumed to be the file from which the
XML content is to be read. If @c false, @p content is taken to be a
string that @em is the content to be read.
@param library the name of the parser library to use.
@param errorLog the XMLErrorLog object to use.
@htmlinclude warn-default-args-in-docs.html
"""
this = _libsbml.new_XMLInputStream(*args)
try:
self.this.append(this)
except:
self.this = this
__swig_destroy__ = _libsbml.delete_XMLInputStream
__del__ = lambda self: None
def getEncoding(self):
"""
getEncoding(XMLInputStream self) -> string
Returns the encoding of the XML stream.
The encoding is indicated by the xml declaration at the beginning of
an XML document or data stream. The form of this declaration is
Note that the SBML specifications require the use of UTF-8 encoding,
so for SBML documents, the value returned by this method will always
be the string 'UTF-8'.
Returns the encoding of the XML stream.
See also getVersion().
"""
return _libsbml.XMLInputStream_getEncoding(self)
def getVersion(self):
"""
getVersion(XMLInputStream self) -> string
Returns the version of the XML stream.
The version is indicated by the xml declaration at the beginning of an
XML document or data stream. The form of this declaration is
Note that the SBML specifications require the use of version 1.0, so
for SBML documents, the value returned by this method will always be
the string '1.0'.
Returns the version of the XML stream.
See also getEncoding().
"""
return _libsbml.XMLInputStream_getVersion(self)
def getErrorLog(self):
"""
getErrorLog(XMLInputStream self) -> XMLErrorLog
Returns the XMLErrorLog used to log parsing problems.
Returns the XMLErrorLog used to log XML parse errors and other
validation errors (and messages).
"""
return _libsbml.XMLInputStream_getErrorLog(self)
def isEOF(self):
"""
isEOF(XMLInputStream self) -> bool
Returns True if end of file (stream) has been reached.
Returns True if end of file (stream) has been reached, False
otherwise.
"""
return _libsbml.XMLInputStream_isEOF(self)
def isError(self):
"""
isError(XMLInputStream self) -> bool
Returns True if a fatal error occurred while reading from this stream.
Returns True if a fatal error occurred while reading from this stream.
"""
return _libsbml.XMLInputStream_isError(self)
def isGood(self):
"""
isGood(XMLInputStream self) -> bool
Returns True if the stream is in a good state.
The definition of 'good state' is that isEOF() and isError() both
return False.
Returns True if the stream is in a good state, False otherwise.
"""
return _libsbml.XMLInputStream_isGood(self)
def next(self):
"""
next(XMLInputStream self) -> XMLToken
Returns the next token on this XML input stream.
The token is consumed in the process.
Returns the next XMLToken, or an EOF token (i.e., XMLToken.isEOF() ==
true).
See also peek().
"""
return _libsbml.XMLInputStream_next(self)
def peek(self):
"""
peek(XMLInputStream self) -> XMLToken
Returns the next token without consuming it.
A subsequent call to either peek() or next() will return the same
token.
Returns the next XMLToken or EOF (XMLToken.isEOF() == true).
See also next().
"""
return _libsbml.XMLInputStream_peek(self)
def skipPastEnd(self, element):
"""
skipPastEnd(XMLInputStream self, XMLToken element)
Consume zero or more tokens up to and including the corresponding end
element or EOF.
Parameter 'element' is the element whose end will be sought in the
input stream.
"""
return _libsbml.XMLInputStream_skipPastEnd(self, element)
def skipText(self):
"""
skipText(XMLInputStream self)
Consume zero or more tokens up to but not including the next XML
element or EOF.
"""
return _libsbml.XMLInputStream_skipText(self)
def setErrorLog(self, log):
"""
setErrorLog(XMLInputStream self, XMLErrorLog log) -> int
Sets the XMLErrorLog this stream will use to log errors.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
* LIBSBML_OPERATION_FAILED
"""
return _libsbml.XMLInputStream_setErrorLog(self, log)
def toString(self):
"""
toString(XMLInputStream self) -> string
Prints a string representation of the underlying token stream.
Returns a string representing the underlying XML token stream.
Note:
This method is intended for debugging purposes.
"""
return _libsbml.XMLInputStream_toString(self)
def getSBMLNamespaces(self):
"""
getSBMLNamespaces(XMLInputStream self) -> SBMLNamespaces
Returns the SBMLNamespaces object attached to this XMLInputStream.
Returns the SBMLNamespaces object or None if none has been set.
"""
return _libsbml.XMLInputStream_getSBMLNamespaces(self)
def setSBMLNamespaces(self, sbmlns):
"""
setSBMLNamespaces(XMLInputStream self, SBMLNamespaces sbmlns)
Sets the SBML namespaces associated with this XML input stream.
This allows this stream to reference the available SBML namespaces
being read.
Parameter 'sbmlns' is the list of namespaces to use.
"""
return _libsbml.XMLInputStream_setSBMLNamespaces(self, sbmlns)
def determineNumberChildren(self, *args):
"""
determineNumberChildren(XMLInputStream self, string elementName) -> unsigned int
determineNumberChildren(XMLInputStream self) -> unsigned int
Returns the number of child tokens of the given element in this
stream.
This method allows information from the input stream to be determined
without the need to actually read and consume the tokens in the
stream. It returns the number of child elements of the element
represented by the 'elementName', i.e., the number of child elements
encountered before the closing tag for the 'elementName' supplied.
If no 'elementName' is supplied or it is an empty string, then as a
special case, this method assumes the element is a MathML apply
element followed by a function name.
Parameter 'elementName' is a string representing the name of the
element for which the number of children are to be determined.
Returns a long integer giving the number of children of the
'elementName' specified.
Note:
This method assumes the stream has been read up to and including the
element 'elementName'.
"""
return _libsbml.XMLInputStream_determineNumberChildren(self, *args)
def determineNumSpecificChildren(self, childName, container):
"""
determineNumSpecificChildren(XMLInputStream self, string childName, string container) -> unsigned int
Returns the number of child tokens of the specified type within a
given container element.
This method allows information from the input stream to be determined
without the need to actually read and consume the tokens in the
stream. It returns the number of child elements of the 'childName'
element within the element specified by 'container'. In other words,
it counts the number of 'childName' elements encountered before the
closing tag for the 'container' supplied.
Parameter 'childName' is a string representing the name of the child
element whose number is to be determined.
Parameter 'container' is a string representing the name of the element
for which the number of children are to be determined.
Returns a long integer giving the number of children of type
'childName' within the 'container' element.
Note:
This method assumes the stream has been read up to and including the
element 'container'.
"""
return _libsbml.XMLInputStream_determineNumSpecificChildren(self, childName, container)
XMLInputStream_swigregister = _libsbml.XMLInputStream_swigregister
XMLInputStream_swigregister(XMLInputStream)
_libsbml.XMLUnknownError_swigconstant(_libsbml)
XMLUnknownError = _libsbml.XMLUnknownError
_libsbml.XMLOutOfMemory_swigconstant(_libsbml)
XMLOutOfMemory = _libsbml.XMLOutOfMemory
_libsbml.XMLFileUnreadable_swigconstant(_libsbml)
XMLFileUnreadable = _libsbml.XMLFileUnreadable
_libsbml.XMLFileUnwritable_swigconstant(_libsbml)
XMLFileUnwritable = _libsbml.XMLFileUnwritable
_libsbml.XMLFileOperationError_swigconstant(_libsbml)
XMLFileOperationError = _libsbml.XMLFileOperationError
_libsbml.XMLNetworkAccessError_swigconstant(_libsbml)
XMLNetworkAccessError = _libsbml.XMLNetworkAccessError
_libsbml.InternalXMLParserError_swigconstant(_libsbml)
InternalXMLParserError = _libsbml.InternalXMLParserError
_libsbml.UnrecognizedXMLParserCode_swigconstant(_libsbml)
UnrecognizedXMLParserCode = _libsbml.UnrecognizedXMLParserCode
_libsbml.XMLTranscoderError_swigconstant(_libsbml)
XMLTranscoderError = _libsbml.XMLTranscoderError
_libsbml.MissingXMLDecl_swigconstant(_libsbml)
MissingXMLDecl = _libsbml.MissingXMLDecl
_libsbml.MissingXMLEncoding_swigconstant(_libsbml)
MissingXMLEncoding = _libsbml.MissingXMLEncoding
_libsbml.BadXMLDecl_swigconstant(_libsbml)
BadXMLDecl = _libsbml.BadXMLDecl
_libsbml.BadXMLDOCTYPE_swigconstant(_libsbml)
BadXMLDOCTYPE = _libsbml.BadXMLDOCTYPE
_libsbml.InvalidCharInXML_swigconstant(_libsbml)
InvalidCharInXML = _libsbml.InvalidCharInXML
_libsbml.BadlyFormedXML_swigconstant(_libsbml)
BadlyFormedXML = _libsbml.BadlyFormedXML
_libsbml.UnclosedXMLToken_swigconstant(_libsbml)
UnclosedXMLToken = _libsbml.UnclosedXMLToken
_libsbml.InvalidXMLConstruct_swigconstant(_libsbml)
InvalidXMLConstruct = _libsbml.InvalidXMLConstruct
_libsbml.XMLTagMismatch_swigconstant(_libsbml)
XMLTagMismatch = _libsbml.XMLTagMismatch
_libsbml.DuplicateXMLAttribute_swigconstant(_libsbml)
DuplicateXMLAttribute = _libsbml.DuplicateXMLAttribute
_libsbml.UndefinedXMLEntity_swigconstant(_libsbml)
UndefinedXMLEntity = _libsbml.UndefinedXMLEntity
_libsbml.BadProcessingInstruction_swigconstant(_libsbml)
BadProcessingInstruction = _libsbml.BadProcessingInstruction
_libsbml.BadXMLPrefix_swigconstant(_libsbml)
BadXMLPrefix = _libsbml.BadXMLPrefix
_libsbml.BadXMLPrefixValue_swigconstant(_libsbml)
BadXMLPrefixValue = _libsbml.BadXMLPrefixValue
_libsbml.MissingXMLRequiredAttribute_swigconstant(_libsbml)
MissingXMLRequiredAttribute = _libsbml.MissingXMLRequiredAttribute
_libsbml.XMLAttributeTypeMismatch_swigconstant(_libsbml)
XMLAttributeTypeMismatch = _libsbml.XMLAttributeTypeMismatch
_libsbml.XMLBadUTF8Content_swigconstant(_libsbml)
XMLBadUTF8Content = _libsbml.XMLBadUTF8Content
_libsbml.MissingXMLAttributeValue_swigconstant(_libsbml)
MissingXMLAttributeValue = _libsbml.MissingXMLAttributeValue
_libsbml.BadXMLAttributeValue_swigconstant(_libsbml)
BadXMLAttributeValue = _libsbml.BadXMLAttributeValue
_libsbml.BadXMLAttribute_swigconstant(_libsbml)
BadXMLAttribute = _libsbml.BadXMLAttribute
_libsbml.UnrecognizedXMLElement_swigconstant(_libsbml)
UnrecognizedXMLElement = _libsbml.UnrecognizedXMLElement
_libsbml.BadXMLComment_swigconstant(_libsbml)
BadXMLComment = _libsbml.BadXMLComment
_libsbml.BadXMLDeclLocation_swigconstant(_libsbml)
BadXMLDeclLocation = _libsbml.BadXMLDeclLocation
_libsbml.XMLUnexpectedEOF_swigconstant(_libsbml)
XMLUnexpectedEOF = _libsbml.XMLUnexpectedEOF
_libsbml.BadXMLIDValue_swigconstant(_libsbml)
BadXMLIDValue = _libsbml.BadXMLIDValue
_libsbml.BadXMLIDRef_swigconstant(_libsbml)
BadXMLIDRef = _libsbml.BadXMLIDRef
_libsbml.UninterpretableXMLContent_swigconstant(_libsbml)
UninterpretableXMLContent = _libsbml.UninterpretableXMLContent
_libsbml.BadXMLDocumentStructure_swigconstant(_libsbml)
BadXMLDocumentStructure = _libsbml.BadXMLDocumentStructure
_libsbml.InvalidAfterXMLContent_swigconstant(_libsbml)
InvalidAfterXMLContent = _libsbml.InvalidAfterXMLContent
_libsbml.XMLExpectedQuotedString_swigconstant(_libsbml)
XMLExpectedQuotedString = _libsbml.XMLExpectedQuotedString
_libsbml.XMLEmptyValueNotPermitted_swigconstant(_libsbml)
XMLEmptyValueNotPermitted = _libsbml.XMLEmptyValueNotPermitted
_libsbml.XMLBadNumber_swigconstant(_libsbml)
XMLBadNumber = _libsbml.XMLBadNumber
_libsbml.XMLBadColon_swigconstant(_libsbml)
XMLBadColon = _libsbml.XMLBadColon
_libsbml.MissingXMLElements_swigconstant(_libsbml)
MissingXMLElements = _libsbml.MissingXMLElements
_libsbml.XMLContentEmpty_swigconstant(_libsbml)
XMLContentEmpty = _libsbml.XMLContentEmpty
_libsbml.XMLErrorCodesUpperBound_swigconstant(_libsbml)
XMLErrorCodesUpperBound = _libsbml.XMLErrorCodesUpperBound
_libsbml.LIBSBML_CAT_INTERNAL_swigconstant(_libsbml)
LIBSBML_CAT_INTERNAL = _libsbml.LIBSBML_CAT_INTERNAL
_libsbml.LIBSBML_CAT_SYSTEM_swigconstant(_libsbml)
LIBSBML_CAT_SYSTEM = _libsbml.LIBSBML_CAT_SYSTEM
_libsbml.LIBSBML_CAT_XML_swigconstant(_libsbml)
LIBSBML_CAT_XML = _libsbml.LIBSBML_CAT_XML
_libsbml.LIBSBML_SEV_INFO_swigconstant(_libsbml)
LIBSBML_SEV_INFO = _libsbml.LIBSBML_SEV_INFO
_libsbml.LIBSBML_SEV_WARNING_swigconstant(_libsbml)
LIBSBML_SEV_WARNING = _libsbml.LIBSBML_SEV_WARNING
_libsbml.LIBSBML_SEV_ERROR_swigconstant(_libsbml)
LIBSBML_SEV_ERROR = _libsbml.LIBSBML_SEV_ERROR
_libsbml.LIBSBML_SEV_FATAL_swigconstant(_libsbml)
LIBSBML_SEV_FATAL = _libsbml.LIBSBML_SEV_FATAL
_libsbml.LIBSBML_OVERRIDE_DISABLED_swigconstant(_libsbml)
LIBSBML_OVERRIDE_DISABLED = _libsbml.LIBSBML_OVERRIDE_DISABLED
_libsbml.LIBSBML_OVERRIDE_DONT_LOG_swigconstant(_libsbml)
LIBSBML_OVERRIDE_DONT_LOG = _libsbml.LIBSBML_OVERRIDE_DONT_LOG
_libsbml.LIBSBML_OVERRIDE_WARNING_swigconstant(_libsbml)
LIBSBML_OVERRIDE_WARNING = _libsbml.LIBSBML_OVERRIDE_WARNING
class XMLError(_object):
"""
XML-level errors, warnings and other diagnostics.
LibSBML can be configured to use any of a number of XML parsers; at
the time of this writing, libSBML supports Xerces versions 2.4 through
3.1, Expat version 1.95.x and higher, and libxml2 version 2.6.16 and
higher. These parsers each report different status codes for the
various exceptions that can occur during XML processing. The XMLError
object class abstracts away from the particular diagnostics reported
by the different parsers and presents a single uniform interface and
set of status codes, along with operations for manipulating the error
objects.
When the libSBML XML parser layer encounters an error in the XML
content being processed, or when there is something else wrong (such
as an out-of-memory condition), the problems are reported as XMLError
objects. Each XMLError object instance has an identification number
that identifies the nature of the problem. This error identifier is
one of the constants listed in the next section below. Applications
can use the error identifiers as a means of recognizing the error
encountered and changing their behavior if desired.
Integer error codes are useful for software, but not so much for
telling humans what happened. For this reason, XMLError also provides
two text messages describing the nature of the error. These messages
are accessible by means of the methods XMLError.getShortMessage() and
XMLError.getMessage(). The method XMLError.getShortMessage() returns
a very brief synopsis of the warning or error condition, whereas
XMLError.getMessage() returns a longer explanation. These text
strings are suitable for displaying to human users.
Each XMLError object also contains a category code; its value may be
retrieved using the method XMLError.getCategory(). Category values
are drawn from a set of constants whose names begin with the
characters LIBSBML_CAT_, described below. Categories are used by
libSBML to provide more information to calling programs about the
nature of a given error.
In addition to category codes, each XMLError object also has a
severity code; its value may be retrieved using the method
XMLError.getSeverity(). Severity code values are drawn from a set of
constants whose names begin with the characters LIBSBML_SEV_,
described below. Severity levels range from informational
(LIBSBML_SEV_INFO) to fatal errors (LIBSBML_SEV_FATAL).
Finally, XMLError objects record the line and column near where the
problem occurred in the XML content. The values can be retrieved
using the methods XMLError.getLine() and XMLError.getColumn(). We say
'near where the problem occurred', because many factors affect how
accurate the line/column information ultimately is. For example,
sometimes, the underlying XML parsers can only report such information
for the parent XML element where an error occurs, and not for the
specific point where the problem occurs. In other situations, some
parsers report invalid line and/or column numbers altogether. If this
occurs, libSBML sets the line and/or column number in the XMLError
object to either 0 or the value of the maximum unsigned long integer
representable on the platform where libSBML is running. The
probability that a true line or column number in an SBML model would
equal this value is vanishingly small; thus, if an application
encounters these values in an XMLError object, it can assume no valid
line/column number could be provided by libSBML in that situation.
+-----------------------------+---------------------------------------------------------------+----------+----------+
|Enumerator |Meaning |Category |Severity |
+-----------------------------+---------------------------------------------------------------+----------+----------+
|XMLUnknownError |Unrecognized error encountered internally |INTERNAL |FATAL |
|XMLOutOfMemory |Out of memory |SYSTEM |FATAL |
|XMLFileUnreadable |File unreadable |SYSTEM |ERROR |
|XMLFileUnwritable |File unwritable |SYSTEM |ERROR |
|XMLFileOperationError |Error encountered while attempting file operation |SYSTEM |ERROR |
|XMLNetworkAccessError |Network access error |SYSTEM |ERROR |
|InternalXMLParserError |Internal XML parser state error |INTERNAL |FATAL |
|UnrecognizedXMLParserCode |XML parser returned an unrecognized error code |INTERNAL |FATAL |
|XMLTranscoderError |Character transcoder error |INTERNAL |FATAL |
|MissingXMLDecl |Missing XML declaration at beginning of XML input |XML |ERROR |
|MissingXMLEncoding |Missing encoding attribute in XML declaration |XML |ERROR |
|BadXMLDecl |Invalid or unrecognized XML declaration or XML encoding |XML |ERROR |
|BadXMLDOCTYPE |Invalid, malformed or unrecognized XML DOCTYPE declaration |XML |ERROR |
|InvalidCharInXML |Invalid character in XML content |XML |ERROR |
|BadlyFormedXML |XML content is not well-formed |XML |ERROR |
|UnclosedXMLToken |Unclosed XML token |XML |ERROR |
|InvalidXMLConstruct |XML construct is invalid or not permitted |XML |ERROR |
|XMLTagMismatch |Element tag mismatch or missing tag |XML |ERROR |
|DuplicateXMLAttribute |Duplicate XML attribute |XML |ERROR |
|UndefinedXMLEntity |Undefined XML entity |XML |ERROR |
|BadProcessingInstruction |Invalid, malformed or unrecognized XML processing instruction |XML |ERROR |
|BadXMLPrefix |Invalid or undefined XML namespace prefix |XML |ERROR |
|BadXMLPrefixValue |Invalid XML namespace prefix value |XML |ERROR |
|MissingXMLRequiredAttribute |Missing a required XML attribute |XML |ERROR |
|XMLAttributeTypeMismatch |Data type mismatch for the value of an attribute |XML |ERROR |
|XMLBadUTF8Content |Invalid UTF8 content |XML |ERROR |
|MissingXMLAttributeValue |Missing or improperly formed attribute value |XML |ERROR |
|BadXMLAttributeValue |Invalid or unrecognizable attribute value |XML |ERROR |
|BadXMLAttribute |Invalid, unrecognized or malformed attribute |XML |ERROR |
|UnrecognizedXMLElement |Element either not recognized or not permitted |XML |ERROR |
|BadXMLComment |Badly formed XML comment |XML |ERROR |
|BadXMLDeclLocation |XML declaration not permitted in this location |XML |ERROR |
|XMLUnexpectedEOF |Reached end of input unexpectedly |XML |ERROR |
|BadXMLIDValue |Value is invalid for XML ID, or has already been used |XML |ERROR |
|BadXMLIDRef |XML ID value was never declared |XML |ERROR |
|UninterpretableXMLContent |Unable to interpret content |XML |ERROR |
|BadXMLDocumentStructure |Bad XML document structure |XML |ERROR |
|InvalidAfterXMLContent |Encountered invalid content after expected content |XML |ERROR |
|XMLExpectedQuotedString |Expected to find a quoted string |XML |ERROR |
|XMLEmptyValueNotPermitted |An empty value is not permitted in this context |XML |ERROR |
|XMLBadNumber |Invalid or unrecognized number |XML |ERROR |
|XMLBadColon |Colon characters are invalid in this context |XML |ERROR |
|MissingXMLElements |One or more expected elements are missing |XML |ERROR |
|XMLContentEmpty |Main XML content is empty |XML |ERROR |
+-----------------------------+---------------------------------------------------------------+----------+----------+
+----------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|Enumerator |Meaning |
+----------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|LIBSBML_CAT_INTERNAL |A problem involving the libSBML software itself or the underlying XML parser. This almost certainly indicates a software defect (i.e., bug) in libSBML. Please report instances of this to the libSBML developers. |
|LIBSBML_CAT_SYSTEM |A problem reported by the operating system, such as an inability to read or write a file. This indicates something that is not a program error but is outside of the control of libSBML. |
|LIBSBML_CAT_XML |A problem in the XML content itself. This usually arises from malformed XML or the use of constructs not permitted in SBML. |
+----------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
+---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|Enumerator |Meaning |
+---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|LIBSBML_SEV_INFO |The error is actually informational and not necessarily a serious problem. |
|LIBSBML_SEV_WARNING |The error object represents a problem that is not serious enough to necessarily stop the problem, but applications should take note of the problem and evaluate what its implications may be. |
|LIBSBML_SEV_ERROR |The error object represents a serious error. The application may continue running but it is unlikely to be able to continue processing the same XML file or data stream. |
|LIBSBML_SEV_FATAL |A serious error occurred, such as an out-of-memory condition, and the software should terminate immediately. |
+---------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
"""
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, XMLError, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, XMLError, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(XMLError self, int const errorId=0, string details, unsigned int const line=0, unsigned int const column=0, unsigned int const severity=LIBSBML_SEV_FATAL, unsigned int const category=LIBSBML_CAT_INTERNAL) -> XMLError
__init__(XMLError self, int const errorId=0, string details, unsigned int const line=0, unsigned int const column=0, unsigned int const severity=LIBSBML_SEV_FATAL) -> XMLError
__init__(XMLError self, int const errorId=0, string details, unsigned int const line=0, unsigned int const column=0) -> XMLError
__init__(XMLError self, int const errorId=0, string details, unsigned int const line=0) -> XMLError
__init__(XMLError self, int const errorId=0, string details) -> XMLError
__init__(XMLError self, int const errorId=0) -> XMLError
__init__(XMLError self) -> XMLError
__init__(XMLError self, XMLError orig) -> XMLError
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
XMLError( int errorId = 0 , string details = '' ,
long line = 0 , long column = 0 , long severity =
LIBSBML_SEV_FATAL , long category = LIBSBML_CAT_INTERNAL )
Creates a new XMLError to report that something occurred during XML
processing.
XMLError objects have identification numbers to indicate the nature of
the exception. These numbers are defined as longeger constants in the
file 'libsbmlConstants.java'. See the top of this documentation for a
table listing the possible values and their meanings. The argument
'errorId' to this constructor can be (but does not have to be) a value
from this set of constants. If it is one of the predefined error
identifiers, the XMLError class assumes the error is a low-level
system or XML layer error and prepends a built-in, predefined error
message to any string passed in the argument 'details' to this
constructor. In addition, all the predefined error identifiers have
associated values for the 'severity' and 'category' codes, and these
fields are filled-in as well.
If the error identifier 'errorId' is a number greater than 9999, this
constructor assumes that the error was generated from another part of
the software, and does not do additional filling in of values beyond
the defaults in the constructor itself. This allows XMLError to serve
as a base class for other errors (and is used in this way elsewhere in
libSBML). Callers should fill in all the parameters with suitable
values if generating errors with codes greater than 9999 to make
maximum use of the XMLError facilities.
As mentioned above, there are additional constants defined for
standard severity and standard category codes, and every predefined
error in libSBML has an associated value for severity and category
taken from these predefined sets. These constants have symbol names
prefixed with LIBSBML_SEV_ and LIBSBML_CAT_, respectively. If the
value of 'errorId' is one of the standard error codes, callers do not
need to fill in 'severity' and 'category' in a call to this
constructor. Conversely, if 'errorId' is not an existing XML-level
error code, callers can use other values for 'severity' and
'category'.
Parameter 'errorId' is a long integer, the identification number of
the error.
Parameter 'details' is a string containing additional details about
the error. If the error code in 'errorId' is one that is recognized by
XMLError, the given message is appended to a predefined message
associated with the given code. If the error code is not recognized,
the message is stored as-is as the text of the error.
Parameter 'line' is a long integer, the line number at which the error
occured.
Parameter 'column' is a long integer, the column number at which the
error occured.
Parameter 'severity' is an integer indicating severity of the error.
Parameter 'category' is an integer indicating the category to which
the error belongs.
______________________________________________________________________
Method variant with the following signature:
XMLError(XMLError orig)
Copy constructor; creates a copy of this XMLError.
'orig' the XMLError object to copy.
Throws XMLConstructorException: Thrown if the argument 'orig' is None.
"""
this = _libsbml.new_XMLError(*args)
try:
self.this.append(this)
except:
self.this = this
__swig_destroy__ = _libsbml.delete_XMLError
__del__ = lambda self: None
def getErrorId(self):
"""
getErrorId(XMLError self) -> unsigned int
Returns the identifier of this error.
Returns the error code for this error.
See also getMessage(), getShortMessage(), getCategory(),
getSeverity().
"""
return _libsbml.XMLError_getErrorId(self)
def getMessage(self):
"""
getMessage(XMLError self) -> string
Returns the message text of this error.
The message associated with an error object describes the nature of
the problem. The message returned by this method is generally longer
and clearer than the message returned by XMLError.getShortMessage(),
but not in all cases.
Callers may use XMLError.getCategory() and XMLError.getSeverity() to
obtain additional information about the nature and severity of the
problem.
Returns the message text
See also getErrorId(), getShortMessage(), getCategory(),
getSeverity().
"""
return _libsbml.XMLError_getMessage(self)
def getShortMessage(self):
"""
getShortMessage(XMLError self) -> string
Returns a brief message for this error.
This is an alternative error message that, in general, is as short as
the authors could make it. However, brevity is often inversely
proportional to clarity, so this short message may not be sufficiently
informative to understand the nature of the error. Calling
applications may wish to check XMLError.getMessage() in addition or
instead.
Returns the short error message text
See also getErrorId(), getMessage(), getCategory(), getSeverity().
"""
return _libsbml.XMLError_getShortMessage(self)
def getLine(self):
"""
getLine(XMLError self) -> unsigned int
Returns the line number in the XML input near where the error, warning
or other diagnostic occurred.
We say 'near where the problem occurred', because many factors affect
how accurate the line/column information ultimately is. For example,
sometimes, the underlying XML parsers can only report such information
for the parent XML element where an error occurs, and not for the
specific point where the problem occurs. In other situations, some
parsers report invalid line and/or column numbers altogether. If this
occurs, libSBML sets the line and/or column number in the XMLError
object to either 0 or the value of the maximum unsigned long integer
representable on the platform where libSBML is running. The
probability that a true line or column number in an SBML model would
equal this value is vanishingly small; thus, if an application
encounters these values in an XMLError object, it can assume no valid
line/column number could be provided by libSBML in that situation.
Returns the line number
See also getColumn().
"""
return _libsbml.XMLError_getLine(self)
def getColumn(self):
"""
getColumn(XMLError self) -> unsigned int
Returns the column number in the XML input near where the error,
warning or other diagnostic occurred.
We say 'near where the problem occurred', because many factors affect
how accurate the line/column information ultimately is. For example,
sometimes, the underlying XML parsers can only report such information
for the parent XML element where an error occurs, and not for the
specific point where the problem occurs. In other situations, some
parsers report invalid line and/or column numbers altogether. If this
occurs, libSBML sets the line and/or column number in the XMLError
object to either 0 or the value of the maximum unsigned long integer
representable on the platform where libSBML is running. The
probability that a true line or column number in an SBML model would
equal this value is vanishingly small; thus, if an application
encounters these values in an XMLError object, it can assume no valid
line/column number could be provided by libSBML in that situation.
Returns the column number
See also getLine().
"""
return _libsbml.XMLError_getColumn(self)
def getSeverity(self):
"""
getSeverity(XMLError self) -> unsigned int
Returns the severity of this error.
XMLError defines an enumeration of severity codes for the XML layer.
Applications that build on XMLError by subclassing it may add their
own severity codes with numbers higher than those in the predefined
set of severity codes.
Returns the severity of this XMLError.
See also getSeverityAsString(), getCategory().
"""
return _libsbml.XMLError_getSeverity(self)
def getSeverityAsString(self):
"""
getSeverityAsString(XMLError self) -> string
Returns a string describing the severity level of this error.
XMLError defines an enumeration of severity codes for the XML layer.
Applications that build on XMLError by subclassing it may add their
own severity codes with numbers higher than those in the predefined
set of severity codes.
Returns string representing the severity of this XMLError.
See also getSeverity(), getCategoryAsString().
"""
return _libsbml.XMLError_getSeverityAsString(self)
def getCategory(self):
"""
getCategory(XMLError self) -> unsigned int
Returns the category of this error.
XMLError defines an enumeration of category codes for the XML layer.
Applications that build on XMLError by subclassing it may add their
own categories with numbers higher than those in the predefined set of
category codes.
Categories can be used to partition errors into distinct groups. Among
other things, this can be used to prevent id conflicts by uniquely
identifying an XMLError by both id and category.
Returns the category of this XMLError.
See also getSeverity(), getCategoryAsString().
"""
return _libsbml.XMLError_getCategory(self)
def getCategoryAsString(self):
"""
getCategoryAsString(XMLError self) -> string
Returns a string describing the category of this error.
XMLError defines an enumeration of category codes for the XML layer.
Applications that build on XMLError by subclassing it may add their
own categories with numbers higher than those in the predefined set of
category codes.
Categories can be used to partition errors into distinct groups. Among
other things, this can be used to prevent id conflicts by uniquely
identifying an XMLError by both id and category.
Returns string representing the category of this XMLError.
See also getCategory(), getSeverityAsString().
"""
return _libsbml.XMLError_getCategoryAsString(self)
def isInfo(self):
"""
isInfo(XMLError self) -> bool
Predicate returning True or False depending on whether this error
object is for information purposes only.
This is equivalent to obtaining the severity code from an XMLError
object (via XMLError.getSeverity()) and then comparing it to the value
LIBSBML_SEV_INFO from the set of predefined severity codes.
Returns True if this XMLError is for informational purposes only,
False otherwise.
See also isWarning(), isError(), isFatal().
"""
return _libsbml.XMLError_isInfo(self)
def isWarning(self):
"""
isWarning(XMLError self) -> bool
Predicate returning True or False depending on whether this error
object is a warning.
This is equivalent to obtaining the severity code from an XMLError
object (via XMLError.getSeverity()) and then comparing it to the value
LIBSBML_SEV_WARNING from the set of predefined severity codes.
Returns True if this error is a warning, False otherwise.
See also isInfo(), isError(), isFatal().
"""
return _libsbml.XMLError_isWarning(self)
def isError(self):
"""
isError(XMLError self) -> bool
Predicate returning True or False depending on whether this error is a
significant error.
This is equivalent to obtaining the severity code from an XMLError
object (via XMLError.getSeverity()) and then comparing it to the value
LIBSBML_SEV_ERROR from the set of predefined severity codes.
Returns True if this error is an error, False otherwise.
See also isInfo(), isWarning(), isFatal().
"""
return _libsbml.XMLError_isError(self)
def isFatal(self):
"""
isFatal(XMLError self) -> bool
Predicate returning True or False depending on whether this error is a
fatal run-time error.
This is equivalent to obtaining the severity code from an XMLError
object (via XMLError.getSeverity()) and then comparing it to the value
LIBSBML_SEV_FATAL from the set of predefined severity codes.
Returns True if this error is a fatal error, False otherwise.
See also isInfo(), isWarning(), isError().
"""
return _libsbml.XMLError_isFatal(self)
def isInternal(self):
"""
isInternal(XMLError self) -> bool
Predicate returning True or False depending on whether this error
resulted from an internal program error.
This is equivalent to obtaining the category identifier from an
XMLError object (via XMLError.getCategory()) and then comparing it to
the value LIBSBML_CAT_INTERNAL from the set of predefined category
codes.
Returns True or False
See also isSystem(), isXML().
"""
return _libsbml.XMLError_isInternal(self)
def isSystem(self):
"""
isSystem(XMLError self) -> bool
Predicate returning True or False depending on whether this error was
generated by the operating system.
This is equivalent to obtaining the category identifier from an
XMLError object (via XMLError.getCategory()) and then comparing it to
the value LIBSBML_CAT_SYSTEM from the set of predefined category
codes.
Returns True or False
See also isInternal(), isXML().
"""
return _libsbml.XMLError_isSystem(self)
def isXML(self):
"""
isXML(XMLError self) -> bool
Predicate returning True or False depending on whether this error
resulted from a problem in the XML input (e.g., an XML syntax error).
This is equivalent to obtaining the category identifier from an
XMLError object (via XMLError.getCategory()) and then comparing it to
the value LIBSBML_CAT_XML from the set of predefined category codes.
Returns True or False
See also isInternal(), isSystem().
"""
return _libsbml.XMLError_isXML(self)
def isValid(self):
"""
isValid(XMLError self) -> bool
Predicate returning True or False depending on whether this error
resulted from a problem or whether it was logged as an unknown error.
This is equivalent to obtaining the error identifier from an XMLError
object (via XMLError.getErrorId()) and then comparing it to the value
XMLUnknownError or UnknownError from the set of predefined error
codes.
Returns True or False
"""
return _libsbml.XMLError_isValid(self)
def setLine(self, line):
"""
setLine(XMLError self, unsigned int line) -> int
Sets the line number where this error occurred.
Parameter 'line' is a long integer, the line number to set.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
See also setColumn().
"""
return _libsbml.XMLError_setLine(self, line)
def setColumn(self, column):
"""
setColumn(XMLError self, unsigned int column) -> int
Sets the column number where this error occurred.
Parameter 'column' is a long integer, the column number to set.
Returns integer value indicating success/failure of the function.
The possible values returned by this function are:
* LIBSBML_OPERATION_SUCCESS
See also setLine().
"""
return _libsbml.XMLError_setColumn(self, column)
def getStandardMessage(code):
"""
getStandardMessage(int const code) -> string
Returns a copy of the message string associated with the given
predefined XMLError code.
Parameter 'code' is the error code whose message is sought; it must be
a predefined value from the set of predefined error identifiers.
"""
return _libsbml.XMLError_getStandardMessage(code)
if _newclass:
getStandardMessage = staticmethod(getStandardMessage)
__swig_getmethods__["getStandardMessage"] = lambda x: getStandardMessage
def getPackage(self):
"""
getPackage(XMLError self) -> string
Returns the SBML Level 3 package extension (if any) that logged this
error.
Each error logged by an libSBML extension for SBML Level 3 packages
includes a record of the package that logged it. The field is a
simple text string. If the string is empty or has the value 'core',
then the error came from libSBML core; otherwise, the string will be
the short-form name of the package (e.g., 'comp' for the Hierarchical
Model Composition package).
Returns a string representing the name of the package that logged this
error. If the error did not come from a package extension, the value
will be the empty string or 'core'.
"""
return _libsbml.XMLError_getPackage(self)
def getErrorIdOffset(self):
"""
getErrorIdOffset(XMLError self) -> unsigned int
Returns libSBML's internal numerical offset for the error code
associated with this error.
In the SBML Level 3 package specifications, package validation rules
are identified by 5-digit numbers prefixed with the nickname of the
package itself---e.g., "comp-10101", "fbc-20301", etc.
Historically, libSBML reported error codes as pure integers, and some
application software systems make decisions based on the numerical
values of the error codes. To permit these applications to continue
to function in this fashion, libSBML internally continues to maintain
error identifiers as pure integers. To handle the possibility that
errors may come from package extensions, libSBML uses numerical
offsets added to the internal error codes. These offsets add two
leading digits to the regular 5-digit error codes; for example,
"comp" error codes are stored as 1010101, 1020102, etc. The offset
in this case is 1000000. Another package will have the offset
2000000, yet another will have 3000000, etc.
This method returns the integer offset in this error's error code.
Calling applications can get the 5-digit package-specific number for a
given error code by subtracting the offset from the value reported by
getErrorId():
getErrorId() - getErrorIdOffset()
When libSBML produces error messages, it combines the text string
returned by getPackage() with the subtracted value of the error code,
to produce a text string of the form "comp-10101".
See also getErrorId(), getPackage().
"""
return _libsbml.XMLError_getErrorIdOffset(self)
def __eq__(self, rhs):
if ((self is None) and (rhs is None)): return True
if ((self is None) or (rhs is None)): return False
if (hasattr(self, 'this') and hasattr(rhs, 'this')):
if (self.this == rhs.this): return True
return False
def __ne__(self, rhs):
if ((self is None) and (rhs is None)): return False
if ((self is None) or (rhs is None)): return True
if (hasattr(self, 'this') and hasattr(rhs, 'this')):
if (self.this == rhs.this): return False
return True
XMLError_swigregister = _libsbml.XMLError_swigregister
XMLError_swigregister(XMLError)
def XMLError_getStandardMessage(code):
"""
XMLError_getStandardMessage(int const code) -> string
Returns a copy of the message string associated with the given
predefined XMLError code.
Parameter 'code' is the error code whose message is sought; it must be
a predefined value from the set of predefined error identifiers.
"""
return _libsbml.XMLError_getStandardMessage(code)
class XMLErrorLog(_object):
"""
Log of diagnostics reported during XML processing.
The error log is a list. The XML layer of libSBML maintains an error
log associated with a given XML document or data stream. When an
operation results in an error, or when there is something wrong with
the XML content, the problem is reported as an XMLError object stored
in the XMLErrorLog list. Potential problems range from low-level
issues (such as the inability to open a file) to XML syntax errors
(such as mismatched tags or other problems).
A typical approach for using this error log is to first use
getNumErrors() to inquire how many XMLError object instances it
contains, and then to iterate over the list of objects one at a time
using getError(long n) . Indexing in the list begins at 0.
In normal circumstances, programs using libSBML will actually obtain
an SBMLErrorLog rather than an XMLErrorLog. The former is subclassed
from XMLErrorLog and simply wraps commands for working with SBMLError
objects rather than the low-level XMLError objects. Classes such as
SBMLDocument use the higher-level SBMLErrorLog.
"""
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, XMLErrorLog, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, XMLErrorLog, name)
__repr__ = _swig_repr
def getNumErrors(self):
"""
getNumErrors(XMLErrorLog self) -> unsigned int
Returns the number of errors that have been logged.
To retrieve individual errors from the log, callers may use
XMLErrorLog.getError() .
Returns the number of errors that have been logged.
"""
return _libsbml.XMLErrorLog_getNumErrors(self)
def getError(self, n):
"""
getError(XMLErrorLog self, unsigned int n) -> XMLError
Returns the nth XMLError object in this log.
Index 'n' is counted from 0. Callers should first inquire about the
number of items in the log by using the method getNumErrors().
Attempts to use an error index number that exceeds the actual number
of errors in the log will result in a None being returned.
Parameter 'n' is the index number of the error to retrieve (with 0
being the first error).
Returns the nth XMLError in this log, or None if 'n' is greater than
or equal to getNumErrors().
See also getNumErrors().
"""
return _libsbml.XMLErrorLog_getError(self, n)
def clearLog(self):
"""
clearLog(XMLErrorLog self)
Deletes all errors from this log.
"""
return _libsbml.XMLErrorLog_clearLog(self)
def __init__(self, *args):
"""
__init__(XMLErrorLog self) -> XMLErrorLog
__init__(XMLErrorLog self, XMLErrorLog other) -> XMLErrorLog
@internal
"""
this = _libsbml.new_XMLErrorLog(*args)
try:
self.this.append(this)
except:
self.this = this
__swig_destroy__ = _libsbml.delete_XMLErrorLog
__del__ = lambda self: None
def add(self, *args):
"""
add(XMLErrorLog self, XMLError error)
add(XMLErrorLog self, std::vector< XMLError * > const & errors)
"""
return _libsbml.XMLErrorLog_add(self, *args)
def toString(self):
"""
toString(XMLErrorLog self) -> string
Writes all errors contained in this log to a string and returns it.
This method uses printErrors() to format the diagnostic messages.
Please consult that method for information about the organization of
the messages in the string returned by this method.
Returns a string containing all logged errors and warnings.
See also printErrors().
"""
return _libsbml.XMLErrorLog_toString(self)
def printErrors(self, *args):
"""
printErrors(XMLErrorLog self, ostream stream)
printErrors(XMLErrorLog self)
printErrors(XMLErrorLog self, ostream stream, unsigned int severity)
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
printErrors(std::ostream& stream, long severity)
Prints the errors or warnings with given severity stored in this error
log.
This method prints the text to the stream given by the optional
parameter 'stream'. If no stream is given, the method prints the
output to the standard error stream.
The format of the output is:
N error(s):
line NNN: (id) message
If no errors with that severity was found, then no output will be
produced.
Parameter 'stream' is the ostream or ostringstream object indicating
where the output should be printed. Parameter 'severity' is the
severity of the errors sought.
______________________________________________________________________
Method variant with the following signature:
printErrors(std::ostream& stream = std::cerr)
Prints all the errors or warnings stored in this error log.
This method prints the text to the stream given by the optional
parameter 'stream'. If no stream is given, the method prints the
output to the standard error stream.
The format of the output is:
N error(s):
line NNN: (id) message
If no errors have occurred, i.e., getNumErrors() == 0, then no output
will be produced. Parameter 'stream' is the ostream or ostringstream
object indicating where the output should be printed.
"""
return _libsbml.XMLErrorLog_printErrors(self, *args)
def isSeverityOverridden(self):
"""
isSeverityOverridden(XMLErrorLog self) -> bool
Returns a boolean indicating whether or not the severity has been
overridden.
The severity override mechanism in XMLErrorLog is intended to help
applications handle error conditions in ways that may be more
convenient for those applications. It is possible to use the
mechanism to override the severity code of errors logged by libSBML,
and even to disable error logging completely. An override stays in
effect until the override is changed again by the calling application.
Returns True if an error severity override has been set, False
otherwise.
See also getSeverityOverride(), setSeverityOverride(),
unsetSeverityOverride(), changeErrorSeverity().
"""
return _libsbml.XMLErrorLog_isSeverityOverridden(self)
def unsetSeverityOverride(self):
"""
unsetSeverityOverride(XMLErrorLog self)
Usets an existing override.
The severity override mechanism in XMLErrorLog is intended to help
applications handle error conditions in ways that may be more
convenient for those applications. It is possible to use the
mechanism to override the severity code of errors logged by libSBML,
and even to disable error logging completely. An override stays in
effect until the override is changed again by the calling application.
See also getSeverityOverride(), setSeverityOverride(),
isSeverityOverridden(), changeErrorSeverity().
"""
return _libsbml.XMLErrorLog_unsetSeverityOverride(self)
def getSeverityOverride(self):
"""
getSeverityOverride(XMLErrorLog self) -> XMLErrorSeverityOverride_t
Returns the current override.
The severity override mechanism in XMLErrorLog is intended to help
applications handle error conditions in ways that may be more
convenient for those applications. It is possible to use the
mechanism to override the severity code of errors logged by libSBML,
and even to disable error logging completely. An override stays in
effect until the override is changed again by the calling application.
Returns a severity override code. The possible values are drawn from
the set of integer constants whose names begin with the prefix
LIBSBML_OVERRIDE_:
* LIBSBML_OVERRIDE_DISABLED
* LIBSBML_OVERRIDE_DONT_LOG
* LIBSBML_OVERRIDE_WARNING
See also isSeverityOverridden(), setSeverityOverride(),
unsetSeverityOverride(), changeErrorSeverity().
"""
return _libsbml.XMLErrorLog_getSeverityOverride(self)
def setSeverityOverride(self, severity):
"""
setSeverityOverride(XMLErrorLog self, XMLErrorSeverityOverride_t severity)
Set the severity override.
The severity override mechanism in XMLErrorLog is intended to help
applications handle error conditions in ways that may be more
convenient for those applications. It is possible to use the
mechanism to override the severity code of errors logged by libSBML,
and even to disable error logging completely. An override stays in
effect until the override is changed again by the calling application.
Parameter 'severity' is an override code indicating what to do. If
the value is LIBSBML_OVERRIDE_DISABLED (the default setting) all
errors logged will be given the severity specified in their usual
definition. If the value is LIBSBML_OVERRIDE_WARNING, then all
errors will be logged as warnings. If the value is
LIBSBML_OVERRIDE_DONT_LOG, no error will be logged, regardless of
their severity.
See also isSeverityOverridden(), getSeverityOverride(),
unsetSeverityOverride(), changeErrorSeverity().
"""
return _libsbml.XMLErrorLog_setSeverityOverride(self, severity)
def changeErrorSeverity(self, *args):
"""
changeErrorSeverity(XMLErrorLog self, XMLErrorSeverity_t originalSeverity, XMLErrorSeverity_t targetSeverity, string package)
changeErrorSeverity(XMLErrorLog self, XMLErrorSeverity_t originalSeverity, XMLErrorSeverity_t targetSeverity)
Changes the severity override for errors in the log that have a given
severity.
This method searches through the list of errors in the log, comparing
each one's severity to the value of 'originalSeverity'. For each
error encountered with that severity logged by the named 'package',
the severity of the error is reset to 'targetSeverity'.
The severity override mechanism in XMLErrorLog is intended to help
applications handle error conditions in ways that may be more
convenient for those applications. It is possible to use the
mechanism to override the severity code of errors logged by libSBML,
and even to disable error logging completely. An override stays in
effect until the override is changed again by the calling application.
Parameter 'originalSeverity' is the severity code to match
Parameter 'targetSeverity' is the severity code to use as the new
severity
Parameter 'package' is a string, the name of an SBML Level 3 package
extension to use to narrow the search for errors. A value of 'all'
signifies to match against errors logged from any package; a value of
a package nickname such as 'comp' signifies to limit consideration to
errors from just that package. If no value is provided, 'all' is the
default.
See also isSeverityOverridden(), getSeverityOverride(),
setSeverityOverride(), unsetSeverityOverride().
"""
return _libsbml.XMLErrorLog_changeErrorSeverity(self, *args)
def __eq__(self, rhs):
if ((self is None) and (rhs is None)): return True
if ((self is None) or (rhs is None)): return False
if (hasattr(self, 'this') and hasattr(rhs, 'this')):
if (self.this == rhs.this): return True
return False
def __ne__(self, rhs):
if ((self is None) and (rhs is None)): return False
if ((self is None) or (rhs is None)): return True
if (hasattr(self, 'this') and hasattr(rhs, 'this')):
if (self.this == rhs.this): return False
return True
XMLErrorLog_swigregister = _libsbml.XMLErrorLog_swigregister
XMLErrorLog_swigregister(XMLErrorLog)
class SBMLErrorLog(XMLErrorLog):
"""
Log of diagnostics reported during processing.
The error log is a list. Each SBMLDocument maintains its own
SBMLErrorLog. When a libSBML operation on SBML content results in an
error, or when there is something worth noting about the SBML content,
the issue is reported as an SBMLError object stored in the
SBMLErrorLog list.
SBMLErrorLog is derived from XMLErrorLog, an object class that serves
exactly the same purpose but for the XML parsing layer. XMLErrorLog
provides crucial methods such as getNumErrors() for determining how
many SBMLError or XMLError objects are in the log. SBMLErrorLog
inherits these methods.
The general approach to working with SBMLErrorLog in user programs
involves first obtaining a pointer to a log from a libSBML object such
as SBMLDocument. Callers should then use getNumErrors() to inquire
how many objects there are in the list. (The answer may be 0.) If
there is at least one SBMLError object in the SBMLErrorLog instance,
callers can then iterate over the list using
SBMLErrorLog.getError()@if clike @endif, using methods provided by the
SBMLError class to find out the error code and associated information
such as the error severity, the message, and the line number in the
input.
If you wish to simply print the error strings for a human to read, an
easier and more direct way might be to use SBMLDocument.printErrors().
See also SBMLError, XMLErrorLog, XMLError.
"""
__swig_setmethods__ = {}
for _s in [XMLErrorLog]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, SBMLErrorLog, name, value)
__swig_getmethods__ = {}
for _s in [XMLErrorLog]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, SBMLErrorLog, name)
__repr__ = _swig_repr
def getError(self, n):
"""
getError(SBMLErrorLog self, unsigned int n) -> SBMLError
Returns the nth SBMLError object in this log.
Index 'n' is counted from 0. Callers should first inquire about the
number of items in the log by using the getNumErrors() method.
Attempts to use an error index number that exceeds the actual number
of errors in the log will result in a None being returned.
Parameter 'n' is the index number of the error to retrieve (with 0
being the first error).
Returns the nth SBMLError in this log, or None if 'n' is greater than
or equal to getNumErrors().
See also getNumErrors().
"""
return _libsbml.SBMLErrorLog_getError(self, n)
def getErrorWithSeverity(self, n, severity):
"""
getErrorWithSeverity(SBMLErrorLog self, unsigned int n, unsigned int severity) -> SBMLError
Returns the nth SBMLError object with given severity in this log.
Index 'n' is counted from 0. Callers should first inquire about the
number of items in the log by using the getNumFailsWithSeverity()
method. Attempts to use an error index number that exceeds the actual
number of errors in the log will result in a None being returned.
Parameter 'n' is the index number of the error to retrieve (with 0
being the first error). Parameter 'severity' is the severity of the
error to retrieve
Returns the nth SBMLError in this log, or None if 'n' is greater than
or equal to getNumFailsWithSeverity().
See also getNumFailsWithSeverity().
"""
return _libsbml.SBMLErrorLog_getErrorWithSeverity(self, n, severity)
def getNumFailsWithSeverity(self, *args):
"""
getNumFailsWithSeverity(SBMLErrorLog self, unsigned int severity) -> unsigned int
getNumFailsWithSeverity(SBMLErrorLog self, unsigned int severity) -> unsigned int
Returns the number of errors that have been logged with the given
severity code.
LibSBML associates severity levels with every SBMLError object to
provide an indication of how serious the problem is. Severities range
from informational diagnostics to fatal (irrecoverable) errors. Given
an SBMLError object instance, a caller can interrogate it for its
severity level using methods such as SBMLError.getSeverity(),
SBMLError.isFatal(), and so on. The present method encapsulates
iteration and interrogation of all objects in an SBMLErrorLog, making
it easy to check for the presence of error objects with specific
severity levels.
Parameter 'severity' is a value from the set of LIBSBML_SEV_ constants
defined by the interface class libsbml.
Returns a count of the number of errors with the given severity code.
See also getNumErrors().
"""
return _libsbml.SBMLErrorLog_getNumFailsWithSeverity(self, *args)
def __init__(self, *args):
"""
__init__(SBMLErrorLog self) -> SBMLErrorLog
__init__(SBMLErrorLog self, SBMLErrorLog other) -> SBMLErrorLog
@internal
"""
this = _libsbml.new_SBMLErrorLog(*args)
try:
self.this.append(this)
except:
self.this = this
__swig_destroy__ = _libsbml.delete_SBMLErrorLog
__del__ = lambda self: None
def logError(self, *args):
"""
logError(SBMLErrorLog self, unsigned int const errorId=0, unsigned int const level, unsigned int const version, string details, unsigned int const line=0, unsigned int const column=0, unsigned int const severity=LIBSBML_SEV_ERROR, unsigned int const category=LIBSBML_CAT_SBML)
logError(SBMLErrorLog self, unsigned int const errorId=0, unsigned int const level, unsigned int const version, string details, unsigned int const line=0, unsigned int const column=0, unsigned int const severity=LIBSBML_SEV_ERROR)
logError(SBMLErrorLog self, unsigned int const errorId=0, unsigned int const level, unsigned int const version, string details, unsigned int const line=0, unsigned int const column=0)
logError(SBMLErrorLog self, unsigned int const errorId=0, unsigned int const level, unsigned int const version, string details, unsigned int const line=0)
logError(SBMLErrorLog self, unsigned int const errorId=0, unsigned int const level, unsigned int const version, string details)
logError(SBMLErrorLog self, unsigned int const errorId=0, unsigned int const level, unsigned int const version)
logError(SBMLErrorLog self, unsigned int const errorId=0, unsigned int const level)
logError(SBMLErrorLog self, unsigned int const errorId=0)
logError(SBMLErrorLog self)
Internal implementation method.
"""
return _libsbml.SBMLErrorLog_logError(self, *args)
def logPackageError(self, *args):
"""
logPackageError(SBMLErrorLog self, string package, unsigned int const errorId=0, unsigned int const pkgVersion=1, unsigned int const level, unsigned int const version, string details, unsigned int const line=0, unsigned int const column=0, unsigned int const severity=LIBSBML_SEV_ERROR, unsigned int const category=LIBSBML_CAT_SBML)
logPackageError(SBMLErrorLog self, string package, unsigned int const errorId=0, unsigned int const pkgVersion=1, unsigned int const level, unsigned int const version, string details, unsigned int const line=0, unsigned int const column=0, unsigned int const severity=LIBSBML_SEV_ERROR)
logPackageError(SBMLErrorLog self, string package, unsigned int const errorId=0, unsigned int const pkgVersion=1, unsigned int const level, unsigned int const version, string details, unsigned int const line=0, unsigned int const column=0)
logPackageError(SBMLErrorLog self, string package, unsigned int const errorId=0, unsigned int const pkgVersion=1, unsigned int const level, unsigned int const version, string details, unsigned int const line=0)
logPackageError(SBMLErrorLog self, string package, unsigned int const errorId=0, unsigned int const pkgVersion=1, unsigned int const level, unsigned int const version, string details)
logPackageError(SBMLErrorLog self, string package, unsigned int const errorId=0, unsigned int const pkgVersion=1, unsigned int const level, unsigned int const version)
logPackageError(SBMLErrorLog self, string package, unsigned int const errorId=0, unsigned int const pkgVersion=1, unsigned int const level)
logPackageError(SBMLErrorLog self, string package, unsigned int const errorId=0, unsigned int const pkgVersion=1)
logPackageError(SBMLErrorLog self, string package, unsigned int const errorId=0)
logPackageError(SBMLErrorLog self, string package)
logPackageError(SBMLErrorLog self)
Internal implementation method.
"""
return _libsbml.SBMLErrorLog_logPackageError(self, *args)
def add(self, error):
"""add(SBMLErrorLog self, SBMLError error)"""
return _libsbml.SBMLErrorLog_add(self, error)
def remove(self, errorId):
"""
remove(SBMLErrorLog self, unsigned int const errorId)
Removes an error having errorId from the SBMLError list.
Only the first item will be removed if there are multiple errors with
the given errorId.
Parameter 'errorId' is the error identifier of the error to be
removed.
"""
return _libsbml.SBMLErrorLog_remove(self, errorId)
def contains(self, errorId):
"""
contains(SBMLErrorLog self, unsigned int const errorId) -> bool
Returns true if SBMLErrorLog contains an errorId
Parameter 'errorId' is the error identifier of the error to be found.
"""
return _libsbml.SBMLErrorLog_contains(self, errorId)
SBMLErrorLog_swigregister = _libsbml.SBMLErrorLog_swigregister
SBMLErrorLog_swigregister(SBMLErrorLog)
_libsbml.UnknownError_swigconstant(_libsbml)
UnknownError = _libsbml.UnknownError
_libsbml.NotUTF8_swigconstant(_libsbml)
NotUTF8 = _libsbml.NotUTF8
_libsbml.UnrecognizedElement_swigconstant(_libsbml)
UnrecognizedElement = _libsbml.UnrecognizedElement
_libsbml.NotSchemaConformant_swigconstant(_libsbml)
NotSchemaConformant = _libsbml.NotSchemaConformant
_libsbml.L3NotSchemaConformant_swigconstant(_libsbml)
L3NotSchemaConformant = _libsbml.L3NotSchemaConformant
_libsbml.InvalidMathElement_swigconstant(_libsbml)
InvalidMathElement = _libsbml.InvalidMathElement
_libsbml.DisallowedMathMLSymbol_swigconstant(_libsbml)
DisallowedMathMLSymbol = _libsbml.DisallowedMathMLSymbol
_libsbml.DisallowedMathMLEncodingUse_swigconstant(_libsbml)
DisallowedMathMLEncodingUse = _libsbml.DisallowedMathMLEncodingUse
_libsbml.DisallowedDefinitionURLUse_swigconstant(_libsbml)
DisallowedDefinitionURLUse = _libsbml.DisallowedDefinitionURLUse
_libsbml.BadCsymbolDefinitionURLValue_swigconstant(_libsbml)
BadCsymbolDefinitionURLValue = _libsbml.BadCsymbolDefinitionURLValue
_libsbml.DisallowedMathTypeAttributeUse_swigconstant(_libsbml)
DisallowedMathTypeAttributeUse = _libsbml.DisallowedMathTypeAttributeUse
_libsbml.DisallowedMathTypeAttributeValue_swigconstant(_libsbml)
DisallowedMathTypeAttributeValue = _libsbml.DisallowedMathTypeAttributeValue
_libsbml.LambdaOnlyAllowedInFunctionDef_swigconstant(_libsbml)
LambdaOnlyAllowedInFunctionDef = _libsbml.LambdaOnlyAllowedInFunctionDef
_libsbml.BooleanOpsNeedBooleanArgs_swigconstant(_libsbml)
BooleanOpsNeedBooleanArgs = _libsbml.BooleanOpsNeedBooleanArgs
_libsbml.NumericOpsNeedNumericArgs_swigconstant(_libsbml)
NumericOpsNeedNumericArgs = _libsbml.NumericOpsNeedNumericArgs
_libsbml.ArgsToEqNeedSameType_swigconstant(_libsbml)
ArgsToEqNeedSameType = _libsbml.ArgsToEqNeedSameType
_libsbml.PiecewiseNeedsConsistentTypes_swigconstant(_libsbml)
PiecewiseNeedsConsistentTypes = _libsbml.PiecewiseNeedsConsistentTypes
_libsbml.PieceNeedsBoolean_swigconstant(_libsbml)
PieceNeedsBoolean = _libsbml.PieceNeedsBoolean
_libsbml.ApplyCiMustBeUserFunction_swigconstant(_libsbml)
ApplyCiMustBeUserFunction = _libsbml.ApplyCiMustBeUserFunction
_libsbml.ApplyCiMustBeModelComponent_swigconstant(_libsbml)
ApplyCiMustBeModelComponent = _libsbml.ApplyCiMustBeModelComponent
_libsbml.KineticLawParametersAreLocalOnly_swigconstant(_libsbml)
KineticLawParametersAreLocalOnly = _libsbml.KineticLawParametersAreLocalOnly
_libsbml.MathResultMustBeNumeric_swigconstant(_libsbml)
MathResultMustBeNumeric = _libsbml.MathResultMustBeNumeric
_libsbml.OpsNeedCorrectNumberOfArgs_swigconstant(_libsbml)
OpsNeedCorrectNumberOfArgs = _libsbml.OpsNeedCorrectNumberOfArgs
_libsbml.InvalidNoArgsPassedToFunctionDef_swigconstant(_libsbml)
InvalidNoArgsPassedToFunctionDef = _libsbml.InvalidNoArgsPassedToFunctionDef
_libsbml.DisallowedMathUnitsUse_swigconstant(_libsbml)
DisallowedMathUnitsUse = _libsbml.DisallowedMathUnitsUse
_libsbml.InvalidUnitsValue_swigconstant(_libsbml)
InvalidUnitsValue = _libsbml.InvalidUnitsValue
_libsbml.DuplicateComponentId_swigconstant(_libsbml)
DuplicateComponentId = _libsbml.DuplicateComponentId
_libsbml.DuplicateUnitDefinitionId_swigconstant(_libsbml)
DuplicateUnitDefinitionId = _libsbml.DuplicateUnitDefinitionId
_libsbml.DuplicateLocalParameterId_swigconstant(_libsbml)
DuplicateLocalParameterId = _libsbml.DuplicateLocalParameterId
_libsbml.MultipleAssignmentOrRateRules_swigconstant(_libsbml)
MultipleAssignmentOrRateRules = _libsbml.MultipleAssignmentOrRateRules
_libsbml.MultipleEventAssignmentsForId_swigconstant(_libsbml)
MultipleEventAssignmentsForId = _libsbml.MultipleEventAssignmentsForId
_libsbml.EventAndAssignmentRuleForId_swigconstant(_libsbml)
EventAndAssignmentRuleForId = _libsbml.EventAndAssignmentRuleForId
_libsbml.DuplicateMetaId_swigconstant(_libsbml)
DuplicateMetaId = _libsbml.DuplicateMetaId
_libsbml.InvalidSBOTermSyntax_swigconstant(_libsbml)
InvalidSBOTermSyntax = _libsbml.InvalidSBOTermSyntax
_libsbml.InvalidMetaidSyntax_swigconstant(_libsbml)
InvalidMetaidSyntax = _libsbml.InvalidMetaidSyntax
_libsbml.InvalidIdSyntax_swigconstant(_libsbml)
InvalidIdSyntax = _libsbml.InvalidIdSyntax
_libsbml.InvalidUnitIdSyntax_swigconstant(_libsbml)
InvalidUnitIdSyntax = _libsbml.InvalidUnitIdSyntax
_libsbml.InvalidNameSyntax_swigconstant(_libsbml)
InvalidNameSyntax = _libsbml.InvalidNameSyntax
_libsbml.MissingAnnotationNamespace_swigconstant(_libsbml)
MissingAnnotationNamespace = _libsbml.MissingAnnotationNamespace
_libsbml.DuplicateAnnotationNamespaces_swigconstant(_libsbml)
DuplicateAnnotationNamespaces = _libsbml.DuplicateAnnotationNamespaces
_libsbml.SBMLNamespaceInAnnotation_swigconstant(_libsbml)
SBMLNamespaceInAnnotation = _libsbml.SBMLNamespaceInAnnotation
_libsbml.MultipleAnnotations_swigconstant(_libsbml)
MultipleAnnotations = _libsbml.MultipleAnnotations
_libsbml.InconsistentArgUnits_swigconstant(_libsbml)
InconsistentArgUnits = _libsbml.InconsistentArgUnits
_libsbml.InconsistentKineticLawUnitsL3_swigconstant(_libsbml)
InconsistentKineticLawUnitsL3 = _libsbml.InconsistentKineticLawUnitsL3
_libsbml.AssignRuleCompartmentMismatch_swigconstant(_libsbml)
AssignRuleCompartmentMismatch = _libsbml.AssignRuleCompartmentMismatch
_libsbml.AssignRuleSpeciesMismatch_swigconstant(_libsbml)
AssignRuleSpeciesMismatch = _libsbml.AssignRuleSpeciesMismatch
_libsbml.AssignRuleParameterMismatch_swigconstant(_libsbml)
AssignRuleParameterMismatch = _libsbml.AssignRuleParameterMismatch
_libsbml.AssignRuleStoichiometryMismatch_swigconstant(_libsbml)
AssignRuleStoichiometryMismatch = _libsbml.AssignRuleStoichiometryMismatch
_libsbml.InitAssignCompartmenMismatch_swigconstant(_libsbml)
InitAssignCompartmenMismatch = _libsbml.InitAssignCompartmenMismatch
_libsbml.InitAssignSpeciesMismatch_swigconstant(_libsbml)
InitAssignSpeciesMismatch = _libsbml.InitAssignSpeciesMismatch
_libsbml.InitAssignParameterMismatch_swigconstant(_libsbml)
InitAssignParameterMismatch = _libsbml.InitAssignParameterMismatch
_libsbml.InitAssignStoichiometryMismatch_swigconstant(_libsbml)
InitAssignStoichiometryMismatch = _libsbml.InitAssignStoichiometryMismatch
_libsbml.RateRuleCompartmentMismatch_swigconstant(_libsbml)
RateRuleCompartmentMismatch = _libsbml.RateRuleCompartmentMismatch
_libsbml.RateRuleSpeciesMismatch_swigconstant(_libsbml)
RateRuleSpeciesMismatch = _libsbml.RateRuleSpeciesMismatch
_libsbml.RateRuleParameterMismatch_swigconstant(_libsbml)
RateRuleParameterMismatch = _libsbml.RateRuleParameterMismatch
_libsbml.RateRuleStoichiometryMismatch_swigconstant(_libsbml)
RateRuleStoichiometryMismatch = _libsbml.RateRuleStoichiometryMismatch
_libsbml.KineticLawNotSubstancePerTime_swigconstant(_libsbml)
KineticLawNotSubstancePerTime = _libsbml.KineticLawNotSubstancePerTime
_libsbml.SpeciesInvalidExtentUnits_swigconstant(_libsbml)
SpeciesInvalidExtentUnits = _libsbml.SpeciesInvalidExtentUnits
_libsbml.DelayUnitsNotTime_swigconstant(_libsbml)
DelayUnitsNotTime = _libsbml.DelayUnitsNotTime
_libsbml.EventAssignCompartmentMismatch_swigconstant(_libsbml)
EventAssignCompartmentMismatch = _libsbml.EventAssignCompartmentMismatch
_libsbml.EventAssignSpeciesMismatch_swigconstant(_libsbml)
EventAssignSpeciesMismatch = _libsbml.EventAssignSpeciesMismatch
_libsbml.EventAssignParameterMismatch_swigconstant(_libsbml)
EventAssignParameterMismatch = _libsbml.EventAssignParameterMismatch
_libsbml.EventAssignStoichiometryMismatch_swigconstant(_libsbml)
EventAssignStoichiometryMismatch = _libsbml.EventAssignStoichiometryMismatch
_libsbml.PriorityUnitsNotDimensionless_swigconstant(_libsbml)
PriorityUnitsNotDimensionless = _libsbml.PriorityUnitsNotDimensionless
_libsbml.UpperUnitBound_swigconstant(_libsbml)
UpperUnitBound = _libsbml.UpperUnitBound
_libsbml.OverdeterminedSystem_swigconstant(_libsbml)
OverdeterminedSystem = _libsbml.OverdeterminedSystem
_libsbml.InvalidModelSBOTerm_swigconstant(_libsbml)
InvalidModelSBOTerm = _libsbml.InvalidModelSBOTerm
_libsbml.InvalidFunctionDefSBOTerm_swigconstant(_libsbml)
InvalidFunctionDefSBOTerm = _libsbml.InvalidFunctionDefSBOTerm
_libsbml.InvalidParameterSBOTerm_swigconstant(_libsbml)
InvalidParameterSBOTerm = _libsbml.InvalidParameterSBOTerm
_libsbml.InvalidInitAssignSBOTerm_swigconstant(_libsbml)
InvalidInitAssignSBOTerm = _libsbml.InvalidInitAssignSBOTerm
_libsbml.InvalidRuleSBOTerm_swigconstant(_libsbml)
InvalidRuleSBOTerm = _libsbml.InvalidRuleSBOTerm
_libsbml.InvalidConstraintSBOTerm_swigconstant(_libsbml)
InvalidConstraintSBOTerm = _libsbml.InvalidConstraintSBOTerm
_libsbml.InvalidReactionSBOTerm_swigconstant(_libsbml)
InvalidReactionSBOTerm = _libsbml.InvalidReactionSBOTerm
_libsbml.InvalidSpeciesReferenceSBOTerm_swigconstant(_libsbml)
InvalidSpeciesReferenceSBOTerm = _libsbml.InvalidSpeciesReferenceSBOTerm
_libsbml.InvalidKineticLawSBOTerm_swigconstant(_libsbml)
InvalidKineticLawSBOTerm = _libsbml.InvalidKineticLawSBOTerm
_libsbml.InvalidEventSBOTerm_swigconstant(_libsbml)
InvalidEventSBOTerm = _libsbml.InvalidEventSBOTerm
_libsbml.InvalidEventAssignmentSBOTerm_swigconstant(_libsbml)
InvalidEventAssignmentSBOTerm = _libsbml.InvalidEventAssignmentSBOTerm
_libsbml.InvalidCompartmentSBOTerm_swigconstant(_libsbml)
InvalidCompartmentSBOTerm = _libsbml.InvalidCompartmentSBOTerm
_libsbml.InvalidSpeciesSBOTerm_swigconstant(_libsbml)
InvalidSpeciesSBOTerm = _libsbml.InvalidSpeciesSBOTerm
_libsbml.InvalidCompartmentTypeSBOTerm_swigconstant(_libsbml)
InvalidCompartmentTypeSBOTerm = _libsbml.InvalidCompartmentTypeSBOTerm
_libsbml.InvalidSpeciesTypeSBOTerm_swigconstant(_libsbml)
InvalidSpeciesTypeSBOTerm = _libsbml.InvalidSpeciesTypeSBOTerm
_libsbml.InvalidTriggerSBOTerm_swigconstant(_libsbml)
InvalidTriggerSBOTerm = _libsbml.InvalidTriggerSBOTerm
_libsbml.InvalidDelaySBOTerm_swigconstant(_libsbml)
InvalidDelaySBOTerm = _libsbml.InvalidDelaySBOTerm
_libsbml.NotesNotInXHTMLNamespace_swigconstant(_libsbml)
NotesNotInXHTMLNamespace = _libsbml.NotesNotInXHTMLNamespace
_libsbml.NotesContainsXMLDecl_swigconstant(_libsbml)
NotesContainsXMLDecl = _libsbml.NotesContainsXMLDecl
_libsbml.NotesContainsDOCTYPE_swigconstant(_libsbml)
NotesContainsDOCTYPE = _libsbml.NotesContainsDOCTYPE
_libsbml.InvalidNotesContent_swigconstant(_libsbml)
InvalidNotesContent = _libsbml.InvalidNotesContent
_libsbml.OnlyOneNotesElementAllowed_swigconstant(_libsbml)
OnlyOneNotesElementAllowed = _libsbml.OnlyOneNotesElementAllowed
_libsbml.InvalidNamespaceOnSBML_swigconstant(_libsbml)
InvalidNamespaceOnSBML = _libsbml.InvalidNamespaceOnSBML
_libsbml.MissingOrInconsistentLevel_swigconstant(_libsbml)
MissingOrInconsistentLevel = _libsbml.MissingOrInconsistentLevel
_libsbml.MissingOrInconsistentVersion_swigconstant(_libsbml)
MissingOrInconsistentVersion = _libsbml.MissingOrInconsistentVersion
_libsbml.PackageNSMustMatch_swigconstant(_libsbml)
PackageNSMustMatch = _libsbml.PackageNSMustMatch
_libsbml.LevelPositiveInteger_swigconstant(_libsbml)
LevelPositiveInteger = _libsbml.LevelPositiveInteger
_libsbml.VersionPositiveInteger_swigconstant(_libsbml)
VersionPositiveInteger = _libsbml.VersionPositiveInteger
_libsbml.AllowedAttributesOnSBML_swigconstant(_libsbml)
AllowedAttributesOnSBML = _libsbml.AllowedAttributesOnSBML
_libsbml.L3PackageOnLowerSBML_swigconstant(_libsbml)
L3PackageOnLowerSBML = _libsbml.L3PackageOnLowerSBML
_libsbml.MissingModel_swigconstant(_libsbml)
MissingModel = _libsbml.MissingModel
_libsbml.IncorrectOrderInModel_swigconstant(_libsbml)
IncorrectOrderInModel = _libsbml.IncorrectOrderInModel
_libsbml.EmptyListElement_swigconstant(_libsbml)
EmptyListElement = _libsbml.EmptyListElement
_libsbml.NeedCompartmentIfHaveSpecies_swigconstant(_libsbml)
NeedCompartmentIfHaveSpecies = _libsbml.NeedCompartmentIfHaveSpecies
_libsbml.OneOfEachListOf_swigconstant(_libsbml)
OneOfEachListOf = _libsbml.OneOfEachListOf
_libsbml.OnlyFuncDefsInListOfFuncDefs_swigconstant(_libsbml)
OnlyFuncDefsInListOfFuncDefs = _libsbml.OnlyFuncDefsInListOfFuncDefs
_libsbml.OnlyUnitDefsInListOfUnitDefs_swigconstant(_libsbml)
OnlyUnitDefsInListOfUnitDefs = _libsbml.OnlyUnitDefsInListOfUnitDefs
_libsbml.OnlyCompartmentsInListOfCompartments_swigconstant(_libsbml)
OnlyCompartmentsInListOfCompartments = _libsbml.OnlyCompartmentsInListOfCompartments
_libsbml.OnlySpeciesInListOfSpecies_swigconstant(_libsbml)
OnlySpeciesInListOfSpecies = _libsbml.OnlySpeciesInListOfSpecies
_libsbml.OnlyParametersInListOfParameters_swigconstant(_libsbml)
OnlyParametersInListOfParameters = _libsbml.OnlyParametersInListOfParameters
_libsbml.OnlyInitAssignsInListOfInitAssigns_swigconstant(_libsbml)
OnlyInitAssignsInListOfInitAssigns = _libsbml.OnlyInitAssignsInListOfInitAssigns
_libsbml.OnlyRulesInListOfRules_swigconstant(_libsbml)
OnlyRulesInListOfRules = _libsbml.OnlyRulesInListOfRules
_libsbml.OnlyConstraintsInListOfConstraints_swigconstant(_libsbml)
OnlyConstraintsInListOfConstraints = _libsbml.OnlyConstraintsInListOfConstraints
_libsbml.OnlyReactionsInListOfReactions_swigconstant(_libsbml)
OnlyReactionsInListOfReactions = _libsbml.OnlyReactionsInListOfReactions
_libsbml.OnlyEventsInListOfEvents_swigconstant(_libsbml)
OnlyEventsInListOfEvents = _libsbml.OnlyEventsInListOfEvents
_libsbml.L3ConversionFactorOnModel_swigconstant(_libsbml)
L3ConversionFactorOnModel = _libsbml.L3ConversionFactorOnModel
_libsbml.L3TimeUnitsOnModel_swigconstant(_libsbml)
L3TimeUnitsOnModel = _libsbml.L3TimeUnitsOnModel
_libsbml.L3VolumeUnitsOnModel_swigconstant(_libsbml)
L3VolumeUnitsOnModel = _libsbml.L3VolumeUnitsOnModel
_libsbml.L3AreaUnitsOnModel_swigconstant(_libsbml)
L3AreaUnitsOnModel = _libsbml.L3AreaUnitsOnModel
_libsbml.L3LengthUnitsOnModel_swigconstant(_libsbml)
L3LengthUnitsOnModel = _libsbml.L3LengthUnitsOnModel
_libsbml.L3ExtentUnitsOnModel_swigconstant(_libsbml)
L3ExtentUnitsOnModel = _libsbml.L3ExtentUnitsOnModel
_libsbml.AllowedAttributesOnModel_swigconstant(_libsbml)
AllowedAttributesOnModel = _libsbml.AllowedAttributesOnModel
_libsbml.AllowedAttributesOnListOfFuncs_swigconstant(_libsbml)
AllowedAttributesOnListOfFuncs = _libsbml.AllowedAttributesOnListOfFuncs
_libsbml.AllowedAttributesOnListOfUnitDefs_swigconstant(_libsbml)
AllowedAttributesOnListOfUnitDefs = _libsbml.AllowedAttributesOnListOfUnitDefs
_libsbml.AllowedAttributesOnListOfComps_swigconstant(_libsbml)
AllowedAttributesOnListOfComps = _libsbml.AllowedAttributesOnListOfComps
_libsbml.AllowedAttributesOnListOfSpecies_swigconstant(_libsbml)
AllowedAttributesOnListOfSpecies = _libsbml.AllowedAttributesOnListOfSpecies
_libsbml.AllowedAttributesOnListOfParams_swigconstant(_libsbml)
AllowedAttributesOnListOfParams = _libsbml.AllowedAttributesOnListOfParams
_libsbml.AllowedAttributesOnListOfInitAssign_swigconstant(_libsbml)
AllowedAttributesOnListOfInitAssign = _libsbml.AllowedAttributesOnListOfInitAssign
_libsbml.AllowedAttributesOnListOfRules_swigconstant(_libsbml)
AllowedAttributesOnListOfRules = _libsbml.AllowedAttributesOnListOfRules
_libsbml.AllowedAttributesOnListOfConstraints_swigconstant(_libsbml)
AllowedAttributesOnListOfConstraints = _libsbml.AllowedAttributesOnListOfConstraints
_libsbml.AllowedAttributesOnListOfReactions_swigconstant(_libsbml)
AllowedAttributesOnListOfReactions = _libsbml.AllowedAttributesOnListOfReactions
_libsbml.AllowedAttributesOnListOfEvents_swigconstant(_libsbml)
AllowedAttributesOnListOfEvents = _libsbml.AllowedAttributesOnListOfEvents
_libsbml.FunctionDefMathNotLambda_swigconstant(_libsbml)
FunctionDefMathNotLambda = _libsbml.FunctionDefMathNotLambda
_libsbml.InvalidApplyCiInLambda_swigconstant(_libsbml)
InvalidApplyCiInLambda = _libsbml.InvalidApplyCiInLambda
_libsbml.RecursiveFunctionDefinition_swigconstant(_libsbml)
RecursiveFunctionDefinition = _libsbml.RecursiveFunctionDefinition
_libsbml.InvalidCiInLambda_swigconstant(_libsbml)
InvalidCiInLambda = _libsbml.InvalidCiInLambda
_libsbml.InvalidFunctionDefReturnType_swigconstant(_libsbml)
InvalidFunctionDefReturnType = _libsbml.InvalidFunctionDefReturnType
_libsbml.OneMathElementPerFunc_swigconstant(_libsbml)
OneMathElementPerFunc = _libsbml.OneMathElementPerFunc
_libsbml.AllowedAttributesOnFunc_swigconstant(_libsbml)
AllowedAttributesOnFunc = _libsbml.AllowedAttributesOnFunc
_libsbml.InvalidUnitDefId_swigconstant(_libsbml)
InvalidUnitDefId = _libsbml.InvalidUnitDefId
_libsbml.InvalidSubstanceRedefinition_swigconstant(_libsbml)
InvalidSubstanceRedefinition = _libsbml.InvalidSubstanceRedefinition
_libsbml.InvalidLengthRedefinition_swigconstant(_libsbml)
InvalidLengthRedefinition = _libsbml.InvalidLengthRedefinition
_libsbml.InvalidAreaRedefinition_swigconstant(_libsbml)
InvalidAreaRedefinition = _libsbml.InvalidAreaRedefinition
_libsbml.InvalidTimeRedefinition_swigconstant(_libsbml)
InvalidTimeRedefinition = _libsbml.InvalidTimeRedefinition
_libsbml.InvalidVolumeRedefinition_swigconstant(_libsbml)
InvalidVolumeRedefinition = _libsbml.InvalidVolumeRedefinition
_libsbml.VolumeLitreDefExponentNotOne_swigconstant(_libsbml)
VolumeLitreDefExponentNotOne = _libsbml.VolumeLitreDefExponentNotOne
_libsbml.VolumeMetreDefExponentNot3_swigconstant(_libsbml)
VolumeMetreDefExponentNot3 = _libsbml.VolumeMetreDefExponentNot3
_libsbml.EmptyListOfUnits_swigconstant(_libsbml)
EmptyListOfUnits = _libsbml.EmptyListOfUnits
_libsbml.InvalidUnitKind_swigconstant(_libsbml)
InvalidUnitKind = _libsbml.InvalidUnitKind
_libsbml.OffsetNoLongerValid_swigconstant(_libsbml)
OffsetNoLongerValid = _libsbml.OffsetNoLongerValid
_libsbml.CelsiusNoLongerValid_swigconstant(_libsbml)
CelsiusNoLongerValid = _libsbml.CelsiusNoLongerValid
_libsbml.EmptyUnitListElement_swigconstant(_libsbml)
EmptyUnitListElement = _libsbml.EmptyUnitListElement
_libsbml.OneListOfUnitsPerUnitDef_swigconstant(_libsbml)
OneListOfUnitsPerUnitDef = _libsbml.OneListOfUnitsPerUnitDef
_libsbml.OnlyUnitsInListOfUnits_swigconstant(_libsbml)
OnlyUnitsInListOfUnits = _libsbml.OnlyUnitsInListOfUnits
_libsbml.AllowedAttributesOnUnitDefinition_swigconstant(_libsbml)
AllowedAttributesOnUnitDefinition = _libsbml.AllowedAttributesOnUnitDefinition
_libsbml.AllowedAttributesOnListOfUnits_swigconstant(_libsbml)
AllowedAttributesOnListOfUnits = _libsbml.AllowedAttributesOnListOfUnits
_libsbml.AllowedAttributesOnUnit_swigconstant(_libsbml)
AllowedAttributesOnUnit = _libsbml.AllowedAttributesOnUnit
_libsbml.ZeroDimensionalCompartmentSize_swigconstant(_libsbml)
ZeroDimensionalCompartmentSize = _libsbml.ZeroDimensionalCompartmentSize
_libsbml.ZeroDimensionalCompartmentUnits_swigconstant(_libsbml)
ZeroDimensionalCompartmentUnits = _libsbml.ZeroDimensionalCompartmentUnits
_libsbml.ZeroDimensionalCompartmentConst_swigconstant(_libsbml)
ZeroDimensionalCompartmentConst = _libsbml.ZeroDimensionalCompartmentConst
_libsbml.UndefinedOutsideCompartment_swigconstant(_libsbml)
UndefinedOutsideCompartment = _libsbml.UndefinedOutsideCompartment
_libsbml.RecursiveCompartmentContainment_swigconstant(_libsbml)
RecursiveCompartmentContainment = _libsbml.RecursiveCompartmentContainment
_libsbml.ZeroDCompartmentContainment_swigconstant(_libsbml)
ZeroDCompartmentContainment = _libsbml.ZeroDCompartmentContainment
_libsbml.Invalid1DCompartmentUnits_swigconstant(_libsbml)
Invalid1DCompartmentUnits = _libsbml.Invalid1DCompartmentUnits
_libsbml.Invalid2DCompartmentUnits_swigconstant(_libsbml)
Invalid2DCompartmentUnits = _libsbml.Invalid2DCompartmentUnits
_libsbml.Invalid3DCompartmentUnits_swigconstant(_libsbml)
Invalid3DCompartmentUnits = _libsbml.Invalid3DCompartmentUnits
_libsbml.InvalidCompartmentTypeRef_swigconstant(_libsbml)
InvalidCompartmentTypeRef = _libsbml.InvalidCompartmentTypeRef
_libsbml.OneDimensionalCompartmentUnits_swigconstant(_libsbml)
OneDimensionalCompartmentUnits = _libsbml.OneDimensionalCompartmentUnits
_libsbml.TwoDimensionalCompartmentUnits_swigconstant(_libsbml)
TwoDimensionalCompartmentUnits = _libsbml.TwoDimensionalCompartmentUnits
_libsbml.ThreeDimensionalCompartmentUnits_swigconstant(_libsbml)
ThreeDimensionalCompartmentUnits = _libsbml.ThreeDimensionalCompartmentUnits
_libsbml.AllowedAttributesOnCompartment_swigconstant(_libsbml)
AllowedAttributesOnCompartment = _libsbml.AllowedAttributesOnCompartment
_libsbml.NoUnitsOnCompartment_swigconstant(_libsbml)
NoUnitsOnCompartment = _libsbml.NoUnitsOnCompartment
_libsbml.InvalidSpeciesCompartmentRef_swigconstant(_libsbml)
InvalidSpeciesCompartmentRef = _libsbml.InvalidSpeciesCompartmentRef
_libsbml.HasOnlySubsNoSpatialUnits_swigconstant(_libsbml)
HasOnlySubsNoSpatialUnits = _libsbml.HasOnlySubsNoSpatialUnits
_libsbml.NoSpatialUnitsInZeroD_swigconstant(_libsbml)
NoSpatialUnitsInZeroD = _libsbml.NoSpatialUnitsInZeroD
_libsbml.NoConcentrationInZeroD_swigconstant(_libsbml)
NoConcentrationInZeroD = _libsbml.NoConcentrationInZeroD
_libsbml.SpatialUnitsInOneD_swigconstant(_libsbml)
SpatialUnitsInOneD = _libsbml.SpatialUnitsInOneD
_libsbml.SpatialUnitsInTwoD_swigconstant(_libsbml)
SpatialUnitsInTwoD = _libsbml.SpatialUnitsInTwoD
_libsbml.SpatialUnitsInThreeD_swigconstant(_libsbml)
SpatialUnitsInThreeD = _libsbml.SpatialUnitsInThreeD
_libsbml.InvalidSpeciesSusbstanceUnits_swigconstant(_libsbml)
InvalidSpeciesSusbstanceUnits = _libsbml.InvalidSpeciesSusbstanceUnits
_libsbml.BothAmountAndConcentrationSet_swigconstant(_libsbml)
BothAmountAndConcentrationSet = _libsbml.BothAmountAndConcentrationSet
_libsbml.NonBoundarySpeciesAssignedAndUsed_swigconstant(_libsbml)
NonBoundarySpeciesAssignedAndUsed = _libsbml.NonBoundarySpeciesAssignedAndUsed
_libsbml.NonConstantSpeciesUsed_swigconstant(_libsbml)
NonConstantSpeciesUsed = _libsbml.NonConstantSpeciesUsed
_libsbml.InvalidSpeciesTypeRef_swigconstant(_libsbml)
InvalidSpeciesTypeRef = _libsbml.InvalidSpeciesTypeRef
_libsbml.MultSpeciesSameTypeInCompartment_swigconstant(_libsbml)
MultSpeciesSameTypeInCompartment = _libsbml.MultSpeciesSameTypeInCompartment
_libsbml.MissingSpeciesCompartment_swigconstant(_libsbml)
MissingSpeciesCompartment = _libsbml.MissingSpeciesCompartment
_libsbml.SpatialSizeUnitsRemoved_swigconstant(_libsbml)
SpatialSizeUnitsRemoved = _libsbml.SpatialSizeUnitsRemoved
_libsbml.SubstanceUnitsOnSpecies_swigconstant(_libsbml)
SubstanceUnitsOnSpecies = _libsbml.SubstanceUnitsOnSpecies
_libsbml.ConversionFactorOnSpecies_swigconstant(_libsbml)
ConversionFactorOnSpecies = _libsbml.ConversionFactorOnSpecies
_libsbml.AllowedAttributesOnSpecies_swigconstant(_libsbml)
AllowedAttributesOnSpecies = _libsbml.AllowedAttributesOnSpecies
_libsbml.InvalidParameterUnits_swigconstant(_libsbml)
InvalidParameterUnits = _libsbml.InvalidParameterUnits
_libsbml.ParameterUnits_swigconstant(_libsbml)
ParameterUnits = _libsbml.ParameterUnits
_libsbml.ConversionFactorMustConstant_swigconstant(_libsbml)
ConversionFactorMustConstant = _libsbml.ConversionFactorMustConstant
_libsbml.AllowedAttributesOnParameter_swigconstant(_libsbml)
AllowedAttributesOnParameter = _libsbml.AllowedAttributesOnParameter
_libsbml.InvalidInitAssignSymbol_swigconstant(_libsbml)
InvalidInitAssignSymbol = _libsbml.InvalidInitAssignSymbol
_libsbml.MultipleInitAssignments_swigconstant(_libsbml)
MultipleInitAssignments = _libsbml.MultipleInitAssignments
_libsbml.InitAssignmentAndRuleForSameId_swigconstant(_libsbml)
InitAssignmentAndRuleForSameId = _libsbml.InitAssignmentAndRuleForSameId
_libsbml.OneMathElementPerInitialAssign_swigconstant(_libsbml)
OneMathElementPerInitialAssign = _libsbml.OneMathElementPerInitialAssign
_libsbml.AllowedAttributesOnInitialAssign_swigconstant(_libsbml)
AllowedAttributesOnInitialAssign = _libsbml.AllowedAttributesOnInitialAssign
_libsbml.InvalidAssignRuleVariable_swigconstant(_libsbml)
InvalidAssignRuleVariable = _libsbml.InvalidAssignRuleVariable
_libsbml.InvalidRateRuleVariable_swigconstant(_libsbml)
InvalidRateRuleVariable = _libsbml.InvalidRateRuleVariable
_libsbml.AssignmentToConstantEntity_swigconstant(_libsbml)
AssignmentToConstantEntity = _libsbml.AssignmentToConstantEntity
_libsbml.RateRuleForConstantEntity_swigconstant(_libsbml)
RateRuleForConstantEntity = _libsbml.RateRuleForConstantEntity
_libsbml.RepeatedRule10304_swigconstant(_libsbml)
RepeatedRule10304 = _libsbml.RepeatedRule10304
_libsbml.CircularRuleDependency_swigconstant(_libsbml)
CircularRuleDependency = _libsbml.CircularRuleDependency
_libsbml.OneMathElementPerRule_swigconstant(_libsbml)
OneMathElementPerRule = _libsbml.OneMathElementPerRule
_libsbml.AllowedAttributesOnAssignRule_swigconstant(_libsbml)
AllowedAttributesOnAssignRule = _libsbml.AllowedAttributesOnAssignRule
_libsbml.AllowedAttributesOnRateRule_swigconstant(_libsbml)
AllowedAttributesOnRateRule = _libsbml.AllowedAttributesOnRateRule
_libsbml.AllowedAttributesOnAlgRule_swigconstant(_libsbml)
AllowedAttributesOnAlgRule = _libsbml.AllowedAttributesOnAlgRule
_libsbml.ConstraintMathNotBoolean_swigconstant(_libsbml)
ConstraintMathNotBoolean = _libsbml.ConstraintMathNotBoolean
_libsbml.IncorrectOrderInConstraint_swigconstant(_libsbml)
IncorrectOrderInConstraint = _libsbml.IncorrectOrderInConstraint
_libsbml.ConstraintNotInXHTMLNamespace_swigconstant(_libsbml)
ConstraintNotInXHTMLNamespace = _libsbml.ConstraintNotInXHTMLNamespace
_libsbml.ConstraintContainsXMLDecl_swigconstant(_libsbml)
ConstraintContainsXMLDecl = _libsbml.ConstraintContainsXMLDecl
_libsbml.ConstraintContainsDOCTYPE_swigconstant(_libsbml)
ConstraintContainsDOCTYPE = _libsbml.ConstraintContainsDOCTYPE
_libsbml.InvalidConstraintContent_swigconstant(_libsbml)
InvalidConstraintContent = _libsbml.InvalidConstraintContent
_libsbml.OneMathElementPerConstraint_swigconstant(_libsbml)
OneMathElementPerConstraint = _libsbml.OneMathElementPerConstraint
_libsbml.OneMessageElementPerConstraint_swigconstant(_libsbml)
OneMessageElementPerConstraint = _libsbml.OneMessageElementPerConstraint
_libsbml.AllowedAttributesOnConstraint_swigconstant(_libsbml)
AllowedAttributesOnConstraint = _libsbml.AllowedAttributesOnConstraint
_libsbml.NoReactantsOrProducts_swigconstant(_libsbml)
NoReactantsOrProducts = _libsbml.NoReactantsOrProducts
_libsbml.IncorrectOrderInReaction_swigconstant(_libsbml)
IncorrectOrderInReaction = _libsbml.IncorrectOrderInReaction
_libsbml.EmptyListInReaction_swigconstant(_libsbml)
EmptyListInReaction = _libsbml.EmptyListInReaction
_libsbml.InvalidReactantsProductsList_swigconstant(_libsbml)
InvalidReactantsProductsList = _libsbml.InvalidReactantsProductsList
_libsbml.InvalidModifiersList_swigconstant(_libsbml)
InvalidModifiersList = _libsbml.InvalidModifiersList
_libsbml.OneSubElementPerReaction_swigconstant(_libsbml)
OneSubElementPerReaction = _libsbml.OneSubElementPerReaction
_libsbml.CompartmentOnReaction_swigconstant(_libsbml)
CompartmentOnReaction = _libsbml.CompartmentOnReaction
_libsbml.AllowedAttributesOnReaction_swigconstant(_libsbml)
AllowedAttributesOnReaction = _libsbml.AllowedAttributesOnReaction
_libsbml.InvalidSpeciesReference_swigconstant(_libsbml)
InvalidSpeciesReference = _libsbml.InvalidSpeciesReference
_libsbml.RepeatedRule20611_swigconstant(_libsbml)
RepeatedRule20611 = _libsbml.RepeatedRule20611
_libsbml.BothStoichiometryAndMath_swigconstant(_libsbml)
BothStoichiometryAndMath = _libsbml.BothStoichiometryAndMath
_libsbml.AllowedAttributesOnSpeciesReference_swigconstant(_libsbml)
AllowedAttributesOnSpeciesReference = _libsbml.AllowedAttributesOnSpeciesReference
_libsbml.AllowedAttributesOnModifier_swigconstant(_libsbml)
AllowedAttributesOnModifier = _libsbml.AllowedAttributesOnModifier
_libsbml.UndeclaredSpeciesRef_swigconstant(_libsbml)
UndeclaredSpeciesRef = _libsbml.UndeclaredSpeciesRef
_libsbml.IncorrectOrderInKineticLaw_swigconstant(_libsbml)
IncorrectOrderInKineticLaw = _libsbml.IncorrectOrderInKineticLaw
_libsbml.EmptyListInKineticLaw_swigconstant(_libsbml)
EmptyListInKineticLaw = _libsbml.EmptyListInKineticLaw
_libsbml.NonConstantLocalParameter_swigconstant(_libsbml)
NonConstantLocalParameter = _libsbml.NonConstantLocalParameter
_libsbml.SubsUnitsNoLongerValid_swigconstant(_libsbml)
SubsUnitsNoLongerValid = _libsbml.SubsUnitsNoLongerValid
_libsbml.TimeUnitsNoLongerValid_swigconstant(_libsbml)
TimeUnitsNoLongerValid = _libsbml.TimeUnitsNoLongerValid
_libsbml.OneListOfPerKineticLaw_swigconstant(_libsbml)
OneListOfPerKineticLaw = _libsbml.OneListOfPerKineticLaw
_libsbml.OnlyLocalParamsInListOfLocalParams_swigconstant(_libsbml)
OnlyLocalParamsInListOfLocalParams = _libsbml.OnlyLocalParamsInListOfLocalParams
_libsbml.AllowedAttributesOnListOfLocalParam_swigconstant(_libsbml)
AllowedAttributesOnListOfLocalParam = _libsbml.AllowedAttributesOnListOfLocalParam
_libsbml.OneMathPerKineticLaw_swigconstant(_libsbml)
OneMathPerKineticLaw = _libsbml.OneMathPerKineticLaw
_libsbml.UndeclaredSpeciesInStoichMath_swigconstant(_libsbml)
UndeclaredSpeciesInStoichMath = _libsbml.UndeclaredSpeciesInStoichMath
_libsbml.AllowedAttributesOnKineticLaw_swigconstant(_libsbml)
AllowedAttributesOnKineticLaw = _libsbml.AllowedAttributesOnKineticLaw
_libsbml.AllowedAttributesOnListOfSpeciesRef_swigconstant(_libsbml)
AllowedAttributesOnListOfSpeciesRef = _libsbml.AllowedAttributesOnListOfSpeciesRef
_libsbml.AllowedAttributesOnListOfMods_swigconstant(_libsbml)
AllowedAttributesOnListOfMods = _libsbml.AllowedAttributesOnListOfMods
_libsbml.AllowedAttributesOnLocalParameter_swigconstant(_libsbml)
AllowedAttributesOnLocalParameter = _libsbml.AllowedAttributesOnLocalParameter
_libsbml.MissingTriggerInEvent_swigconstant(_libsbml)
MissingTriggerInEvent = _libsbml.MissingTriggerInEvent
_libsbml.TriggerMathNotBoolean_swigconstant(_libsbml)
TriggerMathNotBoolean = _libsbml.TriggerMathNotBoolean
_libsbml.MissingEventAssignment_swigconstant(_libsbml)
MissingEventAssignment = _libsbml.MissingEventAssignment
_libsbml.TimeUnitsEvent_swigconstant(_libsbml)
TimeUnitsEvent = _libsbml.TimeUnitsEvent
_libsbml.IncorrectOrderInEvent_swigconstant(_libsbml)
IncorrectOrderInEvent = _libsbml.IncorrectOrderInEvent
_libsbml.ValuesFromTriggerTimeNeedDelay_swigconstant(_libsbml)
ValuesFromTriggerTimeNeedDelay = _libsbml.ValuesFromTriggerTimeNeedDelay
_libsbml.DelayNeedsValuesFromTriggerTime_swigconstant(_libsbml)
DelayNeedsValuesFromTriggerTime = _libsbml.DelayNeedsValuesFromTriggerTime
_libsbml.OneMathPerTrigger_swigconstant(_libsbml)
OneMathPerTrigger = _libsbml.OneMathPerTrigger
_libsbml.OneMathPerDelay_swigconstant(_libsbml)
OneMathPerDelay = _libsbml.OneMathPerDelay
_libsbml.InvalidEventAssignmentVariable_swigconstant(_libsbml)
InvalidEventAssignmentVariable = _libsbml.InvalidEventAssignmentVariable
_libsbml.EventAssignmentForConstantEntity_swigconstant(_libsbml)
EventAssignmentForConstantEntity = _libsbml.EventAssignmentForConstantEntity
_libsbml.OneMathPerEventAssignment_swigconstant(_libsbml)
OneMathPerEventAssignment = _libsbml.OneMathPerEventAssignment
_libsbml.AllowedAttributesOnEventAssignment_swigconstant(_libsbml)
AllowedAttributesOnEventAssignment = _libsbml.AllowedAttributesOnEventAssignment
_libsbml.OnlyOneDelayPerEvent_swigconstant(_libsbml)
OnlyOneDelayPerEvent = _libsbml.OnlyOneDelayPerEvent
_libsbml.OneListOfEventAssignmentsPerEvent_swigconstant(_libsbml)
OneListOfEventAssignmentsPerEvent = _libsbml.OneListOfEventAssignmentsPerEvent
_libsbml.OnlyEventAssignInListOfEventAssign_swigconstant(_libsbml)
OnlyEventAssignInListOfEventAssign = _libsbml.OnlyEventAssignInListOfEventAssign
_libsbml.AllowedAttributesOnListOfEventAssign_swigconstant(_libsbml)
AllowedAttributesOnListOfEventAssign = _libsbml.AllowedAttributesOnListOfEventAssign
_libsbml.AllowedAttributesOnEvent_swigconstant(_libsbml)
AllowedAttributesOnEvent = _libsbml.AllowedAttributesOnEvent
_libsbml.AllowedAttributesOnTrigger_swigconstant(_libsbml)
AllowedAttributesOnTrigger = _libsbml.AllowedAttributesOnTrigger
_libsbml.AllowedAttributesOnDelay_swigconstant(_libsbml)
AllowedAttributesOnDelay = _libsbml.AllowedAttributesOnDelay
_libsbml.PersistentNotBoolean_swigconstant(_libsbml)
PersistentNotBoolean = _libsbml.PersistentNotBoolean
_libsbml.InitialValueNotBoolean_swigconstant(_libsbml)
InitialValueNotBoolean = _libsbml.InitialValueNotBoolean
_libsbml.OnlyOnePriorityPerEvent_swigconstant(_libsbml)
OnlyOnePriorityPerEvent = _libsbml.OnlyOnePriorityPerEvent
_libsbml.OneMathPerPriority_swigconstant(_libsbml)
OneMathPerPriority = _libsbml.OneMathPerPriority
_libsbml.AllowedAttributesOnPriority_swigconstant(_libsbml)
AllowedAttributesOnPriority = _libsbml.AllowedAttributesOnPriority
_libsbml.GeneralWarningNotSpecified_swigconstant(_libsbml)
GeneralWarningNotSpecified = _libsbml.GeneralWarningNotSpecified
_libsbml.CompartmentShouldHaveSize_swigconstant(_libsbml)
CompartmentShouldHaveSize = _libsbml.CompartmentShouldHaveSize
_libsbml.SpeciesShouldHaveValue_swigconstant(_libsbml)
SpeciesShouldHaveValue = _libsbml.SpeciesShouldHaveValue
_libsbml.ParameterShouldHaveUnits_swigconstant(_libsbml)
ParameterShouldHaveUnits = _libsbml.ParameterShouldHaveUnits
_libsbml.LocalParameterShadowsId_swigconstant(_libsbml)
LocalParameterShadowsId = _libsbml.LocalParameterShadowsId
_libsbml.LibSBMLAdditionalCodesLowerBound_swigconstant(_libsbml)
LibSBMLAdditionalCodesLowerBound = _libsbml.LibSBMLAdditionalCodesLowerBound
_libsbml.CannotConvertToL1V1_swigconstant(_libsbml)
CannotConvertToL1V1 = _libsbml.CannotConvertToL1V1
_libsbml.NoEventsInL1_swigconstant(_libsbml)
NoEventsInL1 = _libsbml.NoEventsInL1
_libsbml.NoFunctionDefinitionsInL1_swigconstant(_libsbml)
NoFunctionDefinitionsInL1 = _libsbml.NoFunctionDefinitionsInL1
_libsbml.NoConstraintsInL1_swigconstant(_libsbml)
NoConstraintsInL1 = _libsbml.NoConstraintsInL1
_libsbml.NoInitialAssignmentsInL1_swigconstant(_libsbml)
NoInitialAssignmentsInL1 = _libsbml.NoInitialAssignmentsInL1
_libsbml.NoSpeciesTypesInL1_swigconstant(_libsbml)
NoSpeciesTypesInL1 = _libsbml.NoSpeciesTypesInL1
_libsbml.NoCompartmentTypeInL1_swigconstant(_libsbml)
NoCompartmentTypeInL1 = _libsbml.NoCompartmentTypeInL1
_libsbml.NoNon3DCompartmentsInL1_swigconstant(_libsbml)
NoNon3DCompartmentsInL1 = _libsbml.NoNon3DCompartmentsInL1
_libsbml.NoFancyStoichiometryMathInL1_swigconstant(_libsbml)
NoFancyStoichiometryMathInL1 = _libsbml.NoFancyStoichiometryMathInL1
_libsbml.NoNonIntegerStoichiometryInL1_swigconstant(_libsbml)
NoNonIntegerStoichiometryInL1 = _libsbml.NoNonIntegerStoichiometryInL1
_libsbml.NoUnitMultipliersOrOffsetsInL1_swigconstant(_libsbml)
NoUnitMultipliersOrOffsetsInL1 = _libsbml.NoUnitMultipliersOrOffsetsInL1
_libsbml.SpeciesCompartmentRequiredInL1_swigconstant(_libsbml)
SpeciesCompartmentRequiredInL1 = _libsbml.SpeciesCompartmentRequiredInL1
_libsbml.NoSpeciesSpatialSizeUnitsInL1_swigconstant(_libsbml)
NoSpeciesSpatialSizeUnitsInL1 = _libsbml.NoSpeciesSpatialSizeUnitsInL1
_libsbml.NoSBOTermsInL1_swigconstant(_libsbml)
NoSBOTermsInL1 = _libsbml.NoSBOTermsInL1
_libsbml.StrictUnitsRequiredInL1_swigconstant(_libsbml)
StrictUnitsRequiredInL1 = _libsbml.StrictUnitsRequiredInL1
_libsbml.ConversionFactorNotInL1_swigconstant(_libsbml)
ConversionFactorNotInL1 = _libsbml.ConversionFactorNotInL1
_libsbml.CompartmentNotOnL1Reaction_swigconstant(_libsbml)
CompartmentNotOnL1Reaction = _libsbml.CompartmentNotOnL1Reaction
_libsbml.ExtentUnitsNotSubstance_swigconstant(_libsbml)
ExtentUnitsNotSubstance = _libsbml.ExtentUnitsNotSubstance
_libsbml.GlobalUnitsNotDeclared_swigconstant(_libsbml)
GlobalUnitsNotDeclared = _libsbml.GlobalUnitsNotDeclared
_libsbml.HasOnlySubstanceUnitsNotinL1_swigconstant(_libsbml)
HasOnlySubstanceUnitsNotinL1 = _libsbml.HasOnlySubstanceUnitsNotinL1
_libsbml.AvogadroNotSupported_swigconstant(_libsbml)
AvogadroNotSupported = _libsbml.AvogadroNotSupported
_libsbml.NoConstraintsInL2v1_swigconstant(_libsbml)
NoConstraintsInL2v1 = _libsbml.NoConstraintsInL2v1
_libsbml.NoInitialAssignmentsInL2v1_swigconstant(_libsbml)
NoInitialAssignmentsInL2v1 = _libsbml.NoInitialAssignmentsInL2v1
_libsbml.NoSpeciesTypeInL2v1_swigconstant(_libsbml)
NoSpeciesTypeInL2v1 = _libsbml.NoSpeciesTypeInL2v1
_libsbml.NoCompartmentTypeInL2v1_swigconstant(_libsbml)
NoCompartmentTypeInL2v1 = _libsbml.NoCompartmentTypeInL2v1
_libsbml.NoSBOTermsInL2v1_swigconstant(_libsbml)
NoSBOTermsInL2v1 = _libsbml.NoSBOTermsInL2v1
_libsbml.NoIdOnSpeciesReferenceInL2v1_swigconstant(_libsbml)
NoIdOnSpeciesReferenceInL2v1 = _libsbml.NoIdOnSpeciesReferenceInL2v1
_libsbml.NoDelayedEventAssignmentInL2v1_swigconstant(_libsbml)
NoDelayedEventAssignmentInL2v1 = _libsbml.NoDelayedEventAssignmentInL2v1
_libsbml.StrictUnitsRequiredInL2v1_swigconstant(_libsbml)
StrictUnitsRequiredInL2v1 = _libsbml.StrictUnitsRequiredInL2v1
_libsbml.IntegerSpatialDimensions_swigconstant(_libsbml)
IntegerSpatialDimensions = _libsbml.IntegerSpatialDimensions
_libsbml.StoichiometryMathNotYetSupported_swigconstant(_libsbml)
StoichiometryMathNotYetSupported = _libsbml.StoichiometryMathNotYetSupported
_libsbml.PriorityLostFromL3_swigconstant(_libsbml)
PriorityLostFromL3 = _libsbml.PriorityLostFromL3
_libsbml.NonPersistentNotSupported_swigconstant(_libsbml)
NonPersistentNotSupported = _libsbml.NonPersistentNotSupported
_libsbml.InitialValueFalseEventNotSupported_swigconstant(_libsbml)
InitialValueFalseEventNotSupported = _libsbml.InitialValueFalseEventNotSupported
_libsbml.SBOTermNotUniversalInL2v2_swigconstant(_libsbml)
SBOTermNotUniversalInL2v2 = _libsbml.SBOTermNotUniversalInL2v2
_libsbml.NoUnitOffsetInL2v2_swigconstant(_libsbml)
NoUnitOffsetInL2v2 = _libsbml.NoUnitOffsetInL2v2
_libsbml.NoKineticLawTimeUnitsInL2v2_swigconstant(_libsbml)
NoKineticLawTimeUnitsInL2v2 = _libsbml.NoKineticLawTimeUnitsInL2v2
_libsbml.NoKineticLawSubstanceUnitsInL2v2_swigconstant(_libsbml)
NoKineticLawSubstanceUnitsInL2v2 = _libsbml.NoKineticLawSubstanceUnitsInL2v2
_libsbml.NoDelayedEventAssignmentInL2v2_swigconstant(_libsbml)
NoDelayedEventAssignmentInL2v2 = _libsbml.NoDelayedEventAssignmentInL2v2
_libsbml.ModelSBOBranchChangedBeyondL2v2_swigconstant(_libsbml)
ModelSBOBranchChangedBeyondL2v2 = _libsbml.ModelSBOBranchChangedBeyondL2v2
_libsbml.StrictUnitsRequiredInL2v2_swigconstant(_libsbml)
StrictUnitsRequiredInL2v2 = _libsbml.StrictUnitsRequiredInL2v2
_libsbml.StrictSBORequiredInL2v2_swigconstant(_libsbml)
StrictSBORequiredInL2v2 = _libsbml.StrictSBORequiredInL2v2
_libsbml.DuplicateAnnotationInvalidInL2v2_swigconstant(_libsbml)
DuplicateAnnotationInvalidInL2v2 = _libsbml.DuplicateAnnotationInvalidInL2v2
_libsbml.NoUnitOffsetInL2v3_swigconstant(_libsbml)
NoUnitOffsetInL2v3 = _libsbml.NoUnitOffsetInL2v3
_libsbml.NoKineticLawTimeUnitsInL2v3_swigconstant(_libsbml)
NoKineticLawTimeUnitsInL2v3 = _libsbml.NoKineticLawTimeUnitsInL2v3
_libsbml.NoKineticLawSubstanceUnitsInL2v3_swigconstant(_libsbml)
NoKineticLawSubstanceUnitsInL2v3 = _libsbml.NoKineticLawSubstanceUnitsInL2v3
_libsbml.NoSpeciesSpatialSizeUnitsInL2v3_swigconstant(_libsbml)
NoSpeciesSpatialSizeUnitsInL2v3 = _libsbml.NoSpeciesSpatialSizeUnitsInL2v3
_libsbml.NoEventTimeUnitsInL2v3_swigconstant(_libsbml)
NoEventTimeUnitsInL2v3 = _libsbml.NoEventTimeUnitsInL2v3
_libsbml.NoDelayedEventAssignmentInL2v3_swigconstant(_libsbml)
NoDelayedEventAssignmentInL2v3 = _libsbml.NoDelayedEventAssignmentInL2v3
_libsbml.ModelSBOBranchChangedBeyondL2v3_swigconstant(_libsbml)
ModelSBOBranchChangedBeyondL2v3 = _libsbml.ModelSBOBranchChangedBeyondL2v3
_libsbml.StrictUnitsRequiredInL2v3_swigconstant(_libsbml)
StrictUnitsRequiredInL2v3 = _libsbml.StrictUnitsRequiredInL2v3
_libsbml.StrictSBORequiredInL2v3_swigconstant(_libsbml)
StrictSBORequiredInL2v3 = _libsbml.StrictSBORequiredInL2v3
_libsbml.DuplicateAnnotationInvalidInL2v3_swigconstant(_libsbml)
DuplicateAnnotationInvalidInL2v3 = _libsbml.DuplicateAnnotationInvalidInL2v3
_libsbml.NoUnitOffsetInL2v4_swigconstant(_libsbml)
NoUnitOffsetInL2v4 = _libsbml.NoUnitOffsetInL2v4
_libsbml.NoKineticLawTimeUnitsInL2v4_swigconstant(_libsbml)
NoKineticLawTimeUnitsInL2v4 = _libsbml.NoKineticLawTimeUnitsInL2v4
_libsbml.NoKineticLawSubstanceUnitsInL2v4_swigconstant(_libsbml)
NoKineticLawSubstanceUnitsInL2v4 = _libsbml.NoKineticLawSubstanceUnitsInL2v4
_libsbml.NoSpeciesSpatialSizeUnitsInL2v4_swigconstant(_libsbml)
NoSpeciesSpatialSizeUnitsInL2v4 = _libsbml.NoSpeciesSpatialSizeUnitsInL2v4
_libsbml.NoEventTimeUnitsInL2v4_swigconstant(_libsbml)
NoEventTimeUnitsInL2v4 = _libsbml.NoEventTimeUnitsInL2v4
_libsbml.ModelSBOBranchChangedInL2v4_swigconstant(_libsbml)
ModelSBOBranchChangedInL2v4 = _libsbml.ModelSBOBranchChangedInL2v4
_libsbml.DuplicateAnnotationInvalidInL2v4_swigconstant(_libsbml)
DuplicateAnnotationInvalidInL2v4 = _libsbml.DuplicateAnnotationInvalidInL2v4
_libsbml.NoSpeciesTypeInL3v1_swigconstant(_libsbml)
NoSpeciesTypeInL3v1 = _libsbml.NoSpeciesTypeInL3v1
_libsbml.NoCompartmentTypeInL3v1_swigconstant(_libsbml)
NoCompartmentTypeInL3v1 = _libsbml.NoCompartmentTypeInL3v1
_libsbml.NoUnitOffsetInL3v1_swigconstant(_libsbml)
NoUnitOffsetInL3v1 = _libsbml.NoUnitOffsetInL3v1
_libsbml.NoKineticLawTimeUnitsInL3v1_swigconstant(_libsbml)
NoKineticLawTimeUnitsInL3v1 = _libsbml.NoKineticLawTimeUnitsInL3v1
_libsbml.NoKineticLawSubstanceUnitsInL3v1_swigconstant(_libsbml)
NoKineticLawSubstanceUnitsInL3v1 = _libsbml.NoKineticLawSubstanceUnitsInL3v1
_libsbml.NoSpeciesSpatialSizeUnitsInL3v1_swigconstant(_libsbml)
NoSpeciesSpatialSizeUnitsInL3v1 = _libsbml.NoSpeciesSpatialSizeUnitsInL3v1
_libsbml.NoEventTimeUnitsInL3v1_swigconstant(_libsbml)
NoEventTimeUnitsInL3v1 = _libsbml.NoEventTimeUnitsInL3v1
_libsbml.ModelSBOBranchChangedInL3v1_swigconstant(_libsbml)
ModelSBOBranchChangedInL3v1 = _libsbml.ModelSBOBranchChangedInL3v1
_libsbml.DuplicateAnnotationInvalidInL3v1_swigconstant(_libsbml)
DuplicateAnnotationInvalidInL3v1 = _libsbml.DuplicateAnnotationInvalidInL3v1
_libsbml.NoCompartmentOutsideInL3v1_swigconstant(_libsbml)
NoCompartmentOutsideInL3v1 = _libsbml.NoCompartmentOutsideInL3v1
_libsbml.NoStoichiometryMathInL3v1_swigconstant(_libsbml)
NoStoichiometryMathInL3v1 = _libsbml.NoStoichiometryMathInL3v1
_libsbml.InvalidSBMLLevelVersion_swigconstant(_libsbml)
InvalidSBMLLevelVersion = _libsbml.InvalidSBMLLevelVersion
_libsbml.AnnotationNotesNotAllowedLevel1_swigconstant(_libsbml)
AnnotationNotesNotAllowedLevel1 = _libsbml.AnnotationNotesNotAllowedLevel1
_libsbml.InvalidRuleOrdering_swigconstant(_libsbml)
InvalidRuleOrdering = _libsbml.InvalidRuleOrdering
_libsbml.RequiredPackagePresent_swigconstant(_libsbml)
RequiredPackagePresent = _libsbml.RequiredPackagePresent
_libsbml.UnrequiredPackagePresent_swigconstant(_libsbml)
UnrequiredPackagePresent = _libsbml.UnrequiredPackagePresent
_libsbml.PackageRequiredShouldBeFalse_swigconstant(_libsbml)
PackageRequiredShouldBeFalse = _libsbml.PackageRequiredShouldBeFalse
_libsbml.SubsUnitsAllowedInKL_swigconstant(_libsbml)
SubsUnitsAllowedInKL = _libsbml.SubsUnitsAllowedInKL
_libsbml.TimeUnitsAllowedInKL_swigconstant(_libsbml)
TimeUnitsAllowedInKL = _libsbml.TimeUnitsAllowedInKL
_libsbml.FormulaInLevel1KL_swigconstant(_libsbml)
FormulaInLevel1KL = _libsbml.FormulaInLevel1KL
_libsbml.L3SubstanceUnitsOnModel_swigconstant(_libsbml)
L3SubstanceUnitsOnModel = _libsbml.L3SubstanceUnitsOnModel
_libsbml.TimeUnitsRemoved_swigconstant(_libsbml)
TimeUnitsRemoved = _libsbml.TimeUnitsRemoved
_libsbml.BadMathML_swigconstant(_libsbml)
BadMathML = _libsbml.BadMathML
_libsbml.FailedMathMLReadOfDouble_swigconstant(_libsbml)
FailedMathMLReadOfDouble = _libsbml.FailedMathMLReadOfDouble
_libsbml.FailedMathMLReadOfInteger_swigconstant(_libsbml)
FailedMathMLReadOfInteger = _libsbml.FailedMathMLReadOfInteger
_libsbml.FailedMathMLReadOfExponential_swigconstant(_libsbml)
FailedMathMLReadOfExponential = _libsbml.FailedMathMLReadOfExponential
_libsbml.FailedMathMLReadOfRational_swigconstant(_libsbml)
FailedMathMLReadOfRational = _libsbml.FailedMathMLReadOfRational
_libsbml.BadMathMLNodeType_swigconstant(_libsbml)
BadMathMLNodeType = _libsbml.BadMathMLNodeType
_libsbml.InvalidMathMLAttribute_swigconstant(_libsbml)
InvalidMathMLAttribute = _libsbml.InvalidMathMLAttribute
_libsbml.NoTimeSymbolInFunctionDef_swigconstant(_libsbml)
NoTimeSymbolInFunctionDef = _libsbml.NoTimeSymbolInFunctionDef
_libsbml.NoBodyInFunctionDef_swigconstant(_libsbml)
NoBodyInFunctionDef = _libsbml.NoBodyInFunctionDef
_libsbml.DanglingUnitSIdRef_swigconstant(_libsbml)
DanglingUnitSIdRef = _libsbml.DanglingUnitSIdRef
_libsbml.RDFMissingAboutTag_swigconstant(_libsbml)
RDFMissingAboutTag = _libsbml.RDFMissingAboutTag
_libsbml.RDFEmptyAboutTag_swigconstant(_libsbml)
RDFEmptyAboutTag = _libsbml.RDFEmptyAboutTag
_libsbml.RDFAboutTagNotMetaid_swigconstant(_libsbml)
RDFAboutTagNotMetaid = _libsbml.RDFAboutTagNotMetaid
_libsbml.RDFNotCompleteModelHistory_swigconstant(_libsbml)
RDFNotCompleteModelHistory = _libsbml.RDFNotCompleteModelHistory
_libsbml.RDFNotModelHistory_swigconstant(_libsbml)
RDFNotModelHistory = _libsbml.RDFNotModelHistory
_libsbml.AnnotationNotElement_swigconstant(_libsbml)
AnnotationNotElement = _libsbml.AnnotationNotElement
_libsbml.InconsistentArgUnitsWarnings_swigconstant(_libsbml)
InconsistentArgUnitsWarnings = _libsbml.InconsistentArgUnitsWarnings
_libsbml.InconsistentPowerUnitsWarnings_swigconstant(_libsbml)
InconsistentPowerUnitsWarnings = _libsbml.InconsistentPowerUnitsWarnings
_libsbml.InconsistentExponUnitsWarnings_swigconstant(_libsbml)
InconsistentExponUnitsWarnings = _libsbml.InconsistentExponUnitsWarnings
_libsbml.UndeclaredUnits_swigconstant(_libsbml)
UndeclaredUnits = _libsbml.UndeclaredUnits
_libsbml.UndeclaredTimeUnitsL3_swigconstant(_libsbml)
UndeclaredTimeUnitsL3 = _libsbml.UndeclaredTimeUnitsL3
_libsbml.UndeclaredExtentUnitsL3_swigconstant(_libsbml)
UndeclaredExtentUnitsL3 = _libsbml.UndeclaredExtentUnitsL3
_libsbml.UndeclaredObjectUnitsL3_swigconstant(_libsbml)
UndeclaredObjectUnitsL3 = _libsbml.UndeclaredObjectUnitsL3
_libsbml.UnrecognisedSBOTerm_swigconstant(_libsbml)
UnrecognisedSBOTerm = _libsbml.UnrecognisedSBOTerm
_libsbml.ObseleteSBOTerm_swigconstant(_libsbml)
ObseleteSBOTerm = _libsbml.ObseleteSBOTerm
_libsbml.IncorrectCompartmentSpatialDimensions_swigconstant(_libsbml)
IncorrectCompartmentSpatialDimensions = _libsbml.IncorrectCompartmentSpatialDimensions
_libsbml.CompartmentTypeNotValidAttribute_swigconstant(_libsbml)
CompartmentTypeNotValidAttribute = _libsbml.CompartmentTypeNotValidAttribute
_libsbml.ConstantNotValidAttribute_swigconstant(_libsbml)
ConstantNotValidAttribute = _libsbml.ConstantNotValidAttribute
_libsbml.MetaIdNotValidAttribute_swigconstant(_libsbml)
MetaIdNotValidAttribute = _libsbml.MetaIdNotValidAttribute
_libsbml.SBOTermNotValidAttributeBeforeL2V3_swigconstant(_libsbml)
SBOTermNotValidAttributeBeforeL2V3 = _libsbml.SBOTermNotValidAttributeBeforeL2V3
_libsbml.InvalidL1CompartmentUnits_swigconstant(_libsbml)
InvalidL1CompartmentUnits = _libsbml.InvalidL1CompartmentUnits
_libsbml.L1V1CompartmentVolumeReqd_swigconstant(_libsbml)
L1V1CompartmentVolumeReqd = _libsbml.L1V1CompartmentVolumeReqd
_libsbml.CompartmentTypeNotValidComponent_swigconstant(_libsbml)
CompartmentTypeNotValidComponent = _libsbml.CompartmentTypeNotValidComponent
_libsbml.ConstraintNotValidComponent_swigconstant(_libsbml)
ConstraintNotValidComponent = _libsbml.ConstraintNotValidComponent
_libsbml.EventNotValidComponent_swigconstant(_libsbml)
EventNotValidComponent = _libsbml.EventNotValidComponent
_libsbml.SBOTermNotValidAttributeBeforeL2V2_swigconstant(_libsbml)
SBOTermNotValidAttributeBeforeL2V2 = _libsbml.SBOTermNotValidAttributeBeforeL2V2
_libsbml.FuncDefNotValidComponent_swigconstant(_libsbml)
FuncDefNotValidComponent = _libsbml.FuncDefNotValidComponent
_libsbml.InitialAssignNotValidComponent_swigconstant(_libsbml)
InitialAssignNotValidComponent = _libsbml.InitialAssignNotValidComponent
_libsbml.VariableNotValidAttribute_swigconstant(_libsbml)
VariableNotValidAttribute = _libsbml.VariableNotValidAttribute
_libsbml.UnitsNotValidAttribute_swigconstant(_libsbml)
UnitsNotValidAttribute = _libsbml.UnitsNotValidAttribute
_libsbml.ConstantSpeciesNotValidAttribute_swigconstant(_libsbml)
ConstantSpeciesNotValidAttribute = _libsbml.ConstantSpeciesNotValidAttribute
_libsbml.SpatialSizeUnitsNotValidAttribute_swigconstant(_libsbml)
SpatialSizeUnitsNotValidAttribute = _libsbml.SpatialSizeUnitsNotValidAttribute
_libsbml.SpeciesTypeNotValidAttribute_swigconstant(_libsbml)
SpeciesTypeNotValidAttribute = _libsbml.SpeciesTypeNotValidAttribute
_libsbml.HasOnlySubsUnitsNotValidAttribute_swigconstant(_libsbml)
HasOnlySubsUnitsNotValidAttribute = _libsbml.HasOnlySubsUnitsNotValidAttribute
_libsbml.IdNotValidAttribute_swigconstant(_libsbml)
IdNotValidAttribute = _libsbml.IdNotValidAttribute
_libsbml.NameNotValidAttribute_swigconstant(_libsbml)
NameNotValidAttribute = _libsbml.NameNotValidAttribute
_libsbml.SpeciesTypeNotValidComponent_swigconstant(_libsbml)
SpeciesTypeNotValidComponent = _libsbml.SpeciesTypeNotValidComponent
_libsbml.StoichiometryMathNotValidComponent_swigconstant(_libsbml)
StoichiometryMathNotValidComponent = _libsbml.StoichiometryMathNotValidComponent
_libsbml.MultiplierNotValidAttribute_swigconstant(_libsbml)
MultiplierNotValidAttribute = _libsbml.MultiplierNotValidAttribute
_libsbml.OffsetNotValidAttribute_swigconstant(_libsbml)
OffsetNotValidAttribute = _libsbml.OffsetNotValidAttribute
_libsbml.L3SpatialDimensionsUnset_swigconstant(_libsbml)
L3SpatialDimensionsUnset = _libsbml.L3SpatialDimensionsUnset
_libsbml.UnknownCoreAttribute_swigconstant(_libsbml)
UnknownCoreAttribute = _libsbml.UnknownCoreAttribute
_libsbml.UnknownPackageAttribute_swigconstant(_libsbml)
UnknownPackageAttribute = _libsbml.UnknownPackageAttribute
_libsbml.PackageConversionNotSupported_swigconstant(_libsbml)
PackageConversionNotSupported = _libsbml.PackageConversionNotSupported
_libsbml.InvalidTargetLevelVersion_swigconstant(_libsbml)
InvalidTargetLevelVersion = _libsbml.InvalidTargetLevelVersion
_libsbml.L3NotSupported_swigconstant(_libsbml)
L3NotSupported = _libsbml.L3NotSupported
_libsbml.SBMLCodesUpperBound_swigconstant(_libsbml)
SBMLCodesUpperBound = _libsbml.SBMLCodesUpperBound
_libsbml.LIBSBML_CAT_SBML_swigconstant(_libsbml)
LIBSBML_CAT_SBML = _libsbml.LIBSBML_CAT_SBML
_libsbml.LIBSBML_CAT_SBML_L1_COMPAT_swigconstant(_libsbml)
LIBSBML_CAT_SBML_L1_COMPAT = _libsbml.LIBSBML_CAT_SBML_L1_COMPAT
_libsbml.LIBSBML_CAT_SBML_L2V1_COMPAT_swigconstant(_libsbml)
LIBSBML_CAT_SBML_L2V1_COMPAT = _libsbml.LIBSBML_CAT_SBML_L2V1_COMPAT
_libsbml.LIBSBML_CAT_SBML_L2V2_COMPAT_swigconstant(_libsbml)
LIBSBML_CAT_SBML_L2V2_COMPAT = _libsbml.LIBSBML_CAT_SBML_L2V2_COMPAT
_libsbml.LIBSBML_CAT_GENERAL_CONSISTENCY_swigconstant(_libsbml)
LIBSBML_CAT_GENERAL_CONSISTENCY = _libsbml.LIBSBML_CAT_GENERAL_CONSISTENCY
_libsbml.LIBSBML_CAT_IDENTIFIER_CONSISTENCY_swigconstant(_libsbml)
LIBSBML_CAT_IDENTIFIER_CONSISTENCY = _libsbml.LIBSBML_CAT_IDENTIFIER_CONSISTENCY
_libsbml.LIBSBML_CAT_UNITS_CONSISTENCY_swigconstant(_libsbml)
LIBSBML_CAT_UNITS_CONSISTENCY = _libsbml.LIBSBML_CAT_UNITS_CONSISTENCY
_libsbml.LIBSBML_CAT_MATHML_CONSISTENCY_swigconstant(_libsbml)
LIBSBML_CAT_MATHML_CONSISTENCY = _libsbml.LIBSBML_CAT_MATHML_CONSISTENCY
_libsbml.LIBSBML_CAT_SBO_CONSISTENCY_swigconstant(_libsbml)
LIBSBML_CAT_SBO_CONSISTENCY = _libsbml.LIBSBML_CAT_SBO_CONSISTENCY
_libsbml.LIBSBML_CAT_OVERDETERMINED_MODEL_swigconstant(_libsbml)
LIBSBML_CAT_OVERDETERMINED_MODEL = _libsbml.LIBSBML_CAT_OVERDETERMINED_MODEL
_libsbml.LIBSBML_CAT_SBML_L2V3_COMPAT_swigconstant(_libsbml)
LIBSBML_CAT_SBML_L2V3_COMPAT = _libsbml.LIBSBML_CAT_SBML_L2V3_COMPAT
_libsbml.LIBSBML_CAT_MODELING_PRACTICE_swigconstant(_libsbml)
LIBSBML_CAT_MODELING_PRACTICE = _libsbml.LIBSBML_CAT_MODELING_PRACTICE
_libsbml.LIBSBML_CAT_INTERNAL_CONSISTENCY_swigconstant(_libsbml)
LIBSBML_CAT_INTERNAL_CONSISTENCY = _libsbml.LIBSBML_CAT_INTERNAL_CONSISTENCY
_libsbml.LIBSBML_CAT_SBML_L2V4_COMPAT_swigconstant(_libsbml)
LIBSBML_CAT_SBML_L2V4_COMPAT = _libsbml.LIBSBML_CAT_SBML_L2V4_COMPAT
_libsbml.LIBSBML_CAT_SBML_L3V1_COMPAT_swigconstant(_libsbml)
LIBSBML_CAT_SBML_L3V1_COMPAT = _libsbml.LIBSBML_CAT_SBML_L3V1_COMPAT
_libsbml.LIBSBML_SEV_SCHEMA_ERROR_swigconstant(_libsbml)
LIBSBML_SEV_SCHEMA_ERROR = _libsbml.LIBSBML_SEV_SCHEMA_ERROR
_libsbml.LIBSBML_SEV_GENERAL_WARNING_swigconstant(_libsbml)
LIBSBML_SEV_GENERAL_WARNING = _libsbml.LIBSBML_SEV_GENERAL_WARNING
_libsbml.LIBSBML_SEV_NOT_APPLICABLE_swigconstant(_libsbml)
LIBSBML_SEV_NOT_APPLICABLE = _libsbml.LIBSBML_SEV_NOT_APPLICABLE
class SBMLError(XMLError):
"""
An error, warning or other diagnostic.
When a libSBML operation on SBML content results in an error, or when
there is something wrong with the SBML content, the problems are
reported as SBMLError objects. These are generally stored in an
SBMLErrorLog object; this log object, in turn, is kept in the
SBMLDocument object containing the SBML content. Applications can
obtain the list of logged errors using SBMLDocument.getErrorLog() and
then use the methods provided by SBMLErrorLog to access individual
SBMLError objects. (Note that despite the word 'error' in the name,
SBMLError objects are used to represent not only 'true' errors, but
also warnings and some informational diagnostics. The name is a
historical hold-over from early versions of libSBML, in which the
object really was only used to report errors.)
Each SBMLError object instance has an identification number that
identifies the nature of the problem. This 'error id' number will be
up to five digits long, and it will come from one of two sets of
static integer constants defined in the interface class libsbml:
either the SBML error identifiers (described below) or the XML error
identifiers (described in the documentation for the class XMLError).
The former set of constants includes all the SBML validation rule
numbers listed in the appendices of the SBML specification documents,
as well as some additional libSBML-specific error codes.
Error codes are useful mainly for software. For human readers,
SBMLError also includes text messages that describe the nature of a
given problem. The messages can be accessed using
SBMLError.getShortMessage() and SBMLError.getMessage(). The former
provides a brief one-line description of the issue, while
SBMLError.getMessage() provides a more detailed text, including (if
appropriate) references to sections of the SBML specifications where
relevant topics are discussed. These text strings are suitable for
displaying to human users.
An SBMLError object also contains a category code; its value may be
retrieved using the method SBMLError.getCategory(). Category values
are drawn from a set of static integer constants defined in libsbml
and having names beginning with the characters LIBSBML_CAT_. The list
of possible codes is described in a separate section below.
Categories are used to partition errors into distinct conceptual
groups. This is principally used by the libSBML validation system to
group classes of validation checks. For example,
LIBSBML_CAT_IDENTIFIER_CONSISTENCY is the category for tests that
check identifier consistency; LIBSBML_CAT_MATHML_CONSISTENCY is the
category for MathML consistency checking; and so on.
In addition, SBMLError also has a severity code. Its value may be
retrieved using the method SBMLError.getSeverity(). The possible
severity values are the same as those reported by XMLError. Severity
levels currently range from informational (LIBSBML_SEV_INFO) to fatal
errors (LIBSBML_SEV_FATAL). They can be used by an application to
evaluate how serious a given problem is.
SBMLError also tracks the Level 3 package extension, if any, was
responsible for a given warning or error. Each diagnostic code logged
by an libSBML extension for SBML Level 3 packages includes a record of
the package that logged it. It can be retrieved using
SBMLError.getPackage(). The information is a simple text string; the
string will be the nickname of the package, such as 'comp' for the
Hierarchical Model Composition package, 'fbc' for the Flux Balance
Constraints package, and so on. If the value returned by
SBMLError.getPackage() is an empty string or has the value 'core',
then the error came from libSBML core.
Finally, SBMLError records the line and column near where the problem
occurred in the SBML content. The values may be retrieved using the
methods SBMLError.getLine() and SBMLError.getColumn(). We say 'near',
because a lot of factors affect how accurate the line/column
information ultimately is. For example, different XML parsers have
different conventions for which line and column number they report for
a particular problem (which makes a difference when a problem involves
an opening XML tag on one line and a closing tag on another line). In
some situations, some parsers report invalid line and/or column
numbers altogether. If this occurs, libSBML sets the line and/or
column number in the SBMLError object to the the value of the maximum
unsigned long integer representable on the platform where libSBML is
running. (This is equal to the constant named ULONG_MAX in C and
C++.) The probability that a true line or column number in an SBML
model would equal this value is vanishingly small; thus, if an
application encounters these values in an XMLError object, it can
assume no valid line/column number could be provided by libSBML in
that situation.
Error codes associated with SBMLError objects
......................................................................
The error and warning codes returned by libSBML are listed in the
table below. The method SBMLError.getErrorId() returns the error code
of a given SBMLError object instance. In the libSBML Python language
interface, these error identifiers are currently implemented as static
integer constants defined in the interface class libsbml.
In this table, the right-hand columns titled 'L1V1', 'L1V2', etc.
refer to Levels and Versions of the SBML specifications, and the
entries in each column refer to whether the severity of the condition
in that particular Level+Version of SBML. The codes stand for the
following:
= Not applicable
= Warning
= Error
= Fatal
The text shown in the 'Meaning' is the text returned by the
SBMLError.getShortMessage() method on a given SBMLError object. A
longer and (hopefully) clearer explanation of the issue is returned by
SBMLError.getMessage().
The error codes come from different lists depending on whether they're
from libSBML core or from an SBML Level 3 package extension.
However, in the language interfaces other than C++, all libSBML error
codes are ultimately represented as integer constants rather than
separate enumerations lists, and they are all stored in a single
interface class. Codes from different libSBML extensions have names
that begin with the package's nickname, such as Qual for the
Qualitative Models package, Layout for the Layout package, and so on.
If the name of a code does not begin with one of the package nicknames
(Layout, Fbc, Comp, Qual, etc.), then it is a code from libSBML core.
+----------------------------------------+------------------------------------------------------------------------------------------------------+-------+-------+-------+-------+-------+-------+-------+
|Enumerator |Meaning |L1 V1 |L1 V2 |L2 V1 |L2 V2 |L2 V3 |L2 V4 |L3 V1 |
+----------------------------------------+------------------------------------------------------------------------------------------------------+-------+-------+-------+-------+-------+-------+-------+
|XMLUnknownError |Unknown error | | | | | | | |
|XMLOutOfMemory |Out of memory | | | | | | | |
|XMLFileUnreadable |File unreadable | | | | | | | |
|XMLFileUnwritable |File unwritable | | | | | | | |
|XMLFileOperationError |File operation error | | | | | | | |
|XMLNetworkAccessError |Network access error | | | | | | | |
|InternalXMLParserError |Internal XML parser error | | | | | | | |
|UnrecognizedXMLParserCode |Unrecognized XML parser code | | | | | | | |
|XMLTranscoderError |Transcoder error | | | | | | | |
|MissingXMLDecl |Missing XML declaration | | | | | | | |
|MissingXMLEncoding |Missing XML encoding attribute | | | | | | | |
|BadXMLDecl |Bad XML declaration | | | | | | | |
|BadXMLDOCTYPE |Bad XML DOCTYPE | | | | | | | |
|InvalidCharInXML |Invalid character | | | | | | | |
|BadlyFormedXML |Badly formed XML | | | | | | | |
|UnclosedXMLToken |Unclosed token | | | | | | | |
|InvalidXMLConstruct |Invalid XML construct | | | | | | | |
|XMLTagMismatch |XML tag mismatch | | | | | | | |
|DuplicateXMLAttribute |Duplicate attribute | | | | | | | |
|UndefinedXMLEntity |Undefined XML entity | | | | | | | |
|BadProcessingInstruction |Bad XML processing instruction | | | | | | | |
|BadXMLPrefix |Bad XML prefix | | | | | | | |
|BadXMLPrefixValue |Bad XML prefix value | | | | | | | |
|MissingXMLRequiredAttribute |Missing required attribute | | | | | | | |
|XMLAttributeTypeMismatch |Attribute type mismatch | | | | | | | |
|XMLBadUTF8Content |Bad UTF8 content | | | | | | | |
|MissingXMLAttributeValue |Missing attribute value | | | | | | | |
|BadXMLAttributeValue |Bad attribute value | | | | | | | |
|BadXMLAttribute |Bad XML attribute | | | | | | | |
|UnrecognizedXMLElement |Unrecognized XML element | | | | | | | |
|BadXMLComment |Bad XML comment | | | | | | | |
|BadXMLDeclLocation |Bad XML declaration location | | | | | | | |
|XMLUnexpectedEOF |Unexpected EOF | | | | | | | |
|BadXMLIDValue |Bad XML ID value | | | | | | | |
|BadXMLIDRef |Bad XML IDREF | | | | | | | |
|UninterpretableXMLContent |Uninterpretable XML content | | | | | | | |
|BadXMLDocumentStructure |Bad XML document structure | | | | | | | |
|InvalidAfterXMLContent |Invalid content after XML content | | | | | | | |
|XMLExpectedQuotedString |Expected quoted string | | | | | | | |
|XMLEmptyValueNotPermitted |Empty value not permitted | | | | | | | |
|XMLBadNumber |Bad number | | | | | | | |
|XMLBadColon |Colon character not permitted | | | | | | | |
|MissingXMLElements |Missing XML elements | | | | | | | |
|XMLContentEmpty |Empty XML content | | | | | | | |
|UnknownError |Encountered unknown internal libSBML error | | | | | | | |
|NotUTF8 |File does not use UTF-8 encoding | | | | | | | |
|UnrecognizedElement |Encountered unrecognized element | | | | | | | |
|NotSchemaConformant |Document does not conform to the SBML XML schema | | | | | | | |
|L3NotSchemaConformant |Document is not well-formed XML | | | | | | | |
|InvalidMathElement |Invalid MathML | | | | | | | |
|DisallowedMathMLSymbol |Disallowed MathML symbol found | | | | | | | |
|DisallowedMathMLEncodingUse |Use of the MathML 'encoding' attribute is not allowed on this element | | | | | | | |
|DisallowedDefinitionURLUse |Use of the MathML 'definitionURL' attribute is not allowed on this element | | | | | | | |
|BadCsymbolDefinitionURLValue |Invalid 'definitionURL' attribute value | | | | | | | |
|DisallowedMathTypeAttributeUse |Use of the MathML 'type' attribute is not allowed on this element | | | | | | | |
|DisallowedMathTypeAttributeValue |Disallowed MathML 'type' attribute value | | | | | | | |
|LambdaOnlyAllowedInFunctionDef |Use of not permitted outside of FunctionDefinition objects | | | | | | | |
|BooleanOpsNeedBooleanArgs |Non-Boolean argument given to Boolean operator | | | | | | | |
|NumericOpsNeedNumericArgs |Non-numerical argument given to numerical operator | | | | | | | |
|ArgsToEqNeedSameType |Arguments to and must have the same data types | | | | | | | |
|PiecewiseNeedsConsistentTypes |Terms in a expression must have consistent data types | | | | | | | |
|PieceNeedsBoolean |The second argument of a expression must yield a Boolean value | | | | | | | |
|ApplyCiMustBeUserFunction |A element in this context must refer to a function definition | | | | | | | |
|ApplyCiMustBeModelComponent |A element in this context must refer to a model component | | | | | | | |
|KineticLawParametersAreLocalOnly |Cannot use a KineticLaw local parameter outside of its local scope | | | | | | | |
|MathResultMustBeNumeric |A formula's result in this context must be a numerical value | | | | | | | |
|OpsNeedCorrectNumberOfArgs |Incorrect number of arguments given to MathML operator | | | | | | | |
|InvalidNoArgsPassedToFunctionDef |Incorrect number of arguments given to function invocation | | | | | | | |
|DisallowedMathUnitsUse |Attribute 'units' is only permitted on elements | | | | | | | |
|InvalidUnitsValue |Invalid value given for the 'units' attribute | | | | | | | |
|DuplicateComponentId |Duplicate 'id' attribute value | | | | | | | |
|DuplicateUnitDefinitionId |Duplicate unit definition 'id' attribute value | | | | | | | |
|DuplicateLocalParameterId |Duplicate local parameter 'id' attribute value | | | | | | | |
|MultipleAssignmentOrRateRules |Multiple rules for the same variable are not allowed | | | | | | | |
|MultipleEventAssignmentsForId |Multiple event assignments for the same variable are not allowed | | | | | | | |
|EventAndAssignmentRuleForId |An event assignment and an assignment rule must not have the same value for 'variable' | | | | | | | |
|DuplicateMetaId |Duplicate 'metaid' attribute value | | | | | | | |
|InvalidSBOTermSyntax |Invalid syntax for an 'sboTerm' attribute value | | | | | | | |
|InvalidMetaidSyntax |Invalid syntax for a 'metaid' attribute value | | | | | | | |
|InvalidIdSyntax |Invalid syntax for an 'id' attribute value | | | | | | | |
|InvalidUnitIdSyntax |Invalid syntax for the identifier of a unit | | | | | | | |
|InvalidNameSyntax |Invalid syntax for a 'name' attribute value | | | | | | | |
|MissingAnnotationNamespace |Missing declaration of the XML namespace for the annotation | | | | | | | |
|DuplicateAnnotationNamespaces |Multiple annotations using the same XML namespace | | | | | | | |
|SBMLNamespaceInAnnotation |The SBML XML namespace cannot be used in an Annotation object | | | | | | | |
|MultipleAnnotations |Only one Annotation object is permitted under a given SBML object | | | | | | | |
|InconsistentArgUnits |The units of the function call's arguments are not consistent with its definition | | | | | | | |
|InconsistentKineticLawUnitsL3 |The kinetic law's units are inconsistent with those of other kinetic laws in the model | | | | | | | |
|AssignRuleCompartmentMismatch |Mismatched units in assignment rule for compartment | | | | | | | |
|AssignRuleSpeciesMismatch |Mismatched units in assignment rule for species | | | | | | | |
|AssignRuleParameterMismatch |Mismatched units in assignment rule for parameter | | | | | | | |
|AssignRuleStoichiometryMismatch |Mismatched units in assignment rule for stoichiometry | | | | | | | |
|InitAssignCompartmenMismatch |Mismatched units in initial assignment to compartment | | | | | | | |
|InitAssignSpeciesMismatch |Mismatched units in initial assignment to species | | | | | | | |
|InitAssignParameterMismatch |Mismatched units in initial assignment to parameter | | | | | | | |
|InitAssignStoichiometryMismatch |Mismatched units in initial assignment to stoichiometry | | | | | | | |
|RateRuleCompartmentMismatch |Mismatched units in rate rule for compartment | | | | | | | |
|RateRuleSpeciesMismatch |Mismatched units in rate rule for species | | | | | | | |
|RateRuleParameterMismatch |Mismatched units in rate rule for parameter | | | | | | | |
|RateRuleStoichiometryMismatch |Mismatched units in rate rule for stoichiometry | | | | | | | |
|KineticLawNotSubstancePerTime |The units of the kinetic law are not 'substance'/'time' | | | | | | | |
|SpeciesInvalidExtentUnits |The species' units are not consistent with units of extent | | | | | | | |
|DelayUnitsNotTime |The units of the delay expression are not units of time | | | | | | | |
|EventAssignCompartmentMismatch |Mismatched units in event assignment for compartment | | | | | | | |
|EventAssignSpeciesMismatch |Mismatched units in event assignment for species | | | | | | | |
|EventAssignParameterMismatch |Mismatched units in event assignment for parameter | | | | | | | |
|EventAssignStoichiometryMismatch |Mismatched units in event assignment for stoichiometry | | | | | | | |
|PriorityUnitsNotDimensionless |The units of a priority expression must be 'dimensionless' | | | | | | | |
|OverdeterminedSystem |The model is overdetermined | | | | | | | |
|InvalidModelSBOTerm |Invalid 'sboTerm' attribute value for a Model object | | | | | | | |
|InvalidFunctionDefSBOTerm |Invalid 'sboTerm' attribute value for a FunctionDefinition object | | | | | | | |
|InvalidParameterSBOTerm |Invalid 'sboTerm' attribute value for a Parameter object | | | | | | | |
|InvalidInitAssignSBOTerm |Invalid 'sboTerm' attribute value for an InitialAssignment object | | | | | | | |
|InvalidRuleSBOTerm |Invalid 'sboTerm' attribute value for a Rule object | | | | | | | |
|InvalidConstraintSBOTerm |Invalid 'sboTerm' attribute value for a Constraint object | | | | | | | |
|InvalidReactionSBOTerm |Invalid 'sboTerm' attribute value for a Reaction object | | | | | | | |
|InvalidSpeciesReferenceSBOTerm |Invalid 'sboTerm' attribute value for a SpeciesReference object | | | | | | | |
|InvalidKineticLawSBOTerm |Invalid 'sboTerm' attribute value for a KineticLaw object | | | | | | | |
|InvalidEventSBOTerm |Invalid 'sboTerm' attribute value for an Event object | | | | | | | |
|InvalidEventAssignmentSBOTerm |Invalid 'sboTerm' attribute value for an EventAssignment object | | | | | | | |
|InvalidCompartmentSBOTerm |Invalid 'sboTerm' attribute value for a Compartment object | | | | | | | |
|InvalidSpeciesSBOTerm |Invalid 'sboTerm' attribute value for a Species object | | | | | | | |
|InvalidCompartmentTypeSBOTerm |Invalid 'sboTerm' attribute value for a CompartmentType object | | | | | | | |
|InvalidSpeciesTypeSBOTerm |Invalid 'sboTerm' attribute value for a SpeciesType object | | | | | | | |
|InvalidTriggerSBOTerm |Invalid 'sboTerm' attribute value for an Event Trigger object | | | | | | | |
|InvalidDelaySBOTerm |Invalid 'sboTerm' attribute value for an Event Delay object | | | | | | | |
|NotesNotInXHTMLNamespace |Notes must be placed in the XHTML XML namespace | | | | | | | |
|NotesContainsXMLDecl |XML declarations are not permitted in Notes objects | | | | | | | |
|NotesContainsDOCTYPE |XML DOCTYPE elements are not permitted in Notes objects | | | | | | | |
|InvalidNotesContent |Invalid notes content found | | | | | | | |
|OnlyOneNotesElementAllowed |Only one Notes subobject is permitted on a given SBML object | | | | | | | |
|InvalidNamespaceOnSBML |Invalid XML namespace for the SBML container element | | | | | | | |
|MissingOrInconsistentLevel |Missing or inconsistent value for the 'level' attribute | | | | | | | |
|MissingOrInconsistentVersion |Missing or inconsistent value for the 'version' attribute | | | | | | | |
|PackageNSMustMatch |Inconsistent or invalid SBML Level/Version for the package namespace declaration | | | | | | | |
|LevelPositiveInteger |The 'level' attribute must have a positive integer value | | | | | | | |
|VersionPositiveInteger |The 'version' attribute must have a positive integer value | | | | | | | |
|AllowedAttributesOnSBML |Invalid attribute found on the SBML container element | | | | | | | |
|L3PackageOnLowerSBML |An L3 package ns found on the SBML container element | | | | | | | |
|MissingModel |No model definition found | | | | | | | |
|IncorrectOrderInModel |Incorrect ordering of components within the Model object | | | | | | | |
|EmptyListElement |Empty ListOf___ object found | | | | | | | |
|NeedCompartmentIfHaveSpecies |The presence of a species requires a compartment | | | | | | | |
|OneOfEachListOf |Only one of each kind of ListOf___ object is allowed inside a Model object | | | | | | | |
|OnlyFuncDefsInListOfFuncDefs |Only FunctionDefinition, Notes and Annotation objects are allowed in ListOfFunctionDefinitions | | | | | | | |
|OnlyUnitDefsInListOfUnitDefs |Only UnitDefinition, Notes and Annotation objects are allowed in ListOfUnitDefinitions objects | | | | | | | |
|OnlyCompartmentsInListOfCompartments |Only Compartment, Notes and Annotation objects are allowed in ListOfCompartments objects | | | | | | | |
|OnlySpeciesInListOfSpecies |Only Species, Notes and Annotation objects are allowed in ListOfSpecies objects | | | | | | | |
|OnlyParametersInListOfParameters |Only Parameter, Notes and Annotation objects are allowed in ListOfParameters objects | | | | | | | |
|OnlyInitAssignsInListOfInitAssigns |Only InitialAssignment, Notes and Annotation objects are allowed in ListOfInitialAssignments objects | | | | | | | |
|OnlyRulesInListOfRules |Only Rule, Notes and Annotation objects are allowed in ListOfRules objects | | | | | | | |
|OnlyConstraintsInListOfConstraints |Only Constraint, Notes and Annotation objects are allowed in ListOfConstraints objects | | | | | | | |
|OnlyReactionsInListOfReactions |Only Reaction, Notes and Annotation objects are allowed in ListOfReactions objects | | | | | | | |
|OnlyEventsInListOfEvents |Only Event, Notes and Annotation objects are allowed in ListOfEvents objects | | | | | | | |
|L3ConversionFactorOnModel |A 'conversionFactor' attribute value must reference a Parameter object | | | | | | | |
|L3TimeUnitsOnModel |Invalid 'timeUnits' attribute value | | | | | | | |
|L3VolumeUnitsOnModel |Invalid 'volumeUnits' attribute value | | | | | | | |
|L3AreaUnitsOnModel |Invalid 'areaUnits' attribute value | | | | | | | |
|L3LengthUnitsOnModel |Invalid 'lengthUnits' attribute value | | | | | | | |
|L3ExtentUnitsOnModel |Invalid 'extentUnits' attribute value | | | | | | | |
|AllowedAttributesOnModel |Invalid attribute found on the Model object | | | | | | | |
|AllowedAttributesOnListOfFuncs |Invalid attribute found on the ListOfFunctionDefinitions object | | | | | | | |
|AllowedAttributesOnListOfUnitDefs |Invalid attribute found on the ListOfUnitDefinitions object | | | | | | | |
|AllowedAttributesOnListOfComps |Invalid attribute found on the ListOfCompartments object | | | | | | | |
|AllowedAttributesOnListOfSpecies |Invalid attribute found on the ListOfSpecies object | | | | | | | |
|AllowedAttributesOnListOfParams |Invalid attribute found on the ListOfParameters object | | | | | | | |
|AllowedAttributesOnListOfInitAssign |Invalid attribute found on the ListOfInitialAssignments object | | | | | | | |
|AllowedAttributesOnListOfRules |Invalid attribute found on the ListOfRules object | | | | | | | |
|AllowedAttributesOnListOfConstraints |Invalid attribute found on the ListOfConstraints object | | | | | | | |
|AllowedAttributesOnListOfReactions |Invalid attribute found on the ListOfReactions object | | | | | | | |
|AllowedAttributesOnListOfEvents |Invalid attribute found on the ListOfEvents object | | | | | | | |
|FunctionDefMathNotLambda |Invalid expression found in the function definition | | | | | | | |
|InvalidApplyCiInLambda |Invalid forward reference in the MathML ... expression | | | | | | | |
|RecursiveFunctionDefinition |Recursive function definitions are not permitted | | | | | | | |
|InvalidCiInLambda |Invalid reference found inside the mathematical formula | | | | | | | |
|InvalidFunctionDefReturnType |A function's return type must be either a number or a Boolean | | | | | | | |
|OneMathElementPerFunc |A FunctionDefinition object must contain one element | | | | | | | |
|AllowedAttributesOnFunc |Invalid attribute found on the FunctionDefinition object | | | | | | | |
|InvalidUnitDefId |Invalid 'id' attribute value for a UnitDefinition object | | | | | | | |
|InvalidSubstanceRedefinition |Invalid redefinition of built-in type 'substance' | | | | | | | |
|InvalidLengthRedefinition |Invalid redefinition of built-in type 'length' | | | | | | | |
|InvalidAreaRedefinition |Invalid redefinition of built-in type name 'area' | | | | | | | |
|InvalidTimeRedefinition |Invalid redefinition of built-in type name 'time' | | | | | | | |
|InvalidVolumeRedefinition |Invalid redefinition of built-in type name 'volume' | | | | | | | |
|VolumeLitreDefExponentNotOne |Must use 'exponent'=1 when defining 'volume' in terms of litres | | | | | | | |
|VolumeMetreDefExponentNot3 |Must use 'exponent'=3 when defining 'volume' in terms of metres | | | | | | | |
|EmptyListOfUnits |An empty list of Unit objects is not permitted in a UnitDefinition object | | | | | | | |
|InvalidUnitKind |Invalid value for the 'kind' attribute of a UnitDefinition object | | | | | | | |
|OffsetNoLongerValid |Unit attribute 'offset' is not supported in this Level+Version of SBML | | | | | | | |
|CelsiusNoLongerValid |Unit name 'Celsius' is not defined in this Level+Version of SBML | | | | | | | |
|EmptyUnitListElement |A ListOfUnits object must not be empty | | | | | | | |
|OneListOfUnitsPerUnitDef |At most one ListOfUnits object is allowed inside a UnitDefinition object | | | | | | | |
|OnlyUnitsInListOfUnits |Only Unit, Notes and Annotation objects are allowed in ListOfUnits objects | | | | | | | |
|AllowedAttributesOnUnitDefinition |Invalid attribute found on the UnitDefinition object | | | | | | | |
|AllowedAttributesOnListOfUnits |Invalid attribute found on the ListOfUnits object | | | | | | | |
|AllowedAttributesOnUnit |Invalid attribute found on the Unit object | | | | | | | |
|ZeroDimensionalCompartmentSize |Invalid use of the 'size' attribute for a zero-dimensional compartment | | | | | | | |
|ZeroDimensionalCompartmentUnits |Invalid use of the 'units' attribute for a zero-dimensional compartment | | | | | | | |
|ZeroDimensionalCompartmentConst |Zero-dimensional compartments must be defined to be constant | | | | | | | |
|UndefinedOutsideCompartment |Invalid value for the 'outside' attribute of a Compartment object | | | | | | | |
|RecursiveCompartmentContainment |Recursive nesting of compartments via the 'outside' attribute is not permitted | | | | | | | |
|ZeroDCompartmentContainment |Invalid nesting of zero-dimensional compartments | | | | | | | |
|Invalid1DCompartmentUnits |Invalid value for the 'units' attribute of a one-dimensional compartment | | | | | | | |
|Invalid2DCompartmentUnits |Invalid value for the 'units' attribute of a two-dimensional compartment | | | | | | | |
|Invalid3DCompartmentUnits |Invalid value for the 'units' attribute of a three-dimensional compartment | | | | | | | |
|InvalidCompartmentTypeRef |Invalid value for the 'compartmentType' attribute of a compartment | | | | | | | |
|OneDimensionalCompartmentUnits |No units defined for 1-D compartment | | | | | | | |
|TwoDimensionalCompartmentUnits |No units defined for 2-D compartment | | | | | | | |
|ThreeDimensionalCompartmentUnits |No units defined for 3-D Compartment object | | | | | | | |
|AllowedAttributesOnCompartment |Invalid attribute found on Compartment object | | | | | | | |
|NoUnitsOnCompartment |No units defined for Compartment object | | | | | | | |
|InvalidSpeciesCompartmentRef |Invalid value found for Species 'compartment' attribute | | | | | | | |
|HasOnlySubsNoSpatialUnits |Attribute 'spatialSizeUnits' must not be set if 'hasOnlySubstanceUnits'='true' | | | | | | | |
|NoSpatialUnitsInZeroD |Attribute 'spatialSizeUnits' must not be set if the compartment is zero-dimensional | | | | | | | |
|NoConcentrationInZeroD |Attribute 'initialConcentration' must not be set if the compartment is zero-dimensional | | | | | | | |
|SpatialUnitsInOneD |Invalid value for 'spatialSizeUnits' attribute of a one-dimensional compartment | | | | | | | |
|SpatialUnitsInTwoD |Invalid value for the 'spatialSizeUnits' attribute of a two-dimensional compartment | | | | | | | |
|SpatialUnitsInThreeD |Invalid value for the 'spatialSizeUnits' attribute of a three-dimensional compartment | | | | | | | |
|InvalidSpeciesSusbstanceUnits |Invalid value for a Species 'units' attribute | | | | | | | |
|BothAmountAndConcentrationSet |Cannot set both 'initialConcentration' and 'initialAmount' attributes simultaneously | | | | | | | |
|NonBoundarySpeciesAssignedAndUsed |Cannot use a non-boundary species in both reactions and rules simultaneously | | | | | | | |
|NonConstantSpeciesUsed |Cannot use a constant, non-boundary species as a reactant or product | | | | | | | |
|InvalidSpeciesTypeRef |Invalid value for the 'speciesType' attribute of a species | | | | | | | |
|MultSpeciesSameTypeInCompartment |Cannot have multiple species of the same species type in the same compartment | | | | | | | |
|MissingSpeciesCompartment |Missing value for the 'compartment' attribute | | | | | | | |
|SpatialSizeUnitsRemoved |Attribute 'spatialSizeUnits' is not supported in this Level+Version of SBML | | | | | | | |
|SubstanceUnitsOnSpecies |No substance units defined for the species | | | | | | | |
|ConversionFactorOnSpecies |Invalid value for the 'conversionFactor' attribute | | | | | | | |
|AllowedAttributesOnSpecies |Invalid attribute found on Species object | | | | | | | |
|InvalidParameterUnits |Invalid value for the 'units' attribute of a Parameter object | | | | | | | |
|ParameterUnits |No units defined for the parameter | | | | | | | |
|ConversionFactorMustConstant |A conversion factor must reference a Parameter object declared to be a constant | | | | | | | |
|AllowedAttributesOnParameter |Invalid attribute found on Parameter object | | | | | | | |
|InvalidInitAssignSymbol |Invalid value for the 'symbol' attribute of an InitialAssignment object | | | | | | | |
|MultipleInitAssignments |Multiple initial assignments for the same 'symbol' value are not allowed | | | | | | | |
|InitAssignmentAndRuleForSameId |Cannot set a value using both an initial assignment and an assignment rule simultaneously | | | | | | | |
|OneMathElementPerInitialAssign |An InitialAssignment object must contain one element | | | | | | | |
|AllowedAttributesOnInitialAssign |Invalid attribute found on an InitialAssignment object | | | | | | | |
|InvalidAssignRuleVariable |Invalid value for the 'variable' attribute of an AssignmentRule object | | | | | | | |
|InvalidRateRuleVariable |Invalid value for the 'variable' attribute of a RateRule object | | | | | | | |
|AssignmentToConstantEntity |An assignment rule cannot assign an entity declared to be constant | | | | | | | |
|RateRuleForConstantEntity |A rate rule cannot assign an entity declared to be constant | | | | | | | |
|CircularRuleDependency |Circular dependencies involving rules and reactions are not permitted | | | | | | | |
|OneMathElementPerRule |A rule object must contain one element | | | | | | | |
|AllowedAttributesOnAssignRule |Invalid attribute found on an AssignmentRule object | | | | | | | |
|AllowedAttributesOnRateRule |Invalid attribute found on a RateRule object | | | | | | | |
|AllowedAttributesOnAlgRule |Invalid attribute found on an AlgebraicRule object | | | | | | | |
|ConstraintMathNotBoolean |A Constraint object's must evaluate to a Boolean value | | | | | | | |
|IncorrectOrderInConstraint |Subobjects inside the Constraint object are not in the prescribed order | | | | | | | |
|ConstraintNotInXHTMLNamespace |A Constraint's Message subobject must be in the XHTML XML namespace | | | | | | | |
|ConstraintContainsXMLDecl |XML declarations are not permitted within Constraint's Message objects | | | | | | | |
|ConstraintContainsDOCTYPE |XML DOCTYPE elements are not permitted within Constraint's Message objects | | | | | | | |
|InvalidConstraintContent |Invalid content for a Constraint object's Message object | | | | | | | |
|OneMathElementPerConstraint |A Constraint object must contain one element | | | | | | | |
|OneMessageElementPerConstraint |A Constraint object must contain one Message subobject | | | | | | | |
|AllowedAttributesOnConstraint |Invalid attribute found on Constraint object | | | | | | | |
|NoReactantsOrProducts |Cannot have a reaction with neither reactants nor products | | | | | | | |
|IncorrectOrderInReaction |Subobjects inside the Reaction object are not in the prescribed order | | | | | | | |
|EmptyListInReaction |Reaction components, if present, cannot be empty | | | | | | | |
|InvalidReactantsProductsList |Invalid object found in the list of reactants or products | | | | | | | |
|InvalidModifiersList |Invalid object found in the list of modifiers | | | | | | | |
|OneSubElementPerReaction |A Reaction object can only contain one of each allowed type of object | | | | | | | |
|CompartmentOnReaction |Invalid value for the Reaction 'compartment' attribute | | | | | | | |
|AllowedAttributesOnReaction |Invalid attribute for a Reaction object | | | | | | | |
|InvalidSpeciesReference |Invalid 'species' attribute value in SpeciesReference object | | | | | | | |
|BothStoichiometryAndMath |The 'stoichiometry' attribute and StoichiometryMath subobject are mutually exclusive | | | | | | | |
|AllowedAttributesOnSpeciesReference |Invalid attribute found on the SpeciesReference object | | | | | | | |
|AllowedAttributesOnModifier |Invalid attribute found on the ModifierSpeciesReference object | | | | | | | |
|UndeclaredSpeciesRef |Unknown species referenced in the kinetic law formula | | | | | | | |
|IncorrectOrderInKineticLaw |Incorrect ordering of components in the KineticLaw object | | | | | | | |
|EmptyListInKineticLaw |The list of parameters, if present, cannot be empty | | | | | | | |
|NonConstantLocalParameter |Parameters local to a KineticLaw object must have a 'constant' attribute value of 'true' | | | | | | | |
|SubsUnitsNoLongerValid |Attribute 'substanceUnits' is not supported in this Level+Version of SBML | | | | | | | |
|TimeUnitsNoLongerValid |Attribute 'timeUnits' is not supported in this Level+Version of SBML | | | | | | | |
|OneListOfPerKineticLaw |Only one ListOfLocalParameters object is permitted within a KineticLaw object | | | | | | | |
|OnlyLocalParamsInListOfLocalParams |Only LocalParameter, Notes and Annotation objects are allowed in ListOfLocalParameter objects | | | | | | | |
|AllowedAttributesOnListOfLocalParam |Invalid attribute found on the ListOfLocalParameters object | | | | | | | |
|OneMathPerKineticLaw |Only one element is allowed in a KineticLaw object | | | | | | | |
|UndeclaredSpeciesInStoichMath |Unknown species referenced in the StoichiometryMath object's formula | | | | | | | |
|AllowedAttributesOnKineticLaw |Invalid attribute found on the KineticLaw object | | | | | | | |
|AllowedAttributesOnListOfSpeciesRef |Invalid attribute found on the ListOfSpeciesReferences object | | | | | | | |
|AllowedAttributesOnListOfMods |Invalid attribute found on the ListOfModifiers object | | | | | | | |
|AllowedAttributesOnLocalParameter |Invalid attribute found on the LocalParameter object | | | | | | | |
|MissingTriggerInEvent |The Event object is missing a Trigger subobject | | | | | | | |
|TriggerMathNotBoolean |A Trigger object's expression must evaluate to a Boolean value | | | | | | | |
|MissingEventAssignment |The Event object is missing an EventAssignment subobject | | | | | | | |
|TimeUnitsEvent |Units referenced by 'timeUnits' attribute are not compatible with units of time | | | | | | | |
|IncorrectOrderInEvent |Incorrect ordering of components in Event object | | | | | | | |
|ValuesFromTriggerTimeNeedDelay |Attribute 'useValuesFromTriggerTime'='false', but the Event object does not define a delay | | | | | | | |
|DelayNeedsValuesFromTriggerTime |The use of a Delay object requires the Event attribute 'useValuesFromTriggerTime' | | | | | | | |
|OneMathPerTrigger |A Trigger object must have one element | | | | | | | |
|OneMathPerDelay |A Delay object must have one element | | | | | | | |
|InvalidEventAssignmentVariable |Invalid 'variable' attribute value in Event object | | | | | | | |
|EventAssignmentForConstantEntity |An EventAssignment object cannot assign to a component having attribute 'constant'='true' | | | | | | | |
|OneMathPerEventAssignment |An EventAssignment object must have one element | | | | | | | |
|AllowedAttributesOnEventAssignment |Invalid attribute found on the EventAssignment object | | | | | | | |
|OnlyOneDelayPerEvent |An Event object can only have one Delay subobject | | | | | | | |
|OneListOfEventAssignmentsPerEvent |An Event object can only have one ListOfEventAssignments subobject | | | | | | | |
|OnlyEventAssignInListOfEventAssign |Only EventAssignment, Notes and Annotation objects are allowed in ListOfEventAssignments | | | | | | | |
|AllowedAttributesOnListOfEventAssign |Invalid attribute found on the ListOfEventAssignments object | | | | | | | |
|AllowedAttributesOnEvent |Invalid attribute found on the Event object | | | | | | | |
|AllowedAttributesOnTrigger |Invalid attribute found on the Trigger object | | | | | | | |
|AllowedAttributesOnDelay |Invalid attribute found on the Delay object | | | | | | | |
|PersistentNotBoolean |The Trigger attribute 'persistent' must evaluate to a Boolean value | | | | | | | |
|InitialValueNotBoolean |The Trigger attribute 'initialValue' must evaluate to a Boolean value | | | | | | | |
|OnlyOnePriorityPerEvent |An Event object can only have one Priority subobject | | | | | | | |
|OneMathPerPriority |A Priority object must have one element | | | | | | | |
|AllowedAttributesOnPriority |Invalid attribute found on the Priority object | | | | | | | |
|CompartmentShouldHaveSize |It's best to define a size for every compartment in a model | | | | | | | |
|SpeciesShouldHaveValue |It's best to define an initial amount or initial concentration for every species in a model | | | | | | | |
|ParameterShouldHaveUnits |It's best to declare units for every parameter in a model | | | | | | | |
|LocalParameterShadowsId |Local parameters defined within a kinetic law shadow global object symbols | | | | | | | |
|CannotConvertToL1V1 |Cannot convert to SBML Level 1 Version 1 | | | | | | | |
|NoEventsInL1 |SBML Level 1 does not support events | | | | | | | |
|NoFunctionDefinitionsInL1 |SBML Level 1 does not support function definitions | | | | | | | |
|NoConstraintsInL1 |SBML Level 1 does not support constraints | | | | | | | |
|NoInitialAssignmentsInL1 |SBML Level 1 does not support initial assignments | | | | | | | |
|NoSpeciesTypesInL1 |SBML Level 1 does not support species types | | | | | | | |
|NoCompartmentTypeInL1 |SBML Level 1 does not support compartment types | | | | | | | |
|NoNon3DCompartmentsInL1 |SBML Level 1 only supports three-dimensional compartments | | | | | | | |
|NoFancyStoichiometryMathInL1 |SBML Level 1 does not support non-integer nor non-rational stoichiometry formulas | | | | | | | |
|NoNonIntegerStoichiometryInL1 |SBML Level 1 does not support non-integer 'stoichiometry' attribute values | | | | | | | |
|NoUnitMultipliersOrOffsetsInL1 |SBML Level 1 does not support multipliers or offsets in unit definitions | | | | | | | |
|SpeciesCompartmentRequiredInL1 |In SBML Level 1, a value for 'compartment' is mandatory in species definitions | | | | | | | |
|NoSpeciesSpatialSizeUnitsInL1 |SBML Level 1 does not support species 'spatialSizeUnits' settings | | | | | | | |
|NoSBOTermsInL1 |SBML Level 1 does not support the 'sboTerm' attribute | | | | | | | |
|StrictUnitsRequiredInL1 |SBML Level 1 requires strict unit consistency | | | | | | | |
|ConversionFactorNotInL1 |SBML Level 1 does not support the 'conversionFactor' attribute | | | | | | | |
|CompartmentNotOnL1Reaction |SBML Level 1 does not support the 'compartment' attribute on Reaction objects | | | | | | | |
|ExtentUnitsNotSubstance |Units of extent must be compatible with units of substance | | | | | | | |
|GlobalUnitsNotDeclared |Global units must be refer to unit kind or unitDefinition. | | | | | | | |
|HasOnlySubstanceUnitsNotinL1 |The concept of hasOnlySubstanceUnits was not available in SBML Level 1. | | | | | | | |
|AvogadroNotSupported |Avogadro not supported in Levels 2 and 1. | | | | | | | |
|NoConstraintsInL2v1 |SBML Level 2 Version 1 does not support Constraint objects | | | | | | | |
|NoInitialAssignmentsInL2v1 |SBML Level 2 Version 1 does not support InitialAssignment objects | | | | | | | |
|NoSpeciesTypeInL2v1 |SBML Level 2 Version 1 does not support SpeciesType objects | | | | | | | |
|NoCompartmentTypeInL2v1 |SBML Level 2 Version 1 does not support CompartmentType objects | | | | | | | |
|NoSBOTermsInL2v1 |SBML Level 2 Version 1 does not support the 'sboTerm' attribute | | | | | | | |
|NoIdOnSpeciesReferenceInL2v1 |SBML Level 2 Version 1 does not support the 'id' attribute on SpeciesReference objects | | | | | | | |
|NoDelayedEventAssignmentInL2v1 |SBML Level 2 Version 1 does not support the 'useValuesFromTriggerTime' attribute | | | | | | | |
|StrictUnitsRequiredInL2v1 |SBML Level 2 Version 1 requires strict unit consistency | | | | | | | |
|IntegerSpatialDimensions |SBML Level 2 Version 1 requires that compartments have spatial dimensions of 0-3 | | | | | | | |
|StoichiometryMathNotYetSupported |Conversion to StoichiometryMath objects not yet supported | | | | | | | |
|PriorityLostFromL3 |SBML Level 2 Version 1 does not support priorities on Event objects | | | | | | | |
|NonPersistentNotSupported |SBML Level 2 Version 1 does not support the 'persistent' attribute on Trigger objects | | | | | | | |
|InitialValueFalseEventNotSupported |SBML Level 2 Version 1 does not support the 'initialValue' attribute on Trigger objects | | | | | | | |
|SBOTermNotUniversalInL2v2 |The 'sboTerm' attribute is invalid for this component in SBML Level 2 Version 2 | | | | | | | |
|NoUnitOffsetInL2v2 |This Level+Version of SBML does not support the 'offset' attribute on Unit objects | | | | | | | |
|NoKineticLawTimeUnitsInL2v2 |This Level+Version of SBML does not support the 'timeUnits' attribute on KineticLaw objects | | | | | | | |
|NoKineticLawSubstanceUnitsInL2v2 |This Level+Version of SBML does not support the 'substanceUnits' attribute on KineticLaw objects | | | | | | | |
|NoDelayedEventAssignmentInL2v2 |This Level+Version of SBML does not support the 'useValuesFromTriggerTime' attribute | | | | | | | |
|ModelSBOBranchChangedBeyondL2v2 |The allowable 'sboTerm' attribute values for Model objects differ for this SBML Level+Version | | | | | | | |
|StrictUnitsRequiredInL2v2 |SBML Level 2 Version 2 requires strict unit consistency | | | | | | | |
|StrictSBORequiredInL2v2 |SBML Level 2 Version 2 requires strict SBO term consistency | | | | | | | |
|DuplicateAnnotationInvalidInL2v2 |Duplicate top-level annotations are invalid in SBML Level 2 Version 2 | | | | | | | |
|NoUnitOffsetInL2v3 |This Level+Version of SBML does not support the 'offset' attribute on Unit objects | | | | | | | |
|NoKineticLawTimeUnitsInL2v3 |This Level+Version of SBML does not support the 'timeUnits' attribute on KineticLaw objects | | | | | | | |
|NoKineticLawSubstanceUnitsInL2v3 |This Level+Version of SBML does not support the 'substanceUnits' attribute on KineticLaw objects | | | | | | | |
|NoSpeciesSpatialSizeUnitsInL2v3 |This Level+Version of SBML does not support the 'spatialSizeUnit' attribute on Species objects | | | | | | | |
|NoEventTimeUnitsInL2v3 |This Level+Version of SBML does not support the 'timeUnits' attribute on Event objects | | | | | | | |
|NoDelayedEventAssignmentInL2v3 |This Level+Version of SBML does not support the 'useValuesFromTriggerTime' attribute | | | | | | | |
|ModelSBOBranchChangedBeyondL2v3 |The allowable 'sboTerm' attribute values for Model objects differ for this SBML Level+Version | | | | | | | |
|StrictUnitsRequiredInL2v3 |SBML Level 2 Version 3 requires strict unit consistency | | | | | | | |
|StrictSBORequiredInL2v3 |SBML Level 2 Version 3 requires strict SBO term consistency | | | | | | | |
|DuplicateAnnotationInvalidInL2v3 |Duplicate top-level annotations are invalid in SBML Level 2 Version 3 | | | | | | | |
|NoUnitOffsetInL2v4 |This Level+Version of SBML does not support the 'offset' attribute on Unit objects | | | | | | | |
|NoKineticLawTimeUnitsInL2v4 |This Level+Version of SBML does not support the 'timeUnits' attribute on KineticLaw objects | | | | | | | |
|NoKineticLawSubstanceUnitsInL2v4 |This Level+Version of SBML does not support the 'substanceUnits' attribute on KineticLaw objects | | | | | | | |
|NoSpeciesSpatialSizeUnitsInL2v4 |This Level+Version of SBML does not support the 'spatialSizeUnit' attribute on Species objects | | | | | | | |
|NoEventTimeUnitsInL2v4 |This Level+Version of SBML does not support the 'timeUnits' attribute on Event objects | | | | | | | |
|ModelSBOBranchChangedInL2v4 |The allowable 'sboTerm' attribute values for Model objects differ for this SBML Level+Version | | | | | | | |
|DuplicateAnnotationInvalidInL2v4 |Duplicate top-level annotations are invalid in SBML Level 2 Version 4 | | | | | | | |
|NoSpeciesTypeInL3v1 |SBML Level 3 Version 1 does not support SpeciesType objects | | | | | | | |
|NoCompartmentTypeInL3v1 |SBML Level 3 Version 1 does not support CompartmentType objects | | | | | | | |
|NoUnitOffsetInL3v1 |This Level+Version of SBML does not support the 'offset' attribute on Unit objects | | | | | | | |
|NoKineticLawTimeUnitsInL3v1 |This Level+Version of SBML does not support the 'timeUnits' attribute on KineticLaw objects | | | | | | | |
|NoKineticLawSubstanceUnitsInL3v1 |This Level+Version of SBML does not support the 'substanceUnits' attribute on KineticLaw objects | | | | | | | |
|NoSpeciesSpatialSizeUnitsInL3v1 |This Level+Version of SBML does not support the 'spatialSizeUnit' attribute on Species objects | | | | | | | |
|NoEventTimeUnitsInL3v1 |This Level+Version of SBML does not support the 'timeUnits' attribute on Event objects | | | | | | | |
|ModelSBOBranchChangedInL3v1 |The allowable 'sboTerm' attribute values for Model objects differ for this SBML Level+Version | | | | | | | |
|DuplicateAnnotationInvalidInL3v1 |Duplicate top-level annotations are invalid in SBML Level 3 Version 1 | | | | | | | |
|NoCompartmentOutsideInL3v1 |This Level+Version of SBML does not support the 'outside' attribute on Compartment objects | | | | | | | |
|NoStoichiometryMathInL3v1 |This Level+Version of SBML does not support the StoichiometryMath object | | | | | | | |
|InvalidSBMLLevelVersion |Unknown Level+Version combination of SBML | | | | | | | |
|AnnotationNotesNotAllowedLevel1 |Annotation objects on the SBML container element are not permitted in SBML Level 1 | | | | | | | |
|InvalidRuleOrdering |Invalid ordering of rules | | | | | | | |
|RequiredPackagePresent |The SBML document requires an SBML Level 3 package unavailable in this software | | | | | | | |
|UnrequiredPackagePresent |The SBML document uses an SBML Level 3 package unavailable in this software | | | | | | | |
|PackageRequiredShouldBeFalse |This package expects required to be false | | | | | | | |
|SubsUnitsAllowedInKL |Disallowed value for attribute 'substanceUnits' on KineticLaw object | | | | | | | |
|TimeUnitsAllowedInKL |Disallowed value for attribute 'timeUnits' on KineticLaw object | | | | | | | |
|FormulaInLevel1KL |Only predefined functions are allowed in SBML Level 1 formulas | | | | | | | |
|L3SubstanceUnitsOnModel |Invalid 'substanceUnits' attribute value | | | | | | | |
|TimeUnitsRemoved |This Level+Version of SBML does not support the 'timeUnits' attribute on Event objects | | | | | | | |
|BadMathML |Invalid MathML expression | | | | | | | |
|FailedMathMLReadOfDouble |Missing or invalid floating-point number in MathML expression | | | | | | | |
|FailedMathMLReadOfInteger |Missing or invalid integer in MathML expression | | | | | | | |
|FailedMathMLReadOfExponential |Missing or invalid exponential expression in MathML | | | | | | | |
|FailedMathMLReadOfRational |Missing or invalid rational expression in MathML | | | | | | | |
|BadMathMLNodeType |Invalid MathML element | | | | | | | |
|InvalidMathMLAttribute |Invalid MathML attribute | | | | | | | |
|NoTimeSymbolInFunctionDef |Use of for 'time' not allowed within FunctionDefinition objects | | | | | | | |
|NoBodyInFunctionDef |There must be a body within the element of a FunctionDefinition object | | | | | | | |
|DanglingUnitSIdRef |Units must refer to valid unit or unitDefinition | | | | | | | |
|RDFMissingAboutTag |RDF missing the tag | | | | | | | |
|RDFEmptyAboutTag |RDF empty tag | | | | | | | |
|RDFAboutTagNotMetaid |RDF tag is not metaid | | | | | | | |
|RDFNotCompleteModelHistory |RDF does not contain valid ModelHistory | | | | | | | |
|RDFNotModelHistory |RDF does not result in a ModelHistory | | | | | | | |
|AnnotationNotElement |Annotation must contain element | | | | | | | |
|UndeclaredUnits |Missing unit declarations on parameters or literal numbers in expression | | | | | | | |
|UndeclaredTimeUnitsL3 |Unable to verify consistency of units: the unit of time has not been declared | | | | | | | |
|UndeclaredExtentUnitsL3 |Unable to verify consistency of units: the units of reaction extent have not been declared | | | | | | | |
|UndeclaredObjectUnitsL3 |Unable to verify consistency of units: encountered a model entity with no declared units | | | | | | | |
|UnrecognisedSBOTerm |Unrecognized 'sboTerm' attribute value | | | | | | | |
|ObseleteSBOTerm |Obsolete 'sboTerm' attribute value | | | | | | | |
|IncorrectCompartmentSpatialDimensions |In SBML Level 1, only three-dimensional compartments are allowed | | | | | | | |
|CompartmentTypeNotValidAttribute |CompartmentType objects are not available in this Level+Version of SBML | | | | | | | |
|ConstantNotValidAttribute |This Level+Version of SBML does not support the 'constant' attribute on this component | | | | | | | |
|MetaIdNotValidAttribute |Attribute 'metaid' is not available in SBML Level 1 | | | | | | | |
|SBOTermNotValidAttributeBeforeL2V3 |The 'sboTerm' attribute is not available on this component before SBML Level 2 Version 3 | | | | | | | |
|InvalidL1CompartmentUnits |Invalid units for a compartment in SBML Level 1 | | | | | | | |
|L1V1CompartmentVolumeReqd |In SBML Level 1, a compartment's volume must be specified | | | | | | | |
|CompartmentTypeNotValidComponent |CompartmentType objects are not available in this Level+Version of SBML | | | | | | | |
|ConstraintNotValidComponent |Constraint objects are not available in this Level+Version of SBML | | | | | | | |
|EventNotValidComponent |Event objects are not available in this Level+Version of SBML | | | | | | | |
|SBOTermNotValidAttributeBeforeL2V2 |The 'sboTerm' attribute is invalid for this component before Level 2 Version 2 | | | | | | | |
|FuncDefNotValidComponent |FunctionDefinition objects are not available in this Level+Version of SBML | | | | | | | |
|InitialAssignNotValidComponent |InitialAssignment objects are not available in this Level+Version of SBML | | | | | | | |
|VariableNotValidAttribute |Attribute 'variable' is not available on this component in this Level+Version of SBML | | | | | | | |
|UnitsNotValidAttribute |Attribute 'units' is not available on this component in this Level+Version of SBML | | | | | | | |
|ConstantSpeciesNotValidAttribute |Attribute 'constant' is not available on Species objects in SBML Level 1 | | | | | | | |
|SpatialSizeUnitsNotValidAttribute |Attribute 'spatialSizeUnits' is not available on Species objects in SBML Level 1 | | | | | | | |
|SpeciesTypeNotValidAttribute |Attribute 'speciesType' is not available on Species objects in SBML Level 1 | | | | | | | |
|HasOnlySubsUnitsNotValidAttribute |Attribute 'hasOnlySubstanceUnits' is not available on Species objects in SBML Level 1 | | | | | | | |
|IdNotValidAttribute |Attribute 'id' is not available on SpeciesReference objects in SBML Level 1 | | | | | | | |
|NameNotValidAttribute |Attribute 'name' is not available on SpeciesReference objects in SBML Level 1 | | | | | | | |
|SpeciesTypeNotValidComponent |The SpeciesType object is not supported in SBML Level 1 | | | | | | | |
|StoichiometryMathNotValidComponent |The StoichiometryMath object is not supported in SBML Level 1 | | | | | | | |
|MultiplierNotValidAttribute |Attribute 'multiplier' on Unit objects is not supported in SBML Level 1 | | | | | | | |
|OffsetNotValidAttribute |Attribute 'offset' on Unit objects is only available in SBML Level 2 Version 1 | | | | | | | |
|L3SpatialDimensionsUnset |No value given for 'spatialDimensions' attribute; assuming a value of 3 | | | | | | | |
|PackageConversionNotSupported |Conversion of SBML Level 3 package constructs is not yet supported | | | | | | | |
|InvalidTargetLevelVersion |The requested SBML Level/Version combination is not known to exist | | | | | | | |
|L3NotSupported |SBML Level 3 is not yet supported | | | | | | | |
|CompUnknown | | | | | | | | |
|CompNSUndeclared |The comp ns is not correctly declared | | | | | | | |
|CompElementNotInNs |Element not in comp namespace | | | | | | | |
|CompDuplicateComponentId |Duplicate 'id' attribute value | | | | | | | |
|CompUniqueModelIds |Model and ExternalModelDefinitions must have unique ids | | | | | | | |
|CompUniquePortIds |Ports must have unique ids | | | | | | | |
|CompInvalidSIdSyntax |Invalid SId syntax | | | | | | | |
|CompInvalidSubmodelRefSyntax |Invalid submodelRef syntax | | | | | | | |
|CompInvalidDeletionSyntax |Invalid deletion syntax | | | | | | | |
|CompInvalidConversionFactorSyntax |Invalid conversionFactor syntax | | | | | | | |
|CompInvalidNameSyntax |Invalid name syntax | | | | | | | |
|CompReplacedUnitsShouldMatch |Units of replaced elements should match replacement units. | | | | | | | |
|CompOneListOfReplacedElements |Only one allowed. | | | | | | | |
|CompLOReplaceElementsAllowedElements |Allowed children of | | | | | | | |
|CompLOReplacedElementsAllowedAttribs |Allowed attributes | | | | | | | |
|CompEmptyLOReplacedElements | must not be empty | | | | | | | |
|CompOneReplacedByElement |Only one object allowed. | | | | | | | |
|CompAttributeRequiredMissing |Required comp:required attribute on | | | | | | | |
|CompAttributeRequiredMustBeBoolean |The comp:required attribute must be Boolean | | | | | | | |
|CompRequiredTrueIfElementsRemain |The comp:required attribute must be 'true' if math changes | | | | | | | |
|CompRequiredFalseIfAllElementsReplaced |The comp:required attribute must be 'false' if math does not change | | | | | | | |
|CompOneListOfModelDefinitions |Only one allowed. | | | | | | | |
|CompEmptyLOModelDefs | and must not be empty | | | | | | | |
|CompLOModelDefsAllowedElements |Only in | | | | | | | |
|CompLOExtModelDefsAllowedElements |Only in | | | | | | | |
|CompLOModelDefsAllowedAttributes |Allowed attributes | | | | | | | |
|CompLOExtModDefsAllowedAttributes |Allowed attributes | | | | | | | |
|CompOneListOfExtModelDefinitions |Only one allowed. | | | | | | | |
|CompAttributeRequiredMustBeTrue |The comp:required attribute must be 'true' | | | | | | | |
|CompExtModDefAllowedCoreAttributes |Allowed core attributes | | | | | | | |
|CompExtModDefAllowedElements |Allowed elements | | | | | | | |
|CompExtModDefAllowedAttributes |Allowed attributes | | | | | | | |
|CompReferenceMustBeL3 |External models must be L3 | | | | | | | |
|CompModReferenceMustIdOfModel |'modelRef' must be the 'id' of a model in the 'source' document | | | | | | | |
|CompExtModMd5DoesNotMatch |MD5 checksum does not match the 'source' document | | | | | | | |
|CompInvalidSourceSyntax |The 'comp:source' attribute must be of type 'anyURI' | | | | | | | |
|CompInvalidModelRefSyntax |The 'comp:modelRef' attribute must have the syntax of 'SId' | | | | | | | |
|CompInvalidMD5Syntax |The 'comp:md5' attribute must have the syntax of 'string' | | | | | | | |
|CompCircularExternalModelReference |Circular reference in and one allowed | | | | | | | |
|CompNoEmptyListOfOnModel |No empty listOf elements allowed | | | | | | | |
|CompLOSubmodelsAllowedElements |Allowed elements on | | | | | | | |
|CompLOPortsAllowedElements |Allowed elements on | | | | | | | |
|CompLOSubmodelsAllowedAttributes |Allowed attributes on | | | | | | | |
|CompLOPortsAllowedAttributes |Allowed attributes on | | | | | | | |
|CompSubmodelAllowedCoreAttributes |Allowed core attributes on | | | | | | | |
|CompSubmodelAllowedElements |Allowed elements on | | | | | | | |
|CompOneListOfDeletionOnSubmodel |Only one on a allowed | | | | | | | |
|CompSubmodelNoEmptyLODeletions |No empty listOfDeletions elements allowed | | | | | | | |
|CompLODeletionsAllowedElements |Allowed elements on | | | | | | | |
|CompLODeletionAllowedAttributes |Allowed attributes | | | | | | | |
|CompSubmodelAllowedAttributes |Allowed attributes | | | | | | | |
|CompModReferenceSyntax |'comp:modelRef' must conform to SId syntax | | | | | | | |
|CompInvalidTimeConvFactorSyntax |'comp:timeConversionFactor' must conform to SId syntax | | | | | | | |
|CompInvalidExtentConvFactorSyntax |'comp:extentConversionFactor' must conform to SId syntax | | | | | | | |
|CompSubmodelMustReferenceModel |The 'comp:modelRef' attribute must reference a model | | | | | | | |
|CompSubmodelCannotReferenceSelf |The 'comp:modelRef' attribute cannot reference own model | | | | | | | |
|CompModCannotCircularlyReferenceSelf | may not reference that references itself. | | | | | | | |
|CompTimeConversionMustBeParameter |The 'comp:timeConversionFactor' must reference a parameter | | | | | | | |
|CompExtentConversionMustBeParameter |The 'comp:extentConversionFactor' must reference a parameter | | | | | | | |
|CompPortRefMustReferencePort |The 'comp:portRef' attribute must be the 'id' of a | | | | | | | |
|CompIdRefMustReferenceObject |The 'comp:idRef' attribute must be the 'id' of a model element | | | | | | | |
|CompUnitRefMustReferenceUnitDef |The 'comp:unitRef' attribute must be the 'id' of a UnitDefinition | | | | | | | |
|CompMetaIdRefMustReferenceObject |The 'comp:metaIdRef' attribute must be the 'metaid' of an object | | | | | | | |
|CompParentOfSBRefChildMustBeSubmodel |If has a child its parent must be a | | | | | | | |
|CompInvalidPortRefSyntax |The 'comp:portRef' attribute must have the syntax of an SBML SId | | | | | | | |
|CompInvalidIdRefSyntax |The 'comp:idRef' attribute must have the syntax of an SBML SId | | | | | | | |
|CompInvalidUnitRefSyntax |The 'comp:unitRef' attribute must have the syntax of an SBML SId | | | | | | | |
|CompInvalidMetaIdRefSyntax |The 'comp:metaIdRef' attribute must have the syntax of an XML ID | | | | | | | |
|CompOneSBaseRefOnly |Only one | | | | | | | |
|CompDeprecatedSBaseRefSpelling |The spelling 'sbaseRef' is deprecated | | | | | | | |
|CompSBaseRefMustReferenceObject |An SBaseRef must reference an object. | | | | | | | |
|CompSBaseRefMustReferenceOnlyOneObject |An SBaseRef must reference only one other object. | | | | | | | |
|CompNoMultipleReferences |Objects may not be referenced by mutiple SBaseRef constructs. | | | | | | | |
|CompPortMustReferenceObject |Port must reference an object | | | | | | | |
|CompPortMustReferenceOnlyOneObject |Port must reference only one other object. | | | | | | | |
|CompPortAllowedAttributes |Allowed attributes on a Port | | | | | | | |
|CompPortReferencesUnique |Port definitions must be unique. | | | | | | | |
|CompDeletionMustReferenceObject |Deletion must reference an object | | | | | | | |
|CompDeletionMustReferOnlyOneObject |Deletion must reference only one other object. | | | | | | | |
|CompDeletionAllowedAttributes |Allowed attributes on a Deletion | | | | | | | |
|CompReplacedElementMustRefObject |ReplacedElement must reference an object | | | | | | | |
|CompReplacedElementMustRefOnlyOne |ReplacedElement must reference only one other object. | | | | | | | |
|CompReplacedElementAllowedAttributes |Allowed attributes on | | | | | | | |
|CompReplacedElementSubModelRef |The 'comp:submodelRef' attribute must point to a | | | | | | | |
|CompReplacedElementDeletionRef |The 'comp:deletion' attribute must point to a | | | | | | | |
|CompReplacedElementConvFactorRef |The 'comp:conversionFactor attribute must point to a | | | | | | | |
|CompReplacedElementSameReference |No refer to same object | | | | | | | |
|CompReplacedElementNoDelAndConvFact |No with deletion and conversionfactor | | | | | | | |
|CompReplacedByMustRefObject |ReplacedBy must reference an object | | | | | | | |
|CompReplacedByMustRefOnlyOne |ReplacedBy must reference only one other object. | | | | | | | |
|CompReplacedByAllowedAttributes |Allowed attributes on | | | | | | | |
|CompReplacedBySubModelRef |The 'comp:submodelRef' attribute must point to a | | | | | | | |
|CompMustReplaceSameClass |Replaced classes must match. | | | | | | | |
|CompMustReplaceIDs |Replaced IDs must be replaced with IDs. | | | | | | | |
|CompMustReplaceMetaIDs |Replaced metaids must be replaced with metaids. | | | | | | | |
|CompMustReplacePackageIDs |Replaced package IDs must be replaced with package IDs. | | | | | | | |
|CompUnresolvedReference |Unresolved reference. | | | | | | | |
|CompNoModelInReference |No model in referenced document. | | | | | | | |
|CompExtModDefBad |Referenced | | | | | | | |
|FbcAttributeRequiredMustBeBoolean |The fbc:required attribute must be Boolean | | | | | | | |
|FbcRequiredFalse |The fbc:required attribute must be 'false' | | | | | | | |
|FbcOnlyOneEachListOf |One of each list of allowed | | | | | | | |
|FbcNoEmptyListOfs |ListOf elements cannot be empty | | | | | | | |
|FbcLOFluxBoundsAllowedElements |Allowed elements on ListOfFluxBounds | | | | | | | |
|FbcLOObjectivesAllowedElements |Allowed elements on ListOfObjectives | | | | | | | |
|FbcLOFluxBoundsAllowedAttributes |Allowed attributes on ListOfFluxBounds | | | | | | | |
|FbcLOObjectivesAllowedAttributes |Allowed attributes on ListOfObjectives | | | | | | | |
|FbcActiveObjectiveSyntax |Type of activeObjective attribute | | | | | | | |
|FbcActiveObjectiveRefersObjective |ActiveObjective must reference Objective | | | | | | | |
|FbcSpeciesAllowedL3Attributes |Species allowed attributes | | | | | | | |
|FbcSpeciesChargeMustBeInteger |Charge must be integer | | | | | | | |
|FbcSpeciesFormulaMustBeString |Chemical formula must be string | | | | | | | |
|FbcFluxBoundAllowedL3Attributes | may only have 'metaId' and 'sboTerm' from L3 namespace | | | | | | | |
|FbcFluxBoundAllowedElements | may only have and from L3 Core | | | | | | | |
|FbcFluxBoundRequiredAttributes |Invalid attribute found on object | | | | | | | |
|FbcFluxBoundRectionMustBeSIdRef |Datatype for 'fbc:reaction' must be SIdRef | | | | | | | |
|FbcFluxBoundNameMustBeString |The attribute 'fbc:name' must be of the data type string | | | | | | | |
|FbcFluxBoundOperationMustBeEnum |The attribute 'fbc:operation' must be of data type FbcOperation | | | | | | | |
|FbcFluxBoundValueMustBeDouble |The attribute 'fbc:value' must be of the data type double | | | | | | | |
|FbcFluxBoundReactionMustExist |'fbc:reaction' must refer to valid reaction | | | | | | | |
|FbcFluxBoundsForReactionConflict |Conflicting set of FluxBounds for a reaction | | | | | | | |
|FbcObjectiveAllowedL3Attributes | may only have 'metaId' and 'sboTerm' from L3 namespace | | | | | | | |
|FbcObjectiveAllowedElements | may only have and from L3 Core | | | | | | | |
|FbcObjectiveRequiredAttributes |Invalid attribute found on object | | | | | | | |
|FbcObjectiveNameMustBeString |The attribute 'fbc:name' must be of the data type string | | | | | | | |
|FbcObjectiveTypeMustBeEnum |The attribute 'fbc:type' must be of data type FbcType. | | | | | | | |
|FbcObjectiveOneListOfObjectives |An must have one . | | | | | | | |
|FbcObjectiveLOFluxObjMustNotBeEmpty | subobject must not be empty | | | | | | | |
|FbcObjectiveLOFluxObjOnlyFluxObj |Invalid element found in | | | | | | | |
|FbcObjectiveLOFluxObjAllowedAttribs | may only have 'metaId' and 'sboTerm' from L3 core | | | | | | | |
|FbcFluxObjectAllowedL3Attributes | and from L3 Core | | | | | | | |
|FbcFluxObjectRequiredAttributes |Invalid attribute found on | | | | | | | |
|QualAttributeRequiredMustBeBoolean |The qual:required attribute must be Boolean | | | | | | | |
|QualRequiredTrueIfTransitions |The qual:required attribute must be 'true' if math changes | | | | | | | |
|QualOneListOfTransOrQS |Only one or or . | | | | | | | |
|QualLOQualSpeciesAllowedElements |Elements allowed on . | | | | | | | |
|QualLOQualSpeciesAllowedAttributes |Attributes allowed on . | | | | | | | |
|QualQualSpeciesAllowedCoreAttributes |Core attributes allowed on . | | | | | | | |
|QualTransitionAllowedElements |Elements allowed on . | | | | | | | |
|QualTransitionAllowedAttributes |Attributes allowed on . | | | | | | | |
|QualTransitionNameMustBeString |Attribute 'name' on must be string. | | | | | | | |
|QualTransitionLOElements |ListOf elements on . | | | | | | | |
|QualTransitionEmptyLOElements |ListOf elements on not empty. | | | | | | | |
|QualTransitionLOInputElements |Elements on . | | | | | | | |
|QualTransitionLOOutputElements |Elements on . | | | | | | | |
|QualTransitionLOFuncTermElements |Elements on . | | | | | | | |
|QualTransitionLOInputAttributes |Attributes allowed on . | | | | | | | |
|QualTransitionLOOutputAttributes |Attributes allowed on . | | | | | | | |
|QualTransitionLOFuncTermAttributes |Attributes allowed on . | | | | | | | |
|QualTransitionLOFuncTermExceedMax | cannot make qualitativeSpecies exceed maxLevel. | | | | | | | |
|QualTransitionLOFuncTermNegative | cannot make qualitativeSpecies negative. | | | | | | | |
|QualInputAllowedCoreAttributes |Core attributes allowed on . | | | | | | | |
|QualInputAllowedElements |Elements allowed on . | | | | | | | |
|QualInputAllowedAttributes |Attributes allowed on . | | | | | | | |
|QualInputNameMustBeString |Attribute 'name' on must be string. | | | | | | | |
|QualInputSignMustBeSignEnum |Attribute 'sign' on must be enum. | | | | | | | |
|QualInputTransEffectMustBeInputEffect |Attribute 'transitionEffect' on must be enum. | | | | | | | |
|QualInputThreshMustBeInteger |Attribute 'thresholdLevel' on must be non negative integer. | | | | | | | |
|QualInputQSMustBeExistingQS |Attribute 'qualitativeSpecies' on must refer to existing | | | | | | | |
|QualInputConstantCannotBeConsumed |Constant cannot be consumed. | | | | | | | |
|QualInputThreshMustBeNonNegative |Attribute 'thresholdLevel' on must be non negative integer. | | | | | | | |
|QualOutputAllowedCoreAttributes |Core attributes allowed on . | | | | | | | |
|QualOutputAllowedElements |Elements allowed on . | | | | | | | |
|QualOutputAllowedAttributes |Attributes allowed on . | | | | | | | |
|QualOutputNameMustBeString |Attribute 'name' on must be string. | | | | | | | |
|QualOutputTransEffectMustBeOutput |Attribute 'transitionEffect' on must be enum. | | | | | | | |
|QualOutputLevelMustBeInteger |Attribute 'outputLevel' on must be non negative integer. | | | | | | | |
|QualOutputQSMustBeExistingQS |Attribute 'qualitativeSpecies' on must refer to existing | | | | | | | |
|QualOutputConstantMustBeFalse |Constant 'qualitativeSpecies' cannot be | | | | | | | |
|QualOutputProductionMustHaveLevel | being produced must have level | | | | | | | |
|QualOutputLevelMustBeNonNegative |Attribute 'outputLevel' on must be non negative integer. | | | | | | | |
|QualDefaultTermAllowedCoreAttributes |Core attributes allowed on . | | | | | | | |
|QualDefaultTermAllowedElements |Elements allowed on . | | | | | | | |
|QualDefaultTermAllowedAttributes |Attributes allowed on . | | | | | | | |
|QualDefaultTermResultMustBeInteger |Attribute 'resultLevel' on must be non negative integer. | | | | | | | |
|QualDefaultTermResultMustBeNonNeg |Attribute 'resultLevel' on must be non negative integer. | | | | | | | |
|QualFuncTermAllowedCoreAttributes |Core attributes allowed on . | | | | | | | |
|QualFuncTermAllowedElements |Elements allowed on . | | | | | | | |
|QualFuncTermAllowedAttributes |Attributes allowed on . | | | | | | | |
|QualFuncTermOnlyOneMath |Only one on . | | | | | | | |
|QualFuncTermResultMustBeInteger |Attribute 'resultLevel' on must be non negative integer. | | | | | | | |
|QualFuncTermResultMustBeNonNeg |Attribute 'resultLevel' on must be non negative integer. | | | | | | | |
|LayoutUnknownError | | | | | | | | |
|LayoutNSUndeclared |The layout ns is not correctly declared | | | | | | | |
|LayoutElementNotInNs |Element not in layout namespace | | | | | | | |
|LayoutDuplicateComponentId |Duplicate 'id' attribute value | | | | | | | |
|LayoutSIdSyntax |'id' attribute incorrect syntax | | | | | | | |
|LayoutXsiTypeAllowedLocations |'xsi:type' allowed locations | | | | | | | |
|LayoutXsiTypeSyntax |'xsi:type' attribute incorrect syntax | | | | | | | |
|LayoutAttributeRequiredMissing |Required layout:required attribute on | | | | | | | |
|LayoutAttributeRequiredMustBeBoolean |The layout:required attribute must be Boolean | | | | | | | |
|LayoutRequiredFalse |The layout:required attribute must be 'false' | | | | | | | |
|LayoutOnlyOneLOLayouts |Only one listOfLayouts on | | | | | | | |
|LayoutLOLayoutsNotEmpty |ListOf elements cannot be empty | | | | | | | |
|LayoutLOLayoutsAllowedElements |Allowed elements on ListOfLayouts | | | | | | | |
|LayoutLOLayoutsAllowedAttributes |Allowed attributes on ListOfLayouts | | | | | | | |
|LayoutLayoutAllowedElements |Allowed elements on Layout | | | | | | | |
|LayoutLayoutAllowedCoreAttributes |Allowed core attributes on Layout | | | | | | | |
|LayoutOnlyOneEachListOf |Only one each listOf on | | | | | | | |
|LayoutNoEmptyListOfs |ListOf elements cannot be empty | | | | | | | |
|LayoutLayoutAllowedAttributes | must have 'id' and may have 'name' | | | | | | | |
|LayoutLayoutNameMustBeString |'name' must be string | | | | | | | |
|LayoutLOCompGlyphAllowedAttributes |Attributes allowed on . | | | | | | | |
|LayoutLOCompGlyphAllowedElements |Elements allowed on . | | | | | | | |
|LayoutLOSpeciesGlyphAllowedAttributes |Attributes allowed on . | | | | | | | |
|LayoutLOSpeciesGlyphAllowedElements |Elements allowed on . | | | | | | | |
|LayoutLORnGlyphAllowedAttributes |Attributes allowed on . | | | | | | | |
|LayoutLORnGlyphAllowedElements |Elements allowed on . | | | | | | | |
|LayoutLOAddGOAllowedAttribut |Attributes allowed on . | | | | | | | |
|LayoutLOAddGOAllowedElements |Elements allowed on . | | | | | | | |
|LayoutLayoutMustHaveDimensions |Layout must have . | | | | | | | |
|LayoutLOTextGlyphAllowedAttributes |Attributes allowed on . | | | | | | | |
|LayoutLOTextGlyphAllowedElements |Elements allowed on . | | | | | | | |
|LayoutGOAllowedCoreElements |Core elements allowed on . | | | | | | | |
|LayoutGOAllowedCoreAttributes |Core attributes allowed on . | | | | | | | |
|LayoutGOAllowedElements |Layout elements allowed on . | | | | | | | |
|LayoutGOAllowedAttributes |Layout attributes allowed on . | | | | | | | |
|LayoutGOMetaIdRefMustBeIDREF |Layout 'metIdRef' must be IDREF. | | | | | | | |
|LayoutGOMetaIdRefMustReferenceObject |Layout 'metIdRef' must reference existing object. | | | | | | | |
|LayoutGOMustContainBoundingBox |A must contain a . | | | | | | | |
|LayoutCGAllowedCoreElements |Core elements allowed on . | | | | | | | |
|LayoutCGAllowedCoreAttributes |Core attributes allowed on . | | | | | | | |
|LayoutCGAllowedElements |Layout elements allowed on . | | | | | | | |
|LayoutCGAllowedAttributes |Layout attributes allowed on . | | | | | | | |
|LayoutCGMetaIdRefMustBeIDREF |Layout 'metIdRef' must be IDREF. | | | | | | | |
|LayoutCGMetaIdRefMustReferenceObject |Layout 'metIdRef' must reference existing object. | | | | | | | |
|LayoutCGCompartmentSyntax |CompartmentGlyph 'compartment' must have SIdRef syntax. | | | | | | | |
|LayoutCGCompartmentMustRefComp |CompartmentGlyph compartment must reference existing compartment. | | | | | | | |
|LayoutCGNoDuplicateReferences |CompartmentGlyph cannot reference two objects. | | | | | | | |
|LayoutCGOrderMustBeDouble |CompartmentGlyph order must be double. | | | | | | | |
|LayoutSGAllowedCoreElements |Core elements allowed on . | | | | | | | |
|LayoutSGAllowedCoreAttributes |Core attributes allowed on . | | | | | | | |
|LayoutSGAllowedElements |Layout elements allowed on . | | | | | | | |
|LayoutSGAllowedAttributes |Layout attributes allowed on . | | | | | | | |
|LayoutSGMetaIdRefMustBeIDREF |Layout 'metIdRef' must be IDREF. | | | | | | | |
|LayoutSGMetaIdRefMustReferenceObject |Layout 'metIdRef' must reference existing object. | | | | | | | |
|LayoutSGSpeciesSyntax |SpeciesGlyph 'species' must have SIdRef syntax. | | | | | | | |
|LayoutSGSpeciesMustRefSpecies |SpeciesGlyph species must reference existing species. | | | | | | | |
|LayoutSGNoDuplicateReferences |SpeciesGlyph cannot reference two objects. | | | | | | | |
|LayoutRGAllowedCoreElements |Core elements allowed on . | | | | | | | |
|LayoutRGAllowedCoreAttributes |Core attributes allowed on . | | | | | | | |
|LayoutRGAllowedElements |Layout elements allowed on . | | | | | | | |
|LayoutRGAllowedAttributes |Layout attributes allowed on . | | | | | | | |
|LayoutRGMetaIdRefMustBeIDREF |Layout 'metIdRef' must be IDREF. | | | | | | | |
|LayoutRGMetaIdRefMustReferenceObject |Layout 'metIdRef' must reference existing object. | | | | | | | |
|LayoutRGReactionSyntax |ReactionGlyph 'reaction' must have SIdRef syntax. | | | | | | | |
|LayoutRGReactionMustRefReaction |ReactionGlyph reaction must reference existing reaction. | | | | | | | |
|LayoutRGNoDuplicateReferences |ReactionGlyph cannot reference two objects. | | | | | | | |
|LayoutLOSpeciesRefGlyphAllowedElements |Allowed elements on ListOfSpeciesReferenceGlyphs | | | | | | | |
|LayoutLOSpeciesRefGlyphAllowedAttribs |Allowed attributes on ListOfSpeciesReferenceGlyphs | | | | | | | |
|LayoutLOSpeciesRefGlyphNotEmpty |ListOfSpeciesReferenceGlyphs not empty | | | | | | | |
|LayoutGGAllowedCoreElements |Core elements allowed on . | | | | | | | |
|LayoutGGAllowedCoreAttributes |Core attributes allowed on . | | | | | | | |
|LayoutGGAllowedElements |Layout elements allowed on . | | | | | | | |
|LayoutGGAllowedAttributes |Layout attributes allowed on . | | | | | | | |
|LayoutGGMetaIdRefMustBeIDREF |Layout 'metIdRef' must be IDREF. | | | | | | | |
|LayoutGGMetaIdRefMustReferenceObject |Layout 'metIdRef' must reference existing object. | | | | | | | |
|LayoutGGReferenceSyntax |GeneralGlyph 'reference' must have SIdRef syntax. | | | | | | | |
|LayoutGGReferenceMustRefObject |GeneralGlyph 'reference' must reference existing element. | | | | | | | |
|LayoutGGNoDuplicateReferences |GeneralGlyph cannot reference two objects. | | | | | | | |
|LayoutLOReferenceGlyphAllowedElements |Allowed elements on ListOfReferenceGlyphs | | | | | | | |
|LayoutLOReferenceGlyphAllowedAttribs |Allowed attributes on ListOfReferenceGlyphs | | | | | | | |
|LayoutLOSubGlyphAllowedElements | | | | | | | | |
|LayoutLOSubGlyphAllowedAttribs |Allowed attributes on ListOfSubGlyphs | | | | | | | |
|LayoutTGAllowedCoreElements |Core elements allowed on . | | | | | | | |
|LayoutTGAllowedCoreAttributes |Core attributes allowed on . | | | | | | | |
|LayoutTGAllowedElements |Layout elements allowed on . | | | | | | | |
|LayoutTGAllowedAttributes |Layout attributes allowed on . | | | | | | | |
|LayoutTGMetaIdRefMustBeIDREF |Layout 'metIdRef' must be IDREF. | | | | | | | |
|LayoutTGMetaIdRefMustReferenceObject |Layout 'metIdRef' must reference existing object. | | | | | | | |
|LayoutTGOriginOfTextSyntax |TextGlyph 'originOfText' must have SIdRef syntax. | | | | | | | |
|LayoutTGOriginOfTextMustRefObject |TextGlyph 'originOfText' must reference existing element. | | | | | | | |
|LayoutTGNoDuplicateReferences |TextGlyph cannot reference two objects. | | | | | | | |
|LayoutTGGraphicalObjectSyntax |TextGlyph 'graphicalObject' must have SIdRef syntax. | | | | | | | |
|LayoutTGGraphicalObjectMustRefObject |TextGlyph 'graphicalObject' must reference existing element. | | | | | | | |
|LayoutTGTextMustBeString |TextGlyph 'text' must be string. | | | | | | | |
|LayoutSRGAllowedCoreElements |Core elements allowed on . | | | | | | | |
|LayoutREFGAllowedCoreAttributes |Core attributes allowed on . | | | | | | | |
|LayoutREFGAllowedElements |Layout elements allowed on . | | | | | | | |
|LayoutREFGAllowedAttributes |Layout attributes allowed on . | | | | | | | |
|LayoutREFGMetaIdRefMustBeIDREF |Layout 'metIdRef' must be IDREF. | | | | | | | |
|LayoutREFGMetaIdRefMustReferenceObject |Layout 'metIdRef' must reference existing object. | | | | | | | |
|LayoutREFGReferenceSyntax |ReferenceGlyph 'reference' must have SIdRef syntax. | | | | | | | |
|LayoutREFGReferenceMustRefObject |ReferenceGlyph 'reference' must reference existing element. | | | | | | | |
|LayoutREFGNoDuplicateReferences |ReferenceGlyph cannot reference two objects. | | | | | | | |
|LayoutREFGGlyphSyntax |ReferenceGlyph 'glyph' must have SIdRef syntax. | | | | | | | |
|LayoutREFGGlyphMustRefObject |ReferenceGlyph 'glyph' must reference existing element. | | | | | | | |
|LayoutREFGRoleSyntax |ReferenceGlyph 'role' must be string. | | | | | | | |
|LayoutPointAllowedCoreElements |Core elements allowed on . | | | | | | | |
|LayoutPointAllowedCoreAttributes |Core attributes allowed on . | | | | | | | |
|LayoutPointAllowedAttributes |Layout attributes allowed on . | | | | | | | |
|LayoutPointAttributesMustBeDouble |Layout 'x', 'y' and 'z' must be double. | | | | | | | |
|LayoutBBoxAllowedCoreElements |Core elements allowed on . | | | | | | | |
|LayoutBBoxAllowedCoreAttributes |Core attributes allowed on . | | | | | | | |
|LayoutBBoxAllowedElements |Layout elements allowed on . | | | | | | | |
|LayoutBBoxAllowedAttributes |Layout attributes allowed on . | | | | | | | |
|LayoutBBoxConsistent3DDefinition |Layout consistent dimensions on a | | | | | | | |
|LayoutCurveAllowedCoreElements |Core elements allowed on . | | | | | | | |
|LayoutCurveAllowedCoreAttributes |Core attributes allowed on . | | | | | | | |
|LayoutCurveAllowedElements |Layout elements allowed on . | | | | | | | |
|LayoutCurveAllowedAttributes |Layout attributes allowed on . | | | | | | | |
|LayoutLOCurveSegsAllowedAttributes |Allowed attributes on ListOfCurveSegments | | | | | | | |
|LayoutLOCurveSegsAllowedElements |Allowed elements on ListOfCurveSegments | | | | | | | |
|LayoutLOCurveSegsNotEmpty |No empty ListOfCurveSegments | | | | | | | |
|LayoutLSegAllowedCoreElements |Core elements allowed on . | | | | | | | |
|LayoutLSegAllowedCoreAttributes |Core attributes allowed on . | | | | | | | |
|LayoutLSegAllowedElements |Layout elements allowed on . | | | | | | | |
|LayoutLSegAllowedAttributes |Layout attributes allowed on . | | | | | | | |
|LayoutCBezAllowedCoreElements |Core elements allowed on . | | | | | | | |
|LayoutCBezAllowedCoreAttributes |Core attributes allowed on . | | | | | | | |
|LayoutCBezAllowedElements |Layout elements allowed on . | | | | | | | |
|LayoutCBezAllowedAttributes |Layout attributes allowed on . | | | | | | | |
|LayoutDimsAllowedCoreElements |Core elements allowed on . | | | | | | | |
|LayoutDimsAllowedCoreAttributes |Core attributes allowed on . | | | | | | | |
|LayoutDimsAllowedAttributes |Layout attributes allowed on . | | | | | | | |
|LayoutDimsAttributesMustBeDouble |Layout 'width', 'height' and 'depth' must be double. | | | | | | | |
+----------------------------------------+------------------------------------------------------------------------------------------------------+-------+-------+-------+-------+-------+-------+-------+
Category codes associated with SBMLError objects
......................................................................
As discussed above, each SBMLError object contains a value for a
category identifier, describing the type of issue that the SBMLError
object represents. The category can be retrieved from an SBMLError
object using the method SBMLError.getCategory(). The following table
lists each possible value and a brief description of its meaning.
As is the case with the error codes, in the libSBML Python language
interface, the category identifiers are currently implemented as
static integer constants defined in the interface class libsbml.
The following table lists each possible value and a brief description
of its meaning.
LIBSBML_CAT_SBML General error not falling into another category below.
LIBSBML_CAT_SBML_L1_COMPAT Category of errors that can only occur during attempted translation from one Level/Version of SBML to another. This particular category applies to errors encountered while trying to convert a model from SBML Level 2 to SBML Level 1.
LIBSBML_CAT_SBML_L2V1_COMPAT Category of errors that can only occur during attempted translation from one Level/Version of SBML to another. This particular category applies to errors encountered while trying to convert a model to SBML Level 2 Version 1.
LIBSBML_CAT_SBML_L2V2_COMPAT Category of errors that can only occur during attempted translation from one Level/Version of SBML to another. This particular category applies to errors encountered while trying to convert a model to SBML Level 2 Version 2.
LIBSBML_CAT_GENERAL_CONSISTENCY Category of errors that can occur while validating general SBML constructs. With respect to the SBML specification, these concern failures in applying the validation rules numbered 2xxxx in the Level 2 Versions 2-4 and Level 3 Version 1 specifications.
LIBSBML_CAT_IDENTIFIER_CONSISTENCY Category of errors that can occur while validating symbol identifiers in a model. With respect to the SBML specification, these concern failures in applying the validation rules numbered 103xx in the Level 2 Versions 2-4 and Level 3 Version 1 specifications.
LIBSBML_CAT_UNITS_CONSISTENCY Category of errors that can occur while validating the units of measurement on quantities in a model. With respect to the SBML specification, these concern failures in applying the validation rules numbered 105xx in the Level 2 Versions 2-4 and Level 3 Version 1 specifications.
LIBSBML_CAT_MATHML_CONSISTENCY Category of errors that can occur while validating MathML formulas in a model. With respect to the SBML specification, these concern failures in applying the validation rules numbered 102xx in the Level 2 Versions 2-4 and Level 3 Version 1 specifications.
LIBSBML_CAT_SBO_CONSISTENCY Category of errors that can occur while validating SBO identifiers in a model. With respect to the SBML specification, these concern failures in applying the validation rules numbered 107xx in the Level 2 Versions 2-4 and Level 3 Version 1 specifications.
LIBSBML_CAT_OVERDETERMINED_MODEL Error in the system of equations in the model: the system is overdetermined, therefore violating a tenet of proper SBML. With respect to the SBML specification, this is validation rule #10601 in the SBML Level 2 Versions 2-4 and Level 3 Version 1 specifications.
LIBSBML_CAT_SBML_L2V3_COMPAT Category of errors that can only occur during attempted translation from one Level/Version of SBML to another. This particular category applies to errors encountered while trying to convert a model to SBML Level 2 Version 3.
LIBSBML_CAT_MODELING_PRACTICE Category of warnings about recommended good practices involving SBML and computational modeling. (These are tests performed by libSBML and do not have equivalent SBML validation rules.)
LIBSBML_CAT_INTERNAL_CONSISTENCY Category of errors that can occur while validating libSBML's internal representation of SBML constructs. (These are tests performed by libSBML and do not have equivalent SBML validation rules.)
LIBSBML_CAT_SBML_L2V4_COMPAT Category of errors that can only occur during attempted translation from one Level/Version of SBML to another. This particular category applies to errors encountered while trying to convert a model to SBML Level 2 Version 4.
LIBSBML_CAT_SBML_L3V1_COMPAT Category of errors that can only occur during attempted translation from one Level/Version of SBML to another. This particular category applies to errors encountered while trying to convert a model to SBML Level 3 Version 1.
Severity codes associated
with SBMLError objects
......................................................................
In libSBML version there are no additional severity codes beyond
those defined by XMLError. They are implemented as static integer
constants defined in the interface class libsbml, and have names
beginning with LIBSBML_SEV_.
"""
__swig_setmethods__ = {}
for _s in [XMLError]:
__swig_setmethods__.update(getattr(_s, '__swig_setmethods__', {}))
__setattr__ = lambda self, name, value: _swig_setattr(self, SBMLError, name, value)
__swig_getmethods__ = {}
for _s in [XMLError]:
__swig_getmethods__.update(getattr(_s, '__swig_getmethods__', {}))
__getattr__ = lambda self, name: _swig_getattr(self, SBMLError, name)
__repr__ = _swig_repr
def __init__(self, *args):
"""
__init__(SBMLError self, unsigned int const errorId=0, unsigned int const level, unsigned int const version, string details, unsigned int const line=0, unsigned int const column=0, unsigned int const severity=LIBSBML_SEV_ERROR, unsigned int const category=LIBSBML_CAT_SBML, string package, unsigned int const pkgVersion=1) -> SBMLError
__init__(SBMLError self, unsigned int const errorId=0, unsigned int const level, unsigned int const version, string details, unsigned int const line=0, unsigned int const column=0, unsigned int const severity=LIBSBML_SEV_ERROR, unsigned int const category=LIBSBML_CAT_SBML, string package) -> SBMLError
__init__(SBMLError self, unsigned int const errorId=0, unsigned int const level, unsigned int const version, string details, unsigned int const line=0, unsigned int const column=0, unsigned int const severity=LIBSBML_SEV_ERROR, unsigned int const category=LIBSBML_CAT_SBML) -> SBMLError
__init__(SBMLError self, unsigned int const errorId=0, unsigned int const level, unsigned int const version, string details, unsigned int const line=0, unsigned int const column=0, unsigned int const severity=LIBSBML_SEV_ERROR) -> SBMLError
__init__(SBMLError self, unsigned int const errorId=0, unsigned int const level, unsigned int const version, string details, unsigned int const line=0, unsigned int const column=0) -> SBMLError
__init__(SBMLError self, unsigned int const errorId=0, unsigned int const level, unsigned int const version, string details, unsigned int const line=0) -> SBMLError
__init__(SBMLError self, unsigned int const errorId=0, unsigned int const level, unsigned int const version, string details) -> SBMLError
__init__(SBMLError self, unsigned int const errorId=0, unsigned int const level, unsigned int const version) -> SBMLError
__init__(SBMLError self, unsigned int const errorId=0, unsigned int const level) -> SBMLError
__init__(SBMLError self, unsigned int const errorId=0) -> SBMLError
__init__(SBMLError self) -> SBMLError
__init__(SBMLError self, SBMLError orig) -> SBMLError
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
SBMLError(SBMLError orig)
Copy constructor; creates a copy of this SBMLError.
______________________________________________________________________
Method variant with the following signature:
SBMLError( long errorId = 0 , long level =
SBML_DEFAULT_LEVEL , long version = SBML_DEFAULT_VERSION , string
details = '' , long line = 0 , long column = 0 , long
severity = LIBSBML_SEV_ERROR , long category = LIBSBML_CAT_SBML ,
string package = 'core' , long pkgVersion = 1 )
Creates a new SBMLError to report that something occurred during SBML
processing.
When a libSBML operation on SBML content results in a warning, error
or other diagnostic, the issue is reported as an SBMLError object.
SBMLError objects have identification numbers to indicate the nature
of the exception. These numbers are defined as longeger constants in
the interface class libsbml. See the top of this documentation page
for a table listing the possible values and their meanings. The
argument 'errorId' to this constructor can be (but does not have to
be) a value from this set of constants. If it is one of the
predefined error identifiers, the SBMLError class assumes the error is
a low-level system or SBML layer error and prepends a built-in,
predefined error message to any string passed in the argument
'details' to this constructor. In addition, all the predefined error
identifiers have associated values for the 'severity' and 'category'
codes, and these fields are filled-in using the libSBML defaults for
each different error identifier.
If the error identifier 'errorId' is a number greater than 99999, the
SBMLError class assumes the error was generated from another part of
the software and does not do additional filling in of values beyond
the default in the constructor itself. This allows SBMLError to serve
as a base class for other errors, such as for user-defined validation
rules (see Validator). Callers should fill in all the parameters with
suitable values if generating errors with codes greater than 99999 to
make maximum use of the SBMLError facilities.
As mentioned above, there are additional constants defined for
standard severity and standard category codes, and every predefined
error in libSBML has an associated value for severity and category
taken from these predefined sets. These constants have symbol names
prefixed with LIBSBML_SEV_ and LIBSBML_CAT_, respectively. If the
value of 'errorId' is one of the standard error codes, callers do not
need to fill in 'severity' and 'category' in a call to this
constructor. Conversely, if 'errorId' is not an existing SBML-level
error code, callers can use other values for 'severity' and
'category'.
Please see the top of the documentation for SBMLError for a longer
discussion of the possible error codes, their meanings, and their
applicability to different combinations of Level+Version of SBML.
Parameter 'errorId' is a long integer, the identification number of
the error.
Parameter 'level' is the SBML Level of the SBML model
Parameter 'version' is the SBML Version within the Level of the SBML
model
Parameter 'details' is a string containing additional details about
the error. If the error code in 'errorId' is one that is recognized by
SBMLError, the given message is appended to a predefined message
associated with the given code. If the error code is not recognized,
the message is stored as-is as the text of the error.
Parameter 'line' is a long integer, the line number at which the error
occured.
Parameter 'column' is a long integer, the column number at which the
error occured.
Parameter 'severity' is an integer indicating severity of the error.
Parameter 'category' is an integer indicating the category to which
the error belongs.
Parameter 'package' is the SBML Level package involved.
Parameter 'pkgVersion' is the version of the 'package'.
"""
this = _libsbml.new_SBMLError(*args)
try:
self.this.append(this)
except:
self.this = this
__swig_destroy__ = _libsbml.delete_SBMLError
__del__ = lambda self: None
SBMLError_swigregister = _libsbml.SBMLError_swigregister
SBMLError_swigregister(SBMLError)
_libsbml.MODEL_QUALIFIER_swigconstant(_libsbml)
MODEL_QUALIFIER = _libsbml.MODEL_QUALIFIER
_libsbml.BIOLOGICAL_QUALIFIER_swigconstant(_libsbml)
BIOLOGICAL_QUALIFIER = _libsbml.BIOLOGICAL_QUALIFIER
_libsbml.UNKNOWN_QUALIFIER_swigconstant(_libsbml)
UNKNOWN_QUALIFIER = _libsbml.UNKNOWN_QUALIFIER
_libsbml.BQM_IS_swigconstant(_libsbml)
BQM_IS = _libsbml.BQM_IS
_libsbml.BQM_IS_DESCRIBED_BY_swigconstant(_libsbml)
BQM_IS_DESCRIBED_BY = _libsbml.BQM_IS_DESCRIBED_BY
_libsbml.BQM_IS_DERIVED_FROM_swigconstant(_libsbml)
BQM_IS_DERIVED_FROM = _libsbml.BQM_IS_DERIVED_FROM
_libsbml.BQM_IS_INSTANCE_OF_swigconstant(_libsbml)
BQM_IS_INSTANCE_OF = _libsbml.BQM_IS_INSTANCE_OF
_libsbml.BQM_HAS_INSTANCE_swigconstant(_libsbml)
BQM_HAS_INSTANCE = _libsbml.BQM_HAS_INSTANCE
_libsbml.BQM_UNKNOWN_swigconstant(_libsbml)
BQM_UNKNOWN = _libsbml.BQM_UNKNOWN
_libsbml.BQB_IS_swigconstant(_libsbml)
BQB_IS = _libsbml.BQB_IS
_libsbml.BQB_HAS_PART_swigconstant(_libsbml)
BQB_HAS_PART = _libsbml.BQB_HAS_PART
_libsbml.BQB_IS_PART_OF_swigconstant(_libsbml)
BQB_IS_PART_OF = _libsbml.BQB_IS_PART_OF
_libsbml.BQB_IS_VERSION_OF_swigconstant(_libsbml)
BQB_IS_VERSION_OF = _libsbml.BQB_IS_VERSION_OF
_libsbml.BQB_HAS_VERSION_swigconstant(_libsbml)
BQB_HAS_VERSION = _libsbml.BQB_HAS_VERSION
_libsbml.BQB_IS_HOMOLOG_TO_swigconstant(_libsbml)
BQB_IS_HOMOLOG_TO = _libsbml.BQB_IS_HOMOLOG_TO
_libsbml.BQB_IS_DESCRIBED_BY_swigconstant(_libsbml)
BQB_IS_DESCRIBED_BY = _libsbml.BQB_IS_DESCRIBED_BY
_libsbml.BQB_IS_ENCODED_BY_swigconstant(_libsbml)
BQB_IS_ENCODED_BY = _libsbml.BQB_IS_ENCODED_BY
_libsbml.BQB_ENCODES_swigconstant(_libsbml)
BQB_ENCODES = _libsbml.BQB_ENCODES
_libsbml.BQB_OCCURS_IN_swigconstant(_libsbml)
BQB_OCCURS_IN = _libsbml.BQB_OCCURS_IN
_libsbml.BQB_HAS_PROPERTY_swigconstant(_libsbml)
BQB_HAS_PROPERTY = _libsbml.BQB_HAS_PROPERTY
_libsbml.BQB_IS_PROPERTY_OF_swigconstant(_libsbml)
BQB_IS_PROPERTY_OF = _libsbml.BQB_IS_PROPERTY_OF
_libsbml.BQB_HAS_TAXON_swigconstant(_libsbml)
BQB_HAS_TAXON = _libsbml.BQB_HAS_TAXON
_libsbml.BQB_UNKNOWN_swigconstant(_libsbml)
BQB_UNKNOWN = _libsbml.BQB_UNKNOWN
class CVTerm(_object):
"""
A MIRIAM-compliant controlled vocabulary term.
The SBML Level 2 and Level 3 specifications define a simple format
for annotating models when (a) referring to controlled vocabulary
terms and database identifiers that define and describe biological and
biochemical entities, and (b) describing the creator of a model and
the model's modification history. This SBML format is a concrete
syntax that conforms to the guidelines of MIRIAM ('Minimum Information
Requested in the Annotation of biochemical Models', Nature
Biotechnology, vol. 23, no. 12, Dec. 2005). The format uses a subset
of W3C RDF (Resource Description Format). In order to help
application developers work with annotations in this format, libSBML
provides several helper classes that provide higher-level interfaces
to the data elements; these classes include CVTerm, ModelCreator,
ModelHistory, RDFAnnotationParser, and Date.
Components of an SBML annotation
======================================================================
The SBML annotation format consists of RDF-based content placed inside
an element attached to an SBML component such as Species,
Compartment, etc. A small change was introduced in SBML Level 2
Version 5 and SBML Level 3 Version 2 to permit nested annotations:
lower Versions of the SBML specifications did not explicitly allow
this. We first describe the different parts of SBML annotations in
XML form for SBML Level 2 below Version 5 and SBML Level 3 below
Version 2:
+++
+++
HISTORY
...
...
+++
+++
+++
In the template above, the placeholder SBML_ELEMENT stands for the
XML tag name of an SBML model component (e.g., model, reaction, etc.)
and the placeholder meta id stands for the element's meta identifier,
which is a field available on all SBML components derived from the
SBase base object class. The dotted portions are optional, the symbol
+++ is a placeholder for either no content or valid XML content that
is not defined by this annotation scheme, and the ellipses ... are
placeholders for zero or more elements of the same form as the
immediately preceding element. The optional content HISTORY is a
creation and modification history; in libSBML, this is stored using
ModelHistory objects.
The placeholder RELATION_ELEMENT refers to a BioModels.net qualifier
element name. This is an element in either the XML namespace
'http://biomodels.net/model-qualifiers' (for model qualifiers) or
'http://biomodels.net/biology-qualifiers' (for biological qualifier).
Note that these namespace URIs are only labels, and not actual Web
locations, which means you cannot visit an address such as
'http://biomodels.net/model-qualifiers' in your browser or try to have
your application access it.
The URI is a required data value that uniquely identifies a resource
and data within that resource to which the annotation refers. Again,
being URIs, these do not refer to physical Web locations;
nevertheless, applications will often want a means of finding the
resource to which a given URI refers. Providing the facilities for
this task is the purpose of MIRIAM Resources, described in detail
online at http://biomodels.net/miriam) and also in the paper 'MIRIAM
Resources: tools to generate and resolve robust cross-references in
Systems Biology', BMC Systems Biology, 58(1), 2007.
Finally, the following is the same template as above, but this time
showing the nested content permitted by the most recent SBML
specifications (SBML Level 2 Version 5 and Level 3 Version 2):
+++
+++
HISTORY
NESTED_CONTENT
...
...
+++
+++
+++
The placeholder NESTED_CONTENT refers to other optional RDF elements
such as 'bqbiol:isDescribedBy' that describe a clarification or
another annotation about the RELATION_ELEMENT in which it appears.
Nested content allows one to, for example, describe protein
modifications on species, or to add evidence codes for an annotation.
Nested content relates to its containing RELATION_ELEMENT, not the
other way around. It qualifies it, but does not change its meaning.
As such, ignoring a NESTED_CONTENT does not affect the information
provided by the containing RELATION_ELEMENT.
For more information about SBML annotations in general, please refer
to Section 6 in the SBML Level 2 (Versions 2-4) or Level 3
specification documents.
The parts of a CVTerm
======================================================================
Annotations that refer to controlled vocabularies are managed in
libSBML using CVTerm objects. The relation-resource pairs discussed
in the previous section are the 'controlled vocabulary' terms that
CVTerm is designed to store and manipulate. A set of RDF-based
annotations attached to a given SBML element are read by
RDFAnnotationParser and converted into a list of these CVTerm objects.
Each CVTerm object instance stores the following components of an
annotation:
* The qualifier, which can be a BioModels.net 'biological
qualifier', a BioModels.net 'model qualifier', or an unknown qualifier
(as far as the CVTerm class is concerned). Qualifiers are used in
MIRIAM to indicate the nature of the relationship between the object
being annotated and the resource. In CVTerm, the qualifiers can be
manipulated using the methods CVTerm.getQualifierType(),
CVTerm.setQualifierType(), and related methods.
* The resource, represented by a URI (which, we must remind
developers, is not the same as a URL). In the CVTerm class, the
resource component can be manipulated using the methods
CVTerm.addResource() and CVTerm.removeResource().
Note that a CVTerm contains a single qualifier, but possibly more than
one resource. This corresponds to the possibility of an annotation
that points to multiple resources, all of which are qualified by the
same BioModels.net qualifier. The CVTerm object class supports this
by supporting a list of resources.
Detailed explanations of the qualifiers defined by BioModels.net can
be found at http://co.mbine.org/standards/qualifiers.
"""
__swig_setmethods__ = {}
__setattr__ = lambda self, name, value: _swig_setattr(self, CVTerm, name, value)
__swig_getmethods__ = {}
__getattr__ = lambda self, name: _swig_getattr(self, CVTerm, name)
__repr__ = _swig_repr
__swig_destroy__ = _libsbml.delete_CVTerm
__del__ = lambda self: None
def __init__(self, *args):
"""
__init__(CVTerm self, QualifierType_t type=UNKNOWN_QUALIFIER) -> CVTerm
__init__(CVTerm self) -> CVTerm
__init__(CVTerm self, XMLNode node) -> CVTerm
__init__(CVTerm self, CVTerm orig) -> CVTerm
This method has multiple variants; they differ in the arguments they
accept. Each variant is described separately below.
______________________________________________________________________
Method variant with the following signature:
CVTerm(CVTerm orig)
Copy constructor; creates a copy of a CVTerm object.
Parameter 'orig' is the CVTerm instance to copy.
Throws SBMLConstructorException: Thrown if the argument 'orig' is
None.
______________________________________________________________________
Method variant with the following signature:
CVTerm( XMLNode node)
Creates a new CVTerm from the given XMLNode.
The SBML Level 2 and Level 3 specifications define a simple format
for annotating models when (a) referring to controlled vocabulary
terms and database identifiers that define and describe biological and
other entities, and (b) describing the creator of a model and the
model's modification history. The annotation content is stored in
elements attached to individual SBML elements. The
format for storing the content inside SBML elements is a
subset of W3C RDF (Resource Description Format) expressed in XML. The
CVTerm class provides a programming interface for working directly
with controlled vocabulary term ('CV term') objects without having to
deal directly with the XML form. When libSBML reads in an SBML model
containing RDF annotations, it parses those annotations into a list of
CVTerm objects, and when writing a model, it parses the CVTerm objects
back into the appropriate SBML structure.
This method creates a CVTerm object from the given XMLNode object
'node'. XMLNode is libSBML's representation of a node in an XML tree
of elements, and each such element can be placed in a namespace. This
constructor looks for the element to be in the XML namespaces
'http://biomodels.net/model-qualifiers' (for model qualifiers) and
'http://biomodels.net/biology-qualifiers' (for biological qualifier),
and if they are, creates CVTerm objects for the result.
Parameter 'node' is an XMLNode representing a CVTerm.
Note:
This method assumes that the given XMLNode object 'node' is of the
correct structural form.
______________________________________________________________________
Method variant with the following signature:
CVTerm(QualifierType_t type = UNKNOWN_QUALIFIER)
Creates an empty CVTerm, optionally with the given qualifier 'type'.
The SBML Level 2 and Level 3 specifications define a simple format
for annotating models when (a) referring to controlled vocabulary
terms and database identifiers that define and describe biological and
other entities, and (b) describing the creator of a model and the
model's modification history. The annotation content is stored in
elements attached to individual SBML elements. The
format for storing the content inside SBML elements is a
subset of W3C RDF (Resource Description Format) expressed in XML. The
CVTerm class provides a programming interface for working directly
with controlled vocabulary term ('CV term') objects without having to
deal directly with the XML form. When libSBML reads in an SBML model
containing RDF annotations, it parses those annotations into a list of
CVTerm objects, and when writing a model, it parses the CVTerm objects
back into the appropriate SBML structure.
This method creates an empty CVTerm object. The possible qualifier
types usable as values of 'type' are MODEL_QUALIFIER and
BIOLOGICAL_QUALIFIER. If an explicit value for 'type' is not given,
this method defaults to using UNKNOWN_QUALIFIER. The qualifier type
can be set later using the CVTerm.setQualifierType() method.
Different BioModels.net qualifier elements encode different types of
relationships. Please refer to the SBML specification or the
BioModels.net qualifiers web page for an explanation of the meaning of
these different qualifiers.
Parameter 'type' is a qualifier type
"""
this = _libsbml.new_CVTerm(*args)
try:
self.this.append(this)
except:
self.this = this
def clone(self):
"""
clone(CVTerm self) -> CVTerm
Creates and returns a deep copy of this CVTerm object.
Returns the (deep) copy of this CVTerm object.
"""
return _libsbml.CVTerm_clone(self)
def getQualifierType(self, *args):
"""
getQualifierType(CVTerm self) -> QualifierType_t
getQualifierType(CVTerm self) -> QualifierType_t
Returns the qualifier type of this CVTerm object.
The RDF element used in the SBML format for referring to external
entities is , with a element inside of it
containing one or more elements. The following template
illustrates the structure:
HISTORY
...
...
In the template above, the placeholder meta id stands for the
element's meta identifier, which is a field available on all SBML
components derived from the SBase base object class. The dotted
portions are optional, and the ellipses ... are placeholders for zero
or more elements of the same form as the immediately preceding
element.
The placeholder RELATION_ELEMENT refers to a BioModels.net qualifier
element name. This is an element in either the XML namespace
'http://biomodels.net/model-qualifiers' (for model qualifiers) or
'http://biomodels.net/biology-qualifiers' (for biological qualifier).
The present method returns a code identifying which one of these two
relationship namespaces is being used; any other qualifier in libSBML
is considered unknown (as far as the CVTerm class is concerned).
Consequently, this method will return one of the following values:
* MODEL_QUALIFIER
* BIOLOGICAL_QUALIFIER
* UNKNOWN_QUALIFIER
The specific relationship of this CVTerm to the enclosing SBML object
can be determined using the CVTerm methods such as
CVTerm.getModelQualifierType() and
CVTerm.getBiologicalQualifierType(). Callers will typically want to
use the present method to find out which one of the other two methods
to call to find out the specific relationship.
Returns the qualifier type of this object or UNKNOWN_QUALIFIER (the
default).
See also CVTerm.getResources(), CVTerm.getModelQualifierType(),
CVTerm.getBiologicalQualifierType().
"""
return _libsbml.CVTerm_getQualifierType(self, *args)
def getModelQualifierType(self, *args):
"""
getModelQualifierType(CVTerm self) -> ModelQualifierType_t
getModelQualifierType(CVTerm self) -> ModelQualifierType_t
Returns the model qualifier type of this CVTerm object.
The RDF element used in the SBML format for referring to external
entities is , with a element inside of it
containing one or more elements. The following template
illustrates the structure:
HISTORY