4.1. wc_lang package

4.1.2. Submodules

4.1.3. wc_lang.__main__ module

Command line programs for manipulating model definitions

Author:Jonathan Karr <karr@mssm.edu>
Date:2016-12-07
Copyright:2016, Karr Lab
License:MIT
class wc_lang.__main__.App(label=None, **kw)[source]

Bases: cement.core.foundation.App

Command line application

class Meta[source]

Bases: object

base_controller = 'base'[source]
handlers = [<class 'wc_lang.__main__.BaseController'>, <class 'wc_lang.__main__.CutSubmodelsController'>, <class 'wc_lang.__main__.MergeModelsController'>, <class 'wc_lang.__main__.ValidateController'>, <class 'wc_lang.__main__.DifferenceController'>, <class 'wc_lang.__main__.TransformController'>, <class 'wc_lang.__main__.NormalizeController'>, <class 'wc_lang.__main__.ConvertController'>, <class 'wc_lang.__main__.CreateTemplateController'>, <class 'wc_lang.__main__.UpdateVersionMetadataController'>, <class 'wc_lang.__main__.MigrateController'>, <class 'wc_lang.__main__.ExportController'>, <class 'wc_lang.__main__.ImportController'>][source]
label = 'wc-lang'[source]
class wc_lang.__main__.BaseController(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

Base controller for command line application

class Meta[source]

Bases: object

arguments = [(['-v', '--version'], {'action': 'version', 'version': '0.0.1'})][source]
description = 'Command line utilities for managing whole-cell model definitions'[source]
label = 'base'[source]
class wc_lang.__main__.ConvertController(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

Convert model among Excel (.xlsx), comma separated (.csv), JavaScript Object Notation (.json), tab separated (.tsv), and Yet Another Markup Language (.yaml, .yml) formats

class Meta[source]

Bases: object

arguments = [(['source'], {'type': <class 'str'>, 'help': 'Path to model'}), (['dest'], {'type': <class 'str'>, 'help': 'Path to save model in converted format'})][source]
description = 'Convert model among .csv, .json, .tsv, .xlsx, .yaml, and .yml formats'[source]
label = 'convert'[source]
stacked_on = 'base'[source]
stacked_type = 'nested'[source]
class wc_lang.__main__.CreateTemplateController(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

Create file with model template (i.e. create file with row and column labels)

class Meta[source]

Bases: object

arguments = [(['path'], {'type': <class 'str'>, 'help': 'Path to save model template'}), (['--ignore-repo-metadata'], {'dest': 'set_repo_metadata_from_path', 'default': True, 'action': 'store_false', 'help': 'If set, do not set the Git repository metadata for the knowledge base from the parent directory of `path`'})][source]
description = 'Create file with model template: blank file(s) with row and column labels'[source]
label = 'create-template'[source]
stacked_on = 'base'[source]
stacked_type = 'nested'[source]
class wc_lang.__main__.CutSubmodelsController(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

Cut submodels into separate models

class Meta[source]

Bases: object

arguments = [(['in_file'], {'type': <class 'str'>, 'help': 'Path to model to cut'}), (['out_dir'], {'type': <class 'str'>, 'help': 'Directory to save cut submodels'})][source]
description = 'Cut submodels into separate models'[source]
label = 'cut-submodels'[source]
stacked_on = 'base'[source]
stacked_type = 'nested'[source]
class wc_lang.__main__.DifferenceController(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

Display difference between two model definitions

class Meta[source]

Bases: object

arguments = [(['path_1'], {'type': <class 'str'>, 'help': 'Path to first model'}), (['path_2'], {'type': <class 'str'>, 'help': 'Path to second model'}), (['--compare-files'], {'dest': 'compare_files', 'default': False, 'action': 'store_true', 'help': 'If true, compare models; otherwise compare files directly'})][source]
description = 'Get difference between two model definitions'[source]
label = 'difference'[source]
stacked_on = 'base'[source]
stacked_type = 'nested'[source]
class wc_lang.__main__.ExportController(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

Export a model to SBML

class Meta[source]

Bases: object

arguments = [(['in_path'], {'type': <class 'str'>, 'help': 'Path to model to export'}), (['out_dir'], {'type': <class 'str'>, 'help': 'Directory to save exported model'})][source]
description = 'Export a model to SBML'[source]
label = 'export'[source]
stacked_on = 'base'[source]
stacked_type = 'nested'[source]
class wc_lang.__main__.ImportController(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

Import a model from SBML

class Meta[source]

Bases: object

arguments = [(['in_dir'], {'type': <class 'str'>, 'help': 'Directory with model to import'}), (['out_path'], {'type': <class 'str'>, 'help': 'Path to save model'})][source]
description = 'Import a model from SBML'[source]
label = 'import'[source]
stacked_on = 'base'[source]
stacked_type = 'nested'[source]
class wc_lang.__main__.MergeModelsController(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

Merge models

class Meta[source]

Bases: object

arguments = [(['-p', '--primary'], {'dest': 'primary_path', 'type': <class 'str'>, 'help': 'Path to base for merged model'}), (['-s', '--secondary'], {'dest': 'secondary_paths', 'type': <class 'str'>, 'nargs': '*', 'help': 'Path to models to merge into primary model'}), (['-o', '--out'], {'dest': 'out_path', 'type': <class 'str'>, 'help': 'Path to save merged model'})][source]
description = 'Merge multiple models'[source]
label = 'merge-models'[source]
stacked_on = 'base'[source]
stacked_type = 'nested'[source]
class wc_lang.__main__.MigrateController(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

Migrate a model to another version of wc_lang

class Meta[source]

Bases: object

arguments = [(['in_path'], {'type': <class 'str'>, 'help': 'Path to model to migrate'}), (['version'], {'type': <class 'str'>, 'help': 'WC-Lang version'}), (['--out-path'], {'type': <class 'str'>, 'help': 'Path to save migrated model. Default: overwrite the original file'}), (['--ignore-repo-metadata'], {'dest': 'set_repo_metadata_from_path', 'default': True, 'action': 'store_false', 'help': 'If set, do not set the Git repository metadata for the knowledge base from the parent directory of `path-core`'})][source]
description = 'Migrate a model to another version of WC-Lang'[source]
label = 'migrate'[source]
stacked_on = 'base'[source]
stacked_type = 'nested'[source]
class wc_lang.__main__.NormalizeController(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

Normalize model

class Meta[source]

Bases: object

arguments = [(['source'], {'type': <class 'str'>, 'help': 'Path to model'}), (['--dest'], {'default': '', 'type': <class 'str'>, 'help': 'Path to save normalized model'})][source]
description = 'Normalize model'[source]
label = 'normalize'[source]
stacked_on = 'base'[source]
stacked_type = 'nested'[source]
class wc_lang.__main__.TransformController(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

Apply one, or more, transforms to a model and save the result

class Meta[source]

Bases: object

arguments = [(['source'], {'type': <class 'str'>, 'help': 'Path to model'}), (['dest'], {'type': <class 'str'>, 'help': 'Path to save transformed model'}), (['--transform'], {'dest': 'transforms', 'action': 'append', 'help': 'Model transform:\n ChangeValue: Change a value of an attribute of a model\n CreateImplicitDfbaExchangeReactions: Create implicit exchange reactions for dFBA submodels\n CreateImplicitDistributionZeroInitConcentrations: Create the implicit zero concentrations in a model\n MergeAlgorithmicallyLikeSubmodels: Merge groups of algorithmically-like submodels into individual submodels\n NullifyAttrs: Generate a reduced model by nullifying specific attributes\n PrepForSbml: Transform model into SBML-compatible representation and discard information that cannot be exported to SBML\n PrepForWCSim: Prepare model for simulation by making implicit information in the model explicit\n SetFiniteDfbaFluxBoundsTransform: Clip the flux bounds for the reactions in dFBA submodels to the default flux range\n SplitReversibleReactions: Split reversible reactions into separate forward and backward reactions'})][source]
description = 'Apply one, or more, transforms to a model and save the result'[source]
label = 'transform'[source]
stacked_on = 'base'[source]
stacked_type = 'nested'[source]
class wc_lang.__main__.UpdateVersionMetadataController(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

Update the version metadata (repository URL, branch, revision; wc_lang version) of a model

class Meta[source]

Bases: object

arguments = [(['path'], {'type': <class 'str'>, 'help': 'Path to model'}), (['--ignore-repo-metadata'], {'dest': 'set_repo_metadata_from_path', 'default': True, 'action': 'store_false', 'help': 'If set, do not set the Git repository metadata for the knowledge base from the parent directory of `path-core`'})][source]
description = 'Update the version metadata (repository URL, branch, revision; wc_lang version) of a model'[source]
label = 'update-version-metadata'[source]
stacked_on = 'base'[source]
stacked_type = 'nested'[source]
class wc_lang.__main__.ValidateController(*args, **kw)[source]

Bases: cement.ext.ext_argparse.ArgparseController

Validate model and display errors

class Meta[source]

Bases: object

arguments = [(['path'], {'type': <class 'str'>, 'help': 'Path to model'})][source]
description = 'Validate model and display errors'[source]
label = 'validate'[source]
stacked_on = 'base'[source]
stacked_type = 'nested'[source]
wc_lang.__main__.main()[source]

4.1.4. wc_lang.core module

Data model to represent composite, multi-algorithmic biochemical models.

This module defines classes that represent the schema of a biochemical model:

These are all instances of obj_model.Model, an alias for obj_model.Model. A biochemical model may contain a list of instances of each of these classes, interlinked by object references. For example, a Reaction will reference its constituent SpeciesCoefficient instances, and the RateLaw that describes the reaction’s rate.

This module also defines numerous classes that serve as attributes of these classes.

Author:Jonathan Karr <karr@mssm.edu>
Author:Arthur Goldberg <Arthur.Goldberg@mssm.edu>
Date:2016-11-10
Copyright:2016-2017, Karr Lab
License:MIT
class wc_lang.core.Author(**kwargs)[source]

Bases: obj_model.core.Model, wc_lang.sbml.util.SbmlModelMixin

An author of a model

id[source]

unique identifier

Type:str
name[source]

full name

Type:str
model[source]

model

Type:Model
last_name[source]

last name(s)

Type:str
first_name[source]

first name(s)

Type:str
middle_name[source]

middle name(s)

Type:str
title[source]

title

Type:str
organization[source]

organization

Type:str
email[source]

email address

Type:str
website[source]

website

Type:str
address[source]

physical address

Type:str
identifiers[source]

identifiers

Type:list of Identifier
comments[source]

comments

Type:str

Related attributes:

  • conclusions (list of Conclusion): conclusions
  • changes (list of Change): changes
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'name', 'last_name', 'first_name', 'middle_name', 'title', 'organization', 'email', 'website', 'address', 'identifiers', 'comments')[source]
attributes = {'address': <obj_model.core.LongStringAttribute object>, 'comments': <obj_model.core.LongStringAttribute object>, 'email': <obj_model.core.EmailAttribute object>, 'first_name': <obj_model.core.StringAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'identifiers': <wc_lang.core.IdentifierManyToManyAttribute object>, 'last_name': <obj_model.core.StringAttribute object>, 'middle_name': <obj_model.core.StringAttribute object>, 'model': <obj_model.core.ManyToOneAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'organization': <obj_model.core.LongStringAttribute object>, 'title': <obj_model.core.LongStringAttribute object>, 'website': <obj_model.core.UrlAttribute object>}[source]
child_attrs = {'sbml': ('id', 'name', 'model', 'last_name', 'first_name', 'middle_name', 'title', 'organization', 'email', 'website', 'address', 'identifiers', 'comments'), 'wc_sim': ()}[source]
children = {'core_model': ('identifiers',), 'submodel': ('identifiers',)}[source]
frozen_columns = 2[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_lang.core.Author'>,)[source]
local_attributes = {'address': <obj_model.core.LocalAttribute object>, 'changes': <obj_model.core.LocalAttribute object>, 'comments': <obj_model.core.LocalAttribute object>, 'conclusions': <obj_model.core.LocalAttribute object>, 'email': <obj_model.core.LocalAttribute object>, 'first_name': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'identifiers': <obj_model.core.LocalAttribute object>, 'last_name': <obj_model.core.LocalAttribute object>, 'middle_name': <obj_model.core.LocalAttribute object>, 'model': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'organization': <obj_model.core.LocalAttribute object>, 'title': <obj_model.core.LocalAttribute object>, 'website': <obj_model.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.SlugAttribute object>[source]
related_attributes = {'changes': <obj_model.core.ManyToManyAttribute object>, 'conclusions': <obj_model.core.ManyToManyAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Author'[source]
verbose_name_plural = 'Authors'[source]
address = <obj_model.core.LongStringAttribute object>[source]
comments = <obj_model.core.LongStringAttribute object>[source]
email = <obj_model.core.EmailAttribute object>[source]
first_name = <obj_model.core.StringAttribute object>[source]
get_identifier(namespace)[source]

Get the author’s id in a namespace (e.g., github.user, orcid)

Parameters:namespace (str) – namespace of the identifier to retrieve
Returns:user’s id in namespace
Return type:str
Raises:ValueError – if the author has multiple ids in namespace
id = <obj_model.core.SlugAttribute object>[source]
identifiers = <wc_lang.core.IdentifierManyToManyAttribute object>[source]
last_name = <obj_model.core.StringAttribute object>[source]
middle_name = <obj_model.core.StringAttribute object>[source]
model = <obj_model.core.ManyToOneAttribute object>[source]
name = <obj_model.core.StringAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
organization = <obj_model.core.LongStringAttribute object>[source]
title = <obj_model.core.LongStringAttribute object>[source]
website = <obj_model.core.UrlAttribute object>[source]
class wc_lang.core.Change(**kwargs)[source]

Bases: obj_model.core.Model, wc_lang.sbml.util.SbmlModelMixin

A change to a model

id[source]

unique identifier

Type:str
name[source]

full name

Type:str
model[source]

model

Type:Model
type[source]

type

Type:pronto.term.Term
target[source]

target

Type:str
target_submodel[source]

target submodel

Type:Submodel
target_type[source]

target type

Type:pronto.term.Term
reason[source]

reason

Type:str
reason_type[source]

type of reason

Type:pronto.term.Term
intention[source]

intention

Type:str
intention_type[source]

type of intention

Type:pronto.term.Term
identifiers (

list of Identifier): identifiers

conclusions[source]

conclusions

Type:list of Conclusion
comments[source]

comments

Type:str
references[source]

references

Type:list of Reference
authors[source]

authors

Type:list of Author
date[source]

date

Type:datetime.datetime
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'name', 'type', 'target', 'target_submodel', 'target_type', 'reason', 'reason_type', 'intention', 'intention_type', 'identifiers', 'evidence', 'conclusions', 'comments', 'references', 'authors', 'date')[source]
attributes = {'authors': <obj_model.core.ManyToManyAttribute object>, 'comments': <obj_model.core.LongStringAttribute object>, 'conclusions': <obj_model.core.ManyToManyAttribute object>, 'date': <obj_model.core.DateTimeAttribute object>, 'evidence': <wc_lang.core.EvidenceManyToManyAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'identifiers': <wc_lang.core.IdentifierManyToManyAttribute object>, 'intention': <obj_model.core.LongStringAttribute object>, 'intention_type': <obj_model.ontology.OntologyAttribute object>, 'model': <obj_model.core.ManyToOneAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'reason': <obj_model.core.LongStringAttribute object>, 'reason_type': <obj_model.ontology.OntologyAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>, 'target': <obj_model.core.LongStringAttribute object>, 'target_submodel': <obj_model.core.ManyToOneAttribute object>, 'target_type': <obj_model.ontology.OntologyAttribute object>, 'type': <obj_model.ontology.OntologyAttribute object>}[source]
child_attrs = {'sbml': (), 'wc_sim': ()}[source]
children = {'core_model': ('identifiers', 'evidence', 'conclusions', 'references', 'authors'), 'submodel': ('identifiers', 'evidence', 'conclusions', 'references', 'authors')}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_lang.core.Change'>,)[source]
local_attributes = {'authors': <obj_model.core.LocalAttribute object>, 'comments': <obj_model.core.LocalAttribute object>, 'conclusions': <obj_model.core.LocalAttribute object>, 'date': <obj_model.core.LocalAttribute object>, 'evidence': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'identifiers': <obj_model.core.LocalAttribute object>, 'intention': <obj_model.core.LocalAttribute object>, 'intention_type': <obj_model.core.LocalAttribute object>, 'model': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'reason': <obj_model.core.LocalAttribute object>, 'reason_type': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'target': <obj_model.core.LocalAttribute object>, 'target_submodel': <obj_model.core.LocalAttribute object>, 'target_type': <obj_model.core.LocalAttribute object>, 'type': <obj_model.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.SlugAttribute object>[source]
related_attributes = {}[source]
unique_together = ()[source]
verbose_name = 'Change'[source]
verbose_name_plural = 'Changes'[source]
authors = <obj_model.core.ManyToManyAttribute object>[source]
comments = <obj_model.core.LongStringAttribute object>[source]
conclusions = <obj_model.core.ManyToManyAttribute object>[source]
date = <obj_model.core.DateTimeAttribute object>[source]
evidence = <wc_lang.core.EvidenceManyToManyAttribute object>[source]
id = <obj_model.core.SlugAttribute object>[source]
identifiers = <wc_lang.core.IdentifierManyToManyAttribute object>[source]
intention = <obj_model.core.LongStringAttribute object>[source]
intention_type = <obj_model.ontology.OntologyAttribute object>[source]
model = <obj_model.core.ManyToOneAttribute object>[source]
name = <obj_model.core.StringAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
reason = <obj_model.core.LongStringAttribute object>[source]
reason_type = <obj_model.ontology.OntologyAttribute object>[source]
references = <obj_model.core.ManyToManyAttribute object>[source]
target = <obj_model.core.LongStringAttribute object>[source]
target_submodel = <obj_model.core.ManyToOneAttribute object>[source]
target_type = <obj_model.ontology.OntologyAttribute object>[source]
type = <obj_model.ontology.OntologyAttribute object>[source]
class wc_lang.core.ChemicalStructure(**kwargs)[source]

Bases: obj_model.core.Model, wc_lang.sbml.util.SbmlModelMixin

Structure of a chemical compound

value[source]
Type:str
format[source]

format of the structure

Type:ChemicalStructureFormat
alphabet[source]

alphabet of BpForms-encoded structure

Type:ChemicalStructureAlphabet
empirical_formula[source]

empirical formula

Type:EmpiricalFormula
molecular_weight[source]

molecular weight

Type:float
charge[source]

charge

Type:int
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('value', 'format', 'alphabet', 'empirical_formula', 'molecular_weight', 'charge')[source]
attributes = {'alphabet': <obj_model.core.EnumAttribute object>, 'charge': <obj_model.core.IntegerAttribute object>, 'empirical_formula': <obj_model.chem.EmpiricalFormulaAttribute object>, 'format': <obj_model.core.EnumAttribute object>, 'molecular_weight': <obj_model.core.FloatAttribute object>, 'value': <obj_model.core.LongStringAttribute object>}[source]
child_attrs = {'sbml': ('value', 'format', 'alphabet', 'empirical_formula', 'molecular_weight', 'charge'), 'wc_sim': ('molecular_weight', 'charge')}[source]
children = {'core_model': (), 'submodel': ()}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_lang.core.ChemicalStructure'>,)[source]
local_attributes = {'alphabet': <obj_model.core.LocalAttribute object>, 'charge': <obj_model.core.LocalAttribute object>, 'empirical_formula': <obj_model.core.LocalAttribute object>, 'format': <obj_model.core.LocalAttribute object>, 'molecular_weight': <obj_model.core.LocalAttribute object>, 'species_types': <obj_model.core.LocalAttribute object>, 'value': <obj_model.core.LocalAttribute object>}[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {'species_types': <obj_model.core.ManyToOneAttribute object>}[source]
tabular_orientation = 4[source]
unique_together = (('alphabet', 'charge', 'empirical_formula', 'format', 'molecular_weight', 'value'),)[source]
verbose_name = 'Chemical structure'[source]
verbose_name_plural = 'Chemical structures'[source]
alphabet = <obj_model.core.EnumAttribute object>[source]
charge = <obj_model.core.IntegerAttribute object>[source]
empirical_formula = <obj_model.chem.EmpiricalFormulaAttribute object>[source]
format = <obj_model.core.EnumAttribute object>[source]
get_structure()[source]

Get structure

Returns:structure
Return type:openbabel.OBMol of bpforms.BpForm
Raises:ValueError – if the structure cannot be parsed
has_carbon()[source]

Returns True is species contains at least one carbon atom.

Returns:True is species contains at least one carbon atom.
Return type:bool
molecular_weight = <obj_model.core.FloatAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
serialize()[source]

Generate string representation

Returns:string representation
Return type:str
validate()[source]

Check that the structure is valid

  • Format provided when structure is not None
  • Value provided when format is not None
  • Alphabet provided for BpForms-encoded structures
  • Empirical formula, molecular weight, charge match structure (when)
Returns:
None if the object is valid,
otherwise return a list of errors as an instance of InvalidObject
Return type:InvalidObject or None
value = <obj_model.core.LongStringAttribute object>[source]
class wc_lang.core.ChemicalStructureAlphabet[source]

Bases: int, wc_utils.util.enumerate.CaseInsensitiveEnum

An enumeration.

canonical_dna = 4[source]
canonical_protein = 6[source]
canonical_rna = 5[source]
dna = 1[source]
protein = 3[source]
rna = 2[source]
class wc_lang.core.ChemicalStructureFormat[source]

Bases: int, wc_utils.util.enumerate.CaseInsensitiveEnum

Format of a chemical structure

bpforms = 1[source]
smiles = 0[source]
class wc_lang.core.CommentAttribute(min_length=0, max_length=4294967295, default='', default_cleaned_value='', none_value='', verbose_name='', help='', primary=False, unique=False, unique_case_insensitive=False)[source]

Bases: obj_model.core.LongStringAttribute

Comment attribute

SEPARATOR = '\n\n'[source]
merge(left, right, right_objs_in_left, left_objs_in_right)[source]

Merge an attribute of elements of two models

Parameters:
  • left (Model) – an element in a model to merge
  • right (Model) – an element in a second model to merge
  • right_objs_in_left (dict) – mapping from objects in right model to objects in left model
  • left_objs_in_right (dict) – mapping from objects in left model to objects in right model
class wc_lang.core.Compartment(**kwargs)[source]

Bases: obj_model.core.Model, wc_lang.sbml.util.SbmlModelMixin

id[source]

unique identifier

Type:str
name[source]

name

Type:str
model[source]

model

Type:Model
biological_type[source]

biological type

Type:pronto.term.Term
physical_type[source]

physical type

Type:pronto.term.Term
geometry[source]

geometry

Type:pronto.term.Term
parent_compartment[source]

parent compartment

Type:Compartment
mass_units[source]

mass units

Type:unit_registry.Unit
init_volume[source]

initial volume

Type:InitVolume
init_density[source]

function that calculates the density during the initialization of each simulation

Type:Parameter
ph[source]

pH

Type:Ph
identifiers[source]

identifiers

Type:list of Identifier
conclusions[source]

conclusions

Type:list of Conclusion
comments[source]

comments

Type:str
references[source]

references

Type:list of Reference

Related attributes:

class Meta[source]

Bases: obj_model.core.Meta, obj_model.expression.ExpressionDynamicTermMeta

attribute_order = ('id', 'name', 'biological_type', 'physical_type', 'geometry', 'parent_compartment', 'mass_units', 'init_volume', 'init_density', 'ph', 'identifiers', 'evidence', 'conclusions', 'comments', 'references')[source]
attributes = {'biological_type': <obj_model.ontology.OntologyAttribute object>, 'comments': <wc_lang.core.CommentAttribute object>, 'conclusions': <obj_model.core.ManyToManyAttribute object>, 'evidence': <wc_lang.core.EvidenceManyToManyAttribute object>, 'geometry': <obj_model.ontology.OntologyAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'identifiers': <wc_lang.core.IdentifierManyToManyAttribute object>, 'init_density': <obj_model.core.OneToOneAttribute object>, 'init_volume': <obj_model.core.ManyToOneAttribute object>, 'mass_units': <obj_model.units.UnitAttribute object>, 'model': <obj_model.core.ManyToOneAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'parent_compartment': <obj_model.core.ManyToOneAttribute object>, 'ph': <obj_model.core.ManyToOneAttribute object>, 'physical_type': <obj_model.ontology.OntologyAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>}[source]
child_attrs = {'sbml': ('id', 'name', 'model', 'biological_type', 'physical_type', 'geometry', 'parent_compartment', 'mass_units', 'init_volume', 'init_density', 'ph', 'identifiers', 'comments'), 'wc_sim': ('id', 'model', 'mass_units', 'init_volume', 'init_density')}[source]
children = {'core_model': ('parent_compartment', 'sub_compartments', 'init_volume', 'init_density', 'ph', 'identifiers', 'evidence', 'conclusions', 'references'), 'submodel': ('init_volume', 'init_density', 'ph', 'identifiers', 'evidence', 'conclusions', 'references')}[source]
expression_term_units = 'mass_units'[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_lang.core.Compartment'>,)[source]
local_attributes = {'biological_type': <obj_model.core.LocalAttribute object>, 'comments': <obj_model.core.LocalAttribute object>, 'conclusions': <obj_model.core.LocalAttribute object>, 'evidence': <obj_model.core.LocalAttribute object>, 'function_expressions': <obj_model.core.LocalAttribute object>, 'geometry': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'identifiers': <obj_model.core.LocalAttribute object>, 'init_density': <obj_model.core.LocalAttribute object>, 'init_volume': <obj_model.core.LocalAttribute object>, 'mass_units': <obj_model.core.LocalAttribute object>, 'model': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'parent_compartment': <obj_model.core.LocalAttribute object>, 'ph': <obj_model.core.LocalAttribute object>, 'physical_type': <obj_model.core.LocalAttribute object>, 'rate_law_expressions': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'species': <obj_model.core.LocalAttribute object>, 'stop_condition_expressions': <obj_model.core.LocalAttribute object>, 'sub_compartments': <obj_model.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.SlugAttribute object>[source]
related_attributes = {'function_expressions': <obj_model.core.ManyToManyAttribute object>, 'rate_law_expressions': <obj_model.core.ManyToManyAttribute object>, 'species': <obj_model.core.ManyToOneAttribute object>, 'stop_condition_expressions': <obj_model.core.ManyToManyAttribute object>, 'sub_compartments': <obj_model.core.ManyToOneAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Compartment'[source]
verbose_name_plural = 'Compartments'[source]
biological_type = <obj_model.ontology.OntologyAttribute object>[source]
comments = <wc_lang.core.CommentAttribute object>[source]
conclusions = <obj_model.core.ManyToManyAttribute object>[source]
evidence = <wc_lang.core.EvidenceManyToManyAttribute object>[source]
export_relations_to_sbml(sbml_model, sbml)[source]

Add relationships to/from object to SBML compartment.

Parameters:
  • sbml_model (libsbml.Model) – SBML model
  • sbml (libsbml.Compartment) – SBML compartment
export_to_sbml(sbml_model)[source]

Add this compartment to a SBML model.

Parameters:sbml_model (libsbml.Model) – SBML model
Returns:SBML compartment
Return type:libsbml.Compartment
Raises:ValueError – if the geometry cannot be exported to SBML
geometry = <obj_model.ontology.OntologyAttribute object>[source]
get_sub_compartments(nested=False)[source]

Get sub-compartments, optionally including all nested sub-compartments

Returns:list of sub-compartments
Return type:list of Compartment
get_tot_mean_init_volume()[source]

Get total mean initial volume of compartment and nested sub-compartments

Returns:
total mean initial volume of compartment and nested
sub-compartments
Return type:float
id = <obj_model.core.SlugAttribute object>[source]
identifiers = <wc_lang.core.IdentifierManyToManyAttribute object>[source]
import_from_sbml(sbml)[source]

Load from SBML compartment

Parameters:sbml (libsbml.Compartment) – SBML compartment
Raises:ValueError – if the geometry cannot be imported from SBML
import_relations_from_sbml(sbml, objs)[source]

Load relationships from SBML compartment

Parameters:
  • sbml (libsbml.Compartment) – SBML compartment
  • objs (dict) – dictionary that maps WC-Lang types to dictionaries that map the ids of WC-Lang objects to WC-Lang objects
init_density = <obj_model.core.OneToOneAttribute object>[source]
init_volume = <obj_model.core.ManyToOneAttribute object>[source]
mass_units = <obj_model.units.UnitAttribute object>[source]
model = <obj_model.core.ManyToOneAttribute object>[source]
name = <obj_model.core.StringAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
parent_compartment = <obj_model.core.ManyToOneAttribute object>[source]
ph = <obj_model.core.ManyToOneAttribute object>[source]
physical_type = <obj_model.ontology.OntologyAttribute object>[source]
references = <obj_model.core.ManyToManyAttribute object>[source]
validate()[source]

Check that the compartment is valid

  • Check that the units of density are g l^-1
Returns:
None if the object is valid,
otherwise return a list of errors as an instance of InvalidObject
Return type:InvalidObject or None
class wc_lang.core.Conclusion(**kwargs)[source]

Bases: obj_model.core.Model

Conclusion of one or more observations

id[source]

unique identifier

Type:str
name[source]

name

Type:str
model[source]

model

Type:Model
value[source]

value

Type:str
std[source]

standard error of the value

Type:str
units[source]

units

Type:unit_registry.Unit
type[source]

type

Type:pronto.term.Term
process[source]

procedure which produced the conclusion

Type:Process
identifiers[source]

identifiers

Type:list of Identifier
evidence[source]

evidence that supports/refutes the conclusion (e.g. individual observations underlying an average)

Type:list of Evidence
comments[source]

comments

Type:str
references[source]

references

Type:list of Reference
authors[source]

authors

Type:list of Author
date[source]

date and time when the conclusion was made

Type:datetime.datetime

Related attributes:

class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'name', 'value', 'std', 'units', 'type', 'process', 'identifiers', 'evidence', 'comments', 'references', 'authors', 'date')[source]
attributes = {'authors': <obj_model.core.ManyToManyAttribute object>, 'comments': <wc_lang.core.CommentAttribute object>, 'date': <obj_model.core.DateTimeAttribute object>, 'evidence': <wc_lang.core.EvidenceManyToManyAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'identifiers': <wc_lang.core.IdentifierManyToManyAttribute object>, 'model': <obj_model.core.ManyToOneAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'process': <obj_model.core.ManyToOneAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>, 'std': <obj_model.core.StringAttribute object>, 'type': <obj_model.ontology.OntologyAttribute object>, 'units': <obj_model.units.UnitAttribute object>, 'value': <obj_model.core.StringAttribute object>}[source]
child_attrs = {'sbml': (), 'wc_sim': ()}[source]
children = {'core_model': ('process', 'identifiers', 'evidence', 'references', 'authors'), 'submodel': ('process', 'identifiers', 'evidence', 'references', 'authors')}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_lang.core.Conclusion'>,)[source]
local_attributes = {'authors': <obj_model.core.LocalAttribute object>, 'changes': <obj_model.core.LocalAttribute object>, 'comments': <obj_model.core.LocalAttribute object>, 'compartments': <obj_model.core.LocalAttribute object>, 'date': <obj_model.core.LocalAttribute object>, 'dfba_obj_reactions': <obj_model.core.LocalAttribute object>, 'dfba_obj_species': <obj_model.core.LocalAttribute object>, 'dfba_objs': <obj_model.core.LocalAttribute object>, 'distribution_init_concentrations': <obj_model.core.LocalAttribute object>, 'evidence': <obj_model.core.LocalAttribute object>, 'functions': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'identifiers': <obj_model.core.LocalAttribute object>, 'model': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'observables': <obj_model.core.LocalAttribute object>, 'parameters': <obj_model.core.LocalAttribute object>, 'process': <obj_model.core.LocalAttribute object>, 'rate_laws': <obj_model.core.LocalAttribute object>, 'reactions': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'species': <obj_model.core.LocalAttribute object>, 'species_types': <obj_model.core.LocalAttribute object>, 'std': <obj_model.core.LocalAttribute object>, 'stop_conditions': <obj_model.core.LocalAttribute object>, 'submodels': <obj_model.core.LocalAttribute object>, 'type': <obj_model.core.LocalAttribute object>, 'units': <obj_model.core.LocalAttribute object>, 'value': <obj_model.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.SlugAttribute object>[source]
related_attributes = {'changes': <obj_model.core.ManyToManyAttribute object>, 'compartments': <obj_model.core.ManyToManyAttribute object>, 'dfba_obj_reactions': <obj_model.core.ManyToManyAttribute object>, 'dfba_obj_species': <obj_model.core.ManyToManyAttribute object>, 'dfba_objs': <obj_model.core.ManyToManyAttribute object>, 'distribution_init_concentrations': <obj_model.core.ManyToManyAttribute object>, 'functions': <obj_model.core.ManyToManyAttribute object>, 'observables': <obj_model.core.ManyToManyAttribute object>, 'parameters': <obj_model.core.ManyToManyAttribute object>, 'rate_laws': <obj_model.core.ManyToManyAttribute object>, 'reactions': <obj_model.core.ManyToManyAttribute object>, 'species': <obj_model.core.ManyToManyAttribute object>, 'species_types': <obj_model.core.ManyToManyAttribute object>, 'stop_conditions': <obj_model.core.ManyToManyAttribute object>, 'submodels': <obj_model.core.ManyToManyAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Conclusion'[source]
verbose_name_plural = 'Conclusions'[source]
authors = <obj_model.core.ManyToManyAttribute object>[source]
comments = <wc_lang.core.CommentAttribute object>[source]
date = <obj_model.core.DateTimeAttribute object>[source]
evidence = <wc_lang.core.EvidenceManyToManyAttribute object>[source]
id = <obj_model.core.SlugAttribute object>[source]
identifiers = <wc_lang.core.IdentifierManyToManyAttribute object>[source]
model = <obj_model.core.ManyToOneAttribute object>[source]
name = <obj_model.core.StringAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
process = <obj_model.core.ManyToOneAttribute object>[source]
references = <obj_model.core.ManyToManyAttribute object>[source]
std = <obj_model.core.StringAttribute object>[source]
type = <obj_model.ontology.OntologyAttribute object>[source]
units = <obj_model.units.UnitAttribute object>[source]
value = <obj_model.core.StringAttribute object>[source]
class wc_lang.core.DfbaObjReaction(**kwargs)[source]

Bases: obj_model.core.Model, wc_lang.sbml.util.SbmlModelMixin

A pseudo-reaction used to represent the interface between metabolism and other cell processes.

id[source]

unique identifier

Type:str
name[source]

name

Type:str
model[source]

model

Type:Model
submodel[source]

submodel that uses this reaction

Type:Submodel
units[source]

rate units

Type:unit_registry.Unit
cell_size_units[source]

cell size units

Type:unit_registry.Unit
identifiers[source]

identifiers

Type:list of Identifier
conclusions[source]

conclusions

Type:list of Conclusion
comments[source]

comments

Type:str
references[source]

references

Type:list of Reference

Related attributes:

class Meta[source]

Bases: obj_model.core.Meta, obj_model.expression.ExpressionDynamicTermMeta

attribute_order = ('id', 'name', 'submodel', 'units', 'cell_size_units', 'identifiers', 'evidence', 'conclusions', 'comments', 'references')[source]
attributes = {'cell_size_units': <obj_model.units.UnitAttribute object>, 'comments': <wc_lang.core.CommentAttribute object>, 'conclusions': <obj_model.core.ManyToManyAttribute object>, 'evidence': <wc_lang.core.EvidenceManyToManyAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'identifiers': <wc_lang.core.IdentifierManyToManyAttribute object>, 'model': <obj_model.core.ManyToOneAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>, 'submodel': <obj_model.core.ManyToOneAttribute object>, 'units': <obj_model.units.UnitAttribute object>}[source]
child_attrs = {'sbml': ('id', 'name', 'model', 'submodel', 'units', 'cell_size_units', 'identifiers', 'comments'), 'wc_sim': ('id', 'model', 'submodel', 'units', 'cell_size_units')}[source]
children = {'core_model': ('dfba_obj_species', 'identifiers', 'evidence', 'conclusions', 'references'), 'submodel': ('dfba_obj_species', 'identifiers', 'evidence', 'conclusions', 'references')}[source]
expression_term_units = 'units'[source]
indexed_attrs_tuples = (('id',),)[source]
inheritance = (<class 'wc_lang.core.DfbaObjReaction'>,)[source]
local_attributes = {'cell_size_units': <obj_model.core.LocalAttribute object>, 'comments': <obj_model.core.LocalAttribute object>, 'conclusions': <obj_model.core.LocalAttribute object>, 'dfba_obj_expression': <obj_model.core.LocalAttribute object>, 'dfba_obj_species': <obj_model.core.LocalAttribute object>, 'evidence': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'identifiers': <obj_model.core.LocalAttribute object>, 'model': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'submodel': <obj_model.core.LocalAttribute object>, 'units': <obj_model.core.LocalAttribute object>}[source]
merge = 2[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.SlugAttribute object>[source]
related_attributes = {'dfba_obj_expression': <obj_model.core.OneToManyAttribute object>, 'dfba_obj_species': <obj_model.core.ManyToOneAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'dFBA objective reaction'[source]
verbose_name_plural = 'dFBA objective reactions'[source]
cell_size_units = <obj_model.units.UnitAttribute object>[source]
comments = <wc_lang.core.CommentAttribute object>[source]
conclusions = <obj_model.core.ManyToManyAttribute object>[source]
evidence = <wc_lang.core.EvidenceManyToManyAttribute object>[source]
export_relations_to_sbml(sbml_model, sbml_rxn)[source]

Add relationships to/from object to SBML reaction.

Parameters:
  • sbml_model (libsbml.Model) – SBML model
  • sbml_rxn (libsbml.Reaction) – SBML reaction
export_to_sbml(sbml_model)[source]

Add a dFBA objective reaction to a SBML model.

DfbaObjReactions are added to the SBML model because they can be used in a dFBA submodel’s objective function. In fact the default objective function is the submodel’s dFBA objective reaction. Since SBML does not define DfbaObjReaction as a separate class, DfbaObjReactions are added to the SBML model as SBML reactions. CheckModel ensures that wc_lang DfbaObjReactions and Reactions have distinct ids.

Parameters:sbml_model (libsbml.Model) – SBML model
Returns:SBML reaction
Return type:libsbml.Reaction
id = <obj_model.core.SlugAttribute object>[source]
identifiers = <wc_lang.core.IdentifierManyToManyAttribute object>[source]
import_from_sbml(sbml_rxn)[source]

Load from SBML reaction

Parameters:sbml (libsbml.Reaction) – SBML reaction
import_relations_from_sbml(sbml_rxn, objs)[source]

Load relationships from SBML reaction

Parameters:
  • sbml (libsbml.Reaction) – SBML reaction
  • objs (dict) – dictionary that maps WC-Lang types to dictionaries that map the ids of WC-Lang objects to WC-Lang objects
model = <obj_model.core.ManyToOneAttribute object>[source]
name = <obj_model.core.StringAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
references = <obj_model.core.ManyToManyAttribute object>[source]
submodel = <obj_model.core.ManyToOneAttribute object>[source]
units = <obj_model.units.UnitAttribute object>[source]
class wc_lang.core.DfbaObjSpecies(**kwargs)[source]

Bases: obj_model.core.Model, wc_lang.sbml.util.SbmlModelMixin

A dFBA objective reaction contains a list of DfbaObjSpecies instances. Distinct DfbaObjSpecies enable separate comments and references for each one.

id[source]

unique identifier per DfbaObjSpecies equal to dfba-net-species-{dfba_obj_reaction.id}-{species.id}

Type:str
name[source]

name

Type:str
model[source]

model

Type:Model
dfba_obj_reaction[source]

the dFBA objective reaction that uses the dFBA objective species

Type:DfbaObjReaction
species[source]

species

Type:Species
value[source]

the specie’s reaction coefficient

Type:float
units[source]

units of the value

Type:unit_registry.Unit
identifiers[source]

identifiers

Type:list of Identifier
conclusions[source]

conclusions

Type:list of Conclusion
comments[source]

comments

Type:str
references[source]

references

Type:list of Reference
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'name', 'dfba_obj_reaction', 'species', 'value', 'units', 'identifiers', 'evidence', 'conclusions', 'comments', 'references')[source]
attributes = {'comments': <wc_lang.core.CommentAttribute object>, 'conclusions': <obj_model.core.ManyToManyAttribute object>, 'dfba_obj_reaction': <obj_model.core.ManyToOneAttribute object>, 'evidence': <wc_lang.core.EvidenceManyToManyAttribute object>, 'id': <obj_model.core.StringAttribute object>, 'identifiers': <wc_lang.core.IdentifierManyToManyAttribute object>, 'model': <obj_model.core.ManyToOneAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>, 'species': <obj_model.core.ManyToOneAttribute object>, 'units': <obj_model.units.UnitAttribute object>, 'value': <obj_model.core.FloatAttribute object>}[source]
child_attrs = {'sbml': ('id', 'name', 'model', 'dfba_obj_reaction', 'species', 'value', 'units', 'identifiers', 'comments'), 'wc_sim': ('id', 'model', 'dfba_obj_reaction', 'species', 'value', 'units')}[source]
children = {'core_model': ('dfba_obj_reaction', 'species', 'identifiers', 'evidence', 'conclusions', 'references'), 'submodel': ('dfba_obj_reaction', 'species', 'identifiers', 'evidence', 'conclusions', 'references')}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_lang.core.DfbaObjSpecies'>,)[source]
local_attributes = {'comments': <obj_model.core.LocalAttribute object>, 'conclusions': <obj_model.core.LocalAttribute object>, 'dfba_obj_reaction': <obj_model.core.LocalAttribute object>, 'evidence': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'identifiers': <obj_model.core.LocalAttribute object>, 'model': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'species': <obj_model.core.LocalAttribute object>, 'units': <obj_model.core.LocalAttribute object>, 'value': <obj_model.core.LocalAttribute object>}[source]
merge = 2[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.StringAttribute object>[source]
related_attributes = {}[source]
unique_together = ()[source]
verbose_name = 'dFBA objective species'[source]
verbose_name_plural = 'dFBA objective species'[source]
comments = <wc_lang.core.CommentAttribute object>[source]
conclusions = <obj_model.core.ManyToManyAttribute object>[source]
dfba_obj_reaction = <obj_model.core.ManyToOneAttribute object>[source]
evidence = <wc_lang.core.EvidenceManyToManyAttribute object>[source]
gen_id()[source]

Generate identifier equal to dfba-net-species-{dfba_obj_reaction.id}-{species.id}

Returns:identifier
Return type:str
id = <obj_model.core.StringAttribute object>[source]
identifiers = <wc_lang.core.IdentifierManyToManyAttribute object>[source]
model = <obj_model.core.ManyToOneAttribute object>[source]
name = <obj_model.core.StringAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
references = <obj_model.core.ManyToManyAttribute object>[source]
species = <obj_model.core.ManyToOneAttribute object>[source]
units = <obj_model.units.UnitAttribute object>[source]
validate()[source]

Validate that the dFBA objective is valid

  • Check if the identifier is equal to dfba-net-species-{dfba_obj_reaction.id}-{species.id}
  • Units consistent with units of cell size
Returns:
None if the object is valid,
otherwise return a list of errors as an instance of InvalidObject
Return type:InvalidObject or None
value = <obj_model.core.FloatAttribute object>[source]
class wc_lang.core.DfbaObjective(**kwargs)[source]

Bases: obj_model.core.Model, wc_lang.sbml.util.SbmlModelMixin

dFBA objective function

id[source]

identifier equal to dfba-obj-{submodel.id}

Type:str
name[source]

name

Type:str
model[source]

model

Type:Model
submodel[source]

the Submodel which uses this DfbaObjective

Type:Submodel
expression[source]

mathematical expression of the objective function

Type:DfbaObjectiveExpression
units[source]

units

Type:unit_registry.Unit
reaction_rate_units[source]

reaction rate units

Type:unit_registry.Unit
coefficient_units[source]

coefficient units

Type:unit_registry.Unit
identifiers[source]

identifiers

Type:list of Identifier
conclusions[source]

conclusions

Type:list of Conclusion
comments[source]

comments

Type:str
references[source]

references

Type:list of Reference
class Meta[source]

Bases: obj_model.core.Meta, obj_model.expression.ExpressionExpressionTermMeta

attribute_order = ('id', 'name', 'submodel', 'expression', 'units', 'reaction_rate_units', 'coefficient_units', 'identifiers', 'evidence', 'conclusions', 'comments', 'references')[source]
attributes = {'coefficient_units': <obj_model.units.UnitAttribute object>, 'comments': <wc_lang.core.CommentAttribute object>, 'conclusions': <obj_model.core.ManyToManyAttribute object>, 'evidence': <wc_lang.core.EvidenceManyToManyAttribute object>, 'expression': <obj_model.expression.ExpressionOneToOneAttribute object>, 'id': <obj_model.core.StringAttribute object>, 'identifiers': <wc_lang.core.IdentifierManyToManyAttribute object>, 'model': <obj_model.core.ManyToOneAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'reaction_rate_units': <obj_model.units.UnitAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>, 'submodel': <obj_model.core.OneToOneAttribute object>, 'units': <obj_model.units.UnitAttribute object>}[source]
child_attrs = {'sbml': ('id', 'name', 'model', 'submodel', 'expression', 'units', 'reaction_rate_units', 'coefficient_units', 'identifiers', 'comments'), 'wc_sim': ('id', 'model', 'submodel', 'expression', 'units', 'reaction_rate_units', 'coefficient_units')}[source]
children = {'core_model': ('expression', 'identifiers', 'evidence', 'conclusions', 'references'), 'submodel': ('expression', 'identifiers', 'evidence', 'conclusions', 'references')}[source]
expression_term_model[source]

alias of DfbaObjectiveExpression

expression_term_units = 'units'[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_lang.core.DfbaObjective'>,)[source]
local_attributes = {'coefficient_units': <obj_model.core.LocalAttribute object>, 'comments': <obj_model.core.LocalAttribute object>, 'conclusions': <obj_model.core.LocalAttribute object>, 'evidence': <obj_model.core.LocalAttribute object>, 'expression': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'identifiers': <obj_model.core.LocalAttribute object>, 'model': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'reaction_rate_units': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'submodel': <obj_model.core.LocalAttribute object>, 'units': <obj_model.core.LocalAttribute object>}[source]
merge = 2[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.StringAttribute object>[source]
related_attributes = {}[source]
unique_together = ()[source]
verbose_name = 'dFBA objective'[source]
verbose_name_plural = 'dFBA objectives'[source]
coefficient_units = <obj_model.units.UnitAttribute object>[source]
comments = <wc_lang.core.CommentAttribute object>[source]
conclusions = <obj_model.core.ManyToManyAttribute object>[source]
evidence = <wc_lang.core.EvidenceManyToManyAttribute object>[source]
export_relations_to_sbml(sbml_model, sbml)[source]

Add relationships to/from object to SBML objective.

Parameters:
  • sbml_model (libsbml.Model) – SBML model
  • sbml (libsbml.Objective) – SBML objective
export_to_sbml(sbml_model)[source]

Add this dFBA objective to a SBML model.

This uses version 2 of the ‘Flux Balance Constraints’ extension. SBML assumes that an DfbaObjective is a linear combination of reaction fluxes.

Parameters:sbml_model (libsbml.Model) – SBML model
Returns:SBML objective
Return type:libsbml.Objective
expression = <obj_model.expression.ExpressionOneToOneAttribute object>[source]
gen_id()[source]

Generate identifier

Returns:identifier
Return type:str
get_products(_DfbaObjective__type=None, **kwargs)[source]

Get the species produced by this objective function

Parameters:
  • __type (types.TypeType or tuple of types.TypeType) – subclass(es) of Model
  • kwargs (dict of str –> object) – dictionary of attribute name/value pairs to find matching objects
Returns:

species produced by this objective function

Return type:

list of Species

id = <obj_model.core.StringAttribute object>[source]
identifiers = <wc_lang.core.IdentifierManyToManyAttribute object>[source]
import_from_sbml(sbml)[source]

Load from SBML objective

Parameters:sbml (libsbml.Objective) – SBML objective
import_relations_from_sbml(sbml, objs)[source]

Load relationships from SBML objective

Parameters:
  • sbml (libsbml.Objective) – SBML objective
  • objs (dict) – dictionary that maps WC-Lang types to dictionaries that map the ids of WC-Lang objects to WC-Lang objects
model = <obj_model.core.ManyToOneAttribute object>[source]
name = <obj_model.core.StringAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
reaction_rate_units = <obj_model.units.UnitAttribute object>[source]
references = <obj_model.core.ManyToManyAttribute object>[source]
submodel = <obj_model.core.OneToOneAttribute object>[source]
units = <obj_model.units.UnitAttribute object>[source]
validate()[source]

Validate that the dFBA objective is valid

  • Check if the identifier is equal to dfba-obj-{submodel.id}]
Returns:
None if the object is valid,
otherwise return a list of errors as an instance of InvalidObject
Return type:InvalidObject or None
class wc_lang.core.DfbaObjectiveExpression(**kwargs)[source]

Bases: obj_model.core.Model, obj_model.expression.Expression, wc_lang.sbml.util.SbmlModelMixin

A mathematical expression of Reactions and DfbaObjReactions

The expression used by a DfbaObjective.

expression[source]

mathematical expression

Type:str
_parsed_expression[source]

an analyzed expression; not an obj_model.Model

Type:ParsedExpression
reactions[source]

reactions used by this expression

Type:list of Reaction
dfba_obj_reactions[source]

dFBA objective reactions used by this expression

Type:list of Species

Related attributes:

class Meta[source]

Bases: obj_model.core.Meta, obj_model.expression.Meta

attribute_order = ()[source]
attributes = {'dfba_obj_reactions': <obj_model.core.OneToManyAttribute object>, 'expression': <obj_model.core.LongStringAttribute object>, 'reactions': <obj_model.core.OneToManyAttribute object>}[source]
child_attrs = {'sbml': ('expression', 'reactions', 'dfba_obj_reactions'), 'wc_sim': ('expression', 'reactions', 'dfba_obj_reactions')}[source]
children = {'core_model': ('reactions', 'dfba_obj_reactions'), 'submodel': ('reactions', 'dfba_obj_reactions')}[source]
expression_term_models = ('Reaction', 'DfbaObjReaction')[source]
expression_unit_registry = <pint.registry.UnitRegistry object>[source]
expression_valid_functions = ()[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_lang.core.DfbaObjectiveExpression'>,)[source]
local_attributes = {'dfba_obj': <obj_model.core.LocalAttribute object>, 'dfba_obj_reactions': <obj_model.core.LocalAttribute object>, 'expression': <obj_model.core.LocalAttribute object>, 'reactions': <obj_model.core.LocalAttribute object>}[source]
merge = 2[source]
ordering = ('expression',)[source]
primary_attribute = <obj_model.core.LongStringAttribute object>[source]
related_attributes = {'dfba_obj': <obj_model.expression.ExpressionOneToOneAttribute object>}[source]
tabular_orientation = 3[source]
unique_together = ()[source]
verbose_name = 'dFBA objective expression'[source]
verbose_name_plural = 'dFBA objective expressions'[source]
classmethod deserialize(value, objects)[source]

Deserialize value

Parameters:
  • value (str) – String representation
  • objects (dict) – dictionary of objects, grouped by model
Returns:

tuple

of cleaned value and cleaning error

Return type:

tuple of DfbaObjectiveExpression, InvalidAttribute or None

dfba_obj_reactions = <obj_model.core.OneToManyAttribute object>[source]
expression = <obj_model.core.LongStringAttribute object>[source]
merge_attrs(other, other_objs_in_self, self_objs_in_other)[source]

Merge attributes of two objects

Parameters:
  • other (obj_model.Model) – other model
  • other_objs_in_self (dict) – dictionary that maps instances of objects in another model to objects in a model
  • self_objs_in_other (dict) – dictionary that maps instances of objects in a model to objects in another model
objects = <obj_model.core.Manager object>[source]
reactions = <obj_model.core.OneToManyAttribute object>[source]
serialize()[source]

Generate string representation

Returns:string representation
Return type:str
validate()[source]

Determine if the dFBA objective expression is valid

  • Check that the expression is a linear function
  • Check if expression is a function of at least one reaction or dFBA objective reaction
  • Check that the reactions and dFBA objective reactions belong to the same submodel
Returns:
None if the object is valid,
otherwise return a list of errors in an InvalidObject instance
Return type:InvalidObject or None
class wc_lang.core.DistributionInitConcentration(**kwargs)[source]

Bases: obj_model.core.Model, wc_lang.sbml.util.SbmlModelMixin

Distribution of the initial concentration of a species at the beginning of each cell cycle

id[source]

identifier equal to dist-init-conc-{species.id}

Type:str
name[source]

name

Type:str
model[source]

model

Type:Model
species[source]

species

Type:Species
distribution[source]

distribution

Type:pronto.term.Term
mean[source]

mean concentration in a population of single cells at the beginning of each cell cycle

Type:float
std[source]

standard deviation of the concentration in a population of single cells at the beginning of each cell cycle

Type:float
units[source]

units; default units is M

Type:unit_registry.Unit
identifiers[source]

identifiers

Type:list of Identifier
conclusions[source]

conclusions

Type:list of Conclusion
comments[source]

comments

Type:str
references[source]

references

Type:list of Reference
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'name', 'species', 'distribution', 'mean', 'std', 'units', 'identifiers', 'evidence', 'conclusions', 'comments', 'references')[source]
attributes = {'comments': <wc_lang.core.CommentAttribute object>, 'conclusions': <obj_model.core.ManyToManyAttribute object>, 'distribution': <obj_model.ontology.OntologyAttribute object>, 'evidence': <wc_lang.core.EvidenceManyToManyAttribute object>, 'id': <obj_model.core.StringAttribute object>, 'identifiers': <wc_lang.core.IdentifierManyToManyAttribute object>, 'mean': <obj_model.core.FloatAttribute object>, 'model': <obj_model.core.ManyToOneAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>, 'species': <obj_model.core.OneToOneAttribute object>, 'std': <obj_model.core.FloatAttribute object>, 'units': <obj_model.units.UnitAttribute object>}[source]
child_attrs = {'sbml': ('id', 'name', 'model', 'species', 'distribution', 'mean', 'std', 'units', 'identifiers', 'comments'), 'wc_sim': ('id', 'model', 'species', 'distribution', 'mean', 'std', 'units')}[source]
children = {'core_model': ('species', 'identifiers', 'evidence', 'conclusions', 'references'), 'submodel': ('identifiers', 'evidence', 'conclusions', 'references')}[source]
frozen_columns = 1[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_lang.core.DistributionInitConcentration'>,)[source]
local_attributes = {'comments': <obj_model.core.LocalAttribute object>, 'conclusions': <obj_model.core.LocalAttribute object>, 'distribution': <obj_model.core.LocalAttribute object>, 'evidence': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'identifiers': <obj_model.core.LocalAttribute object>, 'mean': <obj_model.core.LocalAttribute object>, 'model': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'species': <obj_model.core.LocalAttribute object>, 'std': <obj_model.core.LocalAttribute object>, 'units': <obj_model.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.StringAttribute object>[source]
related_attributes = {}[source]
unique_together = ()[source]
verbose_name = 'Initial species concentration'[source]
verbose_name_plural = 'Initial species concentrations'[source]
comments = <wc_lang.core.CommentAttribute object>[source]
conclusions = <obj_model.core.ManyToManyAttribute object>[source]
distribution = <obj_model.ontology.OntologyAttribute object>[source]
evidence = <wc_lang.core.EvidenceManyToManyAttribute object>[source]
gen_id()[source]

Generate string representation

Returns:string representation
Return type:str
id = <obj_model.core.StringAttribute object>[source]
identifiers = <wc_lang.core.IdentifierManyToManyAttribute object>[source]
mean = <obj_model.core.FloatAttribute object>[source]
model = <obj_model.core.ManyToOneAttribute object>[source]
name = <obj_model.core.StringAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
references = <obj_model.core.ManyToManyAttribute object>[source]
species = <obj_model.core.OneToOneAttribute object>[source]
std = <obj_model.core.FloatAttribute object>[source]
units = <obj_model.units.UnitAttribute object>[source]
validate()[source]

Check that the distribution of initial concentrations at the beginning of each cell cycle is valid

  • Validate that identifier is equal to dist-init-conc-{species.id}]
Returns:
None if the object is valid,
otherwise return a list of errors as an instance of InvalidObject
Return type:InvalidObject or None
class wc_lang.core.Environment(**kwargs)[source]

Bases: obj_model.core.Model, wc_lang.sbml.util.SbmlModelMixin

id[source]

unique identifier equal to ‘env’

Type:str
name[source]

name

Type:str
model[source]

model

Type:Model
temp[source]

temperature

Type:float
temp_units[source]

temperature units

Type:unit_registry.Unit
identifiers[source]

identifiers

Type:list of Identifier
comments[source]

comments

Type:str
references[source]

references

Type:list of Reference
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'name', 'temp', 'temp_units', 'identifiers', 'comments', 'references')[source]
attributes = {'comments': <wc_lang.core.CommentAttribute object>, 'id': <obj_model.core.RegexAttribute object>, 'identifiers': <wc_lang.core.IdentifierOneToManyAttribute object>, 'model': <obj_model.core.OneToOneAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'references': <obj_model.core.OneToManyAttribute object>, 'temp': <obj_model.core.FloatAttribute object>, 'temp_units': <obj_model.units.UnitAttribute object>}[source]
child_attrs = {'sbml': ('id', 'name', 'model', 'temp', 'temp_units', 'identifiers', 'comments'), 'wc_sim': ()}[source]
children = {'core_model': ('identifiers', 'references'), 'submodel': ('identifiers', 'references')}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_lang.core.Environment'>,)[source]
local_attributes = {'comments': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'identifiers': <obj_model.core.LocalAttribute object>, 'model': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'temp': <obj_model.core.LocalAttribute object>, 'temp_units': <obj_model.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.RegexAttribute object>[source]
related_attributes = {}[source]
tabular_orientation = 2[source]
unique_together = ()[source]
verbose_name = 'Environment'[source]
verbose_name_plural = 'Environments'[source]
comments = <wc_lang.core.CommentAttribute object>[source]
id = <obj_model.core.RegexAttribute object>[source]
identifiers = <wc_lang.core.IdentifierOneToManyAttribute object>[source]
model = <obj_model.core.OneToOneAttribute object>[source]
name = <obj_model.core.StringAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
references = <obj_model.core.OneToManyAttribute object>[source]
temp = <obj_model.core.FloatAttribute object>[source]
temp_units = <obj_model.units.UnitAttribute object>[source]
class wc_lang.core.Evidence(**kwargs)[source]

Bases: obj_model.core.Model

Observation that supports/disputes an conclusion

observation[source]

observation which supports the conclusion

Type:Observation
type[source]

how the observation supports the conclusion (e.g. supporting, inconclusive, disputing)

Type:pronto.Term
strength (

obj:`float): how much the observation supports the conclusion

quality[source]

the reliability of the observation

Type:float

Related attributes:

class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('observation', 'type', 'strength', 'quality')[source]
attributes = {'observation': <obj_model.core.ManyToOneAttribute object>, 'quality': <obj_model.core.FloatAttribute object>, 'strength': <obj_model.core.FloatAttribute object>, 'type': <obj_model.ontology.OntologyAttribute object>}[source]
child_attrs = {'sbml': (), 'wc_sim': ()}[source]
children = {'core_model': ('observation',), 'submodel': ('observation',)}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_lang.core.Evidence'>,)[source]
local_attributes = {'changes': <obj_model.core.LocalAttribute object>, 'compartments': <obj_model.core.LocalAttribute object>, 'conclusions': <obj_model.core.LocalAttribute object>, 'dfba_obj_reactions': <obj_model.core.LocalAttribute object>, 'dfba_obj_species': <obj_model.core.LocalAttribute object>, 'dfba_objs': <obj_model.core.LocalAttribute object>, 'distribution_init_concentrations': <obj_model.core.LocalAttribute object>, 'functions': <obj_model.core.LocalAttribute object>, 'observables': <obj_model.core.LocalAttribute object>, 'observation': <obj_model.core.LocalAttribute object>, 'parameters': <obj_model.core.LocalAttribute object>, 'quality': <obj_model.core.LocalAttribute object>, 'rate_laws': <obj_model.core.LocalAttribute object>, 'reactions': <obj_model.core.LocalAttribute object>, 'species': <obj_model.core.LocalAttribute object>, 'species_types': <obj_model.core.LocalAttribute object>, 'stop_conditions': <obj_model.core.LocalAttribute object>, 'strength': <obj_model.core.LocalAttribute object>, 'submodels': <obj_model.core.LocalAttribute object>, 'type': <obj_model.core.LocalAttribute object>}[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {'changes': <wc_lang.core.EvidenceManyToManyAttribute object>, 'compartments': <wc_lang.core.EvidenceManyToManyAttribute object>, 'conclusions': <wc_lang.core.EvidenceManyToManyAttribute object>, 'dfba_obj_reactions': <wc_lang.core.EvidenceManyToManyAttribute object>, 'dfba_obj_species': <wc_lang.core.EvidenceManyToManyAttribute object>, 'dfba_objs': <wc_lang.core.EvidenceManyToManyAttribute object>, 'distribution_init_concentrations': <wc_lang.core.EvidenceManyToManyAttribute object>, 'functions': <wc_lang.core.EvidenceManyToManyAttribute object>, 'observables': <wc_lang.core.EvidenceManyToManyAttribute object>, 'parameters': <wc_lang.core.EvidenceManyToManyAttribute object>, 'rate_laws': <wc_lang.core.EvidenceManyToManyAttribute object>, 'reactions': <wc_lang.core.EvidenceManyToManyAttribute object>, 'species': <wc_lang.core.EvidenceManyToManyAttribute object>, 'species_types': <wc_lang.core.EvidenceManyToManyAttribute object>, 'stop_conditions': <wc_lang.core.EvidenceManyToManyAttribute object>, 'submodels': <wc_lang.core.EvidenceManyToManyAttribute object>}[source]
tabular_orientation = 3[source]
unique_together = ()[source]
verbose_name = 'Evidence'[source]
verbose_name_plural = 'Evidences'[source]
classmethod deserialize(value, objects)[source]

Deserialize value

Parameters:
  • value (str) – String representation
  • objects (dict) – dictionary of objects, grouped by model
Returns:

cleaned value InvalidAttribute: cleaning error

Return type:

DfbaObjectiveExpression

objects = <obj_model.core.Manager object>[source]
observation = <obj_model.core.ManyToOneAttribute object>[source]
quality = <obj_model.core.FloatAttribute object>[source]
serialize()[source]

Generate string representation

Returns:string representation
Return type:str
strength = <obj_model.core.FloatAttribute object>[source]
type = <obj_model.ontology.OntologyAttribute object>[source]
class wc_lang.core.EvidenceManyToManyAttribute(related_class, related_name='', default=[], default_cleaned_value=[], related_default=[], none_value=<class 'list'>, min_related=0, max_related=inf, min_related_rev=0, max_related_rev=inf, verbose_name='', verbose_related_name='', help='', related_manager=<class 'obj_model.core.ManyToManyRelatedManager'>)[source]

Bases: obj_model.core.ManyToManyAttribute

Many to many attribute for evidence

deserialize(value, objects, decoded=None)[source]

Deserialize value

Parameters:
  • value (str) – String representation
  • objects (dict) – dictionary of objects, grouped by model
  • decoded (dict, optional) – dictionary of objects that have already been decoded
Returns:

cleaned value InvalidAttribute: cleaning error

Return type:

list of Evidence

get_excel_validation()[source]

Get Excel validation

Returns:validation
Return type:wc_utils.workbook.io.FieldValidation
serialize(evidence, encoded=None)[source]

Serialize related object

Parameters:
  • evidence (list of Evidence) – Python representation of evidence
  • encoded (dict, optional) – dictionary of objects that have already been encoded
Returns:

simple Python representation

Return type:

str

class wc_lang.core.FluxBounds(**kwargs)[source]

Bases: obj_model.core.Model, wc_lang.sbml.util.SbmlModelMixin

Flux bounds

min[source]

minimum flux bound for solving an FBA model; negative for reversible reactions

Type:float
max[source]

maximum flux bound for solving an FBA model

Type:float
units[source]

units for the minimum and maximum fluxes

Type:unit_registry.Unit

Related attributes:

  • reactions (list of Reaction): reactions
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('min', 'max', 'units')[source]
attributes = {'max': <obj_model.core.FloatAttribute object>, 'min': <obj_model.core.FloatAttribute object>, 'units': <obj_model.units.UnitAttribute object>}[source]
child_attrs = {'sbml': ('min', 'max', 'units'), 'wc_sim': ('min', 'max', 'units')}[source]
children = {'core_model': (), 'submodel': ()}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_lang.core.FluxBounds'>,)[source]
local_attributes = {'max': <obj_model.core.LocalAttribute object>, 'min': <obj_model.core.LocalAttribute object>, 'reactions': <obj_model.core.LocalAttribute object>, 'units': <obj_model.core.LocalAttribute object>}[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {'reactions': <obj_model.core.ManyToOneAttribute object>}[source]
tabular_orientation = 4[source]
unique_together = (('max', 'min', 'units'),)[source]
verbose_name = 'Flux bounds'[source]
verbose_name_plural = 'Flux boundss'[source]
max = <obj_model.core.FloatAttribute object>[source]
min = <obj_model.core.FloatAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
serialize()[source]

Generate string representation

Returns:string representation
Return type:str
units = <obj_model.units.UnitAttribute object>[source]
class wc_lang.core.Function(**kwargs)[source]

Bases: obj_model.core.Model, wc_lang.sbml.util.SbmlAssignmentRuleMixin

Function: a mathematical expression of Functions, Observbles, Parameters and Python functions

id[source]

unique id

Type:str
name[source]

name

Type:str
model[source]

model

Type:Model
expression[source]

mathematical expression for a Function

Type:FunctionExpression
units[source]

units

Type:unit_registry.Unit
identifiers[source]

identifiers

Type:list of Identifier
conclusions[source]

conclusions

Type:list of Conclusion
comments[source]

comments

Type:str
references[source]

references

Type:list of Reference

Related attributes:

class Meta[source]

Bases: obj_model.core.Meta, obj_model.expression.ExpressionExpressionTermMeta

attribute_order = ('id', 'name', 'expression', 'units', 'identifiers', 'evidence', 'conclusions', 'comments', 'references')[source]
attributes = {'comments': <wc_lang.core.CommentAttribute object>, 'conclusions': <obj_model.core.ManyToManyAttribute object>, 'evidence': <wc_lang.core.EvidenceManyToManyAttribute object>, 'expression': <obj_model.expression.ExpressionOneToOneAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'identifiers': <wc_lang.core.IdentifierManyToManyAttribute object>, 'model': <obj_model.core.ManyToOneAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>, 'units': <obj_model.units.UnitAttribute object>}[source]
child_attrs = {'sbml': ('id', 'name', 'model', 'expression', 'units', 'identifiers', 'comments'), 'wc_sim': ('id', 'model', 'expression', 'units')}[source]
children = {'core_model': ('expression', 'identifiers', 'evidence', 'conclusions', 'references'), 'submodel': ('expression', 'identifiers', 'evidence', 'conclusions', 'references')}[source]
expression_term_model[source]

alias of FunctionExpression

expression_term_units = 'units'[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_lang.core.Function'>,)[source]
local_attributes = {'comments': <obj_model.core.LocalAttribute object>, 'conclusions': <obj_model.core.LocalAttribute object>, 'evidence': <obj_model.core.LocalAttribute object>, 'expression': <obj_model.core.LocalAttribute object>, 'function_expressions': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'identifiers': <obj_model.core.LocalAttribute object>, 'model': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'rate_law_expressions': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'stop_condition_expressions': <obj_model.core.LocalAttribute object>, 'units': <obj_model.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.SlugAttribute object>[source]
related_attributes = {'function_expressions': <obj_model.core.ManyToManyAttribute object>, 'rate_law_expressions': <obj_model.core.ManyToManyAttribute object>, 'stop_condition_expressions': <obj_model.core.ManyToManyAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Function'[source]
verbose_name_plural = 'Functions'[source]
comments = <wc_lang.core.CommentAttribute object>[source]
conclusions = <obj_model.core.ManyToManyAttribute object>[source]
evidence = <wc_lang.core.EvidenceManyToManyAttribute object>[source]
expression = <obj_model.expression.ExpressionOneToOneAttribute object>[source]
id = <obj_model.core.SlugAttribute object>[source]
identifiers = <wc_lang.core.IdentifierManyToManyAttribute object>[source]
model = <obj_model.core.ManyToOneAttribute object>[source]
name = <obj_model.core.StringAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
references = <obj_model.core.ManyToManyAttribute object>[source]
units = <obj_model.units.UnitAttribute object>[source]
validate()[source]

Check that the Function is valid

  • Check that expression has units units
Returns:
None if the object is valid,
otherwise return a list of errors as an instance of InvalidObject
Return type:InvalidObject or None
class wc_lang.core.FunctionExpression(**kwargs)[source]

Bases: obj_model.core.Model, obj_model.expression.Expression, wc_lang.sbml.util.SbmlModelMixin

A mathematical expression of Functions, Observbles, Parameters and Python functions

The expression used by a Function.

expression[source]

mathematical expression for a Function

Type:str
_parsed_expression[source]

an analyzed expression; not an obj_model.Model

Type:ParsedExpression
species[source]

Species used by this function expression

Type:list of Species
observables[source]

Observables used by this function expression

Type:list of Observable
parameters[source]

Parameters used by this function expression

Type:list of Parameter
functions[source]

other Functions used by this function expression

Type:list of Function
compartments[source]

Compartments used by this stop condition expression

Type:list of Compartment

Related attributes:

class Meta[source]

Bases: obj_model.core.Meta, obj_model.expression.Meta

attribute_order = ()[source]
attributes = {'compartments': <obj_model.core.ManyToManyAttribute object>, 'expression': <obj_model.core.LongStringAttribute object>, 'functions': <obj_model.core.ManyToManyAttribute object>, 'observables': <obj_model.core.ManyToManyAttribute object>, 'parameters': <obj_model.core.ManyToManyAttribute object>, 'species': <obj_model.core.ManyToManyAttribute object>}[source]
child_attrs = {'sbml': ('expression', 'parameters', 'species', 'observables', 'functions', 'compartments'), 'wc_sim': ('expression', 'parameters', 'species', 'observables', 'functions', 'compartments')}[source]
children = {'core_model': ('parameters', 'species', 'observables', 'functions', 'compartments'), 'submodel': ('parameters', 'species', 'observables', 'functions', 'compartments')}[source]
expression_term_models = ('Parameter', 'Species', 'Observable', 'Function', 'Compartment')[source]
expression_unit_registry = <pint.registry.UnitRegistry object>[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_lang.core.FunctionExpression'>,)[source]
local_attributes = {'compartments': <obj_model.core.LocalAttribute object>, 'expression': <obj_model.core.LocalAttribute object>, 'function': <obj_model.core.LocalAttribute object>, 'functions': <obj_model.core.LocalAttribute object>, 'observables': <obj_model.core.LocalAttribute object>, 'parameters': <obj_model.core.LocalAttribute object>, 'species': <obj_model.core.LocalAttribute object>}[source]
ordering = ('expression',)[source]
primary_attribute = <obj_model.core.LongStringAttribute object>[source]
related_attributes = {'function': <obj_model.expression.ExpressionOneToOneAttribute object>}[source]
tabular_orientation = 3[source]
unique_together = ()[source]
verbose_name = 'Function expression'[source]
verbose_name_plural = 'Function expressions'[source]
compartments = <obj_model.core.ManyToManyAttribute object>[source]
classmethod deserialize(value, objects)[source]

Deserialize value

Parameters:
  • value (str) – String representation
  • objects (dict) – dictionary of objects, grouped by model
Returns:

tuple of cleaned value

and cleaning error

Return type:

tuple of FunctionExpression, InvalidAttribute or None

expression = <obj_model.core.LongStringAttribute object>[source]
functions = <obj_model.core.ManyToManyAttribute object>[source]
merge_attrs(other, other_objs_in_self, self_objs_in_other)[source]

Merge attributes of two objects

Parameters:
  • other (obj_model.Model) – other model
  • other_objs_in_self (dict) – dictionary that maps instances of objects in another model to objects in a model
  • self_objs_in_other (dict) – dictionary that maps instances of objects in a model to objects in another model
objects = <obj_model.core.Manager object>[source]
observables = <obj_model.core.ManyToManyAttribute object>[source]
parameters = <obj_model.core.ManyToManyAttribute object>[source]
serialize()[source]

Generate string representation

Returns:string representation
Return type:str
species = <obj_model.core.ManyToManyAttribute object>[source]
validate()[source]

Check that the function is valid

  • Check that the expression is a valid Python function
Returns:
None if the object is valid,
otherwise return a list of errors as an instance of InvalidObject
Return type:InvalidObject or None
class wc_lang.core.Identifier(**kwargs)[source]

Bases: obj_model.core.Model, wc_lang.sbml.util.SbmlModelMixin

Reference to an entry in a namespace

namespace[source]

namespace name

Type:str
id[source]

id of entry in namespace

Type:str

Related attributes:

class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('namespace', 'id')[source]
attributes = {'id': <obj_model.core.StringAttribute object>, 'namespace': <obj_model.core.StringAttribute object>}[source]
child_attrs = {'sbml': ('namespace', 'id'), 'wc_sim': ()}[source]
frozen_columns = 2[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_lang.core.Identifier'>,)[source]
local_attributes = {'authors': <obj_model.core.LocalAttribute object>, 'changes': <obj_model.core.LocalAttribute object>, 'compartments': <obj_model.core.LocalAttribute object>, 'conclusions': <obj_model.core.LocalAttribute object>, 'dfba_obj_reactions': <obj_model.core.LocalAttribute object>, 'dfba_obj_species': <obj_model.core.LocalAttribute object>, 'dfba_objs': <obj_model.core.LocalAttribute object>, 'distribution_init_concentrations': <obj_model.core.LocalAttribute object>, 'env': <obj_model.core.LocalAttribute object>, 'functions': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'model': <obj_model.core.LocalAttribute object>, 'namespace': <obj_model.core.LocalAttribute object>, 'observables': <obj_model.core.LocalAttribute object>, 'observation_sets': <obj_model.core.LocalAttribute object>, 'observations': <obj_model.core.LocalAttribute object>, 'parameters': <obj_model.core.LocalAttribute object>, 'rate_laws': <obj_model.core.LocalAttribute object>, 'reactions': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'species': <obj_model.core.LocalAttribute object>, 'species_types': <obj_model.core.LocalAttribute object>, 'stop_conditions': <obj_model.core.LocalAttribute object>, 'submodels': <obj_model.core.LocalAttribute object>, 'taxon': <obj_model.core.LocalAttribute object>}[source]
ordering = ('namespace', 'id')[source]
primary_attribute = None[source]
related_attributes = {'authors': <wc_lang.core.IdentifierManyToManyAttribute object>, 'changes': <wc_lang.core.IdentifierManyToManyAttribute object>, 'compartments': <wc_lang.core.IdentifierManyToManyAttribute object>, 'conclusions': <wc_lang.core.IdentifierManyToManyAttribute object>, 'dfba_obj_reactions': <wc_lang.core.IdentifierManyToManyAttribute object>, 'dfba_obj_species': <wc_lang.core.IdentifierManyToManyAttribute object>, 'dfba_objs': <wc_lang.core.IdentifierManyToManyAttribute object>, 'distribution_init_concentrations': <wc_lang.core.IdentifierManyToManyAttribute object>, 'env': <wc_lang.core.IdentifierOneToManyAttribute object>, 'functions': <wc_lang.core.IdentifierManyToManyAttribute object>, 'model': <wc_lang.core.IdentifierOneToManyAttribute object>, 'observables': <wc_lang.core.IdentifierManyToManyAttribute object>, 'observation_sets': <wc_lang.core.IdentifierManyToManyAttribute object>, 'observations': <wc_lang.core.IdentifierManyToManyAttribute object>, 'parameters': <wc_lang.core.IdentifierManyToManyAttribute object>, 'rate_laws': <wc_lang.core.IdentifierManyToManyAttribute object>, 'reactions': <wc_lang.core.IdentifierManyToManyAttribute object>, 'references': <wc_lang.core.IdentifierManyToManyAttribute object>, 'species': <wc_lang.core.IdentifierManyToManyAttribute object>, 'species_types': <wc_lang.core.IdentifierManyToManyAttribute object>, 'stop_conditions': <wc_lang.core.IdentifierManyToManyAttribute object>, 'submodels': <wc_lang.core.IdentifierManyToManyAttribute object>, 'taxon': <wc_lang.core.IdentifierOneToManyAttribute object>}[source]
tabular_orientation = 3[source]
unique_together = (('id', 'namespace'),)[source]
verbose_name = 'Identifier'[source]
verbose_name_plural = 'Identifiers'[source]
classmethod deserialize(value, objects)[source]

Deserialize value

Parameters:
  • value (str) – String representation
  • objects (dict) – dictionary of objects, grouped by model
Returns:

cleaned value InvalidAttribute: cleaning error

Return type:

Identifier

id = <obj_model.core.StringAttribute object>[source]
namespace = <obj_model.core.StringAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
serialize()[source]

Generate string representation

Returns:value of primary attribute
Return type:str
class wc_lang.core.IdentifierManyToManyAttribute(related_name='', verbose_name='Identifiers', verbose_related_name='', help='')[source]

Bases: obj_model.core.ManyToManyAttribute

deserialize(value, objects, decoded=None)[source]

Deserialize value

Parameters:
  • value (str) – String representation
  • objects (dict) – dictionary of objects, grouped by model
  • decoded (dict, optional) – dictionary of objects that have already been decoded
Returns:

cleaned value InvalidAttribute: cleaning error

Return type:

list of Identifier

get_excel_validation()[source]

Get Excel validation

Returns:validation
Return type:wc_utils.workbook.io.FieldValidation
serialize(identifiers, encoded=None)[source]

Serialize related object

Parameters:
  • identifiers (list of Identifier) – Python representation of identifiers
  • encoded (dict, optional) – dictionary of objects that have already been encoded
Returns:

string representation

Return type:

str

class wc_lang.core.IdentifierOneToManyAttribute(related_name='', verbose_name='Identifiers', verbose_related_name='', help='')[source]

Bases: obj_model.core.OneToManyAttribute

deserialize(value, objects, decoded=None)[source]

Deserialize value

Parameters:
  • value (str) – String representation
  • objects (dict) – dictionary of objects, grouped by model
  • decoded (dict, optional) – dictionary of objects that have already been decoded
Returns:

cleaned value InvalidAttribute: cleaning error

Return type:

list of Identifier

get_excel_validation()[source]

Get Excel validation

Returns:validation
Return type:wc_utils.workbook.io.FieldValidation
serialize(identifiers, encoded=None)[source]

Serialize related object

Parameters:
  • identifiers (list of Identifier) – Python representation of identifiers
  • encoded (dict, optional) – dictionary of objects that have already been encoded
Returns:

string representation

Return type:

str

class wc_lang.core.InitVolume(**kwargs)[source]

Bases: obj_model.core.Model, wc_lang.sbml.util.SbmlModelMixin

Initial volume of a compartment

distribution[source]

distribution

Type:proto.Term
mean[source]

mean initial volume

Type:float
std[source]

standard deviation of the mean initial volume

Type:float
units[source]

units of volume

Type:unit_registry.Unit

Related attributes:

class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('distribution', 'mean', 'std', 'units')[source]
attributes = {'distribution': <obj_model.ontology.OntologyAttribute object>, 'mean': <obj_model.core.FloatAttribute object>, 'std': <obj_model.core.FloatAttribute object>, 'units': <obj_model.units.UnitAttribute object>}[source]
child_attrs = {'sbml': ('distribution', 'mean', 'std', 'units'), 'wc_sim': ('distribution', 'mean', 'std', 'units')}[source]
children = {'core_model': (), 'submodel': ()}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_lang.core.InitVolume'>,)[source]
local_attributes = {'compartments': <obj_model.core.LocalAttribute object>, 'distribution': <obj_model.core.LocalAttribute object>, 'mean': <obj_model.core.LocalAttribute object>, 'std': <obj_model.core.LocalAttribute object>, 'units': <obj_model.core.LocalAttribute object>}[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {'compartments': <obj_model.core.ManyToOneAttribute object>}[source]
tabular_orientation = 4[source]
unique_together = (('distribution', 'mean', 'std', 'units'),)[source]
verbose_name = 'Init volume'[source]
verbose_name_plural = 'Init volumes'[source]
distribution = <obj_model.ontology.OntologyAttribute object>[source]
mean = <obj_model.core.FloatAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
serialize()[source]

Generate string representation

Returns:string representation
Return type:str
std = <obj_model.core.FloatAttribute object>[source]
units = <obj_model.units.UnitAttribute object>[source]
class wc_lang.core.Model(**kwargs)[source]

Bases: obj_model.core.Model, wc_lang.sbml.util.SbmlModelMixin

id[source]

unique identifier

Type:str
name[source]

name

Type:str
version[source]

version of the model

Type:str
url[source]

url of the model Git repository

Type:str
branch[source]

branch of the model Git repository

Type:str
revision[source]

hash for git commit of the wc_lang version used by a model

Type:str
wc_lang_version[source]

version of wc_lang

Type:str
time_units[source]

time units

Type:unit_registry.Unit
identifiers[source]

identifiers

Type:list of Identifier
comments[source]

comments

Type:str
created[source]

date created

Type:datetime.datetime
updated[source]

date updated

Type:datetime.datetime

Related attributes:

class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'name', 'version', 'url', 'branch', 'revision', 'wc_lang_version', 'time_units', 'identifiers', 'comments', 'created', 'updated')[source]
attributes = {'branch': <obj_model.core.StringAttribute object>, 'comments': <wc_lang.core.CommentAttribute object>, 'created': <obj_model.core.DateTimeAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'identifiers': <wc_lang.core.IdentifierOneToManyAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'revision': <obj_model.core.StringAttribute object>, 'time_units': <obj_model.units.UnitAttribute object>, 'updated': <obj_model.core.DateTimeAttribute object>, 'url': <obj_model.core.UrlAttribute object>, 'version': <obj_model.core.RegexAttribute object>, 'wc_lang_version': <obj_model.core.RegexAttribute object>}[source]
child_attrs = {'sbml': ('id', 'name', 'version', 'url', 'branch', 'revision', 'wc_lang_version', 'time_units', 'identifiers', 'comments', 'updated', 'created'), 'wc_sim': ('id', 'version', 'wc_lang_version', 'time_units')}[source]
children = {'core_model': ('taxon', 'env', 'compartments', 'species_types', 'species', 'distribution_init_concentrations', 'observables', 'functions', 'stop_conditions'), 'submodel': ('taxon', 'env')}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_lang.core.Model'>,)[source]
local_attributes = {'authors': <obj_model.core.LocalAttribute object>, 'branch': <obj_model.core.LocalAttribute object>, 'changes': <obj_model.core.LocalAttribute object>, 'comments': <obj_model.core.LocalAttribute object>, 'compartments': <obj_model.core.LocalAttribute object>, 'conclusions': <obj_model.core.LocalAttribute object>, 'created': <obj_model.core.LocalAttribute object>, 'dfba_obj_reactions': <obj_model.core.LocalAttribute object>, 'dfba_obj_species': <obj_model.core.LocalAttribute object>, 'dfba_objs': <obj_model.core.LocalAttribute object>, 'distribution_init_concentrations': <obj_model.core.LocalAttribute object>, 'env': <obj_model.core.LocalAttribute object>, 'functions': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'identifiers': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'observables': <obj_model.core.LocalAttribute object>, 'observation_sets': <obj_model.core.LocalAttribute object>, 'observations': <obj_model.core.LocalAttribute object>, 'parameters': <obj_model.core.LocalAttribute object>, 'rate_laws': <obj_model.core.LocalAttribute object>, 'reactions': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'revision': <obj_model.core.LocalAttribute object>, 'species': <obj_model.core.LocalAttribute object>, 'species_types': <obj_model.core.LocalAttribute object>, 'stop_conditions': <obj_model.core.LocalAttribute object>, 'submodels': <obj_model.core.LocalAttribute object>, 'taxon': <obj_model.core.LocalAttribute object>, 'time_units': <obj_model.core.LocalAttribute object>, 'updated': <obj_model.core.LocalAttribute object>, 'url': <obj_model.core.LocalAttribute object>, 'version': <obj_model.core.LocalAttribute object>, 'wc_lang_version': <obj_model.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.SlugAttribute object>[source]
related_attributes = {'authors': <obj_model.core.ManyToOneAttribute object>, 'changes': <obj_model.core.ManyToOneAttribute object>, 'compartments': <obj_model.core.ManyToOneAttribute object>, 'conclusions': <obj_model.core.ManyToOneAttribute object>, 'dfba_obj_reactions': <obj_model.core.ManyToOneAttribute object>, 'dfba_obj_species': <obj_model.core.ManyToOneAttribute object>, 'dfba_objs': <obj_model.core.ManyToOneAttribute object>, 'distribution_init_concentrations': <obj_model.core.ManyToOneAttribute object>, 'env': <obj_model.core.OneToOneAttribute object>, 'functions': <obj_model.core.ManyToOneAttribute object>, 'observables': <obj_model.core.ManyToOneAttribute object>, 'observation_sets': <obj_model.core.ManyToOneAttribute object>, 'observations': <obj_model.core.ManyToOneAttribute object>, 'parameters': <obj_model.core.ManyToOneAttribute object>, 'rate_laws': <obj_model.core.ManyToOneAttribute object>, 'reactions': <obj_model.core.ManyToOneAttribute object>, 'references': <obj_model.core.ManyToOneAttribute object>, 'species': <obj_model.core.ManyToOneAttribute object>, 'species_types': <obj_model.core.ManyToOneAttribute object>, 'stop_conditions': <obj_model.core.ManyToOneAttribute object>, 'submodels': <obj_model.core.ManyToOneAttribute object>, 'taxon': <obj_model.core.OneToOneAttribute object>}[source]
tabular_orientation = 2[source]
unique_together = ()[source]
verbose_name = 'Model'[source]
verbose_name_plural = 'Models'[source]
branch = <obj_model.core.StringAttribute object>[source]
comments = <wc_lang.core.CommentAttribute object>[source]
created = <obj_model.core.DateTimeAttribute object>[source]
export_relations_to_sbml(sbml_model, sbml)[source]

Add relationships to/from object to SBML model.

Parameters:
  • sbml_model (libsbml.Model) – SBML model
  • sbml (libsbml.Model) – SBML model
export_to_sbml(sbml_model)[source]

Add this metadata about this model to a SBML model.

Parameters:sbml_model (libsbml.Model) – SBML model
Returns:SBML model
Return type:libsbml.Model
get_authors(_Model__type=None, **kwargs)[source]

Get all authors from model and children

Parameters:
  • __type (types.TypeType or tuple of types.TypeType) – subclass(es) of Model
  • kwargs (dict of str –> object) – dictionary of attribute name/value pairs to find matching objects
Returns:

authors

Return type:

list of Author

get_changes(_Model__type=None, **kwargs)[source]

Get all changes from model and children

Parameters:
  • __type (types.TypeType or tuple of types.TypeType) – subclass(es) of Model
  • kwargs (dict of str –> object) – dictionary of attribute name/value pairs to find matching objects
Returns:

changes

Return type:

list of Change

get_compartments(_Model__type=None, **kwargs)[source]

Get all compartments

Parameters:
  • __type (types.TypeType or tuple of types.TypeType) – subclass(es) of Model
  • kwargs (dict of str –> object) – dictionary of attribute name/value pairs to find matching objects
Returns:

compartments

Return type:

list of Compartment

get_components(_Model__type=None, **kwargs)[source]

Find model component of type with id

Parameters:
  • __type (types.TypeType or tuple of types.TypeType) – subclass(es) of Model
  • kwargs (dict of str –> object) – dictionary of attribute name/value pairs to find matching objects
Returns:

component with id, or None if there is no component with id`=`id

Return type:

obj_model.Model

get_conclusions(_Model__type=None, **kwargs)[source]

Get all conclusions for model

Returns:conclusions for model
Return type:list of Conclusion
get_dfba_obj_reactions(_Model__type=None, **kwargs)[source]

Get all dFBA objective reactions used by submodels

Parameters:
  • __type (types.TypeType or tuple of types.TypeType) – subclass(es) of Model
  • kwargs (dict of str –> object) – dictionary of attribute name/value pairs to find matching objects
Returns:

dFBA objective reactions

Return type:

list of DfbaObjReaction

get_dfba_obj_species(_Model__type=None, **kwargs)[source]

Get all dFBA objective species used by submodels

Parameters:
  • __type (types.TypeType or tuple of types.TypeType) – subclass(es) of Model
  • kwargs (dict of str –> object) – dictionary of attribute name/value pairs to find matching objects
Returns:

dFBA objective species

Return type:

list of DfbaObjSpecies

get_dfba_objs(_Model__type=None, **kwargs)[source]

Get all dFBA objectives

Returns:dFBA objectives
Return type:list of DfbaObjective
get_distribution_init_concentrations(_Model__type=None, **kwargs)[source]

Get all initial distributions of concentrations of species at the beginning of each cell cycle

Parameters:
  • __type (types.TypeType or tuple of types.TypeType) – subclass(es) of Model
  • kwargs (dict of str –> object) – dictionary of attribute name/value pairs to find matching objects
Returns:

initial distributions

of concentrations of species at the beginning of each cell cycle

Return type:

list of DistributionInitConcentration

get_evidence(_Model__type=None, **kwargs)[source]

Get all evidence for model

Returns:evidence for model
Return type:list of Evidence
get_functions(_Model__type=None, **kwargs)[source]

Get all functions

Parameters:
  • __type (types.TypeType or tuple of types.TypeType) – subclass(es) of Model
  • kwargs (dict of str –> object) – dictionary of attribute name/value pairs to find matching objects
Returns:

functions

Return type:

list of Function

get_observables(_Model__type=None, **kwargs)[source]

Get all observables

Parameters:
  • __type (types.TypeType or tuple of types.TypeType) – subclass(es) of Model
  • kwargs (dict of str –> object) – dictionary of attribute name/value pairs to find matching objects
Returns:

observables

Return type:

list of Observables

get_observation_sets(_Model__type=None, **kwargs)[source]

Get all observation sets for model

Returns:observation sets for model
Return type:list of ObservationSet
get_observations(_Model__type=None, **kwargs)[source]

Get all observations for model

Returns:observations for model
Return type:list of Observation
get_parameters(_Model__type=None, **kwargs)[source]

Get all parameters from model and submodels

Parameters:
  • __type (types.TypeType or tuple of types.TypeType) – subclass(es) of Model
  • kwargs (dict of str –> object) – dictionary of attribute name/value pairs to find matching objects
Returns:

parameters

Return type:

list of Parameter

get_rate_laws(_Model__type=None, **kwargs)[source]

Get all rate laws from reactions

Parameters:
  • __type (types.TypeType or tuple of types.TypeType) – subclass(es) of Model
  • kwargs (dict of str –> object) – dictionary of attribute name/value pairs to find matching objects
Returns:

rate laws

Return type:

list of RateLaw

get_reactions(_Model__type=None, **kwargs)[source]

Get all reactions from submodels

Parameters:
  • __type (types.TypeType or tuple of types.TypeType) – subclass(es) of Model
  • kwargs (dict of str –> object) – dictionary of attribute name/value pairs to find matching objects
Returns:

reactions

Return type:

list of Reaction

get_references(_Model__type=None, **kwargs)[source]

Get all references from model and children

Parameters:
  • __type (types.TypeType or tuple of types.TypeType) – subclass(es) of Model
  • kwargs (dict of str –> object) – dictionary of attribute name/value pairs to find matching objects
Returns:

references

Return type:

list of Reference

get_root_compartments(_Model__type=None, **kwargs)[source]

Get the root compartments (compartments that either have no parent compartment or whose parent compartment is not cellular)

Returns:root compartments
Return type:list of Compartment
get_species(_Model__type=None, **kwargs)[source]

Get all species from submodels

Parameters:
  • __type (types.TypeType or tuple of types.TypeType) – subclass(es) of Model
  • kwargs (dict of str –> object) – dictionary of attribute name/value pairs to find matching objects
Returns:

species

Return type:

list of Species

get_species_types(_Model__type=None, **kwargs)[source]

Get all species types

Parameters:
  • __type (types.TypeType or tuple of types.TypeType) – subclass(es) of Model
  • kwargs (dict of str –> object) – dictionary of attribute name/value pairs to find matching objects
Returns:

species types

Return type:

list of SpeciesType

get_stop_conditions(_Model__type=None, **kwargs)[source]

Get all stop conditions

Parameters:
  • __type (types.TypeType or tuple of types.TypeType) – subclass(es) of Model
  • kwargs (dict of str –> object) – dictionary of attribute name/value pairs to find matching objects
Returns:

stop conditions

Return type:

list of StopCondition

get_submodels(_Model__type=None, **kwargs)[source]

Get all submodels

Parameters:
  • __type (types.TypeType or tuple of types.TypeType) – subclass(es) of Model
  • kwargs (dict of str –> object) – dictionary of attribute name/value pairs to find matching objects
Returns:

submodels

Return type:

list of Submodel

id = <obj_model.core.SlugAttribute object>[source]
identifiers = <wc_lang.core.IdentifierOneToManyAttribute object>[source]
import_from_sbml(sbml)[source]

Load from SBML model

Parameters:sbml (libsbml.Model) – SBML model
import_relations_from_sbml(sbml, objs)[source]

Load relationships from SBML model

Parameters:
  • sbml (libsbml.Model) – SBML model
  • objs (dict) – dictionary that maps WC-Lang types to dictionaries that map the ids of WC-Lang objects to WC-Lang objects
merge_attrs(other, other_objs_in_self, self_objs_in_other)[source]

Merge attributes of two objects

Parameters:
  • other (Model) – other model
  • other_objs_in_self (dict) – dictionary that maps instances of objects in another model to objects in a model
  • self_objs_in_other (dict) – dictionary that maps instances of objects in a model to objects in another model
name = <obj_model.core.StringAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
revision = <obj_model.core.StringAttribute object>[source]
time_units = <obj_model.units.UnitAttribute object>[source]
updated = <obj_model.core.DateTimeAttribute object>[source]
url = <obj_model.core.UrlAttribute object>[source]
validate()[source]

Determine if the model is valid

  • Network of compartments is rooted and acyclic
  • Networks of observables and functions are acyclic
Returns:
None if the object is valid,
otherwise return a list of errors as an instance of InvalidObject
Return type:InvalidObject or None
version = <obj_model.core.RegexAttribute object>[source]
wc_lang_version = <obj_model.core.RegexAttribute object>[source]
class wc_lang.core.Observable(**kwargs)[source]

Bases: obj_model.core.Model, wc_lang.sbml.util.SbmlAssignmentRuleMixin

Observable: a linear function of other Observbles and Species

id[source]

unique id

Type:str
name[source]

name

Type:str
model[source]

model

Type:Model
expression[source]

mathematical expression for an Observable

Type:ObservableExpression
units[source]

units of expression

Type:unit_registry.Unit
identifiers[source]

identifiers

Type:list of Identifier
conclusions[source]

conclusions

Type:list of Conclusion
comments[source]

comments

Type:str
references[source]

references

Type:list of Reference

Related attributes:

class Meta[source]

Bases: obj_model.core.Meta, obj_model.expression.ExpressionExpressionTermMeta

attribute_order = ('id', 'name', 'expression', 'units', 'identifiers', 'evidence', 'conclusions', 'comments', 'references')[source]
attributes = {'comments': <wc_lang.core.CommentAttribute object>, 'conclusions': <obj_model.core.ManyToManyAttribute object>, 'evidence': <wc_lang.core.EvidenceManyToManyAttribute object>, 'expression': <obj_model.expression.ExpressionOneToOneAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'identifiers': <wc_lang.core.IdentifierManyToManyAttribute object>, 'model': <obj_model.core.ManyToOneAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>, 'units': <obj_model.units.UnitAttribute object>}[source]
child_attrs = {'sbml': ('id', 'name', 'model', 'expression', 'units', 'identifiers', 'comments'), 'wc_sim': ('id', 'model', 'expression', 'units')}[source]
children = {'core_model': ('expression', 'identifiers', 'evidence', 'conclusions', 'references'), 'submodel': ('expression', 'identifiers', 'evidence', 'conclusions', 'references')}[source]
expression_term_model[source]

alias of ObservableExpression

expression_term_units = 'units'[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_lang.core.Observable'>,)[source]
local_attributes = {'comments': <obj_model.core.LocalAttribute object>, 'conclusions': <obj_model.core.LocalAttribute object>, 'evidence': <obj_model.core.LocalAttribute object>, 'expression': <obj_model.core.LocalAttribute object>, 'function_expressions': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'identifiers': <obj_model.core.LocalAttribute object>, 'model': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'observable_expressions': <obj_model.core.LocalAttribute object>, 'rate_law_expressions': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'stop_condition_expressions': <obj_model.core.LocalAttribute object>, 'units': <obj_model.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.SlugAttribute object>[source]
related_attributes = {'function_expressions': <obj_model.core.ManyToManyAttribute object>, 'observable_expressions': <obj_model.core.ManyToManyAttribute object>, 'rate_law_expressions': <obj_model.core.ManyToManyAttribute object>, 'stop_condition_expressions': <obj_model.core.ManyToManyAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Observable'[source]
verbose_name_plural = 'Observables'[source]
comments = <wc_lang.core.CommentAttribute object>[source]
conclusions = <obj_model.core.ManyToManyAttribute object>[source]
evidence = <wc_lang.core.EvidenceManyToManyAttribute object>[source]
expression = <obj_model.expression.ExpressionOneToOneAttribute object>[source]
id = <obj_model.core.SlugAttribute object>[source]
identifiers = <wc_lang.core.IdentifierManyToManyAttribute object>[source]
model = <obj_model.core.ManyToOneAttribute object>[source]
name = <obj_model.core.StringAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
references = <obj_model.core.ManyToManyAttribute object>[source]
units = <obj_model.units.UnitAttribute object>[source]
class wc_lang.core.ObservableExpression(**kwargs)[source]

Bases: obj_model.core.Model, obj_model.expression.Expression, wc_lang.sbml.util.SbmlModelMixin

A mathematical expression of Observables and Species

The expression used by a Observable.

expression[source]

mathematical expression for an Observable

Type:str
_parsed_expression[source]

an analyzed expression; not an obj_model.Model

Type:ParsedExpression
species[source]

Species used by this Observable expression

Type:list of Species
observables[source]

other Observables used by this Observable expression

Type:list of Observable

Related attributes:

class Meta[source]

Bases: obj_model.core.Meta, obj_model.expression.Meta

attribute_order = ()[source]
attributes = {'expression': <obj_model.core.LongStringAttribute object>, 'observables': <obj_model.core.ManyToManyAttribute object>, 'species': <obj_model.core.ManyToManyAttribute object>}[source]
child_attrs = {'sbml': ('expression', 'species', 'observables'), 'wc_sim': ('expression', 'species', 'observables')}[source]
children = {'core_model': ('species', 'observables'), 'submodel': ('species', 'observables')}[source]
expression_is_linear = True[source]
expression_term_models = ('Species', 'Observable')[source]
expression_unit_registry = <pint.registry.UnitRegistry object>[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_lang.core.ObservableExpression'>,)[source]
local_attributes = {'expression': <obj_model.core.LocalAttribute object>, 'observable': <obj_model.core.LocalAttribute object>, 'observables': <obj_model.core.LocalAttribute object>, 'species': <obj_model.core.LocalAttribute object>}[source]
ordering = ('expression',)[source]
primary_attribute = <obj_model.core.LongStringAttribute object>[source]
related_attributes = {'observable': <obj_model.expression.ExpressionOneToOneAttribute object>}[source]
tabular_orientation = 3[source]
unique_together = ()[source]
verbose_name = 'Observable expression'[source]
verbose_name_plural = 'Observable expressions'[source]
classmethod deserialize(value, objects)[source]

Deserialize value

Parameters:
  • value (str) – String representation
  • objects (dict) – dictionary of objects, grouped by model
Returns:

tuple of cleaned value and cleaning error

Return type:

tuple of ObservableExpression, InvalidAttribute or None

expression = <obj_model.core.LongStringAttribute object>[source]
merge_attrs(other, other_objs_in_self, self_objs_in_other)[source]

Merge attributes of two objects

Parameters:
  • other (obj_model.Model) – other model
  • other_objs_in_self (dict) – dictionary that maps instances of objects in another model to objects in a model
  • self_objs_in_other (dict) – dictionary that maps instances of objects in a model to objects in another model
objects = <obj_model.core.Manager object>[source]
observables = <obj_model.core.ManyToManyAttribute object>[source]
serialize()[source]

Generate string representation

Returns:string representation
Return type:str
species = <obj_model.core.ManyToManyAttribute object>[source]
validate()[source]

Check that the observable is valid

  • Check that the expression is a linear function
Returns:
None if the object is valid,
otherwise return a list of errors as an instance of InvalidObject
Return type:InvalidObject or None
class wc_lang.core.Observation(**kwargs)[source]

Bases: obj_model.core.Model

id[source]

unique identifier

Type:str
name[source]

name

Type:str
model[source]

model

Type:Model
value[source]

value

Type:str
std[source]

standard error of the value

Type:str
units[source]

units

Type:unit_registry.Unit
type[source]

type

Type:pronto.term.Term
genotype[source]

genotype

Type:ObservationGenotype
env[source]

environment

Type:ObservationEnv
experiment_type[source]

type of experiment (e.g. RNA-seq)

Type:str
experiment_design[source]

experimental design

Type:str
data_generation_process[source]

process used to measure data (e.g. deep sequencing)

Type:Process
data_analysis_process[source]

process used to analyze data (e.g. Cufflinks)

Type:Process
identifiers[source]

identifiers

Type:list of Identifier
comments[source]

comments

Type:str
references[source]

references

Type:list of Reference

Related attributes:

class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'name', 'value', 'std', 'units', 'type', 'genotype', 'env', 'experiment_type', 'experiment_design', 'data_generation_process', 'data_analysis_process', 'identifiers', 'comments', 'references')[source]
attributes = {'comments': <wc_lang.core.CommentAttribute object>, 'data_analysis_process': <obj_model.core.ManyToOneAttribute object>, 'data_generation_process': <obj_model.core.ManyToOneAttribute object>, 'env': <obj_model.core.ManyToOneAttribute object>, 'experiment_design': <obj_model.core.LongStringAttribute object>, 'experiment_type': <obj_model.core.LongStringAttribute object>, 'genotype': <obj_model.core.ManyToOneAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'identifiers': <wc_lang.core.IdentifierManyToManyAttribute object>, 'model': <obj_model.core.ManyToOneAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>, 'std': <obj_model.core.StringAttribute object>, 'type': <obj_model.ontology.OntologyAttribute object>, 'units': <obj_model.units.UnitAttribute object>, 'value': <obj_model.core.StringAttribute object>}[source]
child_attrs = {'sbml': (), 'wc_sim': ()}[source]
children = {'core_model': ('genotype', 'env', 'data_generation_process', 'data_analysis_process', 'identifiers', 'references'), 'submodel': ('genotype', 'env', 'data_generation_process', 'data_analysis_process', 'identifiers', 'references')}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_lang.core.Observation'>,)[source]
local_attributes = {'comments': <obj_model.core.LocalAttribute object>, 'data_analysis_process': <obj_model.core.LocalAttribute object>, 'data_generation_process': <obj_model.core.LocalAttribute object>, 'env': <obj_model.core.LocalAttribute object>, 'evidence': <obj_model.core.LocalAttribute object>, 'experiment_design': <obj_model.core.LocalAttribute object>, 'experiment_type': <obj_model.core.LocalAttribute object>, 'genotype': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'identifiers': <obj_model.core.LocalAttribute object>, 'model': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'observation_sets': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'std': <obj_model.core.LocalAttribute object>, 'type': <obj_model.core.LocalAttribute object>, 'units': <obj_model.core.LocalAttribute object>, 'value': <obj_model.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.SlugAttribute object>[source]
related_attributes = {'evidence': <obj_model.core.ManyToOneAttribute object>, 'observation_sets': <obj_model.core.ManyToManyAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Observation'[source]
verbose_name_plural = 'Observations'[source]
comments = <wc_lang.core.CommentAttribute object>[source]
data_analysis_process = <obj_model.core.ManyToOneAttribute object>[source]
data_generation_process = <obj_model.core.ManyToOneAttribute object>[source]
env = <obj_model.core.ManyToOneAttribute object>[source]
experiment_design = <obj_model.core.LongStringAttribute object>[source]
experiment_type = <obj_model.core.LongStringAttribute object>[source]
genotype = <obj_model.core.ManyToOneAttribute object>[source]
id = <obj_model.core.SlugAttribute object>[source]
identifiers = <wc_lang.core.IdentifierManyToManyAttribute object>[source]
model = <obj_model.core.ManyToOneAttribute object>[source]
name = <obj_model.core.StringAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
references = <obj_model.core.ManyToManyAttribute object>[source]
std = <obj_model.core.StringAttribute object>[source]
type = <obj_model.ontology.OntologyAttribute object>[source]
units = <obj_model.units.UnitAttribute object>[source]
value = <obj_model.core.StringAttribute object>[source]
class wc_lang.core.ObservationEnv(**kwargs)[source]

Bases: obj_model.core.Model, wc_lang.sbml.util.SbmlModelMixin

Environment of an observation

temp[source]

temperature at which the observation was observed

Type:float
temp_units[source]

temperature units

Type:unit_registry.Unit
ph[source]

pH at which the observation was observed

Type:float
ph_units[source]

pH units

Type:unit_registry.Unit
growth_media[source]

growth media at which the observation was observed

Type:str
condition[source]

experimental conditions (e.g. control)

Type:str

Related attributes:

class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('temp', 'temp_units', 'ph', 'ph_units', 'growth_media', 'condition')[source]
attributes = {'condition': <obj_model.core.LongStringAttribute object>, 'growth_media': <obj_model.core.LongStringAttribute object>, 'ph': <obj_model.core.FloatAttribute object>, 'ph_units': <obj_model.units.UnitAttribute object>, 'temp': <obj_model.core.FloatAttribute object>, 'temp_units': <obj_model.units.UnitAttribute object>}[source]
child_attrs = {'sbml': (), 'wc_sim': ()}[source]
children = {'core_model': (), 'submodel': ()}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_lang.core.ObservationEnv'>,)[source]
local_attributes = {'condition': <obj_model.core.LocalAttribute object>, 'env_observations': <obj_model.core.LocalAttribute object>, 'growth_media': <obj_model.core.LocalAttribute object>, 'ph': <obj_model.core.LocalAttribute object>, 'ph_units': <obj_model.core.LocalAttribute object>, 'temp': <obj_model.core.LocalAttribute object>, 'temp_units': <obj_model.core.LocalAttribute object>}[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {'env_observations': <obj_model.core.ManyToOneAttribute object>}[source]
tabular_orientation = 4[source]
unique_together = (('condition', 'growth_media', 'ph', 'ph_units', 'temp', 'temp_units'),)[source]
verbose_name = 'Observation env'[source]
verbose_name_plural = 'Observation envs'[source]
condition = <obj_model.core.LongStringAttribute object>[source]
growth_media = <obj_model.core.LongStringAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
ph = <obj_model.core.FloatAttribute object>[source]
ph_units = <obj_model.units.UnitAttribute object>[source]
serialize()[source]

Generate string representation

Returns:string representation
Return type:str
temp = <obj_model.core.FloatAttribute object>[source]
temp_units = <obj_model.units.UnitAttribute object>[source]
validate()[source]

Determine if the environment is valid

  • temperature units are defined if the temperature is not None
  • pH units are defined if the pH is not None
Returns:
None if the object is valid,
otherwise return a list of errors as an instance of InvalidObject
Return type:InvalidObject or None
class wc_lang.core.ObservationGenotype(**kwargs)[source]

Bases: obj_model.core.Model, wc_lang.sbml.util.SbmlModelMixin

Genotype of an observation

taxon[source]

taxon in which the observation was observed

Type:str
genetic_variant[source]

genetic variant in which the observation was observed

Type:str

Related attributes:

  • genotype_observations (list of Observation): observations
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('taxon', 'variant')[source]
attributes = {'taxon': <obj_model.core.StringAttribute object>, 'variant': <obj_model.core.StringAttribute object>}[source]
child_attrs = {'sbml': (), 'wc_sim': ()}[source]
children = {'core_model': (), 'submodel': ()}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_lang.core.ObservationGenotype'>,)[source]
local_attributes = {'genotype_observations': <obj_model.core.LocalAttribute object>, 'taxon': <obj_model.core.LocalAttribute object>, 'variant': <obj_model.core.LocalAttribute object>}[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {'genotype_observations': <obj_model.core.ManyToOneAttribute object>}[source]
tabular_orientation = 4[source]
unique_together = (('taxon', 'variant'),)[source]
verbose_name = 'Observation genotype'[source]
verbose_name_plural = 'Observation genotypes'[source]
objects = <obj_model.core.Manager object>[source]
serialize()[source]

Generate string representation

Returns:string representation
Return type:str
taxon = <obj_model.core.StringAttribute object>[source]
variant = <obj_model.core.StringAttribute object>[source]
class wc_lang.core.ObservationSet(**kwargs)[source]

Bases: obj_model.core.Model, wc_lang.sbml.util.SbmlModelMixin

Set of co-observed observations

id[source]

unique identifier

Type:str
name[source]

name

Type:str
model[source]

model

Type:Model
observations[source]

observations

Type:list of Observation
identifiers[source]

identifiers

Type:list of Identifier
comments[source]

comments

Type:str
references[source]

references

Type:list of Reference
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'name', 'observations', 'identifiers', 'comments', 'references')[source]
attributes = {'comments': <wc_lang.core.CommentAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'identifiers': <wc_lang.core.IdentifierManyToManyAttribute object>, 'model': <obj_model.core.ManyToOneAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'observations': <obj_model.core.ManyToManyAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>}[source]
child_attrs = {'sbml': (), 'wc_sim': ()}[source]
children = {'core_model': ('observations', 'identifiers', 'references'), 'submodel': ('observations', 'identifiers', 'references')}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_lang.core.ObservationSet'>,)[source]
local_attributes = {'comments': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'identifiers': <obj_model.core.LocalAttribute object>, 'model': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'observations': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.SlugAttribute object>[source]
related_attributes = {}[source]
unique_together = ()[source]
verbose_name = 'Observation set'[source]
verbose_name_plural = 'Observation sets'[source]
comments = <wc_lang.core.CommentAttribute object>[source]
id = <obj_model.core.SlugAttribute object>[source]
identifiers = <wc_lang.core.IdentifierManyToManyAttribute object>[source]
model = <obj_model.core.ManyToOneAttribute object>[source]
name = <obj_model.core.StringAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
observations = <obj_model.core.ManyToManyAttribute object>[source]
references = <obj_model.core.ManyToManyAttribute object>[source]
class wc_lang.core.Parameter(**kwargs)[source]

Bases: obj_model.core.Model, wc_lang.sbml.util.SbmlModelMixin

id[source]

unique identifier per model/submodel

Type:str
name[source]

name

Type:str
model[source]

model

Type:Model
type[source]

parameter type

Type:pronto.term.Term
value[source]

value

Type:float
std[source]

standard error of the value

Type:float
units[source]

units of the value and standard error

Type:unit_registry.Unit
identifiers[source]

identifiers

Type:list of Identifier
conclusions[source]

conclusions

Type:list of Conclusion
comments[source]

comments

Type:str
references[source]

references

Type:list of Reference

Related attributes:

class Meta[source]

Bases: obj_model.core.Meta, obj_model.expression.ExpressionStaticTermMeta

attribute_order = ('id', 'name', 'type', 'value', 'std', 'units', 'identifiers', 'evidence', 'conclusions', 'comments', 'references')[source]
attributes = {'comments': <wc_lang.core.CommentAttribute object>, 'conclusions': <obj_model.core.ManyToManyAttribute object>, 'evidence': <wc_lang.core.EvidenceManyToManyAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'identifiers': <wc_lang.core.IdentifierManyToManyAttribute object>, 'model': <obj_model.core.ManyToOneAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>, 'std': <obj_model.core.FloatAttribute object>, 'type': <obj_model.ontology.OntologyAttribute object>, 'units': <obj_model.units.UnitAttribute object>, 'value': <obj_model.core.FloatAttribute object>}[source]
child_attrs = {'sbml': ('id', 'name', 'model', 'type', 'value', 'std', 'units', 'identifiers', 'comments'), 'wc_sim': ('id', 'model', 'type', 'value', 'std', 'units')}[source]
children = {'core_model': ('identifiers', 'evidence', 'conclusions', 'references'), 'submodel': ('identifiers', 'evidence', 'conclusions', 'references')}[source]
expression_term_units = 'units'[source]
expression_term_value = 'value'[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_lang.core.Parameter'>,)[source]
local_attributes = {'comments': <obj_model.core.LocalAttribute object>, 'conclusions': <obj_model.core.LocalAttribute object>, 'density_compartment': <obj_model.core.LocalAttribute object>, 'evidence': <obj_model.core.LocalAttribute object>, 'function_expressions': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'identifiers': <obj_model.core.LocalAttribute object>, 'model': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'rate_law_expressions': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'std': <obj_model.core.LocalAttribute object>, 'stop_condition_expressions': <obj_model.core.LocalAttribute object>, 'type': <obj_model.core.LocalAttribute object>, 'units': <obj_model.core.LocalAttribute object>, 'value': <obj_model.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.SlugAttribute object>[source]
related_attributes = {'density_compartment': <obj_model.core.OneToOneAttribute object>, 'function_expressions': <obj_model.core.ManyToManyAttribute object>, 'rate_law_expressions': <obj_model.core.ManyToManyAttribute object>, 'stop_condition_expressions': <obj_model.core.ManyToManyAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Parameter'[source]
verbose_name_plural = 'Parameters'[source]
comments = <wc_lang.core.CommentAttribute object>[source]
conclusions = <obj_model.core.ManyToManyAttribute object>[source]
evidence = <wc_lang.core.EvidenceManyToManyAttribute object>[source]
export_relations_to_sbml(sbml_model, sbml)[source]

Add relationships to/from object to SBML parameter.

Parameters:
  • sbml_model (libsbml.Model) – SBML model
  • sbml (libsbml.Parameter) – SBML parameter
export_to_sbml(sbml_model)[source]

Add this parameter to a SBML model.

Parameters:sbml_model (libsbml.Model) – SBML model
Returns:SBML parameter
Return type:libsbml.Parameter
id = <obj_model.core.SlugAttribute object>[source]
identifiers = <wc_lang.core.IdentifierManyToManyAttribute object>[source]
import_from_sbml(sbml)[source]

Load from SBML parameter

Parameters:sbml (libsbml.Parameter) – SBML parameter
import_relations_from_sbml(sbml, objs)[source]

Load relationships from SBML parameter

Parameters:
  • sbml (libsbml.Parameter) – SBML parameter
  • objs (dict) – dictionary that maps WC-Lang types to dictionaries that map the ids of WC-Lang objects to WC-Lang objects
model = <obj_model.core.ManyToOneAttribute object>[source]
name = <obj_model.core.StringAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
references = <obj_model.core.ManyToManyAttribute object>[source]
std = <obj_model.core.FloatAttribute object>[source]
type = <obj_model.ontology.OntologyAttribute object>[source]
units = <obj_model.units.UnitAttribute object>[source]
value = <obj_model.core.FloatAttribute object>[source]
class wc_lang.core.Ph(**kwargs)[source]

Bases: obj_model.core.Model, wc_lang.sbml.util.SbmlModelMixin

pH of a compartment

distribution[source]

distribution

Type:proto.Term
mean[source]

mean initial volume

Type:float
std[source]

standard deviation of the mean initial volume

Type:float
units[source]

units of volume

Type:unit_registry.Unit

Related attributes:

class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('distribution', 'mean', 'std', 'units')[source]
attributes = {'distribution': <obj_model.ontology.OntologyAttribute object>, 'mean': <obj_model.core.FloatAttribute object>, 'std': <obj_model.core.FloatAttribute object>, 'units': <obj_model.units.UnitAttribute object>}[source]
child_attrs = {'sbml': ('distribution', 'mean', 'std', 'units'), 'wc_sim': ()}[source]
children = {'core_model': (), 'submodel': ()}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_lang.core.Ph'>,)[source]
local_attributes = {'compartments': <obj_model.core.LocalAttribute object>, 'distribution': <obj_model.core.LocalAttribute object>, 'mean': <obj_model.core.LocalAttribute object>, 'std': <obj_model.core.LocalAttribute object>, 'units': <obj_model.core.LocalAttribute object>}[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {'compartments': <obj_model.core.ManyToOneAttribute object>}[source]
tabular_orientation = 4[source]
unique_together = (('distribution', 'mean', 'std', 'units'),)[source]
verbose_name = 'Ph'[source]
verbose_name_plural = 'Phs'[source]
distribution = <obj_model.ontology.OntologyAttribute object>[source]
mean = <obj_model.core.FloatAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
serialize()[source]

Generate string representation

Returns:string representation
Return type:str
std = <obj_model.core.FloatAttribute object>[source]
units = <obj_model.units.UnitAttribute object>[source]
class wc_lang.core.Process(**kwargs)[source]

Bases: obj_model.core.Model, wc_lang.sbml.util.SbmlModelMixin

A process of an observation or conclusion

name[source]

procedure which produced the conclusion

Type:str
version[source]

version of procedure which produced the conclusion

Type:str

Related attributes:

  • observation_analysis (list of Observation): observation
  • observation_measurement (list of Observation): observation
  • conclusions (list of Conclusion): conclusions
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('name', 'version')[source]
attributes = {'name': <obj_model.core.LongStringAttribute object>, 'version': <obj_model.core.StringAttribute object>}[source]
child_attrs = {'sbml': (), 'wc_sim': ()}[source]
children = {'core_model': (), 'submodel': ()}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_lang.core.Process'>,)[source]
local_attributes = {'conclusions': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'observation_data_analysis': <obj_model.core.LocalAttribute object>, 'observation_data_generation': <obj_model.core.LocalAttribute object>, 'version': <obj_model.core.LocalAttribute object>}[source]
ordering = ()[source]
primary_attribute = None[source]
related_attributes = {'conclusions': <obj_model.core.ManyToOneAttribute object>, 'observation_data_analysis': <obj_model.core.ManyToOneAttribute object>, 'observation_data_generation': <obj_model.core.ManyToOneAttribute object>}[source]
tabular_orientation = 4[source]
unique_together = (('name', 'version'),)[source]
verbose_name = 'Process'[source]
verbose_name_plural = 'Processes'[source]
name = <obj_model.core.LongStringAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
serialize()[source]

Generate string representation

Returns:string representation
Return type:str
version = <obj_model.core.StringAttribute object>[source]
class wc_lang.core.RateLaw(**kwargs)[source]

Bases: obj_model.core.Model, wc_lang.sbml.util.SbmlModelMixin

Rate law

id[source]

identifier equal to {reaction.id}-{direction.name}

Type:str
name[source]

name

Type:str
model[source]

model

Type:Model
reaction[source]

reaction

Type:Reaction
direction[source]

direction

Type:RateLawDirection
type[source]

type

Type:pronto.term.Term
expression[source]

expression

Type:RateLawExpression
units[source]

units

Type:unit_registry.Unit
identifiers[source]

identifiers

Type:list of Identifier
conclusions[source]

conclusions

Type:list of Conclusion
comments[source]

comments

Type:str
references[source]

references

Type:list of Reference
class Meta[source]

Bases: obj_model.core.Meta, obj_model.expression.ExpressionExpressionTermMeta

attribute_order = ('id', 'name', 'reaction', 'direction', 'type', 'expression', 'units', 'identifiers', 'evidence', 'conclusions', 'comments', 'references')[source]
attributes = {'comments': <wc_lang.core.CommentAttribute object>, 'conclusions': <obj_model.core.ManyToManyAttribute object>, 'direction': <obj_model.core.EnumAttribute object>, 'evidence': <wc_lang.core.EvidenceManyToManyAttribute object>, 'expression': <obj_model.expression.ExpressionManyToOneAttribute object>, 'id': <obj_model.core.StringAttribute object>, 'identifiers': <wc_lang.core.IdentifierManyToManyAttribute object>, 'model': <obj_model.core.ManyToOneAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'reaction': <obj_model.core.ManyToOneAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>, 'type': <obj_model.ontology.OntologyAttribute object>, 'units': <obj_model.units.UnitAttribute object>}[source]
child_attrs = {'sbml': ('id', 'name', 'model', 'reaction', 'direction', 'type', 'expression', 'units', 'identifiers', 'comments'), 'wc_sim': ('id', 'model', 'reaction', 'direction', 'expression', 'units')}[source]
children = {'core_model': ('expression', 'identifiers', 'evidence', 'conclusions', 'references'), 'submodel': ('expression', 'identifiers', 'evidence', 'conclusions', 'references')}[source]
expression_term_model[source]

alias of RateLawExpression

expression_term_units = 'units'[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_lang.core.RateLaw'>,)[source]
local_attributes = {'comments': <obj_model.core.LocalAttribute object>, 'conclusions': <obj_model.core.LocalAttribute object>, 'direction': <obj_model.core.LocalAttribute object>, 'evidence': <obj_model.core.LocalAttribute object>, 'expression': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'identifiers': <obj_model.core.LocalAttribute object>, 'model': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'reaction': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'type': <obj_model.core.LocalAttribute object>, 'units': <obj_model.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.StringAttribute object>[source]
related_attributes = {}[source]
unique_together = ()[source]
verbose_name = 'Rate law'[source]
verbose_name_plural = 'Rate laws'[source]
comments = <wc_lang.core.CommentAttribute object>[source]
conclusions = <obj_model.core.ManyToManyAttribute object>[source]
direction = <obj_model.core.EnumAttribute object>[source]
evidence = <wc_lang.core.EvidenceManyToManyAttribute object>[source]
export_relations_to_sbml(sbml_model, sbml)[source]

Add relationships to/from object to SBML kinetic law.

Parameters:
  • sbml_model (libsbml.Model) – SBML model
  • sbml (libsbml.KineticLaw) – SBML kinetic law
export_to_sbml(sbml_model)[source]

Add this rate law to a SBML reaction.

Parameters:sbml_model (libsbml.Model) – SBML model
Returns:SBML kinetic law
Return type:libsbml.KineticLaw
expression = <obj_model.expression.ExpressionManyToOneAttribute object>[source]
gen_id()[source]

Generate identifier

Returns:identifier
Return type:str
id = <obj_model.core.StringAttribute object>[source]
identifiers = <wc_lang.core.IdentifierManyToManyAttribute object>[source]
import_from_sbml(sbml)[source]

Load from SBML kinetic law

Parameters:sbml (libsbml.KineticLaw) – SBML kinetic law
import_relations_from_sbml(sbml, objs)[source]

Load relationships from SBML kinetic law

Parameters:
  • sbml (libsbml.KineticLaw) – SBML kinetic law
  • objs (dict) – dictionary that maps WC-Lang types to dictionaries that map the ids of WC-Lang objects to WC-Lang objects
model = <obj_model.core.ManyToOneAttribute object>[source]
name = <obj_model.core.StringAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
reaction = <obj_model.core.ManyToOneAttribute object>[source]
references = <obj_model.core.ManyToManyAttribute object>[source]
type = <obj_model.ontology.OntologyAttribute object>[source]
units = <obj_model.units.UnitAttribute object>[source]
validate()[source]

Determine whether this RateLaw is valid

  • Check if identifier equal to {reaction.id}-{direction.name}
Returns:
None if the object is valid,
otherwise return a list of errors in an InvalidObject instance
Return type:InvalidObject or None
class wc_lang.core.RateLawDirection[source]

Bases: int, wc_utils.util.enumerate.CaseInsensitiveEnum

Rate law directions

backward = -1[source]
forward = 1[source]
class wc_lang.core.RateLawExpression(**kwargs)[source]

Bases: obj_model.core.Model, obj_model.expression.Expression, wc_lang.sbml.util.SbmlModelMixin

Rate law expression

expression[source]

mathematical expression of the rate law

Type:str
_parsed_expression[source]

an analyzed expression; not an obj_model.Model

Type:ParsedExpression
species[source]

species whose dynamic concentrations are used in the rate law

Type:list of Species
parameters[source]

parameters whose values are used in the rate law

Type:list of Parameter
compartments[source]

Compartments used by this stop condition expression

Type:list of Compartment

Related attributes:

  • rate_law (RateLaw): the RateLaw which uses this RateLawExpression
class Meta[source]

Bases: obj_model.core.Meta, obj_model.expression.Meta

attribute_order = ('expression', 'species', 'parameters')[source]
attributes = {'compartments': <obj_model.core.ManyToManyAttribute object>, 'expression': <obj_model.core.LongStringAttribute object>, 'functions': <obj_model.core.ManyToManyAttribute object>, 'observables': <obj_model.core.ManyToManyAttribute object>, 'parameters': <obj_model.core.ManyToManyAttribute object>, 'species': <obj_model.core.ManyToManyAttribute object>}[source]
child_attrs = {'sbml': ('expression', 'parameters', 'species', 'observables', 'functions', 'compartments'), 'wc_sim': ('expression', 'parameters', 'species', 'observables', 'functions', 'compartments')}[source]
children = {'core_model': ('parameters', 'species', 'observables', 'functions', 'compartments'), 'submodel': ('parameters', 'species', 'observables', 'functions', 'compartments')}[source]
expression_term_models = ('Parameter', 'Species', 'Observable', 'Function', 'Compartment')[source]
expression_unit_registry = <pint.registry.UnitRegistry object>[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_lang.core.RateLawExpression'>,)[source]
local_attributes = {'compartments': <obj_model.core.LocalAttribute object>, 'expression': <obj_model.core.LocalAttribute object>, 'functions': <obj_model.core.LocalAttribute object>, 'observables': <obj_model.core.LocalAttribute object>, 'parameters': <obj_model.core.LocalAttribute object>, 'rate_laws': <obj_model.core.LocalAttribute object>, 'species': <obj_model.core.LocalAttribute object>}[source]
ordering = ('expression',)[source]
primary_attribute = <obj_model.core.LongStringAttribute object>[source]
related_attributes = {'rate_laws': <obj_model.expression.ExpressionManyToOneAttribute object>}[source]
tabular_orientation = 3[source]
unique_together = ()[source]
verbose_name = 'Rate law expression'[source]
verbose_name_plural = 'Rate law expressions'[source]
compartments = <obj_model.core.ManyToManyAttribute object>[source]
classmethod deserialize(value, objects)[source]

Deserialize value

Parameters:
  • value (str) – String representation
  • objects (dict) – dictionary of objects, grouped by model
Returns:

tuple of cleaned value

and cleaning error

Return type:

tuple of RateLawExpression, InvalidAttribute or None

expression = <obj_model.core.LongStringAttribute object>[source]
functions = <obj_model.core.ManyToManyAttribute object>[source]
merge_attrs(other, other_objs_in_self, self_objs_in_other)[source]

Merge attributes of two objects

Parameters:
  • other (obj_model.Model) – other model
  • other_objs_in_self (dict) – dictionary that maps instances of objects in another model to objects in a model
  • self_objs_in_other (dict) – dictionary that maps instances of objects in a model to objects in another model
objects = <obj_model.core.Manager object>[source]
observables = <obj_model.core.ManyToManyAttribute object>[source]
parameters = <obj_model.core.ManyToManyAttribute object>[source]
serialize()[source]

Generate string representation

Returns:value of primary attribute
Return type:str
species = <obj_model.core.ManyToManyAttribute object>[source]
validate()[source]

Determine whether a RateLawExpression is valid

  • Check that all of the species and parameters contribute to the expression
  • Check that the species and parameters encompass of the named entities in the expression
Returns:
None if the object is valid,
otherwise return a list of errors in an InvalidObject instance
Return type:InvalidObject or None
class wc_lang.core.Reaction(**kwargs)[source]

Bases: obj_model.core.Model, wc_lang.sbml.util.SbmlModelMixin

id[source]

unique identifier

Type:str
name[source]

name

Type:str
model[source]

model

Type:Model
submodel[source]

submodel that reaction belongs to

Type:Submodel
participants[source]

participants

Type:list of SpeciesCoefficient
reversible[source]

indicates if reaction is thermodynamically reversible

Type:bool
flux_bounds[source]

flux bounds

Type:FluxBounds
identifiers[source]

identifiers

Type:list of Identifier
conclusions[source]

conclusions

Type:list of Conclusion
comments[source]

comments

Type:str
references[source]

references

Type:list of Reference

Related attributes:

  • rate_laws (list of RateLaw): rate laws; if present, rate_laws[0] is the forward rate law, and rate_laws[0] is the backward rate law
  • dfba_obj_expression (DfbaObjectiveExpression): dFBA objective expression
class Meta[source]

Bases: obj_model.core.Meta, obj_model.expression.ExpressionDynamicTermMeta

attribute_order = ('id', 'name', 'submodel', 'participants', 'reversible', 'rate_units', 'flux_bounds', 'identifiers', 'evidence', 'conclusions', 'comments', 'references')[source]
attributes = {'comments': <wc_lang.core.CommentAttribute object>, 'conclusions': <obj_model.core.ManyToManyAttribute object>, 'evidence': <wc_lang.core.EvidenceManyToManyAttribute object>, 'flux_bounds': <obj_model.core.ManyToOneAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'identifiers': <wc_lang.core.IdentifierManyToManyAttribute object>, 'model': <obj_model.core.ManyToOneAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'participants': <wc_lang.core.ReactionParticipantAttribute object>, 'rate_units': <obj_model.units.UnitAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>, 'reversible': <obj_model.core.BooleanAttribute object>, 'submodel': <obj_model.core.ManyToOneAttribute object>}[source]
child_attrs = {'sbml': ('id', 'name', 'model', 'submodel', 'participants', 'reversible', 'rate_units', 'flux_bounds', 'identifiers', 'comments'), 'wc_sim': ('id', 'model', 'submodel', 'participants', 'reversible', 'rate_units', 'flux_bounds')}[source]
children = {'core_model': ('participants', 'rate_laws', 'flux_bounds', 'identifiers', 'evidence', 'conclusions', 'references'), 'submodel': ('participants', 'rate_laws', 'flux_bounds', 'identifiers', 'evidence', 'conclusions', 'references')}[source]
expression_term_units = 'rate_units'[source]
indexed_attrs_tuples = (('id',),)[source]
inheritance = (<class 'wc_lang.core.Reaction'>,)[source]
local_attributes = {'comments': <obj_model.core.LocalAttribute object>, 'conclusions': <obj_model.core.LocalAttribute object>, 'dfba_obj_expression': <obj_model.core.LocalAttribute object>, 'evidence': <obj_model.core.LocalAttribute object>, 'flux_bounds': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'identifiers': <obj_model.core.LocalAttribute object>, 'model': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'participants': <obj_model.core.LocalAttribute object>, 'rate_laws': <obj_model.core.LocalAttribute object>, 'rate_units': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'reversible': <obj_model.core.LocalAttribute object>, 'submodel': <obj_model.core.LocalAttribute object>}[source]
merge = 2[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.SlugAttribute object>[source]
related_attributes = {'dfba_obj_expression': <obj_model.core.OneToManyAttribute object>, 'rate_laws': <obj_model.core.ManyToOneAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Reaction'[source]
verbose_name_plural = 'Reactions'[source]
comments = <wc_lang.core.CommentAttribute object>[source]
conclusions = <obj_model.core.ManyToManyAttribute object>[source]
evidence = <wc_lang.core.EvidenceManyToManyAttribute object>[source]
export_relations_to_sbml(sbml_model, sbml_rxn)[source]

Add relationships to/from object to SBML reaction.

Parameters:
  • sbml_model (libsbml.Model) – SBML model
  • sbml_rxn (libsbml.Reaction) – SBML reaction
export_to_sbml(sbml_model)[source]

Add this reaction to a SBML model.

Parameters:sbml_model (libsbml.Model) – SBML model
Returns:SBML reaction
Return type:libsbml.Reaction
Raises:ValueError – if the reaction has a backward rate law which cannot be exported to SBML
flux_bounds = <obj_model.core.ManyToOneAttribute object>[source]
get_modifiers(direction=<RateLawDirection.forward: 1>)[source]

Get species in the expression that are not reactants in the reaction

Returns:species in the expression that are not reactants in the reaction
Return type:list of Species
get_products()[source]

Get the species produced by the reaction

Returns:product species
Return type:list of Species
get_reactants()[source]

Get the species consumed by the reaction

Returns:reactant species
Return type:list of Species
get_species(_Reaction__type=None, **kwargs)[source]

Get species

Parameters:
  • __type (types.TypeType or tuple of types.TypeType) – subclass(es) of Model
  • kwargs (dict of str –> object) – dictionary of attribute name/value pairs to find matching objects
Returns:

list of Species

Return type:

list

id = <obj_model.core.SlugAttribute object>[source]
identifiers = <wc_lang.core.IdentifierManyToManyAttribute object>[source]
import_from_sbml(sbml_rxn)[source]

Load from SBML reaction

Parameters:sbml (libsbml.Reaction) – SBML reaction
import_relations_from_sbml(sbml_rxn, objs)[source]

Load relationships from SBML reaction

Parameters:
  • sbml (libsbml.Reaction) – SBML reaction
  • objs (dict) – dictionary that maps WC-Lang types to dictionaries that map the ids of WC-Lang objects to WC-Lang objects
model = <obj_model.core.ManyToOneAttribute object>[source]
name = <obj_model.core.StringAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
participants = <wc_lang.core.ReactionParticipantAttribute object>[source]
rate_units = <obj_model.units.UnitAttribute object>[source]
references = <obj_model.core.ManyToManyAttribute object>[source]
reversible = <obj_model.core.BooleanAttribute object>[source]
submodel = <obj_model.core.ManyToOneAttribute object>[source]
validate()[source]

Check if the reaction is valid

  • If the submodel is ODE or SSA, check that the reaction has a forward rate law
  • If the submodel is ODE or SSA and the reaction is reversible, check that the reaction has a backward rate law
  • Check flux units are not None if flux_bounds.min or flux_bounds.max is defined
  • Check that flux_bounds.min <= flux_bounds.max
  • Check that reaction is element and charge balanced
Returns:
None if the object is valid,
otherwise return a list of errors in an InvalidObject instance
Return type:InvalidObject or None
class wc_lang.core.ReactionParticipantAttribute(related_name='', verbose_name='', verbose_related_name='', help='')[source]

Bases: obj_model.core.ManyToManyAttribute

Reaction participants

deserialize(value, objects, decoded=None)[source]

Deserialize value

Parameters:
  • value (str) – String representation
  • objects (dict) – dictionary of objects, grouped by model
  • decoded (dict, optional) – dictionary of objects that have already been decoded
Returns:

cleaned value InvalidAttribute: cleaning error

Return type:

list of SpeciesCoefficient

deserialize_side(direction, value, objects, global_comp)[source]

Deserialize the LHS or RHS of a reaction expression

Parameters:
  • direction (float) – -1. indicates LHS, +1. indicates RHS
  • value (str) – String representation
  • objects (dict) – dictionary of objects, grouped by model
  • global_comp (Compartment) – global compartment of the reaction
Returns:

list of species coefficients list of Exception: list of errors

Return type:

list of SpeciesCoefficient

get_excel_validation()[source]

Get Excel validation

Returns:validation
Return type:wc_utils.workbook.io.FieldValidation
serialize(participants, encoded=None)[source]

Serialize related object

Parameters:
  • participants (list of SpeciesCoefficient) – Python representation of reaction participants
  • encoded (dict, optional) – dictionary of objects that have already been encoded
Returns:

simple Python representation

Return type:

str

validate(obj, value)[source]

Determine if value is a valid value of the attribute

Parameters:
Returns:

None if attribute is valid, other return list of errors as an instance of InvalidAttribute

Return type:

InvalidAttribute or None

class wc_lang.core.Reference(**kwargs)[source]

Bases: obj_model.core.Model

id[source]

unique identifier

Type:str
name[source]

name

Type:str
model[source]

model

Type:Model
title[source]

title

Type:str
author[source]

author(s)

Type:str
editor[source]

editor(s)

Type:str
year[source]

year

Type:int
type[source]

type

Type:proto.term.Term
publication[source]

publication title

Type:str
publisher[source]

publisher

Type:str
series[source]

series

Type:str
volume[source]

volume

Type:str
number[source]

number

Type:str
issue[source]

issue

Type:str
edition[source]

edition

Type:str
chapter[source]

chapter

Type:str
pages[source]

page range

Type:str
identifiers[source]

identifiers

Type:list of Identifier
comments[source]

comments

Type:str

Related attributes:

class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'name', 'title', 'author', 'editor', 'year', 'type', 'publication', 'publisher', 'series', 'volume', 'number', 'issue', 'edition', 'chapter', 'pages', 'identifiers', 'comments')[source]
attributes = {'author': <obj_model.core.StringAttribute object>, 'chapter': <obj_model.core.StringAttribute object>, 'comments': <wc_lang.core.CommentAttribute object>, 'edition': <obj_model.core.StringAttribute object>, 'editor': <obj_model.core.StringAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'identifiers': <wc_lang.core.IdentifierManyToManyAttribute object>, 'issue': <obj_model.core.StringAttribute object>, 'model': <obj_model.core.ManyToOneAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'number': <obj_model.core.StringAttribute object>, 'pages': <obj_model.core.StringAttribute object>, 'publication': <obj_model.core.StringAttribute object>, 'publisher': <obj_model.core.StringAttribute object>, 'series': <obj_model.core.StringAttribute object>, 'title': <obj_model.core.StringAttribute object>, 'type': <obj_model.ontology.OntologyAttribute object>, 'volume': <obj_model.core.StringAttribute object>, 'year': <obj_model.core.PositiveIntegerAttribute object>}[source]
child_attrs = {'sbml': (), 'wc_sim': ()}[source]
children = {'core_model': ('identifiers',), 'submodel': ('identifiers',)}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_lang.core.Reference'>,)[source]
local_attributes = {'author': <obj_model.core.LocalAttribute object>, 'changes': <obj_model.core.LocalAttribute object>, 'chapter': <obj_model.core.LocalAttribute object>, 'comments': <obj_model.core.LocalAttribute object>, 'compartments': <obj_model.core.LocalAttribute object>, 'conclusions': <obj_model.core.LocalAttribute object>, 'dfba_obj_reactions': <obj_model.core.LocalAttribute object>, 'dfba_obj_species': <obj_model.core.LocalAttribute object>, 'dfba_objs': <obj_model.core.LocalAttribute object>, 'distribution_init_concentrations': <obj_model.core.LocalAttribute object>, 'edition': <obj_model.core.LocalAttribute object>, 'editor': <obj_model.core.LocalAttribute object>, 'env': <obj_model.core.LocalAttribute object>, 'functions': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'identifiers': <obj_model.core.LocalAttribute object>, 'issue': <obj_model.core.LocalAttribute object>, 'model': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'number': <obj_model.core.LocalAttribute object>, 'observables': <obj_model.core.LocalAttribute object>, 'observation_sets': <obj_model.core.LocalAttribute object>, 'observations': <obj_model.core.LocalAttribute object>, 'pages': <obj_model.core.LocalAttribute object>, 'parameters': <obj_model.core.LocalAttribute object>, 'publication': <obj_model.core.LocalAttribute object>, 'publisher': <obj_model.core.LocalAttribute object>, 'rate_laws': <obj_model.core.LocalAttribute object>, 'reactions': <obj_model.core.LocalAttribute object>, 'series': <obj_model.core.LocalAttribute object>, 'species': <obj_model.core.LocalAttribute object>, 'species_types': <obj_model.core.LocalAttribute object>, 'stop_conditions': <obj_model.core.LocalAttribute object>, 'submodels': <obj_model.core.LocalAttribute object>, 'taxon': <obj_model.core.LocalAttribute object>, 'title': <obj_model.core.LocalAttribute object>, 'type': <obj_model.core.LocalAttribute object>, 'volume': <obj_model.core.LocalAttribute object>, 'year': <obj_model.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.SlugAttribute object>[source]
related_attributes = {'changes': <obj_model.core.ManyToManyAttribute object>, 'compartments': <obj_model.core.ManyToManyAttribute object>, 'conclusions': <obj_model.core.ManyToManyAttribute object>, 'dfba_obj_reactions': <obj_model.core.ManyToManyAttribute object>, 'dfba_obj_species': <obj_model.core.ManyToManyAttribute object>, 'dfba_objs': <obj_model.core.ManyToManyAttribute object>, 'distribution_init_concentrations': <obj_model.core.ManyToManyAttribute object>, 'env': <obj_model.core.OneToManyAttribute object>, 'functions': <obj_model.core.ManyToManyAttribute object>, 'observables': <obj_model.core.ManyToManyAttribute object>, 'observation_sets': <obj_model.core.ManyToManyAttribute object>, 'observations': <obj_model.core.ManyToManyAttribute object>, 'parameters': <obj_model.core.ManyToManyAttribute object>, 'rate_laws': <obj_model.core.ManyToManyAttribute object>, 'reactions': <obj_model.core.ManyToManyAttribute object>, 'species': <obj_model.core.ManyToManyAttribute object>, 'species_types': <obj_model.core.ManyToManyAttribute object>, 'stop_conditions': <obj_model.core.ManyToManyAttribute object>, 'submodels': <obj_model.core.ManyToManyAttribute object>, 'taxon': <obj_model.core.OneToManyAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Reference'[source]
verbose_name_plural = 'References'[source]
author = <obj_model.core.StringAttribute object>[source]
chapter = <obj_model.core.StringAttribute object>[source]
comments = <wc_lang.core.CommentAttribute object>[source]
edition = <obj_model.core.StringAttribute object>[source]
editor = <obj_model.core.StringAttribute object>[source]
id = <obj_model.core.SlugAttribute object>[source]
identifiers = <wc_lang.core.IdentifierManyToManyAttribute object>[source]
issue = <obj_model.core.StringAttribute object>[source]
model = <obj_model.core.ManyToOneAttribute object>[source]
name = <obj_model.core.StringAttribute object>[source]
number = <obj_model.core.StringAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
pages = <obj_model.core.StringAttribute object>[source]
publication = <obj_model.core.StringAttribute object>[source]
publisher = <obj_model.core.StringAttribute object>[source]
series = <obj_model.core.StringAttribute object>[source]
title = <obj_model.core.StringAttribute object>[source]
type = <obj_model.ontology.OntologyAttribute object>[source]
volume = <obj_model.core.StringAttribute object>[source]
year = <obj_model.core.PositiveIntegerAttribute object>[source]
class wc_lang.core.Species(tuple of species type, compartment)[source]

Bases: obj_model.core.Model, wc_lang.sbml.util.SbmlModelMixin

id[source]

identifier equal to {species_type.id}[{compartment.id}]

Type:str
name[source]

name

Type:str
model[source]

model

Type:Model
species_type[source]

species type

Type:SpeciesType
compartment[source]

compartment

Type:Compartment
units[source]

units of counts

Type:unit_registry.Unit
identifiers[source]

identifiers

Type:list of Identifier
conclusions[source]

conclusions

Type:list of Conclusion
comments[source]

comments

Type:str
references[source]

references

Type:list of Reference

Related attributes:

class Meta[source]

Bases: obj_model.core.Meta, obj_model.expression.ExpressionDynamicTermMeta

attribute_order = ('id', 'name', 'species_type', 'compartment', 'units', 'identifiers', 'evidence', 'conclusions', 'comments', 'references')[source]
attributes = {'comments': <wc_lang.core.CommentAttribute object>, 'compartment': <obj_model.core.ManyToOneAttribute object>, 'conclusions': <obj_model.core.ManyToManyAttribute object>, 'evidence': <wc_lang.core.EvidenceManyToManyAttribute object>, 'id': <obj_model.core.StringAttribute object>, 'identifiers': <wc_lang.core.IdentifierManyToManyAttribute object>, 'model': <obj_model.core.ManyToOneAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>, 'species_type': <obj_model.core.ManyToOneAttribute object>, 'units': <obj_model.units.UnitAttribute object>}[source]
child_attrs = {'sbml': ('id', 'name', 'model', 'species_type', 'compartment', 'units', 'identifiers', 'comments'), 'wc_sim': ('id', 'model', 'species_type', 'compartment', 'units')}[source]
children = {'core_model': ('species_type', 'compartment', 'distribution_init_concentration', 'identifiers', 'evidence', 'conclusions', 'references'), 'submodel': ('species_type', 'compartment', 'distribution_init_concentration', 'identifiers', 'evidence', 'conclusions', 'references')}[source]
expression_term_token_pattern = (1, 9, 1, 10)[source]
expression_term_units = 'units'[source]
frozen_columns = 1[source]
indexed_attrs_tuples = (('compartment', 'species_type'),)[source]
inheritance = (<class 'wc_lang.core.Species'>,)[source]
local_attributes = {'comments': <obj_model.core.LocalAttribute object>, 'compartment': <obj_model.core.LocalAttribute object>, 'conclusions': <obj_model.core.LocalAttribute object>, 'dfba_obj_species': <obj_model.core.LocalAttribute object>, 'distribution_init_concentration': <obj_model.core.LocalAttribute object>, 'evidence': <obj_model.core.LocalAttribute object>, 'function_expressions': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'identifiers': <obj_model.core.LocalAttribute object>, 'model': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'observable_expressions': <obj_model.core.LocalAttribute object>, 'rate_law_expressions': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'species_coefficients': <obj_model.core.LocalAttribute object>, 'species_type': <obj_model.core.LocalAttribute object>, 'stop_condition_expressions': <obj_model.core.LocalAttribute object>, 'units': <obj_model.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.StringAttribute object>[source]
related_attributes = {'dfba_obj_species': <obj_model.core.ManyToOneAttribute object>, 'distribution_init_concentration': <obj_model.core.OneToOneAttribute object>, 'function_expressions': <obj_model.core.ManyToManyAttribute object>, 'observable_expressions': <obj_model.core.ManyToManyAttribute object>, 'rate_law_expressions': <obj_model.core.ManyToManyAttribute object>, 'species_coefficients': <obj_model.core.ManyToOneAttribute object>, 'stop_condition_expressions': <obj_model.core.ManyToManyAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Species'[source]
verbose_name_plural = 'Species'[source]
comments = <wc_lang.core.CommentAttribute object>[source]
compartment = <obj_model.core.ManyToOneAttribute object>[source]
conclusions = <obj_model.core.ManyToManyAttribute object>[source]
evidence = <wc_lang.core.EvidenceManyToManyAttribute object>[source]
export_relations_to_sbml(sbml_model, sbml)[source]

Add relationships to/from object to SBML species.

Parameters:
  • sbml_model (libsbml.Model) – SBML model
  • sbml (libsbml.Species) – SBML species
export_to_sbml(sbml_model)[source]

Add this species to a SBML model.

Parameters:sbml_model (libsbml.Model) – SBML model
Returns:SBML species
Return type:libsbml.Species
gen_id()[source]

Generate identifier

Returns:identifier
Return type:str
static get(ids, species_iterator)[source]

Find some Species instances

Parameters:
  • ids (Iterator of str) – an iterator over some species identifiers
  • species_iterator (Iterator) – an iterator over some species
Returns:

each element of the list corresponds to an element

of ids and contains either a Species with id() equal to the element in ids, or None indicating that species_iterator does not contain a matching Species

Return type:

list of Species or None

id = <obj_model.core.StringAttribute object>[source]
identifiers = <wc_lang.core.IdentifierManyToManyAttribute object>[source]
import_from_sbml(sbml)[source]

Load from SBML species

Parameters:sbml (libsbml.Species) – SBML species
import_relations_from_sbml(sbml, objs)[source]

Load relationships from SBML species

Parameters:
  • sbml (libsbml.Species) – SBML species
  • objs (dict) – dictionary that maps WC-Lang types to dictionaries that map the ids of WC-Lang objects to WC-Lang objects
model = <obj_model.core.ManyToOneAttribute object>[source]
name = <obj_model.core.StringAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
classmethod parse_id(id)[source]
Parameters:id (str) – identifier
Returns:species type id str: compartment id
Return type:str
Raises:ValueError – if the id does not have the format {species.id}[{compartment.id}]
references = <obj_model.core.ManyToManyAttribute object>[source]
species_type = <obj_model.core.ManyToOneAttribute object>[source]
units = <obj_model.units.UnitAttribute object>[source]
validate()[source]

Check that the species is valid

  • Check if the identifier is equal to {species_type.id}[{compartment.id}]
Returns:
None if the object is valid,
otherwise return a list of errors as an instance of InvalidObject
Return type:InvalidObject or None
class wc_lang.core.SpeciesCoefficient(**kwargs)[source]

Bases: obj_model.core.Model, wc_lang.sbml.util.SbmlModelMixin

A tuple of a species and a coefficient

species[source]

species

Type:Species
coefficient[source]

coefficient

Type:float

Related attributes:

class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('species', 'coefficient')[source]
attributes = {'coefficient': <obj_model.core.FloatAttribute object>, 'species': <obj_model.core.ManyToOneAttribute object>}[source]
child_attrs = {'sbml': ('species', 'coefficient'), 'wc_sim': ('species', 'coefficient')}[source]
children = {'core_model': ('species',), 'submodel': ('species',)}[source]
frozen_columns = 1[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_lang.core.SpeciesCoefficient'>,)[source]
local_attributes = {'coefficient': <obj_model.core.LocalAttribute object>, 'reactions': <obj_model.core.LocalAttribute object>, 'species': <obj_model.core.LocalAttribute object>}[source]
ordering = ('species', 'coefficient')[source]
primary_attribute = None[source]
related_attributes = {'reactions': <wc_lang.core.ReactionParticipantAttribute object>}[source]
tabular_orientation = 3[source]
unique_together = (('coefficient', 'species'),)[source]
verbose_name = 'Species coefficient'[source]
verbose_name_plural = 'Species coefficients'[source]
coefficient = <obj_model.core.FloatAttribute object>[source]
classmethod deserialize(value, objects, compartment=None)[source]

Deserialize value

Parameters:
  • value (str) – String representation
  • objects (dict) – dictionary of objects, grouped by model
  • compartment (Compartment, optional) – compartment
Returns:

tuple of cleaned value

and cleaning error

Return type:

tuple of SpeciesCoefficient, InvalidAttribute or None

objects = <obj_model.core.Manager object>[source]
serialize(show_compartment=True, show_coefficient_sign=True)[source]

Serialize related object

Parameters:
  • show_compartment (bool, optional) – if true, show compartment
  • show_coefficient_sign (bool, optional) – if true, show coefficient sign
Returns:

simple Python representation

Return type:

str

species = <obj_model.core.ManyToOneAttribute object>[source]
class wc_lang.core.SpeciesType(**kwargs)[source]

Bases: obj_model.core.Model, wc_lang.sbml.util.SbmlModelMixin

Species type

id[source]

unique identifier

Type:str
name[source]

name

Type:str
model[source]

model

Type:Model
structure[source]

structure (InChI for metabolites; sequence for DNA, RNA, proteins)

Type:ChemicalStructure
type[source]

type

Type:pronto.term.Term
identifiers[source]

identifiers

Type:list of Identifier
conclusions[source]

conclusions

Type:list of Conclusion
comments[source]

comments

Type:str
references[source]

references

Type:list of Reference

Related attributes:

  • species (list of Species): species
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'name', 'structure', 'type', 'identifiers', 'evidence', 'conclusions', 'comments', 'references')[source]
attributes = {'comments': <wc_lang.core.CommentAttribute object>, 'conclusions': <obj_model.core.ManyToManyAttribute object>, 'evidence': <wc_lang.core.EvidenceManyToManyAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'identifiers': <wc_lang.core.IdentifierManyToManyAttribute object>, 'model': <obj_model.core.ManyToOneAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>, 'structure': <obj_model.core.ManyToOneAttribute object>, 'type': <obj_model.ontology.OntologyAttribute object>}[source]
child_attrs = {'sbml': ('id', 'name', 'model', 'structure', 'type', 'identifiers', 'comments'), 'wc_sim': ('id', 'model', 'structure')}[source]
children = {'core_model': ('structure', 'species', 'identifiers', 'evidence', 'conclusions', 'references'), 'submodel': ('structure', 'identifiers', 'evidence', 'conclusions', 'references')}[source]
indexed_attrs_tuples = (('id',),)[source]
inheritance = (<class 'wc_lang.core.SpeciesType'>,)[source]
local_attributes = {'comments': <obj_model.core.LocalAttribute object>, 'conclusions': <obj_model.core.LocalAttribute object>, 'evidence': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'identifiers': <obj_model.core.LocalAttribute object>, 'model': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'species': <obj_model.core.LocalAttribute object>, 'structure': <obj_model.core.LocalAttribute object>, 'type': <obj_model.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.SlugAttribute object>[source]
related_attributes = {'species': <obj_model.core.ManyToOneAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Species type'[source]
verbose_name_plural = 'Species types'[source]
comments = <wc_lang.core.CommentAttribute object>[source]
conclusions = <obj_model.core.ManyToManyAttribute object>[source]
evidence = <wc_lang.core.EvidenceManyToManyAttribute object>[source]
id = <obj_model.core.SlugAttribute object>[source]
identifiers = <wc_lang.core.IdentifierManyToManyAttribute object>[source]
model = <obj_model.core.ManyToOneAttribute object>[source]
name = <obj_model.core.StringAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
references = <obj_model.core.ManyToManyAttribute object>[source]
structure = <obj_model.core.ManyToOneAttribute object>[source]
type = <obj_model.ontology.OntologyAttribute object>[source]
class wc_lang.core.StopCondition(**kwargs)[source]

Bases: obj_model.core.Model

StopCondition: Simulation of a model terminates when one of its stop conditions is true.

A Boolean expression of Functions, Observbles, Parameters and Python functions. Stop conditions are optional.

id[source]

unique id

Type:str
name[source]

name

Type:str
model[source]

model

Type:Model
expression[source]

mathematical expression for a StopCondition

Type:StopConditionExpression
units[source]

units

Type:unit_registry.Unit
identifiers[source]

identifiers

Type:list of Identifier
conclusions[source]

conclusions

Type:list of Conclusion
comments[source]

comments

Type:str
references[source]

references

Type:list of Reference

Related attributes:

  • expressions (Expressions): expressions
class Meta[source]

Bases: obj_model.core.Meta, obj_model.expression.ExpressionExpressionTermMeta

attribute_order = ('id', 'name', 'expression', 'units', 'identifiers', 'evidence', 'conclusions', 'comments', 'references')[source]
attributes = {'comments': <wc_lang.core.CommentAttribute object>, 'conclusions': <obj_model.core.ManyToManyAttribute object>, 'evidence': <wc_lang.core.EvidenceManyToManyAttribute object>, 'expression': <obj_model.expression.ExpressionOneToOneAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'identifiers': <wc_lang.core.IdentifierManyToManyAttribute object>, 'model': <obj_model.core.ManyToOneAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>, 'units': <obj_model.units.UnitAttribute object>}[source]
child_attrs = {'sbml': (), 'wc_sim': ('id', 'model', 'expression', 'units')}[source]
children = {'core_model': ('expression', 'identifiers', 'evidence', 'conclusions', 'references'), 'submodel': ('expression', 'identifiers', 'evidence', 'conclusions', 'references')}[source]
expression_term_model[source]

alias of StopConditionExpression

expression_term_units = 'units'[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_lang.core.StopCondition'>,)[source]
local_attributes = {'comments': <obj_model.core.LocalAttribute object>, 'conclusions': <obj_model.core.LocalAttribute object>, 'evidence': <obj_model.core.LocalAttribute object>, 'expression': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'identifiers': <obj_model.core.LocalAttribute object>, 'model': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>, 'units': <obj_model.core.LocalAttribute object>}[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.SlugAttribute object>[source]
related_attributes = {}[source]
unique_together = ()[source]
verbose_name = 'Stop condition'[source]
verbose_name_plural = 'Stop conditions'[source]
comments = <wc_lang.core.CommentAttribute object>[source]
conclusions = <obj_model.core.ManyToManyAttribute object>[source]
evidence = <wc_lang.core.EvidenceManyToManyAttribute object>[source]
expression = <obj_model.expression.ExpressionOneToOneAttribute object>[source]
id = <obj_model.core.SlugAttribute object>[source]
identifiers = <wc_lang.core.IdentifierManyToManyAttribute object>[source]
model = <obj_model.core.ManyToOneAttribute object>[source]
name = <obj_model.core.StringAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
references = <obj_model.core.ManyToManyAttribute object>[source]
units = <obj_model.units.UnitAttribute object>[source]
validate()[source]

Check that the stop condition is valid

  • Check that expression has units units
Returns:
None if the object is valid,
otherwise return a list of errors as an instance of InvalidObject
Return type:InvalidObject or None
class wc_lang.core.StopConditionExpression(**kwargs)[source]

Bases: obj_model.core.Model, obj_model.expression.Expression

A mathematical expression of Functions, Observables, Parameters and Python functions

The expression used by a StopCondition.

expression[source]

mathematical expression for a StopCondition

Type:str
_parsed_expression[source]

an analyzed expression; not an obj_model.Model

Type:ParsedExpression
species[source]

Species used by this stop condition expression

Type:list of Species
observables[source]

Observables used by this stop condition expression

Type:list of Observable
parameters[source]

Parameters used by this stop condition expression

Type:list of Parameter
functions[source]

Functions used by this stop condition expression

Type:list of Function
compartments[source]

Compartments used by this stop condition expression

Type:list of Compartment

Related attributes:

class Meta[source]

Bases: obj_model.core.Meta, obj_model.expression.Meta

attribute_order = ()[source]
attributes = {'compartments': <obj_model.core.ManyToManyAttribute object>, 'expression': <obj_model.core.LongStringAttribute object>, 'functions': <obj_model.core.ManyToManyAttribute object>, 'observables': <obj_model.core.ManyToManyAttribute object>, 'parameters': <obj_model.core.ManyToManyAttribute object>, 'species': <obj_model.core.ManyToManyAttribute object>}[source]
child_attrs = {'sbml': (), 'wc_sim': ('expression', 'parameters', 'species', 'observables', 'functions', 'compartments')}[source]
children = {'core_model': ('parameters', 'species', 'observables', 'functions', 'compartments'), 'submodel': ('parameters', 'species', 'observables', 'functions', 'compartments')}[source]
expression_term_models = ('Parameter', 'Species', 'Observable', 'Function', 'Compartment')[source]
expression_type[source]

alias of builtins.bool

expression_unit_registry = <pint.registry.UnitRegistry object>[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_lang.core.StopConditionExpression'>,)