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'>][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__.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 PrepareForSimulation: 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

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
orcid[source]

ORCID

Type:str
db_refs[source]

database references

Type:list
comments[source]

comments

Type:str
Related attributes:
interpretations (list of Interpretation): interpretations 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', 'orcid', 'db_refs', 'comments')[source]
attributes = {'address': <obj_model.core.LongStringAttribute object>, 'comments': <obj_model.core.LongStringAttribute object>, 'db_refs': <wc_lang.core.DatabaseReferenceManyToManyAttribute object>, 'email': <obj_model.core.EmailAttribute object>, 'first_name': <obj_model.core.StringAttribute object>, 'id': <obj_model.core.SlugAttribute 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>, 'orcid': <obj_model.core.RegexAttribute object>, 'organization': <obj_model.core.LongStringAttribute object>, 'title': <obj_model.core.LongStringAttribute object>, 'website': <obj_model.core.UrlAttribute object>}[source]
children = {'core_model': ('db_refs',), 'submodel': ('db_refs',)}[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>, 'db_refs': <obj_model.core.LocalAttribute object>, 'email': <obj_model.core.LocalAttribute object>, 'first_name': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'interpretations': <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>, 'orcid': <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>, 'interpretations': <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]
db_refs = <wc_lang.core.DatabaseReferenceManyToManyAttribute object>[source]
email = <obj_model.core.EmailAttribute object>[source]
first_name = <obj_model.core.StringAttribute object>[source]
id = <obj_model.core.SlugAttribute 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]
orcid = <obj_model.core.RegexAttribute 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

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
db_refs (

list of DatabaseReference): database references

evidence[source]

evidence

Type:list
interpretations[source]

interpretations

Type:list
comments[source]

comments

Type:str
references[source]

references

Type:list
authors[source]

authors

Type:list
date[source]

date

