tellurium.dev.deprecated package

Submodules

tellurium.dev.deprecated.tecombine module

Tellurium utilities for working with COMBINE archives.

Open Modeling EXchange format (OMEX) is the basis of the COMBINE Archive, a single file that supports the exchange of all the information necessary for a modeling and simulation experiment in biology. An OMEX file is a ZIP container that includes a manifest file, listing the content of the archive, an optional metadata file adding information about the archive and its content, and the files describing the model. The content of a COMBINE Archive consists of files encoded in COMBINE standards whenever possible, but may include additional files defined by an Internet Media Type.

The COMBINE Archive facilitates the reproduction of modeling and simulation experiments in biology by embedding all the relevant information in one file. Having all the information stored and exchanged at once also helps in building activity logs and audit trails.

The COMBINE archive is described in the following publication BMC Bioinformatics. 2014 Dec 14;15:369. doi: 10.1186/s12859-014-0369-z. COMBINE archive and OMEX format: one file to share all information to reproduce a modeling project.

The specification is available from http://co.mbine.org/specifications/omex.version-1

The archive contains 1. a mandatory manifest file, called manifest.xml, always located at the root of the archive, that describes the location and the type of each data file contained in the archive plus an entry describing the archive itself. The location of those files is defined by a relative path.

2. metadata files containing clerical information about the various files contained in the archive, and the archive itself. A best practice is to include only one file for each file format metadata called metadata.* (where * means the suitable file extension)

  1. all remaining files necessary to the model and simulation project

    An entry in the OmexManifest is represented by the Content class. It declares a file in the COMBINE archive. A content element possesses two required attributes, location and format, as well as an optional one, master.

    The location attribute of type string is required. It represents the relative location of an entry within the archive.

    The archive is represented by a dot ‘.’.

    The format attribute of type string is required. It indicates the file type of the Content element. The allowed values fall in two categories. Either the format denotes one of the COMBINE standards, in which case the format is the corresponding Identifiers.org URI. Or the format represents an InternetMedia type (Freed and Borenstein, 1996) (previously known as “MIME type”), in which case the format indicates this Media type.

    The master attribute of type boolean optional. When set to “true”, it indicates that the file declared by the content element should be used first when processing the content of the archive. The file can be for instance the description of an upper model in a composed model, itself declaring the various submodels; a simulation description, declaring the different model descriptions and data sources used in the experiment. In most cases, one content element per archive will have its master attribute set to true.

class tellurium.dev.deprecated.tecombine.Asset(raw=None, location=None, filetype=None, master=False)[source]

Bases: object

COMBINE_PREFIX = 'http://identifiers.org/combine.specifications/'
FORMATS = {'biopax': 'http://identifiers.org/combine.specifications/biopax', 'cellml': 'http://identifiers.org/combine.specifications/cellml', 'csv': 'http://purl.org/NET/mediatypes/text/csv', 'dat': 'http://purl.org/NET/mediatypes/text/dat', 'gpml': 'http://identifiers.org/combine.specifications/gpml', 'jpeg': 'http://purl.org/NET/mediatypes/image/jpg', 'jpg': 'http://purl.org/NET/mediatypes/image/jpg', 'md': 'http://purl.org/NET/mediatypes/text/x-markdown', 'omex': 'http://identifiers.org/combine.specifications/omex', 'omex-manifest': 'http://identifiers.org/combine.specifications/omex-manifest', 'omex-metadata': 'http://identifiers.org/combine.specifications/omex-metadata', 'pdf': 'http://purl.org/NET/mediatypes/application/pdf', 'png': 'http://purl.org/NET/mediatypes/image/png', 'sbgn': 'http://identifiers.org/combine.specifications/sbgn', 'sbml': 'http://identifiers.org/combine.specifications/sbml', 'sbol': 'http://identifiers.org/combine.specifications/sbol', 'sed-ml': 'http://identifiers.org/combine.specifications/sed-ml', 'svg': 'http://purl.org/NET/mediatypes/image/svg+xml', 'teddy': 'http://identifiers.org/combine.specifications/teddy', 'txt': 'http://purl.org/NET/mediatypes/text/plain'}
MEDIATYPE_PREFIX = 'http://purl.org/NET/mediatypes/'
classmethod formatFromFiletype(filetype)[source]
classmethod fromAntimony(antimonyStr, location, master=None)[source]

Create SBMLAsset from antimonyStr :param antimonyStr: :type antimonyStr: :param location: :type location: :return: :rtype:

classmethod fromFile(filename, filetype, master=None)[source]

Create asset from filename.

