libSBML Python API
5.11.0
|
Public Member Functions | |
def | __init__ (self, args) |
This method has multiple variants; they differ in the arguments they accept. More... | |
def | addL2Namespaces (self, xmlns) |
adds all L2 Extension namespaces to the namespace list. More... | |
def | clone (self) |
Creates and returns a deep copy of this LayoutExtension object. More... | |
def | enableL2NamespaceForDocument (self, doc) |
Adds the L2 Namespace to the document and enables the extension. More... | |
def | getDefaultLevel () |
Returns the default SBML Level used by this libSBML package extension. More... | |
def | getDefaultPackageVersion () |
Returns the default version of the SBML Level 3 package implemented by this libSBML extension. More... | |
def | getDefaultVersion () |
Returns the default SBML Version used by this libSBML package extension. More... | |
def | getLevel (self, uri) |
Returns the SBML Level for the given URI of this package. More... | |
def | getName (self) |
def | getNumOfSBasePlugins (self) |
Core class for SBML Level 3 package plug-ins. More... | |
def | getNumOfSupportedPackageURI (self) |
Returns the number of supported package namespace URIs. More... | |
def | getPackageName () |
layout
Base extension class for the package. More... | |
def | getPackageVersion (self, uri) |
Returns the package version for the given URI of this package. More... | |
def | getSBMLExtensionNamespaces (self, uri) |
Returns an LayoutPkgNamespaces object. More... | |
def | getStringFromTypeCode (self, typeCode) |
Takes a type code of the “layout” package and returns a string describing the code. More... | |
def | getSupportedPackageURI (self, args) |
Returns the nth XML namespace URI. More... | |
def | getURI (self, sbmlLevel, sbmlVersion, pkgVersion) |
Returns the namespace URI corresponding to the combination of the given SBML Level, Version, and package version. More... | |
def | getURI (self, args) |
Returns the XML namespace URI for a given Level and Version. More... | |
def | getVersion (self, uri) |
Returns the SBML Version for the given URI of this package. More... | |
def | getXmlnsL2 () |
Returns the XML namespace URI of the SBML Level 2 version of the package implemented by this libSBML Extension. More... | |
def | getXmlnsL3V1V1 () |
Returns the XML namespace URI of the SBML Level 3 package implemented by this libSBML extension. More... | |
def | getXmlnsXSI () |
Returns the XML namespace URI of any additional XML namespaces needed or used by this SBML Level 3 package. More... | |
def | isEnabled (self) |
Returns True if this package is enabled. More... | |
def | isInUse (self, doc) |
Determines whether this extension is being used by the given SBMLDocument. More... | |
def | isSupported (self, args) |
Returns True if the given XML namespace URI is supported by this package extension. More... | |
def | removeL2Namespaces (self, xmlns) |
Removes the L2 Namespace from a document. More... | |
def | setEnabled (self, args) |
Enable or disable this package. More... | |
def libsbml.LayoutExtension.__init__ | ( | self, | |
args | |||
) |
This method has multiple variants; they differ in the arguments they accept.
__init__() LayoutExtension __init__(LayoutExtension arg2) LayoutExtension
Each variant is described separately below.
LayoutExtension(LayoutExtension)
Copy constructor.
LayoutExtension()
Constructor
def libsbml.LayoutExtension.addL2Namespaces | ( | self, | |
xmlns | |||
) |
adds all L2 Extension namespaces to the namespace list.
addL2Namespaces(XMLNamespaces xmlns)
This method should be overridden by all extensions that want to serialize to an L2 annotation.
def libsbml.LayoutExtension.clone | ( | self | ) |
Creates and returns a deep copy of this LayoutExtension object.
clone() LayoutExtension
def libsbml.LayoutExtension.enableL2NamespaceForDocument | ( | self, | |
doc | |||
) |
Adds the L2 Namespace to the document and enables the extension.
enableL2NamespaceForDocument(SBMLDocument doc)
If the extension supports serialization to SBML L2 Annotations, this method should be overrridden, so it will be activated.
def libsbml.LayoutExtension.getDefaultLevel | ( | ) |
Returns the default SBML Level used by this libSBML package extension.
getDefaultLevel() long
def libsbml.LayoutExtension.getDefaultPackageVersion | ( | ) |
Returns the default version of the SBML Level 3 package implemented by this libSBML extension.
getDefaultPackageVersion() long
def libsbml.LayoutExtension.getDefaultVersion | ( | ) |
Returns the default SBML Version used by this libSBML package extension.
getDefaultVersion() long
def libsbml.LayoutExtension.getLevel | ( | self, | |
uri | |||
) |
Returns the SBML Level for the given URI of this package.
getLevel(string uri) long
uri | the string of URI that represents one of versions of the “layout” package |
0
if the given URI is invalid. def libsbml.LayoutExtension.getName | ( | self | ) |
getName() string
Returns the name of this package ('layout')
|
inherited |
Core class for SBML Level 3 package plug-ins.
This class of objects is defined by libSBML only and has no direct equivalent in terms of SBML components. This class is not prescribed by the SBML specifications, although it is used to implement features defined in SBML.
The SBMLExtension class is a component of the libSBML package extension mechanism. It is an abstract class that is extended by each package extension implementation.
This has the following consequence. If an application queries for the presence of Layout in an SBML Level 2 document by testing only for the existence of the plugin object, it will always get a positive result; in other words, the presence of a Layout extension object is not an indication of whether a read-in Level 2 document does or does not use SBML Layout. Instead, callers have to query explicitly for the existence of layout information. An example of such a query is the following code:
The special, always-available Level 2 Layout behavior was motivated by a desire to support legacy applications. In SBML Level 3, the Layout package uses the normal SBML Level 3 scheme of requiring declarations on the SBML document element. This means that upon reading a model, libSBML knows right away whether it contains layout information. In SBML Level 2, there is no top-level declaration because layout is stored as annotations in the body of the model. Detecting the presence of layout information when reading a Level 2 model requires parsing the annotations. For efficiency reasons, libSBML normally does not parse annotations automatically when reading a model. However, applications that predated the introduction of Level 3 Layout and the updated version of libSBML never had to do anything special to enable parsing layout; the facilities were always available for every Level 2 model as long as libSBML was compiled with Layout support. To avoid burdening developers of legacy applications with the need to modify their software, libSBML provides backward compatibility by always preloading the Layout package extension when reading Level 2 models. The same applies to the creation of Level 2 models: with the plugin-oriented libSBML, applications normally would have to take deliberate steps to activate package code, instantiate objects, manage namespaces, and so on. LibSBML again loads the Layout package plugin automatically when creating a Level 2 model, thereby making the APIs available to legacy applications without further work on their part.
Returns the number of SBasePluginCreatorBase objects stored in this object.
getNumOfSBasePlugins() int
|
inherited |
Returns the number of supported package namespace URIs.
getNumOfSupportedPackageURI() long
def libsbml.LayoutExtension.getPackageVersion | ( | self, | |
uri | |||
) |
Returns the package version for the given URI of this package.
getPackageVersion(string uri) long
uri | the string of URI that represents one of versions of the “layout” package |
0
if the given URI is invalid. def libsbml.LayoutExtension.getSBMLExtensionNamespaces | ( | self, | |
uri | |||
) |
Returns an LayoutPkgNamespaces object.
getSBMLExtensionNamespaces(string uri) SBMLNamespaces
uri | the string of URI that represents one of versions of the “layout” package |
uri
, or None
if the URI is not defined in the Layout package. def libsbml.LayoutExtension.getStringFromTypeCode | ( | self, | |
typeCode | |||
) |
Takes a type code of the “layout” package and returns a string describing the code.
getStringFromTypeCode(int typeCode) string
|
inherited |
Returns the nth XML namespace URI.
getSupportedPackageURI(long n) string
n | the index number of the namespace URI being sought. |
def libsbml.LayoutExtension.getURI | ( | self, | |
sbmlLevel, | |||
sbmlVersion, | |||
pkgVersion | |||
) |
Returns the namespace URI corresponding to the combination of the given SBML Level, Version, and package version.
getURI(long sbmlLevel, long sbmlVersion, long pkgVersion) string
sbmlLevel | the level of SBML |
sbmlVersion | the version of SBML |
pkgVersion | the version of package |
|
inherited |
Returns the XML namespace URI for a given Level and Version.
getURI(long sbmlLevel, long sbmlVersion, long pkgVersion) string
sbmlLevel | the SBML Level. |
sbmlVersion | the SBML Version. |
pkgVersion | the version of the package. |
def libsbml.LayoutExtension.getVersion | ( | self, | |
uri | |||
) |
Returns the SBML Version for the given URI of this package.
getVersion(string uri) long
uri | the string of URI that represents one of versions of the “layout” package |
0
if the given URI is invalid. def libsbml.LayoutExtension.getXmlnsL2 | ( | ) |
Returns the XML namespace URI of the SBML Level 2 version of the package implemented by this libSBML Extension.
getXmlnsL2() string
Unique among the SBML Level 3 packages, the Layout package existed and was in widespread use prior to the introduction of SBML Level 3. The Layout package was used as model annotations in SBML Level 2. This method returns the SBML annotation XML namespace used for Level 2.
def libsbml.LayoutExtension.getXmlnsL3V1V1 | ( | ) |
Returns the XML namespace URI of the SBML Level 3 package implemented by this libSBML extension.
getXmlnsL3V1V1() string
def libsbml.LayoutExtension.getXmlnsXSI | ( | ) |
Returns the XML namespace URI of any additional XML namespaces needed or used by this SBML Level 3 package.
getXmlnsXSI() string
|
inherited |
Returns True
if this package is enabled.
isEnabled() bool
True
if this package is enabled, False
otherwise. def libsbml.LayoutExtension.isInUse | ( | self, | |
doc | |||
) |
Determines whether this extension is being used by the given SBMLDocument.
The implementation returns true if the model object contains one or more layouts.
isInUse(SBMLDocument doc) bool
doc | the sbml document to test. |
|
inherited |
Returns True
if the given XML namespace URI is supported by this package extension.
isSupported(string uri) bool
True
if the given XML namespace URI (equivalent to a package version) is supported by this package extension, False
otherwise. def libsbml.LayoutExtension.removeL2Namespaces | ( | self, | |
xmlns | |||
) |
Removes the L2 Namespace from a document.
removeL2Namespaces(XMLNamespaces xmlns)
This method should be overridden by all extensions that want to serialize to an L2 annotation.
|
inherited |
Enable or disable this package.
setEnabled(bool isEnabled) bool
isEnabled | flag indicating whether to enable (if True ) or disable (False ) this package extension. |
True
if this call succeeded; False
otherwise.