Type: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', 'db_refs', 'evidence', 'interpretations', 'comments', 'references', 'authors', 'date')[source]
attributes = {'authors': <obj_model.core.ManyToManyAttribute object>, 'comments': <obj_model.core.LongStringAttribute object>, 'date': <obj_model.core.DateTimeAttribute object>, 'db_refs': <wc_lang.core.DatabaseReferenceManyToManyAttribute object>, 'evidence': <obj_model.core.ManyToManyAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'intention': <obj_model.core.LongStringAttribute object>, 'intention_type': <obj_model.ontology.OntologyAttribute object>, 'interpretations': <obj_model.core.ManyToManyAttribute 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]
children = {'core_model': ('db_refs', 'evidence', 'interpretations', 'references', 'authors'), 'submodel': ('db_refs', 'evidence', 'interpretations', '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>, 'date': <obj_model.core.LocalAttribute object>, 'db_refs': <obj_model.core.LocalAttribute object>, 'evidence': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'intention': <obj_model.core.LocalAttribute object>, 'intention_type': <obj_model.core.LocalAttribute object>, 'interpretations': <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]
date = <obj_model.core.DateTimeAttribute object>[source]
db_refs = <wc_lang.core.DatabaseReferenceManyToManyAttribute object>[source]
evidence = <obj_model.core.ManyToManyAttribute object>[source]
id = <obj_model.core.SlugAttribute object>[source]
intention = <obj_model.core.LongStringAttribute object>[source]
intention_type = <obj_model.ontology.OntologyAttribute object>[source]
interpretations = <obj_model.core.ManyToManyAttribute 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.CommentAttribute(min_length=0, max_length=4294967295, default='', default_cleaned_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
Raises:

ValueError – if the attributes of the elements of the models are different

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

Bases: obj_model.core.Model

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
mean_init_volume[source]

mean initial volume

Type:float
std_init_volume[source]

standard deviation of the mean initial volume

Type:float
init_volume_units[source]

units of volume

Type:unit_registry.Unit
init_density[source]

function that calculates the density during the initialization of each simulation

Type:Parameter
db_refs[source]

database references

Type:list
evidence[source]

evidence

Type:list
interpretations[source]

interpretations

Type:list
comments[source]

comments

Type:str
references[source]

references

Type:list
Related attributes:
sub_compartments (list of Compartment): compartments contained in this compartment species (list of Species): species in this compartment function_expressions (list of FunctionExpression): function expressions rate_law_expressions (list of RateLawExpression): rate law expressions stop_condition_expressions (list of StopConditionExpression): stop condition expressions
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', 'distribution_init_volume', 'mean_init_volume', 'std_init_volume', 'init_volume_units', 'init_density', 'db_refs', 'evidence', 'interpretations', 'comments', 'references')[source]
attributes = {'biological_type': <obj_model.ontology.OntologyAttribute object>, 'comments': <wc_lang.core.CommentAttribute object>, 'db_refs': <wc_lang.core.DatabaseReferenceManyToManyAttribute object>, 'distribution_init_volume': <obj_model.ontology.OntologyAttribute object>, 'evidence': <obj_model.core.ManyToManyAttribute object>, 'geometry': <obj_model.ontology.OntologyAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'init_density': <obj_model.core.OneToOneAttribute object>, 'init_volume_units': <obj_model.units.UnitAttribute object>, 'interpretations': <obj_model.core.ManyToManyAttribute object>, 'mass_units': <obj_model.units.UnitAttribute object>, 'mean_init_volume': <obj_model.core.FloatAttribute object>, 'model': <obj_model.core.ManyToOneAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'parent_compartment': <obj_model.core.ManyToOneAttribute object>, 'physical_type': <obj_model.ontology.OntologyAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>, 'std_init_volume': <obj_model.core.FloatAttribute object>}[source]
children = {'core_model': ('parent_compartment', 'sub_compartments', 'init_density', 'db_refs', 'evidence', 'interpretations', 'references'), 'submodel': ('init_density', 'db_refs', 'evidence', 'interpretations', '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>, 'db_refs': <obj_model.core.LocalAttribute object>, 'distribution_init_volume': <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>, 'init_density': <obj_model.core.LocalAttribute object>, 'init_volume_units': <obj_model.core.LocalAttribute object>, 'interpretations': <obj_model.core.LocalAttribute object>, 'mass_units': <obj_model.core.LocalAttribute object>, 'mean_init_volume': <obj_model.core.LocalAttribute object>, 'model': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'parent_compartment': <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>, 'std_init_volume': <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]
add_to_sbml_model(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:LibSbmlError – if calling libsbml raises an error
biological_type = <obj_model.ontology.OntologyAttribute object>[source]
comments = <wc_lang.core.CommentAttribute object>[source]
db_refs = <wc_lang.core.DatabaseReferenceManyToManyAttribute object>[source]
distribution_init_volume = <obj_model.ontology.OntologyAttribute object>[source]
evidence = <obj_model.core.ManyToManyAttribute object>[source]
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]
init_density = <obj_model.core.OneToOneAttribute object>[source]
init_volume_units = <obj_model.units.UnitAttribute object>[source]
interpretations = <obj_model.core.ManyToManyAttribute object>[source]
mass_units = <obj_model.units.UnitAttribute object>[source]
mean_init_volume = <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]
parent_compartment = <obj_model.core.ManyToOneAttribute object>[source]
physical_type = <obj_model.ontology.OntologyAttribute object>[source]
references = <obj_model.core.ManyToManyAttribute object>[source]
std_init_volume = <obj_model.core.FloatAttribute 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.DatabaseReference(**kwargs)[source]

Bases: obj_model.core.Model

Reference to a source database entry

database[source]

database name

Type:str
id[source]

id of database entry

Type:str
Related attributes:

model (Model): model taxon (Taxon): taxon env (Environment): environment submodels (list of Submodel): submodels compartments (list of Compartment): compartments species_types (list of SpeciesType): species types species (list of Species): species distribution_init_concentrations (list of DistributionInitConcentration):

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

observables (list of Observable): observables functions (list of Function): functions reactions (list of Reaction): reactions rate_laws (list of RateLaw): rate laws dfba_objs (list of DfbaObjective): dFBA objectives dfba_obj_reactions (list of DfbaObjReaction): dFBA objective reactions dfba_obj_species (list of DfbaObjSpecies): dFBA objective species stop_conditions (list of StopCondition): stop conditions parameters (list of Parameter): parameters references (list of Reference): references authors (list of Author): authors changes (list of Change): changes

class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('database', 'id')[source]
attributes = {'database': <obj_model.core.StringAttribute object>, 'id': <obj_model.core.StringAttribute object>}[source]
frozen_columns = 2[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_lang.core.DatabaseReference'>,)[source]
local_attributes = {'authors': <obj_model.core.LocalAttribute object>, 'changes': <obj_model.core.LocalAttribute object>, 'compartments': <obj_model.core.LocalAttribute object>, 'database': <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>, 'evidences': <obj_model.core.LocalAttribute object>, 'functions': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'interpretations': <obj_model.core.LocalAttribute object>, 'model': <obj_model.core.LocalAttribute object>, 'observables': <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 = ('database', 'id')[source]
primary_attribute = None[source]
related_attributes = {'authors': <wc_lang.core.DatabaseReferenceManyToManyAttribute object>, 'changes': <wc_lang.core.DatabaseReferenceManyToManyAttribute object>, 'compartments': <wc_lang.core.DatabaseReferenceManyToManyAttribute object>, 'dfba_obj_reactions': <wc_lang.core.DatabaseReferenceManyToManyAttribute object>, 'dfba_obj_species': <wc_lang.core.DatabaseReferenceManyToManyAttribute object>, 'dfba_objs': <wc_lang.core.DatabaseReferenceManyToManyAttribute object>, 'distribution_init_concentrations': <wc_lang.core.DatabaseReferenceManyToManyAttribute object>, 'env': <wc_lang.core.DatabaseReferenceOneToManyAttribute object>, 'evidences': <wc_lang.core.DatabaseReferenceManyToManyAttribute object>, 'functions': <wc_lang.core.DatabaseReferenceManyToManyAttribute object>, 'interpretations': <wc_lang.core.DatabaseReferenceManyToManyAttribute object>, 'model': <wc_lang.core.DatabaseReferenceOneToManyAttribute object>, 'observables': <wc_lang.core.DatabaseReferenceManyToManyAttribute object>, 'parameters': <wc_lang.core.DatabaseReferenceManyToManyAttribute object>, 'rate_laws': <wc_lang.core.DatabaseReferenceManyToManyAttribute object>, 'reactions': <wc_lang.core.DatabaseReferenceManyToManyAttribute object>, 'references': <wc_lang.core.DatabaseReferenceManyToManyAttribute object>, 'species': <wc_lang.core.DatabaseReferenceManyToManyAttribute object>, 'species_types': <wc_lang.core.DatabaseReferenceManyToManyAttribute object>, 'stop_conditions': <wc_lang.core.DatabaseReferenceManyToManyAttribute object>, 'submodels': <wc_lang.core.DatabaseReferenceManyToManyAttribute object>, 'taxon': <wc_lang.core.DatabaseReferenceOneToManyAttribute object>}[source]
tabular_orientation = 3[source]
unique_together = (('database', 'id'),)[source]
verbose_name = 'Database reference'[source]
verbose_name_plural = 'Database references'[source]
database = <obj_model.core.StringAttribute 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 DatabaseReference, InvalidAttribute or None

id = <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.DatabaseReferenceManyToManyAttribute(related_name='', verbose_name='Database references', 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:

tuple of cleaned value

and cleaning error

Return type:

tuple of list of DatabaseReference, InvalidAttribute or None

get_excel_validation()[source]

Get Excel validation

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

Serialize related object

Parameters:
  • db_refs (list of DatabaseReference) – Python representation of database references
  • encoded (dict, optional) – dictionary of objects that have already been encoded
Returns:

string representation

Return type:

str

class wc_lang.core.DatabaseReferenceOneToManyAttribute(related_name='', verbose_name='Database references', 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:

tuple of cleaned value

and cleaning error

Return type:

tuple of list of DatabaseReference, InvalidAttribute or None

get_excel_validation()[source]

Get Excel validation

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

Serialize related object

Parameters:
  • db_refs (list of DatabaseReference) – Python representation of database references
  • encoded (dict, optional) – dictionary of objects that have already been encoded
Returns:

string representation

Return type:

str

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

Bases: obj_model.core.Model

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
db_refs[source]

database references

Type:list
evidence[source]

evidence

Type:list
interpretations[source]

interpretations

Type:list
comments[source]

comments

Type:str
references[source]

references

Type:list
Related attributes:
dfba_obj_expression (DfbaObjectiveExpression): dFBA objectie expression dfba_obj_species (list of DfbaObjSpecies): the components of this dFBA objective reaction
class Meta[source]

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

attribute_order = ('id', 'name', 'submodel', 'units', 'cell_size_units', 'db_refs', 'evidence', 'interpretations', 'comments', 'references')[source]
attributes = {'cell_size_units': <obj_model.units.UnitAttribute object>, 'comments': <wc_lang.core.CommentAttribute object>, 'db_refs': <wc_lang.core.DatabaseReferenceManyToManyAttribute object>, 'evidence': <obj_model.core.ManyToManyAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'interpretations': <obj_model.core.ManyToManyAttribute 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]
children = {'core_model': ('dfba_obj_species', 'db_refs', 'evidence', 'interpretations', 'references'), 'submodel': ('dfba_obj_species', 'db_refs', 'evidence', 'interpretations', '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>, 'db_refs': <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>, 'interpretations': <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]
add_to_sbml_model(sbml_model)[source]

Add a DfbaObjReaction 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
Raises:LibSbmlError – if calling libsbml raises an error
cell_size_units = <obj_model.units.UnitAttribute object>[source]
comments = <wc_lang.core.CommentAttribute object>[source]
db_refs = <wc_lang.core.DatabaseReferenceManyToManyAttribute object>[source]
evidence = <obj_model.core.ManyToManyAttribute object>[source]
id = <obj_model.core.SlugAttribute object>[source]
interpretations = <obj_model.core.ManyToManyAttribute 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]
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

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
db_refs[source]

database references

Type:list
evidence[source]

evidence

Type:list
interpretations[source]

interpretations

Type:list
comments[source]

comments

Type:str
references[source]

references

Type:list
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'name', 'dfba_obj_reaction', 'species', 'value', 'units', 'db_refs', 'evidence', 'interpretations', 'comments', 'references')[source]
attributes = {'comments': <wc_lang.core.CommentAttribute object>, 'db_refs': <wc_lang.core.DatabaseReferenceManyToManyAttribute object>, 'dfba_obj_reaction': <obj_model.core.ManyToOneAttribute object>, 'evidence': <obj_model.core.ManyToManyAttribute object>, 'id': <obj_model.core.StringAttribute object>, 'interpretations': <obj_model.core.ManyToManyAttribute 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]
children = {'core_model': ('dfba_obj_reaction', 'species', 'db_refs', 'evidence', 'interpretations', 'references'), 'submodel': ('dfba_obj_reaction', 'species', 'db_refs', 'evidence', 'interpretations', 'references')}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_lang.core.DfbaObjSpecies'>,)[source]
local_attributes = {'comments': <obj_model.core.LocalAttribute object>, 'db_refs': <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>, 'interpretations': <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]
db_refs = <wc_lang.core.DatabaseReferenceManyToManyAttribute object>[source]
dfba_obj_reaction = <obj_model.core.ManyToOneAttribute object>[source]
evidence = <obj_model.core.ManyToManyAttribute 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]
interpretations = <obj_model.core.ManyToManyAttribute 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

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
db_refs[source]

database references

Type:list
evidence[source]

evidence

Type:list
interpretations[source]

interpretations

Type:list
comments[source]

comments

Type:str
references[source]

references

Type:list
ACTIVE_OBJECTIVE = 'active_objective'[source]
class Meta[source]

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

attribute_order = ('id', 'name', 'submodel', 'expression', 'units', 'reaction_rate_units', 'coefficient_units', 'db_refs', 'evidence', 'interpretations', 'comments', 'references')[source]
attributes = {'coefficient_units': <obj_model.units.UnitAttribute object>, 'comments': <wc_lang.core.CommentAttribute object>, 'db_refs': <wc_lang.core.DatabaseReferenceManyToManyAttribute object>, 'evidence': <obj_model.core.ManyToManyAttribute object>, 'expression': <obj_model.expression.ExpressionOneToOneAttribute object>, 'id': <obj_model.core.StringAttribute object>, 'interpretations': <obj_model.core.ManyToManyAttribute 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]
children = {'core_model': ('expression', 'db_refs', 'evidence', 'interpretations', 'references'), 'submodel': ('expression', 'db_refs', 'evidence', 'interpretations', '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>, 'db_refs': <obj_model.core.LocalAttribute object>, 'evidence': <obj_model.core.LocalAttribute object>, 'expression': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'interpretations': <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]
add_to_sbml_model(sbml_model)[source]

Add this DfbaObjective 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
Raises:LibSbmlError – if calling libsbml raises an error
coefficient_units = <obj_model.units.UnitAttribute object>[source]
comments = <wc_lang.core.CommentAttribute object>[source]
db_refs = <wc_lang.core.DatabaseReferenceManyToManyAttribute object>[source]
evidence = <obj_model.core.ManyToManyAttribute object>[source]
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
:param **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]
interpretations = <obj_model.core.ManyToManyAttribute object>[source]
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

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
dfba_obj_reactions[source]

dFBA objective reactions used by this expression

Type:list
Related attributes:
dfba_obj (DfbaObjective): dFBA objective
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]
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]
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

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
db_refs[source]

database references

Type:list
evidence[source]

evidence

Type:list
interpretations[source]

interpretations

Type:list
comments[source]

comments

Type:str
references[source]

references

Type:list
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'name', 'species', 'distribution', 'mean', 'std', 'units', 'db_refs', 'evidence', 'interpretations', 'comments', 'references')[source]
attributes = {'comments': <wc_lang.core.CommentAttribute object>, 'db_refs': <wc_lang.core.DatabaseReferenceManyToManyAttribute object>, 'distribution': <obj_model.ontology.OntologyAttribute object>, 'evidence': <obj_model.core.ManyToManyAttribute object>, 'id': <obj_model.core.StringAttribute object>, 'interpretations': <obj_model.core.ManyToManyAttribute 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]
children = {'core_model': ('species', 'db_refs', 'evidence', 'interpretations', 'references'), 'submodel': ('db_refs', 'evidence', 'interpretations', '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>, 'db_refs': <obj_model.core.LocalAttribute object>, 'distribution': <obj_model.core.LocalAttribute object>, 'evidence': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'interpretations': <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]
db_refs = <wc_lang.core.DatabaseReferenceManyToManyAttribute object>[source]
distribution = <obj_model.ontology.OntologyAttribute object>[source]
evidence = <obj_model.core.ManyToManyAttribute object>[source]
gen_id()[source]

Generate string representation

Returns:string representation
Return type:str
id = <obj_model.core.StringAttribute object>[source]
interpretations = <obj_model.core.ManyToManyAttribute 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

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
ph[source]

pH

Type:float
ph_units[source]

pH units

Type:unit_registry.Unit
db_refs[source]

database references

Type:list
comments[source]

comments

Type:str
references[source]

references

Type:list
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'name', 'temp', 'temp_units', 'ph', 'ph_units', 'db_refs', 'comments', 'references')[source]
attributes = {'comments': <wc_lang.core.CommentAttribute object>, 'db_refs': <wc_lang.core.DatabaseReferenceOneToManyAttribute object>, 'id': <obj_model.core.RegexAttribute object>, 'model': <obj_model.core.OneToOneAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'ph': <obj_model.core.FloatAttribute object>, 'ph_units': <obj_model.units.UnitAttribute object>, 'references': <obj_model.core.OneToManyAttribute object>, 'temp': <obj_model.core.FloatAttribute object>, 'temp_units': <obj_model.units.UnitAttribute object>}[source]
children = {'core_model': ('db_refs', 'references'), 'submodel': ('db_refs', 'references')}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_lang.core.Environment'>,)[source]
local_attributes = {'comments': <obj_model.core.LocalAttribute object>, 'db_refs': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'model': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'ph': <obj_model.core.LocalAttribute object>, 'ph_units': <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]
db_refs = <wc_lang.core.DatabaseReferenceOneToManyAttribute object>[source]
id = <obj_model.core.RegexAttribute object>[source]
model = <obj_model.core.OneToOneAttribute object>[source]
name = <obj_model.core.StringAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
ph = <obj_model.core.FloatAttribute object>[source]
ph_units = <obj_model.units.UnitAttribute 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

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
taxon[source]

taxon in which the evidence was observed

Type:str
genetic_variant[source]

genetic variant in which the evidence was observed

Type:str
temp[source]

temperature at which the evidence was observed

Type:float
temp_units[source]

temperature units

Type:unit_registry.Unit
ph[source]

pH at which the evidence was observed

Type:float
ph_units (

obj:`unit_registry.Unit): pH units

growth_media[source]

growth media at which the evidence was observed

Type:str
condition[source]

experimental conditions (e.g. control)

Type:str
experiment_type[source]

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

Type:str
experiment_design[source]

experimental design

Type:str
measurement_method[source]

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

Type:str
analysis_method[source]

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

Type:str
db_refs[source]

database references

Type:list
evidence[source]

evidence underlying reduced evidence (e.g. individual observations underlying an average)

Type:list
comments[source]

comments

Type:str
references[source]

references

Type:list
Related attributes:

submodels (list of Submodel): submodels compartments (list of Compartment): compartments species_types (list of SpeciesType): species types species (list of Species): species distribution_init_concentrations (list of DistributionInitConcentration):

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

observables (list of Observable): observables functions (list of Function): functions reactions (list of Reaction): reactions rate_laws (list of RateLaw): rate laws dfba_objs (list of DfbaObjective): dFBA objectives dfba_obj_reactions (list of DfbaObjReaction): dFBA objective reactions dfba_obj_species (list of DfbaObjSpecies): dFBA objective species stop_conditions (list of StopCondition): stop conditions parameters (list of Parameter): parameters interpretations (list of Interpretation): interpretations changes (list of Change): change reduced_evidences (list of Evidence): reduced evidence that the evidence

supports (e.g. averages supported by this and other evidence)
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'name', 'value', 'std', 'units', 'type', 'taxon', 'genetic_variant', 'temp', 'temp_units', 'ph', 'ph_units', 'growth_media', 'condition', 'experiment_type', 'experiment_design', 'measurement_method', 'analysis_method', 'db_refs', 'evidence', 'comments', 'references')[source]
attributes = {'analysis_method': <obj_model.core.LongStringAttribute object>, 'comments': <wc_lang.core.CommentAttribute object>, 'condition': <obj_model.core.LongStringAttribute object>, 'db_refs': <wc_lang.core.DatabaseReferenceManyToManyAttribute object>, 'evidence': <obj_model.core.ManyToManyAttribute object>, 'experiment_design': <obj_model.core.LongStringAttribute object>, 'experiment_type': <obj_model.core.LongStringAttribute object>, 'genetic_variant': <obj_model.core.StringAttribute object>, 'growth_media': <obj_model.core.LongStringAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'measurement_method': <obj_model.core.LongStringAttribute object>, 'model': <obj_model.core.ManyToOneAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'ph': <obj_model.core.FloatAttribute object>, 'ph_units': <obj_model.units.UnitAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>, 'std': <obj_model.core.StringAttribute object>, 'taxon': <obj_model.core.StringAttribute object>, 'temp': <obj_model.core.FloatAttribute object>, 'temp_units': <obj_model.units.UnitAttribute object>, 'type': <obj_model.ontology.OntologyAttribute object>, 'units': <obj_model.units.UnitAttribute object>, 'value': <obj_model.core.StringAttribute object>}[source]
children = {'core_model': ('db_refs', 'evidence', 'references'), 'submodel': ('db_refs', 'evidence', 'references')}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_lang.core.Evidence'>,)[source]
local_attributes = {'analysis_method': <obj_model.core.LocalAttribute object>, 'changes': <obj_model.core.LocalAttribute object>, 'comments': <obj_model.core.LocalAttribute object>, 'compartments': <obj_model.core.LocalAttribute object>, 'condition': <obj_model.core.LocalAttribute object>, 'db_refs': <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>, 'experiment_design': <obj_model.core.LocalAttribute object>, 'experiment_type': <obj_model.core.LocalAttribute object>, 'functions': <obj_model.core.LocalAttribute object>, 'genetic_variant': <obj_model.core.LocalAttribute object>, 'growth_media': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'interpretations': <obj_model.core.LocalAttribute object>, 'measurement_method': <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>, 'ph': <obj_model.core.LocalAttribute object>, 'ph_units': <obj_model.core.LocalAttribute object>, 'rate_laws': <obj_model.core.LocalAttribute object>, 'reactions': <obj_model.core.LocalAttribute object>, 'reduced_evidences': <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>, 'taxon': <obj_model.core.LocalAttribute object>, 'temp': <obj_model.core.LocalAttribute object>, 'temp_units': <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>, 'interpretations': <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>, 'reduced_evidences': <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 = 'Evidence'[source]
verbose_name_plural = 'Evidence'[source]
analysis_method = <obj_model.core.LongStringAttribute object>[source]
comments = <wc_lang.core.CommentAttribute object>[source]
condition = <obj_model.core.LongStringAttribute object>[source]
db_refs = <wc_lang.core.DatabaseReferenceManyToManyAttribute object>[source]
evidence = <obj_model.core.ManyToManyAttribute object>[source]
experiment_design = <obj_model.core.LongStringAttribute object>[source]
experiment_type = <obj_model.core.LongStringAttribute object>[source]
genetic_variant = <obj_model.core.StringAttribute object>[source]
growth_media = <obj_model.core.LongStringAttribute object>[source]
id = <obj_model.core.SlugAttribute object>[source]
measurement_method = <obj_model.core.LongStringAttribute object>[source]
model = <obj_model.core.ManyToOneAttribute object>[source]
name = <obj_model.core.StringAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
ph = <obj_model.core.FloatAttribute object>[source]
ph_units = <obj_model.units.UnitAttribute object>[source]
references = <obj_model.core.ManyToManyAttribute object>[source]
std = <obj_model.core.StringAttribute object>[source]
taxon = <obj_model.core.StringAttribute object>[source]
temp = <obj_model.core.FloatAttribute object>[source]
temp_units = <obj_model.units.UnitAttribute object>[source]
type = <obj_model.ontology.OntologyAttribute object>[source]
units = <obj_model.units.UnitAttribute object>[source]
validate()[source]

Determine if the evidence 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
value = <obj_model.core.StringAttribute object>[source]
class wc_lang.core.Function(**kwargs)[source]

Bases: obj_model.core.Model

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
db_refs[source]

database references

Type:list
evidence[source]

evidence

Type:list
interpretations[source]

interpretations

Type:list
comments[source]

comments

Type:str
references[source]

references

Type:list
Related attributes:
function_expressions (list of FunctionExpression): function expressions rate_law_expressions (list of RateLawExpression): rate law expressions stop_condition_expressions (list of StopConditionExpression): stop condition expressions
class Meta[source]

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

attribute_order = ('id', 'name', 'expression', 'units', 'db_refs', 'evidence', 'interpretations', 'comments', 'references')[source]
attributes = {'comments': <wc_lang.core.CommentAttribute object>, 'db_refs': <wc_lang.core.DatabaseReferenceManyToManyAttribute object>, 'evidence': <obj_model.core.ManyToManyAttribute object>, 'expression': <obj_model.expression.ExpressionOneToOneAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'interpretations': <obj_model.core.ManyToManyAttribute 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]
children = {'core_model': ('expression', 'db_refs', 'evidence', 'interpretations', 'references'), 'submodel': ('expression', 'db_refs', 'evidence', 'interpretations', '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>, 'db_refs': <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>, 'interpretations': <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]
db_refs = <wc_lang.core.DatabaseReferenceManyToManyAttribute object>[source]
evidence = <obj_model.core.ManyToManyAttribute object>[source]
expression = <obj_model.expression.ExpressionOneToOneAttribute object>[source]
id = <obj_model.core.SlugAttribute object>[source]
interpretations = <obj_model.core.ManyToManyAttribute 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

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
observables[source]

Observables used by this function expression

Type:list
parameters[source]

Parameters used by this function expression

Type:list
functions[source]

other Functions used by this function expression

Type:list
compartments[source]

Compartments used by this stop condition expression

Type:list
Related attributes:
function (Function): function
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]
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]
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.Interpretation(**kwargs)[source]

Bases: obj_model.core.Model

Interpretation of evidence

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
method[source]

procedure which produced the interpretation

Type:str
db_refs[source]

database references

Type:list
evidence[source]

evidence underlying reduced evidence (e.g. individual observations underlying an average)

Type:list
comments[source]

comments

Type:str
references[source]

references

Type:list
authors[source]

authors

Type:list
Related attributes:

submodels (list of Submodel): submodels compartments (list of Compartment): compartments species_types (list of SpeciesType): species types species (list of Species): species distribution_init_concentrations (list of DistributionInitConcentration):

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

observables (list of Observable): observables functions (list of Function): functions reactions (list of Reaction): reactions rate_laws (list of RateLaw): rate laws dfba_objs (list of DfbaObjective): dFBA objectives dfba_obj_reactions (list of DfbaObjReaction): dFBA objective reactions dfba_obj_species (list of DfbaObjSpecies): dFBA objective species stop_conditions (list of StopCondition): stop conditions parameters (list of Parameter): parameters changes (list of Change): changes

class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'name', 'value', 'std', 'units', 'type', 'method', 'db_refs', 'evidence', 'comments', 'references', 'authors')[source]
attributes = {'authors': <obj_model.core.ManyToManyAttribute object>, 'comments': <wc_lang.core.CommentAttribute object>, 'db_refs': <wc_lang.core.DatabaseReferenceManyToManyAttribute object>, 'evidence': <obj_model.core.ManyToManyAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'method': <obj_model.core.LongStringAttribute 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]
children = {'core_model': ('db_refs', 'evidence', 'references', 'authors'), 'submodel': ('db_refs', 'evidence', 'references', 'authors')}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_lang.core.Interpretation'>,)[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>, 'db_refs': <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>, 'method': <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>, '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 = 'Interpretation'[source]
verbose_name_plural = 'Interpretations'[source]
authors = <obj_model.core.ManyToManyAttribute object>[source]
comments = <wc_lang.core.CommentAttribute object>[source]
db_refs = <wc_lang.core.DatabaseReferenceManyToManyAttribute object>[source]
evidence = <obj_model.core.ManyToManyAttribute object>[source]
id = <obj_model.core.SlugAttribute object>[source]
method = <obj_model.core.LongStringAttribute 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.Model(**kwargs)[source]

Bases: obj_model.core.Model

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]

revision of the model Git repository

Type:str
wc_lang_version[source]

version of wc_lang

Type:str
time_units[source]

time units

Type:unit_registry.Unit
db_refs[source]

database references

Type:list
comments[source]

comments

Type:str
created[source]

date created

Type:datetime
updated[source]

date updated

Type:datetime
Related attributes:

taxon (Taxon): taxon env (Environment): environment submodels (list of Submodel): submodels compartments (list of Compartment): compartments species_types (list of SpeciesType): species types species (list of Species): species distribution_init_concentrations (list of DistributionInitConcentration):

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

observables (list of Observable): observables functions (list of Function): functions reactions (list of Reaction): reactions rate_laws (list of RateLaw): rate laws dfba_objs (list of DfbaObjective): dFBA objectives dfba_obj_reactions (list of DfbaObjReaction): dFBA objective reactions dfba_obj_species (list of DfbaObjSpecies): dFBA objective species stop_conditions (list of StopCondition): stop conditions parameters (list of Parameter): parameters evidences (list of Evidence): evidence interpretations (list of Interpretation): interpretations references (list of Reference): references authors (list of Author): authors changes (list of Change): changes

class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'name', 'version', 'url', 'branch', 'revision', 'wc_lang_version', 'time_units', 'db_refs', 'comments', 'created', 'updated')[source]
attributes = {'branch': <obj_model.core.StringAttribute object>, 'comments': <wc_lang.core.CommentAttribute object>, 'created': <obj_model.core.DateTimeAttribute object>, 'db_refs': <wc_lang.core.DatabaseReferenceOneToManyAttribute object>, 'id': <obj_model.core.SlugAttribute 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]
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>, 'created': <obj_model.core.LocalAttribute object>, 'db_refs': <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>, 'evidences': <obj_model.core.LocalAttribute object>, 'functions': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'interpretations': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'observables': <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>, '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>, 'evidences': <obj_model.core.ManyToOneAttribute object>, 'functions': <obj_model.core.ManyToOneAttribute object>, 'interpretations': <obj_model.core.ManyToOneAttribute object>, 'observables': <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]
db_refs = <wc_lang.core.DatabaseReferenceOneToManyAttribute object>[source]
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
:param **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
:param **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
:param **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
:param **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_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
:param **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
:param **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
:param **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
:param **kwargs (dict of str: object): dictionary of attribute name/value pairs to find matching
objects
Returns:functions
Return type:list of Function
get_interpretations(_Model__type=None, **kwargs)[source]

Get all interpretations for model

Returns:interpretations for model
Return type:list of Interpretation
get_observables(_Model__type=None, **kwargs)[source]

Get all observables

Parameters:__type (types.TypeType or tuple of types.TypeType) – subclass(es) of Model
:param **kwargs (dict of str: object): dictionary of attribute name/value pairs to find matching
objects
Returns:observables
Return type:list of Observables
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
:param **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
:param **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
:param **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
:param **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
:param **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
:param **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
:param **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
:param **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]
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

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
db_refs[source]

database references

Type:list
evidence[source]

evidence

Type:list
interpretations[source]

interpretations

Type:list
comments[source]

comments

Type:str
references[source]

references

Type:list
Related attributes:
observable_expressions (list of ObservableExpression): observable expressions function_expressions (list of FunctionExpression): function expressions rate_law_expressions (list of RateLawExpression): rate law expressions stop_condition_expressions (list of StopConditionExpression): stop condition expressions
class Meta[source]

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

attribute_order = ('id', 'name', 'expression', 'units', 'db_refs', 'evidence', 'interpretations', 'comments', 'references')[source]
attributes = {'comments': <wc_lang.core.CommentAttribute object>, 'db_refs': <wc_lang.core.DatabaseReferenceManyToManyAttribute object>, 'evidence': <obj_model.core.ManyToManyAttribute object>, 'expression': <obj_model.expression.ExpressionOneToOneAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'interpretations': <obj_model.core.ManyToManyAttribute 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]
children = {'core_model': ('expression', 'db_refs', 'evidence', 'interpretations', 'references'), 'submodel': ('expression', 'db_refs', 'evidence', 'interpretations', '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>, 'db_refs': <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>, 'interpretations': <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]
db_refs = <wc_lang.core.DatabaseReferenceManyToManyAttribute object>[source]
evidence = <obj_model.core.ManyToManyAttribute object>[source]
expression = <obj_model.expression.ExpressionOneToOneAttribute object>[source]
id = <obj_model.core.SlugAttribute object>[source]
interpretations = <obj_model.core.ManyToManyAttribute 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

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
observables[source]

other Observables used by this Observable expression

Type:list
Related attributes:
observable (Observable): observable
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]
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]
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.Parameter(**kwargs)[source]

Bases: obj_model.core.Model

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
db_refs[source]

database references

Type:list
evidence[source]

evidence

Type:list
interpretations[source]

interpretations

Type:list
comments[source]

comments

Type:str
references[source]

references

Type:list
Related attributes:
density_compartment (Compartment): compartments whose density is represented by the parameter observable_expressions (list of ObservableExpression): observable expressions function_expressions (list of FunctionExpression): function expressions rate_law_expressions (list of RateLawExpression): rate law expressions stop_condition_expressions (list of StopConditionExpression): stop condition expressions
class Meta[source]

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

attribute_order = ('id', 'name', 'type', 'value', 'std', 'units', 'db_refs', 'evidence', 'interpretations', 'comments', 'references')[source]
attributes = {'comments': <wc_lang.core.CommentAttribute object>, 'db_refs': <wc_lang.core.DatabaseReferenceManyToManyAttribute object>, 'evidence': <obj_model.core.ManyToManyAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'interpretations': <obj_model.core.ManyToManyAttribute 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]
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>, 'db_refs': <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>, 'interpretations': <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]
add_to_sbml_model(sbml_model)[source]

Add this parameter to a SBML model.

Parameters:

sbml_model (libsbml.Model) – SBML model

Returns:

SBML parameter

Return type:

libsbml.Parameter

Raises:
  • LibSbmlError – if calling libsbml raises an error
  • ValueError – if units are undefined
comments = <wc_lang.core.CommentAttribute object>[source]
db_refs = <wc_lang.core.DatabaseReferenceManyToManyAttribute object>[source]
evidence = <obj_model.core.ManyToManyAttribute object>[source]
id = <obj_model.core.SlugAttribute object>[source]
interpretations = <obj_model.core.ManyToManyAttribute 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.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.RateLaw(**kwargs)[source]

Bases: obj_model.core.Model

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
db_refs[source]

database references

Type:list
evidence[source]

evidence

Type:list
interpretations[source]

interpretations

Type:list
comments[source]

comments

Type:str
references[source]

references

Type:list
class Meta[source]

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

attribute_order = ('id', 'name', 'reaction', 'direction', 'type', 'expression', 'units', 'db_refs', 'evidence', 'interpretations', 'comments', 'references')[source]
attributes = {'comments': <wc_lang.core.CommentAttribute object>, 'db_refs': <wc_lang.core.DatabaseReferenceManyToManyAttribute object>, 'direction': <obj_model.core.EnumAttribute object>, 'evidence': <obj_model.core.ManyToManyAttribute object>, 'expression': <obj_model.expression.ExpressionManyToOneAttribute object>, 'id': <obj_model.core.StringAttribute object>, 'interpretations': <obj_model.core.ManyToManyAttribute 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]
children = {'core_model': ('expression', 'db_refs', 'evidence', 'interpretations', 'references'), 'submodel': ('expression', 'db_refs', 'evidence', 'interpretations', '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>, 'db_refs': <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>, 'interpretations': <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]
db_refs = <wc_lang.core.DatabaseReferenceManyToManyAttribute object>[source]
direction = <obj_model.core.EnumAttribute object>[source]
evidence = <obj_model.core.ManyToManyAttribute object>[source]
expression = <obj_model.expression.ExpressionManyToOneAttribute object>[source]
gen_id()[source]

Generate identifier

Returns:identifier
Return type:str
id = <obj_model.core.StringAttribute object>[source]
interpretations = <obj_model.core.ManyToManyAttribute object>[source]
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

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
parameters[source]

parameters whose values are used in the rate law

Type:list
compartments[source]

Compartments used by this stop condition expression

Type:list
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]
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]
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

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
reversible[source]

indicates if reaction is thermodynamically reversible

Type:bool
flux_min[source]

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

Type:float
flux_max[source]

maximum flux bound for solving an FBA model

Type:float
flux_bound_units[source]

units for the minimum and maximum fluxes

Type:unit_registry.Unit
db_refs[source]

database references

Type:list
evidence[source]

evidence

Type:list
interpretations[source]

interpretations

Type:list
comments[source]

comments

Type:str
references[source]

references

Type:list
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_min', 'flux_max', 'flux_bound_units', 'db_refs', 'evidence', 'interpretations', 'comments', 'references')[source]
attributes = {'comments': <wc_lang.core.CommentAttribute object>, 'db_refs': <wc_lang.core.DatabaseReferenceManyToManyAttribute object>, 'evidence': <obj_model.core.ManyToManyAttribute object>, 'flux_bound_units': <obj_model.units.UnitAttribute object>, 'flux_max': <obj_model.core.FloatAttribute object>, 'flux_min': <obj_model.core.FloatAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'interpretations': <obj_model.core.ManyToManyAttribute 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]
children = {'core_model': ('participants', 'rate_laws', 'db_refs', 'evidence', 'interpretations', 'references'), 'submodel': ('participants', 'rate_laws', 'db_refs', 'evidence', 'interpretations', '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>, 'db_refs': <obj_model.core.LocalAttribute object>, 'dfba_obj_expression': <obj_model.core.LocalAttribute object>, 'evidence': <obj_model.core.LocalAttribute object>, 'flux_bound_units': <obj_model.core.LocalAttribute object>, 'flux_max': <obj_model.core.LocalAttribute object>, 'flux_min': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'interpretations': <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]
add_to_sbml_model(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:LibSbmlError – if calling libsbml raises an error
comments = <wc_lang.core.CommentAttribute object>[source]
db_refs = <wc_lang.core.DatabaseReferenceManyToManyAttribute object>[source]
evidence = <obj_model.core.ManyToManyAttribute object>[source]
flux_bound_units = <obj_model.units.UnitAttribute object>[source]
flux_max = <obj_model.core.FloatAttribute object>[source]
flux_min = <obj_model.core.FloatAttribute 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
:param **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]
interpretations = <obj_model.core.ManyToManyAttribute object>[source]
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_min or flux_max is defined
  • Check that flux_min <= flux_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:

tuple of cleaned value

and cleaning error

Return type:

tuple of list of SpeciesCoefficient, InvalidAttribute or None

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 SpeciesCoefficient: list of species coefficients
  • list of Exception: list of errors

Return type:

tuple

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
db_refs[source]

database references

Type:list
comments[source]

comments

Type:str
Related attributes:

taxon (Taxon): taxon env (Environment): environment submodels (list of Submodel): submodels compartments (list of Compartment): compartments species_types (list of SpeciesType): species types species (list of Species): species distribution_init_concentrations (list of DistributionInitConcentration):

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

observables (list of Observable): observables functions (list of Function): functions reactions (list of Reaction): reactions rate_laws (list of RateLaw): rate laws dfba_objs (list of DfbaObjective): dFBA objectives dfba_obj_species (list of DfbaObjSpecies): dFBA objective species stop_conditions (list of StopCondition): stop conditions parameters (list of Parameter): parameters changes (list of Change): changes

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', 'db_refs', 'comments')[source]
attributes = {'author': <obj_model.core.StringAttribute object>, 'chapter': <obj_model.core.StringAttribute object>, 'comments': <wc_lang.core.CommentAttribute object>, 'db_refs': <wc_lang.core.DatabaseReferenceManyToManyAttribute object>, 'edition': <obj_model.core.StringAttribute object>, 'editor': <obj_model.core.StringAttribute object>, 'id': <obj_model.core.SlugAttribute 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]
children = {'core_model': ('db_refs',), 'submodel': ('db_refs',)}[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>, 'db_refs': <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>, 'evidences': <obj_model.core.LocalAttribute object>, 'functions': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'interpretations': <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>, '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>, '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>, 'evidences': <obj_model.core.ManyToManyAttribute object>, 'functions': <obj_model.core.ManyToManyAttribute object>, 'interpretations': <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>, '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]
db_refs = <wc_lang.core.DatabaseReferenceManyToManyAttribute object>[source]
edition = <obj_model.core.StringAttribute object>[source]
editor = <obj_model.core.StringAttribute object>[source]
id = <obj_model.core.SlugAttribute 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

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
db_refs[source]

database references

Type:list
evidence[source]

evidence

Type:list
interpretations[source]

interpretations

Type:list
comments[source]

comments

Type:str
references[source]

references

Type:list
Related attributes:
distribution_init_concentration (DistributionInitConcentration):
distribution of initial concentration

species_coefficients (list of SpeciesCoefficient): participations in reactions and observables rate_law_expressions (list of RateLawExpression): rate law expressions observable_expressions (list of ObservableExpression): observable expressions stop_condition_expressions (list of StopConditionExpression): stop condition expressions function_expressions (list of FunctionExpression): function expressions dfba_obj_species (list of DfbaObjSpecies): dFBA objective species

class Meta[source]

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

attribute_order = ('id', 'name', 'species_type', 'compartment', 'units', 'db_refs', 'evidence', 'interpretations', 'comments', 'references')[source]
attributes = {'comments': <wc_lang.core.CommentAttribute object>, 'compartment': <obj_model.core.ManyToOneAttribute object>, 'db_refs': <wc_lang.core.DatabaseReferenceManyToManyAttribute object>, 'evidence': <obj_model.core.ManyToManyAttribute object>, 'id': <obj_model.core.StringAttribute object>, 'interpretations': <obj_model.core.ManyToManyAttribute 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]
children = {'core_model': ('species_type', 'compartment', 'distribution_init_concentration', 'db_refs', 'evidence', 'interpretations', 'references'), 'submodel': ('species_type', 'compartment', 'distribution_init_concentration', 'db_refs', 'evidence', 'interpretations', '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>, 'db_refs': <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>, 'interpretations': <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]
add_to_sbml_model(sbml_model)[source]

Add this species to a SBML model.

Parameters:sbml_model (libsbml.Model) – SBML model
Returns:SBML species
Return type:libsbml.Species
Raises:LibSbmlError – if calling libsbml raises an error
comments = <wc_lang.core.CommentAttribute object>[source]
compartment = <obj_model.core.ManyToOneAttribute object>[source]
db_refs = <wc_lang.core.DatabaseReferenceManyToManyAttribute object>[source]
evidence = <obj_model.core.ManyToManyAttribute object>[source]
gen_id()[source]

Generate identifier

Returns:identifier
Return type:str
gen_sbml_id()[source]

Make a Species id that satisfies the SBML string id syntax.

Replaces the ‘[‘ and ‘]’ in Species.id with double-underscores ‘__’. See Finney and Hucka, “Systems Biology Markup Language (SBML) Level 2: Structures and Facilities for Model Definitions”, 2003, section 3.4.

Returns:SBML id
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]
interpretations = <obj_model.core.ManyToManyAttribute object>[source]
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
references = <obj_model.core.ManyToManyAttribute object>[source]
static sbml_id_to_id(sbml_id)[source]

Convert an sbml_id to its species id.

Returns:species id
Return type:str
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

A tuple of a species and a coefficient

species[source]

species

Type:Species
coefficient[source]

coefficient

Type:float
Related attributes:
reaction (Reaction): reaction observables (Observable): observables
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]
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

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:str
empirical_formula[source]

empirical formula

Type:EmpiricalFormula
molecular_weight[source]

molecular weight

Type:float
charge[source]

charge

Type:int
type[source]

type

Type:pronto.term.Term
db_refs[source]

database references

Type:list
evidence[source]

evidence

Type:list
interpretations[source]

interpretations

Type:list
comments[source]

comments

Type:str
references[source]

references

Type:list
Related attributes:
species (list of Species): species
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'name', 'structure', 'empirical_formula', 'molecular_weight', 'charge', 'type', 'db_refs', 'evidence', 'interpretations', 'comments', 'references')[source]
attributes = {'charge': <obj_model.core.IntegerAttribute object>, 'comments': <wc_lang.core.CommentAttribute object>, 'db_refs': <wc_lang.core.DatabaseReferenceManyToManyAttribute object>, 'empirical_formula': <obj_model.chem.EmpiricalFormulaAttribute object>, 'evidence': <obj_model.core.ManyToManyAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'interpretations': <obj_model.core.ManyToManyAttribute object>, 'model': <obj_model.core.ManyToOneAttribute object>, 'molecular_weight': <obj_model.core.FloatAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>, 'structure': <obj_model.core.LongStringAttribute object>, 'type': <obj_model.ontology.OntologyAttribute object>}[source]
children = {'core_model': ('species', 'db_refs', 'evidence', 'interpretations', 'references'), 'submodel': ('db_refs', 'evidence', 'interpretations', 'references')}[source]
indexed_attrs_tuples = (('id',),)[source]
inheritance = (<class 'wc_lang.core.SpeciesType'>,)[source]
local_attributes = {'charge': <obj_model.core.LocalAttribute object>, 'comments': <obj_model.core.LocalAttribute object>, 'db_refs': <obj_model.core.LocalAttribute object>, 'empirical_formula': <obj_model.core.LocalAttribute object>, 'evidence': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'interpretations': <obj_model.core.LocalAttribute object>, 'model': <obj_model.core.LocalAttribute object>, 'molecular_weight': <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]
charge = <obj_model.core.IntegerAttribute object>[source]
comments = <wc_lang.core.CommentAttribute object>[source]
db_refs = <wc_lang.core.DatabaseReferenceManyToManyAttribute object>[source]
empirical_formula = <obj_model.chem.EmpiricalFormulaAttribute object>[source]
evidence = <obj_model.core.ManyToManyAttribute object>[source]
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
id = <obj_model.core.SlugAttribute object>[source]
interpretations = <obj_model.core.ManyToManyAttribute object>[source]
model = <obj_model.core.ManyToOneAttribute object>[source]
molecular_weight = <obj_model.core.FloatAttribute 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.LongStringAttribute 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 its StopCondition is true.

A mathematical expression of Functions, Observbles, Parameters and Python functions `StopCondition`s are optional. It must return a Boolean.

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
db_refs[source]

database references

Type:list
evidence[source]

evidence

Type:list
interpretations[source]

interpretations

Type:list
comments[source]

comments

Type:str
references[source]

references

Type:list
Related attributes:
expressions (Expressions): expressions
class Meta[source]

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

attribute_order = ('id', 'name', 'expression', 'units', 'db_refs', 'evidence', 'interpretations', 'comments', 'references')[source]
attributes = {'comments': <wc_lang.core.CommentAttribute object>, 'db_refs': <wc_lang.core.DatabaseReferenceManyToManyAttribute object>, 'evidence': <obj_model.core.ManyToManyAttribute object>, 'expression': <obj_model.expression.ExpressionOneToOneAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'interpretations': <obj_model.core.ManyToManyAttribute 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]
children = {'core_model': ('expression', 'db_refs', 'evidence', 'interpretations', 'references'), 'submodel': ('expression', 'db_refs', 'evidence', 'interpretations', '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>, 'db_refs': <obj_model.core.LocalAttribute object>, 'evidence': <obj_model.core.LocalAttribute object>, 'expression': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'interpretations': <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]
db_refs = <wc_lang.core.DatabaseReferenceManyToManyAttribute object>[source]
evidence = <obj_model.core.ManyToManyAttribute object>[source]
expression = <obj_model.expression.ExpressionOneToOneAttribute object>[source]
id = <obj_model.core.SlugAttribute object>[source]
interpretations = <obj_model.core.ManyToManyAttribute 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
observables[source]

Observables used by this stop condition expression

Type:list
parameters[source]

Parameters used by this stop condition expression

Type:list
functions[source]

Functions used by this stop condition expression

Type:list
compartments[source]

Compartments used by this stop condition expression

Type:list
Related attributes:
stop_condition (StopCondition): stop condition
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]
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'>,)[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>, 'species': <obj_model.core.LocalAttribute object>, 'stop_condition': <obj_model.core.LocalAttribute object>}[source]
ordering = ('expression',)[source]
primary_attribute = <obj_model.core.LongStringAttribute object>[source]
related_attributes = {'stop_condition': <obj_model.expression.ExpressionOneToOneAttribute object>}[source]
tabular_orientation = 3[source]
unique_together = ()[source]
verbose_name = 'Stop condition expression'[source]
verbose_name_plural = 'Stop condition 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 StopConditionExpression, InvalidAttribute or None

expression = <obj_model.core.LongStringAttribute object>[source]
functions = <obj_model.core.ManyToManyAttribute object>[source]
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 stop condition is valid

  • Check that the expression is a Boolean 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.Submodel(**kwargs)[source]

Bases: obj_model.core.Model

id[source]

unique identifier

Type:str
name[source]

name

Type:str
model[source]

model

Type:Model
framework[source]

modeling framework (e.g. dynamic flux balance analysis)

Type:pronto.term.Term
db_refs[source]

database references

Type:list
evidence[source]

evidence

Type:list
interpretations[source]

interpretations

Type:list
comments[source]

comments

Type:str
references[source]

references

Type:list
Related attributes:

reactions (list of Reaction): reactions dfba_obj (DfbaObjective): objective function for a dFBA submodel;

if not initialized, then dfba_obj_reaction is used as the objective function

dfba_obj_reactions (list of DfbaObjReaction): the growth reaction for a dFBA submodel changes (list of Change): changes

class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'name', 'framework', 'db_refs', 'evidence', 'interpretations', 'comments', 'references')[source]
attributes = {'comments': <wc_lang.core.CommentAttribute object>, 'db_refs': <wc_lang.core.DatabaseReferenceManyToManyAttribute object>, 'evidence': <obj_model.core.ManyToManyAttribute object>, 'framework': <obj_model.ontology.OntologyAttribute object>, 'id': <obj_model.core.SlugAttribute object>, 'interpretations': <obj_model.core.ManyToManyAttribute object>, 'model': <obj_model.core.ManyToOneAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'references': <obj_model.core.ManyToManyAttribute object>}[source]
children = {'submodel': ('model', 'reactions', 'dfba_obj', 'dfba_obj_reactions', 'db_refs', 'evidence', 'interpretations', 'references', 'changes')}[source]
indexed_attrs_tuples = (('id',),)[source]
inheritance = (<class 'wc_lang.core.Submodel'>,)[source]
local_attributes = {'changes': <obj_model.core.LocalAttribute object>, 'comments': <obj_model.core.LocalAttribute object>, 'db_refs': <obj_model.core.LocalAttribute object>, 'dfba_obj': <obj_model.core.LocalAttribute object>, 'dfba_obj_reactions': <obj_model.core.LocalAttribute object>, 'evidence': <obj_model.core.LocalAttribute object>, 'framework': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'interpretations': <obj_model.core.LocalAttribute object>, 'model': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'reactions': <obj_model.core.LocalAttribute object>, 'references': <obj_model.core.LocalAttribute object>}[source]
merge = 2[source]
ordering = ('id',)[source]
primary_attribute = <obj_model.core.SlugAttribute object>[source]
related_attributes = {'changes': <obj_model.core.ManyToOneAttribute object>, 'dfba_obj': <obj_model.core.OneToOneAttribute object>, 'dfba_obj_reactions': <obj_model.core.ManyToOneAttribute object>, 'reactions': <obj_model.core.ManyToOneAttribute object>}[source]
unique_together = ()[source]
verbose_name = 'Submodel'[source]
verbose_name_plural = 'Submodels'[source]
add_to_sbml_model(sbml_model)[source]

Add this metadata about this submodel to a SBML model.

Parameters:sbml_model (libsbml.Model) – SBML model
Returns:SBML model
Return type:libsbml.Model
Raises:LibSbmlError – if calling libsbml raises an error
comments = <wc_lang.core.CommentAttribute object>[source]
db_refs = <wc_lang.core.DatabaseReferenceManyToManyAttribute object>[source]
evidence = <obj_model.core.ManyToManyAttribute object>[source]
framework = <obj_model.ontology.OntologyAttribute object>[source]
get_children(kind=None, _Submodel__type=None, recursive=True, _Submodel__include_stop_conditions=True, **kwargs)[source]

Get a kind of children.

If kind is None, children are defined to be the values of the related attributes defined in each class.

Parameters:
  • kind (str, optional) – kind of children to get
  • __type (types.TypeType or tuple of types.TypeType) – subclass(es) of Model
  • recursive (bool, optional) – if True, get children recursively

:param kwargs (dict of str: object): dictionary of attribute name/value pairs

Returns:children
Return type:list of Model
get_immediate_children(kind=None, _Submodel__type=None, _Submodel__include_stop_conditions=True, **kwargs)[source]

Get a kind of children.

If kind is None, children are defined to be the values of the related attributes defined in each class.

Parameters:
  • kind (str, optional) – kind of children to get
  • __type (types.TypeType or tuple of types.TypeType) – subclass(es) of Model

:param kwargs (dict of str: object): dictionary of attribute name/value pairs

Returns:children
Return type:list of Model
id = <obj_model.core.SlugAttribute object>[source]
interpretations = <obj_model.core.ManyToManyAttribute 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]
validate()[source]

Determine if the submodel is valid

  • dFBA submodel has an objective
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.SubmodelsToModelRelatedManager(object, attribute)[source]

Bases: obj_model.core.ManyToOneRelatedManager

Submodels to model related manager

gen_models()[source]

Generate separate models for each submodel, as well as a “core” model which contains the model integration framework (compartments, species types, species, observables, functions, stop conditions, etc.) and all model objects that are not associated with at least 1 submodel.

Returns:
model with objects that (a) form the model integration framework or (b) are
not associated with any submodel

list of Model: one model for each submodel

Return type:Model
Raises:ValueError – if submodels do not belong to a model
class wc_lang.core.Taxon(**kwargs)[source]

Bases: obj_model.core.Model

Biological taxon (e.g. family, genus, species, strain, etc.)

id[source]

unique identifier equal to ‘taxon’

Type:str
name[source]

name

Type:str
model[source]

model

Type:Model
rank[source]

rank

Type:TaxonRank
db_refs[source]

database references

Type:list
comments[source]

comments

Type:str
references[source]

references

Type:list
class Meta[source]

Bases: obj_model.core.Meta

attribute_order = ('id', 'name', 'rank', 'db_refs', 'comments', 'references')[source]
attributes = {'comments': <wc_lang.core.CommentAttribute object>, 'db_refs': <wc_lang.core.DatabaseReferenceOneToManyAttribute object>, 'id': <obj_model.core.RegexAttribute object>, 'model': <obj_model.core.OneToOneAttribute object>, 'name': <obj_model.core.StringAttribute object>, 'rank': <obj_model.core.EnumAttribute object>, 'references': <obj_model.core.OneToManyAttribute object>}[source]
children = {'core_model': ('db_refs', 'references'), 'submodel': ('db_refs', 'references')}[source]
indexed_attrs_tuples = ()[source]
inheritance = (<class 'wc_lang.core.Taxon'>,)[source]
local_attributes = {'comments': <obj_model.core.LocalAttribute object>, 'db_refs': <obj_model.core.LocalAttribute object>, 'id': <obj_model.core.LocalAttribute object>, 'model': <obj_model.core.LocalAttribute object>, 'name': <obj_model.core.LocalAttribute object>, 'rank': <obj_model.core.LocalAttribute object>, 'references': <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 = 'Taxon'[source]
verbose_name_plural = 'Taxons'[source]
comments = <wc_lang.core.CommentAttribute object>[source]
db_refs = <wc_lang.core.DatabaseReferenceOneToManyAttribute object>[source]
id = <obj_model.core.RegexAttribute object>[source]
model = <obj_model.core.OneToOneAttribute object>[source]
name = <obj_model.core.StringAttribute object>[source]
objects = <obj_model.core.Manager object>[source]
rank = <obj_model.core.EnumAttribute object>[source]
references = <obj_model.core.OneToManyAttribute object>[source]
class wc_lang.core.TaxonRank[source]

Bases: int, enum.Enum

Taxonomic ranks

classis = 4[source]
domain = 1[source]
family = 6[source]
genus = 8[source]
kingdom = 2[source]
order = 5[source]
phylum = 3[source]
species = 9[source]
tribe = 7[source]
variety = 10[source]
class wc_lang.core.TaxonRankMeta[source]

Bases: wc_utils.util.enumerate.CaseInsensitiveEnumMeta

__getattr__(name)[source]

Get value by name

Parameters:name (str) – attribute name
Returns:taxonomic rank
Return type:TaxonRank
__getitem__(name)[source]

Get value by name

Parameters:name (str) – attribute name
Returns:taxonomic rank
Return type:TaxonRank
class wc_lang.core.Validator[source]

Bases: obj_model.core.Validator

run(model, get_related=True)[source]

Validate a model and return its errors

Parameters:
  • model (Model) – model
  • get_related (bool, optional) – if true, get all related objects
Returns:

list of invalid objects/models and their errors

Return type:

InvalidObjectSet or None

4.1.5. wc_lang.io module

Reading and writing models to/from files.

Supported file types:

  • Comma separated values (.csv)
  • Excel (.xlsx)
  • Tab separated values (.tsv)
Author:Jonathan Karr <karr@mssm.edu>
Date:2016-12-05
Copyright:2016, Karr Lab
License:MIT
class wc_lang.io.Reader[source]

Bases: obj_model.io.Reader

Read model from file(s)

MODELS = (<class 'wc_lang.core.Model'>, <class 'wc_lang.core.Taxon'>, <class 'wc_lang.core.Environment'>, <class 'wc_lang.core.Submodel'>, <class 'wc_lang.core.Compartment'>, <class 'wc_lang.core.SpeciesType'>, <class 'wc_lang.core.Species'>, <class 'wc_lang.core.DistributionInitConcentration'>, <class 'wc_lang.core.Observable'>, <class 'wc_lang.core.Function'>, <class 'wc_lang.core.Reaction'>, <class 'wc_lang.core.RateLaw'>, <class 'wc_lang.core.DfbaObjective'>, <class 'wc_lang.core.DfbaObjReaction'>, <class 'wc_lang.core.DfbaObjSpecies'>, <class 'wc_lang.core.Parameter'>, <class 'wc_lang.core.StopCondition'>, <class 'wc_lang.core.Evidence'>, <class 'wc_lang.core.Interpretation'>, <class 'wc_lang.core.Reference'>, <class 'wc_lang.core.Author'>, <class 'wc_lang.core.Change'>)[source]
run(path, models=None, ignore_missing_sheets=None, ignore_extra_sheets=None, ignore_sheet_order=None, include_all_attributes=False, ignore_missing_attributes=None, ignore_extra_attributes=None, ignore_attribute_order=None, group_objects_by_model=True, validate=None)[source]

Read a list of model objects from file(s) and, optionally, validate them

Parameters:
  • path (str) – path to file(s)
  • models (types.TypeType or list of types.TypeType, optional) – type of object to read or list of types of objects to read
  • ignore_missing_sheets (bool, optional) – if False, report an error if a worksheet/ file is missing for one or more models
  • ignore_extra_sheets (bool, optional) – if True and all models are found, ignore other worksheets or files
  • ignore_sheet_order (bool, optional) – if True, do not require the sheets to be provided in the canonical order
  • include_all_attributes (bool, optional) – if True, export all attributes including those not explictly included in Model.Meta.attribute_order
  • ignore_missing_attributes (bool, optional) – if False, report an error if a worksheet/file doesn’t contain all of attributes in a model in models
  • ignore_extra_attributes (bool, optional) – if True, do not report errors if attributes in the data are not in the model
  • ignore_attribute_order (bool) – if True, do not require the attributes to be provided in the canonical order
  • group_objects_by_model (bool, optional) – if True, group decoded objects by their types
  • validate (bool, optional) – if True, validate the data
Returns:

model objects grouped by obj_model.Model class

Return type:

dict

Raises:

ValueError – if the file defines zero or multiple models or the model defined in the file(s) is invalid

class wc_lang.io.Writer[source]

Bases: obj_model.io.Writer

Write model to file(s)

MODELS = (<class 'wc_lang.core.Model'>, <class 'wc_lang.core.Taxon'>, <class 'wc_lang.core.Environment'>, <class 'wc_lang.core.Submodel'>, <class 'wc_lang.core.Compartment'>, <class 'wc_lang.core.SpeciesType'>, <class 'wc_lang.core.Species'>, <class 'wc_lang.core.DistributionInitConcentration'>, <class 'wc_lang.core.Observable'>, <class 'wc_lang.core.Function'>, <class 'wc_lang.core.Reaction'>, <class 'wc_lang.core.RateLaw'>, <class 'wc_lang.core.DfbaObjective'>, <class 'wc_lang.core.DfbaObjReaction'>, <class 'wc_lang.core.DfbaObjSpecies'>, <class 'wc_lang.core.Parameter'>, <class 'wc_lang.core.StopCondition'>, <class 'wc_lang.core.Evidence'>, <class 'wc_lang.core.Interpretation'>, <class 'wc_lang.core.Reference'>, <class 'wc_lang.core.Author'>, <class 'wc_lang.core.Change'>)[source]
run(path, model, models=None, get_related=True, include_all_attributes=False, validate=None, title=None, description=None, keywords=None, version=None, language=None, creator=None, extra_entries=0, set_repo_metadata_from_path=True)[source]
Write a list of model classes to an Excel file, with one worksheet for each model, or to
a set of .csv or .tsv files, with one file for each model.
Parameters:
  • path (str) – path to write file(s)
  • model (core.Model) – model
  • models (list of Model, optional) – models in the order that they should appear as worksheets; all models which are not in models will follow in alphabetical order
  • get_related (bool, optional) – if True, write object and all related objects
  • include_all_attributes (bool, optional) – if True, export all attributes including those not explictly included in Model.Meta.attribute_order
  • validate (bool, optional) – if True, validate the data
  • title (str, optional) – title
  • description (str, optional) – description
  • keywords (str, optional) – keywords
  • version (str, optional) – version
  • language (str, optional) – language
  • creator (str, optional) – creator
  • extra_entries (int, optional) – additional entries to display
  • set_repo_metadata_from_path (bool, optional) – if True, set the Git repository metadata (URL, branch, revision) for the model from the parent directory of core_path
classmethod validate_implicit_relationships()[source]

Check that relationships to core.Model do not need to be explicitly exported because they can be inferred by Reader.run. This is necessary to enable the relationships to core.Model to not be exported in workbooks, and instead added by Reader.run.

Raises:Exception – if there are relationships from core.Model or one-to-many or many-to-many relationships to core.Model
validate_implicit_relationships_are_set(model)[source]

Check that there is only one instance of core.Model and that each relationship to core.Model is set. This is necessary to enable the relationships to core.Model to not be exported in workbooks, and instead added by Reader.run.

Parameters:model (core.Model) – model
Raises:ValueError – if there are multiple instances of core.Model in the object graph
wc_lang.io.convert(source, destination)[source]

Convert among Excel (.xlsx), comma separated (.csv), and tab separated (.tsv) file formats

Read a model from the source files(s) and write it to the destination files(s). A path to a delimiter separated set of models must be represented by a Unix glob pattern (with a *) that matches all delimiter separated files.

Parameters:
  • source (str) – path to source file(s)
  • destination (str) – path to save converted file
wc_lang.io.create_template(path, extra_entries=10, set_repo_metadata_from_path=True)[source]

Create file with model template, including row and column headings

Parameters:
  • path (str) – path to file(s)
  • extra_entries (int, optional) – additional entries to display
  • set_repo_metadata_from_path (bool, optional) – if True, set the Git repository metadata (URL, branch, revision) for the model from the parent directory of core_path

4.1.6. wc_lang.util module

Utilities

Author:Jonathan Karr <karr@mssm.edu>
Date:2016-11-10
Copyright:2016, Karr Lab
License:MIT
wc_lang.util.gen_ids(model)[source]

Generate ids for model objects

Parameters:model (core.Model) – model
wc_lang.util.get_model_size(model)[source]

Get numbers of model components

Parameters:model (core.Model) – model
Returns:dictionary with numbers of each type of model component
Return type:dict
wc_lang.util.get_model_summary(model)[source]

Get textual summary of a model

Parameters:model (core.Model) – model
Returns:textual summary of the model
Return type:str
wc_lang.util.get_models(inline=True)[source]

Get list of models :param inline: if true, return inline models :type inline: bool, optional

Returns:list of models
Return type:list of class
wc_lang.util.migrate(in_path, wc_lang_version, out_path=None, set_repo_metadata_from_path=True)[source]

Migrate a model to another version of wc_lang

Parameters:
  • in_path (str) – path to model
  • wc_lang_version (str) – version to migrate to
  • out_path (str, optional) – path to save migrated model; default: overwrite original model
  • set_repo_metadata_from_path (bool, optional) – if True, set the Git repository metadata (URL, branch, revision) for the model from the parent directory of core_path
wc_lang.util.set_git_repo_metadata_from_path(model, path='.')[source]

Use Git to set the Git repository URL, branch, and revision metadata for a model

Parameters:
  • model (core.Model) – model
  • path (str, optional) – path to the Git repository for the model

4.1.7. Module contents