Parameters:filename
Returns:
Return type:
classmethod fromPhrasedML(phrasedmlStr, location, master=None)[source]
classmethod fromRaw(raw, location, filetype, master=None)[source]

Create asset from raw string.

Parameters:
  • raw (str) – raw string content
  • location

    ??

Returns:

Return type:

class tellurium.dev.deprecated.tecombine.CombineArchive[source]

Bases: object

Class for creating combine archives.

Raw and file assets are added to the empty COMBINE archive via the respective add*Str and add*File methods. The archive is written to file via the write function.

addAntimonyStr(antimonyStr, location, master=None)[source]
addAsset(asset)[source]
addFile(filename, filetype, master=None)[source]
addPhraSEDMLStr(phrasedmlStr, location, master=None)[source]
addSBMLFile(filename, master=None)[source]
addSBMLStr(sbmlStr, location, master=None)[source]
addSEDMLFile(filename, master=None)[source]
addSEDMLStr(sedmlStr, location, master=None)[source]
addStr(textStr, location, filetype)[source]
checkfile(filename)[source]

Check that file exists.

static extractArchive(archivePath, directory)[source]

Extracts given archive into the target directory.

Target directory is created if it does not exist. Files are overwritten in the directory !

Parameters:
  • archivePath (str) – path to combine archive
  • directory – path to directory where to extract to
static filePathsFromExtractedArchive(directory, filetype)[source]

Reads file paths from extracted combine archive.

Searches the manifest.xml of the archive for files of the specified filetype and checks if the files exist in the directory.

Parameters:directory – directory of extracted archive
Returns:list of paths
Return type:list
static readContentsFromManifest(manifestPath)[source]

Reads the manifest information.

Parameters:manifestPath
Returns:
Return type:
write(outfile)[source]

Write the combine archive to the outfile. Writes all assets and creates the manifest.xml.

class tellurium.dev.deprecated.tecombine.OpenCombine(combinePath)[source]

Bases: object

Main class for handling COMBINE Archives.

addAntimony(antimonyStr, filename=None)[source]

Adds SBML file as Antimony into COMBINE archive. :param antimonyStr: antimony string

addFile(filePath)[source]

Adds other file into COMBINE archive.

Currently, png, jpg, pdf, txt, csv, dat formats are supported.

Parameters:filePath – path to the file
addPhrasedml(phrasedmlStr, antimonyStr, arcname=None)[source]

Adds SEDML file as phraSEDML string into COMBINE archive. :param phrasedmlStr: phraSEDML string :param antimonyStr: antimony string to be referenced :param arcname: (optional) desired name of SEDML file

addSBML(sbmlPath, filename=None)[source]

Adds SBML file into COMBINE archive. :param sbmlPath: path to SBML file or full SBML file string

addSEDML(sedmlPath, arcname=None)[source]

Adds SEDML file into COMBINE archive. :param sedmlPath: path to SEDML file :param arcname: (optional) desired name of SEDML file

getModelName(sbmlfile)[source]
getSBML(sbmlfile)[source]

returns SBML

Parameters:sbmlfile – filename of SBML file in COMBINE archive
Returns:SBML string
Return type:str
getSBMLAsAntimony(sbmlfile)[source]

returns SBML as antimony

Parameters:sbmlfile – filename of SBML file in COMBINE archive
Returns:antimony string
Return type:str
getSEDML(sedmlfile)[source]

returns SEDML

Parameters:sbmlfile – filename of SEDML file in COMBINE archive
Returns:SEDML string
Return type:str
getSEDMLAsPhrasedml(sedmlfile)[source]

returns SEDML as phraSEDML

Parameters:sbmlfile – filename of SEDML file in COMBINE archive
Returns:phraSEDML string
Return type:str
listContents()[source]

returns simplified content list

listDetailedContents()[source]

List contents of the archive from the manifest.xml

Returns:contentList of dictionaries with keys: filename, type
Return type:[{}]
readManifest()[source]
removeFile(fileName)[source]
update(targetFile, change)[source]

update the contents of SBML or SEDML files in COMBINE archive

Only supports antimony or phrasedml string. For other input types, use removeFile().

Parameters:
  • targetFile – SBML or SEDML file to be updated
  • change – antimony or phrasedml string
updateManifest(fileName, fileType, delete=False)[source]
tellurium.dev.deprecated.tecombine.combine(combinePath)[source]

Open a combine archive from local directory.

Parameters:combinePath (str) – Path to a combine archive
Returns:OpenCombine instance

tellurium.dev.deprecated.tephrasedml module

Module contents