4.1. wc_lang package¶
4.1.1. Subpackages¶
- 4.1.1.1. wc_lang.config package
- 4.1.1.2. wc_lang.migrations package
- 4.1.1.3. wc_lang.sbml package
- 4.1.1.4. wc_lang.transform package
- 4.1.1.4.1. Submodules
- 4.1.1.4.2. wc_lang.transform.change_value module
- 4.1.1.4.3. wc_lang.transform.core module
- 4.1.1.4.4. wc_lang.transform.create_implicit_dfba_ex_rxns module
- 4.1.1.4.5. wc_lang.transform.create_implicit_dist_zero_init_concs module
- 4.1.1.4.6. wc_lang.transform.merge_submodels module
- 4.1.1.4.7. wc_lang.transform.nullify_attrs module
- 4.1.1.4.8. wc_lang.transform.prep_for_sbml module
- 4.1.1.4.9. wc_lang.transform.prep_for_wc_sim module
- 4.1.1.4.10. wc_lang.transform.set_finite_dfba_flux_bounds module
- 4.1.1.4.11. wc_lang.transform.split_reversible_reactions module
- 4.1.1.4.12. Module contents
4.1.2. Submodules¶
4.1.3. wc_lang.__main__ module¶
Command line programs for manipulating model definitions
- Author
Jonathan Karr <karr@mssm.edu>
- Author
Arthur Goldberg <Arthur.Goldberg@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
-
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__.ExportController'>, <class 'wc_lang.__main__.ImportController'>, <class 'obj_tables.migrate.CementControllers.SchemaChangesTemplateController'>][source]¶
-
-
class
-
class
wc_lang.__main__.
BaseController
(*args, **kw)[source]¶ Bases:
cement.ext.ext_argparse.ArgparseController
Base controller for command line application
-
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
-
class
-
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': 'data_repo_metadata', '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`'}), (['--unprotected'], {'action': 'store_true', 'default': False, 'help': 'If set, do not protect the outputted workbook'})][source]¶
-
-
class
-
class
wc_lang.__main__.
CutSubmodelsController
(*args, **kw)[source]¶ Bases:
cement.ext.ext_argparse.ArgparseController
Cut submodels into separate models
-
class
Meta
[source]¶ Bases:
object
-
class
-
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'}), (['--compare-metadata-in-files'], {'dest': 'compare_metadata_in_files', 'default': False, 'action': 'store_true', 'help': 'If true, compare metadata (tables of contents, header rows)'})][source]¶
-
-
class
-
class
wc_lang.__main__.
ExportController
(*args, **kw)[source]¶ Bases:
cement.ext.ext_argparse.ArgparseController
Export a model to SBML
-
class
wc_lang.__main__.
ImportController
(*args, **kw)[source]¶ Bases:
cement.ext.ext_argparse.ArgparseController
Import a model from SBML
-
class
Meta
[source]¶ Bases:
object
-
class
-
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'}), (['--unprotected'], {'action': 'store_true', 'default': False, 'help': 'If set, do not protect the outputted workbook'})][source]¶
-
-
class
-
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'}), (['--unprotected'], {'action': 'store_true', 'default': False, 'help': 'If set, do not protect the outputted workbook'})][source]¶
-
-
class
-
class
wc_lang.__main__.
TransformController
(*args, **kw)[source]¶ Bases:
cement.ext.ext_argparse.ArgparseController
Apply one, or more, transforms to a model and save the result
-
class
Meta
[source]¶ Bases:
object
-
arguments
= [(['source'], {'type': <class 'str'>, 'help': 'Path to model'}), (['dest'], {'type': <class 'str'>, 'help': 'Path to save transformed model'}), (['--transform'], {'dest': 'transforms', 'action': 'append', 'help': 'Model transform:\n ChangeValue: Change a value of an attribute of a model\n CreateImplicitDfbaExchangeReactions: Create implicit exchange reactions for dFBA submodels\n CreateImplicitDistributionZeroInitConcentrations: Create the implicit zero concentrations in a model\n MergeAlgorithmicallyLikeSubmodels: Merge groups of algorithmically-like submodels into individual submodels\n NullifyAttrs: Generate a reduced model by nullifying specific attributes\n PrepForSbml: Transform model into SBML-compatible representation and discard information that cannot be exported to SBML\n PrepForWCSim: Prepare model for simulation by making implicit information in the model explicit\n SetFiniteDfbaFluxBoundsTransform: Clip the flux bounds for the reactions in dFBA submodels to the default flux range\n SplitReversibleReactions: Split reversible reactions into separate forward and backward reactions'}), (['--unprotected'], {'action': 'store_true', 'default': False, 'help': 'If set, do not protect the outputted workbook'})][source]¶
-
-
class
-
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': 'data_repo_metadata', '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`'}), (['--unprotected'], {'action': 'store_true', 'default': False, 'help': 'If set, do not protect the outputted workbook'})][source]¶
-
description
= 'Update the version metadata (repository URL, branch, revision; wc_lang version) of a model'[source]¶
-
-
class
4.1.4. wc_lang._version module¶
4.1.5. wc_lang.core module¶
Data model to represent composite, multi-algorithmic biochemical models.
This module defines classes that represent the schema and provenance of a biochemical model:
These are all instances of obj_tables.Model.
A biochemical model may contain a list of instances of each of these classes, interlinked
by object references. For example, a Species
references the compartment which contains it as a
Compartment
instance and the species category to which it belongs as a SpeciesType
instance.
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
(_comments=None, **kwargs)[source]¶ Bases:
obj_tables.core.Model
,wc_lang.sbml.util.SbmlModelMixin
An author of a model
-
identifiers
[source]¶ identifiers
- Type
list
ofIdentifier
Related attributes:
conclusions (
list
ofConclusion
): conclusionschanges (
list
ofChange
): changes
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
-
attribute_order
= ('id', 'name', 'last_name', 'first_name', 'middle_name', 'title', 'organization', 'email', 'website', 'address', 'identifiers', 'comments')[source]¶
-
attributes
= {'address': <obj_tables.core.LongStringAttribute object>, 'comments': <obj_tables.core.LongStringAttribute object>, 'email': <obj_tables.core.EmailAttribute object>, 'first_name': <obj_tables.core.StringAttribute object>, 'id': <obj_tables.core.SlugAttribute object>, 'identifiers': <wc_lang.core.IdentifierManyToManyAttribute object>, 'last_name': <obj_tables.core.StringAttribute object>, 'middle_name': <obj_tables.core.StringAttribute object>, 'model': <obj_tables.core.ManyToOneAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'organization': <obj_tables.core.LongStringAttribute object>, 'title': <obj_tables.core.LongStringAttribute object>, 'website': <obj_tables.core.UrlAttribute object>}[source]¶
-
child_attrs
= {'sbml': ('id', 'name', 'model', 'last_name', 'first_name', 'middle_name', 'title', 'organization', 'email', 'website', 'address', 'identifiers', 'comments'), 'wc_sim': ()}[source]¶
-
local_attributes
= {'address': <obj_tables.core.LocalAttribute object>, 'changes': <obj_tables.core.LocalAttribute object>, 'comments': <obj_tables.core.LocalAttribute object>, 'conclusions': <obj_tables.core.LocalAttribute object>, 'email': <obj_tables.core.LocalAttribute object>, 'first_name': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'last_name': <obj_tables.core.LocalAttribute object>, 'middle_name': <obj_tables.core.LocalAttribute object>, 'model': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'organization': <obj_tables.core.LocalAttribute object>, 'title': <obj_tables.core.LocalAttribute object>, 'website': <obj_tables.core.LocalAttribute object>}[source]¶
-
-
address
= <obj_tables.core.LongStringAttribute object>[source]
-
comments
= <obj_tables.core.LongStringAttribute object>[source]
-
email
= <obj_tables.core.EmailAttribute object>[source]
-
first_name
= <obj_tables.core.StringAttribute object>[source]
-
get_identifier
(namespace)[source]¶ Get the author’s id in a namespace (e.g., github.user, orcid)
- Parameters
namespace (
str
) – namespace of the identifier to retrieve- Returns
user’s id in
namespace
- Return type
str
- Raises
ValueError – if the author has multiple ids in
namespace
-
id
= <obj_tables.core.SlugAttribute object>[source]
-
identifiers
= <wc_lang.core.IdentifierManyToManyAttribute object>[source]
-
last_name
= <obj_tables.core.StringAttribute object>[source]
-
middle_name
= <obj_tables.core.StringAttribute object>[source]
-
model
= <obj_tables.core.ManyToOneAttribute object>[source]
-
name
= <obj_tables.core.StringAttribute object>[source]
-
organization
= <obj_tables.core.LongStringAttribute object>[source]
-
title
= <obj_tables.core.LongStringAttribute object>[source]
-
website
= <obj_tables.core.UrlAttribute object>[source]
-
-
class
wc_lang.core.
Change
(_comments=None, **kwargs)[source]¶ Bases:
obj_tables.core.Model
,wc_lang.sbml.util.SbmlModelMixin
A change to a model
-
identifiers
[source]¶ identifiers
- Type
list
ofIdentifier
-
conclusions
[source]¶ conclusions
- Type
list
ofConclusion
authors
- Type
list
ofAuthor
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
-
attribute_order
= ('id', 'name', 'type', 'target', 'target_submodel', 'target_type', 'reason', 'reason_type', 'intention', 'intention_type', 'identifiers', 'evidence', 'conclusions', 'comments', 'references', 'authors', 'date')[source]¶
-
attributes
= {'authors': <obj_tables.core.ManyToManyAttribute object>, 'comments': <obj_tables.core.LongStringAttribute object>, 'conclusions': <obj_tables.core.ManyToManyAttribute object>, 'date': <obj_tables.core.DateTimeAttribute object>, 'evidence': <wc_lang.core.EvidenceManyToManyAttribute object>, 'id': <obj_tables.core.SlugAttribute object>, 'identifiers': <wc_lang.core.IdentifierManyToManyAttribute object>, 'intention': <obj_tables.core.LongStringAttribute object>, 'intention_type': <obj_tables.sci.onto.OntoTermAttribute object>, 'model': <obj_tables.core.ManyToOneAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'reason': <obj_tables.core.LongStringAttribute object>, 'reason_type': <obj_tables.sci.onto.OntoTermAttribute object>, 'references': <obj_tables.core.ManyToManyAttribute object>, 'target': <obj_tables.core.LongStringAttribute object>, 'target_submodel': <obj_tables.core.ManyToOneAttribute object>, 'target_type': <obj_tables.sci.onto.OntoTermAttribute object>, 'type': <obj_tables.sci.onto.OntoTermAttribute object>}[source]¶
-
children
= {'core_model': ('identifiers', 'evidence', 'conclusions', 'references', 'authors'), 'submodel': ('identifiers', 'evidence', 'conclusions', 'references', 'authors')}[source]¶
-
local_attributes
= {'authors': <obj_tables.core.LocalAttribute object>, 'comments': <obj_tables.core.LocalAttribute object>, 'conclusions': <obj_tables.core.LocalAttribute object>, 'date': <obj_tables.core.LocalAttribute object>, 'evidence': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'intention': <obj_tables.core.LocalAttribute object>, 'intention_type': <obj_tables.core.LocalAttribute object>, 'model': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'reason': <obj_tables.core.LocalAttribute object>, 'reason_type': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>, 'target': <obj_tables.core.LocalAttribute object>, 'target_submodel': <obj_tables.core.LocalAttribute object>, 'target_type': <obj_tables.core.LocalAttribute object>, 'type': <obj_tables.core.LocalAttribute object>}[source]¶
-
-
authors
= <obj_tables.core.ManyToManyAttribute object>[source]
-
comments
= <obj_tables.core.LongStringAttribute object>[source]
-
conclusions
= <obj_tables.core.ManyToManyAttribute object>[source]
-
date
= <obj_tables.core.DateTimeAttribute object>[source]
-
evidence
= <wc_lang.core.EvidenceManyToManyAttribute object>[source]
-
id
= <obj_tables.core.SlugAttribute object>[source]
-
identifiers
= <wc_lang.core.IdentifierManyToManyAttribute object>[source]
-
intention
= <obj_tables.core.LongStringAttribute object>[source]
-
intention_type
= <obj_tables.sci.onto.OntoTermAttribute object>[source]
-
model
= <obj_tables.core.ManyToOneAttribute object>[source]
-
name
= <obj_tables.core.StringAttribute object>[source]
-
reason
= <obj_tables.core.LongStringAttribute object>[source]
-
reason_type
= <obj_tables.sci.onto.OntoTermAttribute object>[source]
-
references
= <obj_tables.core.ManyToManyAttribute object>[source]
-
target
= <obj_tables.core.LongStringAttribute object>[source]
-
target_submodel
= <obj_tables.core.ManyToOneAttribute object>[source]
-
target_type
= <obj_tables.sci.onto.OntoTermAttribute object>[source]
-
type
= <obj_tables.sci.onto.OntoTermAttribute object>[source]
-
-
class
wc_lang.core.
ChemicalStructure
(_comments=None, **kwargs)[source]¶ Bases:
obj_tables.core.Model
,wc_lang.sbml.util.SbmlModelMixin
Structure of a chemical compound
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
-
attribute_order
= ('value', 'format', 'alphabet', 'empirical_formula', 'molecular_weight', 'charge')[source]¶
-
attributes
= {'alphabet': <obj_tables.core.EnumAttribute object>, 'charge': <obj_tables.core.IntegerAttribute object>, 'empirical_formula': <obj_tables.chem.core.ChemicalFormulaAttribute object>, 'format': <obj_tables.core.EnumAttribute object>, 'molecular_weight': <obj_tables.core.FloatAttribute object>, 'value': <obj_tables.core.LongStringAttribute object>}[source]¶
-
child_attrs
= {'sbml': ('value', 'format', 'alphabet', 'empirical_formula', 'molecular_weight', 'charge'), 'wc_sim': ('molecular_weight', 'charge')}[source]¶
-
local_attributes
= {'alphabet': <obj_tables.core.LocalAttribute object>, 'charge': <obj_tables.core.LocalAttribute object>, 'empirical_formula': <obj_tables.core.LocalAttribute object>, 'format': <obj_tables.core.LocalAttribute object>, 'molecular_weight': <obj_tables.core.LocalAttribute object>, 'species_types': <obj_tables.core.LocalAttribute object>, 'value': <obj_tables.core.LocalAttribute object>}[source]¶
-
-
alphabet
= <obj_tables.core.EnumAttribute object>[source]
-
charge
= <obj_tables.core.IntegerAttribute object>[source]
-
empirical_formula
= <obj_tables.chem.core.ChemicalFormulaAttribute object>[source]
-
format
= <obj_tables.core.EnumAttribute object>[source]
-
get_structure
()[source]¶ Get structure
- Returns
structure
- Return type
openbabel.OBMol
,bpforms.BpForm
, orbcforms.BcForm
- Raises
ValueError – if the structure cannot be parsed
-
has_carbon
()[source]¶ Returns True is species contains at least one carbon atom.
- Returns
True is species contains at least one carbon atom.
- Return type
bool
-
molecular_weight
= <obj_tables.core.FloatAttribute object>[source]
-
validate
()[source]¶ Check that the structure is valid
Format provided when structure is not None
Value provided when format is not None
Alphabet provided for BpForms-encoded structures
Empirical formula, molecular weight, charge match structure (when provided)
- 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_tables.core.LongStringAttribute object>[source]
-
class
-
class
wc_lang.core.
ChemicalStructureAlphabet
[source]¶ Bases:
int
,wc_utils.util.enumerate.CaseInsensitiveEnum
An enumeration.
-
class
wc_lang.core.
ChemicalStructureFormat
[source]¶ Bases:
int
,wc_utils.util.enumerate.CaseInsensitiveEnum
Format of a chemical structure
-
class
wc_lang.core.
CommentAttribute
(min_length=0, max_length=4294967295, none=False, default='', default_cleaned_value='', none_value='', verbose_name='', description='', primary=False, unique=False, unique_case_insensitive=False)[source]¶ Bases:
obj_tables.core.LongStringAttribute
Comment attribute
-
class
wc_lang.core.
Compartment
(_comments=None, **kwargs)[source]¶ Bases:
obj_tables.core.Model
,wc_lang.sbml.util.SbmlModelMixin
-
mass_units
[source]¶ the units of the compartment mass returned when an
Expression
uses the compartment as a term, identified by its id- Type
unit_registry.Unit
-
init_density
[source]¶ parameter that provides the density during the initialization of each simulation
- Type
-
identifiers
[source]¶ identifiers
- Type
list
ofIdentifier
-
conclusions
[source]¶ conclusions
- Type
list
ofConclusion
Related attributes:
sub_compartments (
list
ofCompartment
): compartments contained in this compartmentspecies (
list
ofSpecies
): species in this compartmentfunction_expressions (
list
ofFunctionExpression
): function expressionsrate_law_expressions (
list
ofRateLawExpression
): rate law expressionsstop_condition_expressions (
list
ofStopConditionExpression
): stop condition expressions
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
,obj_tables.math.expression.ExpressionDynamicTermMeta
-
attribute_order
= ('id', 'name', 'biological_type', 'physical_type', 'geometry', 'parent_compartment', 'mass_units', 'init_volume', 'init_density', 'ph', 'identifiers', 'evidence', 'conclusions', 'comments', 'references')[source]¶
-
attributes
= {'biological_type': <obj_tables.sci.onto.OntoTermAttribute object>, 'comments': <wc_lang.core.CommentAttribute object>, 'conclusions': <obj_tables.core.ManyToManyAttribute object>, 'evidence': <wc_lang.core.EvidenceManyToManyAttribute object>, 'geometry': <obj_tables.sci.onto.OntoTermAttribute object>, 'id': <obj_tables.core.SlugAttribute object>, 'identifiers': <wc_lang.core.IdentifierManyToManyAttribute object>, 'init_density': <obj_tables.core.OneToOneAttribute object>, 'init_volume': <obj_tables.core.ManyToOneAttribute object>, 'mass_units': <obj_tables.sci.units.UnitAttribute object>, 'model': <obj_tables.core.ManyToOneAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'parent_compartment': <obj_tables.core.ManyToOneAttribute object>, 'ph': <obj_tables.core.ManyToOneAttribute object>, 'physical_type': <obj_tables.sci.onto.OntoTermAttribute object>, 'references': <obj_tables.core.ManyToManyAttribute object>}[source]¶
-
child_attrs
= {'sbml': ('id', 'name', 'model', 'biological_type', 'physical_type', 'geometry', 'parent_compartment', 'mass_units', 'init_volume', 'init_density', 'ph', 'identifiers', 'comments'), 'wc_sim': ('id', 'model', 'mass_units', 'biological_type', 'physical_type', 'geometry', 'parent_compartment', 'init_volume', 'init_density')}[source]¶
-
children
= {'core_model': ('parent_compartment', 'sub_compartments', 'init_volume', 'init_density', 'ph', 'identifiers', 'evidence', 'conclusions', 'references'), 'submodel': ('init_volume', 'init_density', 'ph', 'identifiers', 'evidence', 'conclusions', 'references')}[source]¶
-
local_attributes
= {'biological_type': <obj_tables.core.LocalAttribute object>, 'comments': <obj_tables.core.LocalAttribute object>, 'conclusions': <obj_tables.core.LocalAttribute object>, 'evidence': <obj_tables.core.LocalAttribute object>, 'function_expressions': <obj_tables.core.LocalAttribute object>, 'geometry': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'init_density': <obj_tables.core.LocalAttribute object>, 'init_volume': <obj_tables.core.LocalAttribute object>, 'mass_units': <obj_tables.core.LocalAttribute object>, 'model': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'parent_compartment': <obj_tables.core.LocalAttribute object>, 'ph': <obj_tables.core.LocalAttribute object>, 'physical_type': <obj_tables.core.LocalAttribute object>, 'rate_law_expressions': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>, 'species': <obj_tables.core.LocalAttribute object>, 'stop_condition_expressions': <obj_tables.core.LocalAttribute object>, 'sub_compartments': <obj_tables.core.LocalAttribute object>}[source]¶
-
-
biological_type
= <obj_tables.sci.onto.OntoTermAttribute object>[source]
-
comments
= <wc_lang.core.CommentAttribute object>[source]
-
conclusions
= <obj_tables.core.ManyToManyAttribute object>[source]
-
evidence
= <wc_lang.core.EvidenceManyToManyAttribute object>[source]
-
export_relations_to_sbml
(sbml_model, sbml)[source]¶ Add relationships to/from object to SBML compartment.
- Parameters
sbml_model (
libsbml.Model
) – SBML modelsbml (
libsbml.Compartment
) – SBML compartment
-
export_to_sbml
(sbml_model)[source]¶ Add this compartment to a SBML model.
- Parameters
sbml_model (
libsbml.Model
) – SBML model- Returns
SBML compartment
- Return type
libsbml.Compartment
- Raises
ValueError – if the geometry cannot be exported to SBML
-
geometry
= <obj_tables.sci.onto.OntoTermAttribute 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
ofCompartment
-
get_tot_mean_init_volume
()[source]¶ Get total mean initial volume of a compartment and its nested sub-compartments
- Returns
total mean initial volume of a compartment and its nested sub-compartments
- Return type
float
-
id
= <obj_tables.core.SlugAttribute object>[source]
-
identifiers
= <wc_lang.core.IdentifierManyToManyAttribute object>[source]
-
import_from_sbml
(sbml)[source]¶ Load from SBML compartment
- Parameters
sbml (
libsbml.Compartment
) – SBML compartment- Raises
ValueError – if the geometry cannot be imported from SBML
-
import_relations_from_sbml
(sbml, objs)[source]¶ Load relationships from SBML compartment
- Parameters
sbml (
libsbml.Compartment
) – SBML compartmentobjs (
dict
) – dictionary that maps WC-Lang types to dictionaries that map the ids of WC-Lang objects to WC-Lang objects
-
init_density
= <obj_tables.core.OneToOneAttribute object>[source]
-
init_volume
= <obj_tables.core.ManyToOneAttribute object>[source]
-
mass_units
= <obj_tables.sci.units.UnitAttribute object>[source]
-
model
= <obj_tables.core.ManyToOneAttribute object>[source]
-
name
= <obj_tables.core.StringAttribute object>[source]
-
parent_compartment
= <obj_tables.core.ManyToOneAttribute object>[source]
-
ph
= <obj_tables.core.ManyToOneAttribute object>[source]
-
physical_type
= <obj_tables.sci.onto.OntoTermAttribute object>[source]
-
references
= <obj_tables.core.ManyToManyAttribute object>[source]
-
-
class
wc_lang.core.
Conclusion
(_comments=None, **kwargs)[source]¶ Bases:
obj_tables.core.Model
Conclusion of one or more observations
-
identifiers
[source]¶ identifiers
- Type
list
ofIdentifier
-
evidence
[source]¶ evidence that supports/refutes the conclusion (e.g. individual observations underlying an average)
- Type
list
ofEvidence
authors
- Type
list
ofAuthor
Related attributes:
submodels (
list
ofSubmodel
): submodelscompartments (
list
ofCompartment
): compartmentsspecies_types (
list
ofSpeciesType
): species typesspecies (
list
ofSpecies
): speciesdistribution_init_concentrations (
list
ofDistributionInitConcentration
): distributions of initial concentrations of species at the beginning of each cell cycleobservables (
list
ofObservable
): observablesfunctions (
list
ofFunction
): functionsreactions (
list
ofReaction
): reactionsrate_laws (
list
ofRateLaw
): rate lawsdfba_objs (
list
ofDfbaObjective
): dFBA objectivesdfba_obj_reactions (
list
ofDfbaObjReaction
): dFBA objective reactionsdfba_obj_species (
list
ofDfbaObjSpecies
): dFBA objective speciesstop_conditions (
list
ofStopCondition
): stop conditionsparameters (
list
ofParameter
): parameterschanges (
list
ofChange
): changes
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
-
attribute_order
= ('id', 'name', 'value', 'std', 'units', 'type', 'process', 'identifiers', 'evidence', 'comments', 'references', 'authors', 'date')[source]¶
-
attributes
= {'authors': <obj_tables.core.ManyToManyAttribute object>, 'comments': <wc_lang.core.CommentAttribute object>, 'date': <obj_tables.core.DateTimeAttribute object>, 'evidence': <wc_lang.core.EvidenceManyToManyAttribute object>, 'id': <obj_tables.core.SlugAttribute object>, 'identifiers': <wc_lang.core.IdentifierManyToManyAttribute object>, 'model': <obj_tables.core.ManyToOneAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'process': <obj_tables.core.ManyToOneAttribute object>, 'references': <obj_tables.core.ManyToManyAttribute object>, 'std': <obj_tables.core.StringAttribute object>, 'type': <obj_tables.sci.onto.OntoTermAttribute object>, 'units': <obj_tables.sci.units.UnitAttribute object>, 'value': <obj_tables.core.StringAttribute object>}[source]¶
-
children
= {'core_model': ('process', 'identifiers', 'evidence', 'references', 'authors'), 'submodel': ('process', 'identifiers', 'evidence', 'references', 'authors')}[source]¶
-
local_attributes
= {'authors': <obj_tables.core.LocalAttribute object>, 'changes': <obj_tables.core.LocalAttribute object>, 'comments': <obj_tables.core.LocalAttribute object>, 'compartments': <obj_tables.core.LocalAttribute object>, 'date': <obj_tables.core.LocalAttribute object>, 'dfba_obj_reactions': <obj_tables.core.LocalAttribute object>, 'dfba_obj_species': <obj_tables.core.LocalAttribute object>, 'dfba_objs': <obj_tables.core.LocalAttribute object>, 'distribution_init_concentrations': <obj_tables.core.LocalAttribute object>, 'evidence': <obj_tables.core.LocalAttribute object>, 'functions': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'model': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'observables': <obj_tables.core.LocalAttribute object>, 'parameters': <obj_tables.core.LocalAttribute object>, 'process': <obj_tables.core.LocalAttribute object>, 'rate_laws': <obj_tables.core.LocalAttribute object>, 'reactions': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>, 'species': <obj_tables.core.LocalAttribute object>, 'species_types': <obj_tables.core.LocalAttribute object>, 'std': <obj_tables.core.LocalAttribute object>, 'stop_conditions': <obj_tables.core.LocalAttribute object>, 'submodels': <obj_tables.core.LocalAttribute object>, 'type': <obj_tables.core.LocalAttribute object>, 'units': <obj_tables.core.LocalAttribute object>, 'value': <obj_tables.core.LocalAttribute object>}[source]¶
-
-
authors
= <obj_tables.core.ManyToManyAttribute object>[source]
-
comments
= <wc_lang.core.CommentAttribute object>[source]
-
date
= <obj_tables.core.DateTimeAttribute object>[source]
-
evidence
= <wc_lang.core.EvidenceManyToManyAttribute object>[source]
-
id
= <obj_tables.core.SlugAttribute object>[source]
-
identifiers
= <wc_lang.core.IdentifierManyToManyAttribute object>[source]
-
model
= <obj_tables.core.ManyToOneAttribute object>[source]
-
name
= <obj_tables.core.StringAttribute object>[source]
-
process
= <obj_tables.core.ManyToOneAttribute object>[source]
-
references
= <obj_tables.core.ManyToManyAttribute object>[source]
-
std
= <obj_tables.core.StringAttribute object>[source]
-
type
= <obj_tables.sci.onto.OntoTermAttribute object>[source]
-
units
= <obj_tables.sci.units.UnitAttribute object>[source]
-
value
= <obj_tables.core.StringAttribute object>[source]
-
-
class
wc_lang.core.
DfbaObjReaction
(_comments=None, **kwargs)[source]¶ Bases:
obj_tables.core.Model
,wc_lang.sbml.util.SbmlModelMixin
A pseudo-reaction used to represent the interface between metabolism and other cell processes.
-
identifiers
[source]¶ identifiers
- Type
list
ofIdentifier
-
conclusions
[source]¶ conclusions
- Type
list
ofConclusion
Related attributes:
dfba_obj_expression (
DfbaObjectiveExpression
): dFBA objective expressiondfba_obj_species (
list
ofDfbaObjSpecies
): the components of this dFBA objective reaction
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
,obj_tables.math.expression.ExpressionDynamicTermMeta
-
attribute_order
= ('id', 'name', 'submodel', 'units', 'cell_size_units', 'identifiers', 'evidence', 'conclusions', 'comments', 'references')[source]¶
-
attributes
= {'cell_size_units': <obj_tables.sci.units.UnitAttribute object>, 'comments': <wc_lang.core.CommentAttribute object>, 'conclusions': <obj_tables.core.ManyToManyAttribute object>, 'evidence': <wc_lang.core.EvidenceManyToManyAttribute object>, 'id': <obj_tables.core.SlugAttribute object>, 'identifiers': <wc_lang.core.IdentifierManyToManyAttribute object>, 'model': <obj_tables.core.ManyToOneAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'references': <obj_tables.core.ManyToManyAttribute object>, 'submodel': <obj_tables.core.ManyToOneAttribute object>, 'units': <obj_tables.sci.units.UnitAttribute object>}[source]¶
-
child_attrs
= {'sbml': ('id', 'name', 'model', 'submodel', 'units', 'cell_size_units', 'identifiers', 'comments'), 'wc_sim': ('id', 'model', 'submodel', 'units', 'cell_size_units')}[source]¶
-
children
= {'core_model': ('dfba_obj_species', 'identifiers', 'evidence', 'conclusions', 'references'), 'submodel': ('dfba_obj_species', 'identifiers', 'evidence', 'conclusions', 'references')}[source]¶
-
local_attributes
= {'cell_size_units': <obj_tables.core.LocalAttribute object>, 'comments': <obj_tables.core.LocalAttribute object>, 'conclusions': <obj_tables.core.LocalAttribute object>, 'dfba_obj_expression': <obj_tables.core.LocalAttribute object>, 'dfba_obj_species': <obj_tables.core.LocalAttribute object>, 'evidence': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'model': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>, 'submodel': <obj_tables.core.LocalAttribute object>, 'units': <obj_tables.core.LocalAttribute object>}[source]¶
-
-
cell_size_units
= <obj_tables.sci.units.UnitAttribute object>[source]
-
comments
= <wc_lang.core.CommentAttribute object>[source]
-
conclusions
= <obj_tables.core.ManyToManyAttribute object>[source]
-
evidence
= <wc_lang.core.EvidenceManyToManyAttribute object>[source]
-
export_relations_to_sbml
(sbml_model, sbml_rxn)[source]¶ Add relationships to/from object to SBML reaction.
- Parameters
sbml_model (
libsbml.Model
) – SBML modelsbml_rxn (
libsbml.Reaction
) – SBML reaction
-
export_to_sbml
(sbml_model)[source]¶ Add a dFBA objective reaction to a SBML model.
DfbaObjReactions are added to the SBML model because they can be used in a dFBA submodel’s objective function. In fact the default objective function is the submodel’s dFBA objective reaction. Since SBML does not define DfbaObjReaction as a separate class, DfbaObjReactions are added to the SBML model as SBML reactions. CheckModel ensures that wc_lang DfbaObjReactions and Reactions have distinct ids.
- Parameters
sbml_model (
libsbml.Model
) – SBML model- Returns
SBML reaction
- Return type
libsbml.Reaction
-
id
= <obj_tables.core.SlugAttribute object>[source]
-
identifiers
= <wc_lang.core.IdentifierManyToManyAttribute object>[source]
-
import_from_sbml
(sbml_rxn)[source]¶ Load from SBML reaction
- Parameters
sbml (
libsbml.Reaction
) – SBML reaction
-
import_relations_from_sbml
(sbml_rxn, objs)[source]¶ Load relationships from SBML reaction
- Parameters
sbml (
libsbml.Reaction
) – SBML reactionobjs (
dict
) – dictionary that maps WC-Lang types to dictionaries that map the ids of WC-Lang objects to WC-Lang objects
-
model
= <obj_tables.core.ManyToOneAttribute object>[source]
-
name
= <obj_tables.core.StringAttribute object>[source]
-
references
= <obj_tables.core.ManyToManyAttribute object>[source]
-
submodel
= <obj_tables.core.ManyToOneAttribute object>[source]
-
units
= <obj_tables.sci.units.UnitAttribute object>[source]
-
-
class
wc_lang.core.
DfbaObjSpecies
(_comments=None, **kwargs)[source]¶ Bases:
obj_tables.core.Model
,wc_lang.sbml.util.SbmlModelMixin
A dFBA objective reaction contains a list of DfbaObjSpecies instances. Distinct DfbaObjSpecies enable separate comments and references for each one.
-
id
[source]¶ unique identifier per DfbaObjSpecies equal to dfba-net-species-{dfba_obj_reaction.id}-{species.id}
- Type
str
-
identifiers
[source]¶ identifiers
- Type
list
ofIdentifier
-
conclusions
[source]¶ conclusions
- Type
list
ofConclusion
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
-
attribute_order
= ('id', 'name', 'dfba_obj_reaction', 'species', 'value', 'units', 'identifiers', 'evidence', 'conclusions', 'comments', 'references')[source]¶
-
attributes
= {'comments': <wc_lang.core.CommentAttribute object>, 'conclusions': <obj_tables.core.ManyToManyAttribute object>, 'dfba_obj_reaction': <obj_tables.core.ManyToOneAttribute object>, 'evidence': <wc_lang.core.EvidenceManyToManyAttribute object>, 'id': <obj_tables.core.StringAttribute object>, 'identifiers': <wc_lang.core.IdentifierManyToManyAttribute object>, 'model': <obj_tables.core.ManyToOneAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'references': <obj_tables.core.ManyToManyAttribute object>, 'species': <obj_tables.core.ManyToOneAttribute object>, 'units': <obj_tables.sci.units.UnitAttribute object>, 'value': <obj_tables.core.FloatAttribute object>}[source]¶
-
child_attrs
= {'sbml': ('id', 'name', 'model', 'dfba_obj_reaction', 'species', 'value', 'units', 'identifiers', 'comments'), 'wc_sim': ('id', 'model', 'dfba_obj_reaction', 'species', 'value', 'units')}[source]¶
-
children
= {'core_model': ('dfba_obj_reaction', 'species', 'identifiers', 'evidence', 'conclusions', 'references'), 'submodel': ('dfba_obj_reaction', 'species', 'identifiers', 'evidence', 'conclusions', 'references')}[source]¶
-
local_attributes
= {'comments': <obj_tables.core.LocalAttribute object>, 'conclusions': <obj_tables.core.LocalAttribute object>, 'dfba_obj_reaction': <obj_tables.core.LocalAttribute object>, 'evidence': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'model': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>, 'species': <obj_tables.core.LocalAttribute object>, 'units': <obj_tables.core.LocalAttribute object>, 'value': <obj_tables.core.LocalAttribute object>}[source]¶
-
-
comments
= <wc_lang.core.CommentAttribute object>[source]
-
conclusions
= <obj_tables.core.ManyToManyAttribute object>[source]
-
dfba_obj_reaction
= <obj_tables.core.ManyToOneAttribute object>[source]
-
evidence
= <wc_lang.core.EvidenceManyToManyAttribute object>[source]
-
gen_id
()[source]¶ Generate identifier equal to dfba-net-species-{dfba_obj_reaction.id}-{species.id}
- Returns
identifier
- Return type
str
-
id
= <obj_tables.core.StringAttribute object>[source]
-
identifiers
= <wc_lang.core.IdentifierManyToManyAttribute object>[source]
-
model
= <obj_tables.core.ManyToOneAttribute object>[source]
-
name
= <obj_tables.core.StringAttribute object>[source]
-
references
= <obj_tables.core.ManyToManyAttribute object>[source]
-
species
= <obj_tables.core.ManyToOneAttribute object>[source]
-
units
= <obj_tables.sci.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_tables.core.FloatAttribute object>[source]
-
-
class
wc_lang.core.
DfbaObjective
(_comments=None, **kwargs)[source]¶ Bases:
obj_tables.core.Model
,wc_lang.sbml.util.SbmlModelMixin
dFBA objective function
-
identifiers
[source]¶ identifiers
- Type
list
ofIdentifier
-
conclusions
[source]¶ conclusions
- Type
list
ofConclusion
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
,obj_tables.math.expression.ExpressionExpressionTermMeta
-
attribute_order
= ('id', 'name', 'submodel', 'expression', 'units', 'reaction_rate_units', 'coefficient_units', 'identifiers', 'evidence', 'conclusions', 'comments', 'references')[source]¶
-
attributes
= {'coefficient_units': <obj_tables.sci.units.UnitAttribute object>, 'comments': <wc_lang.core.CommentAttribute object>, 'conclusions': <obj_tables.core.ManyToManyAttribute object>, 'evidence': <wc_lang.core.EvidenceManyToManyAttribute object>, 'expression': <obj_tables.math.expression.OneToOneExpressionAttribute object>, 'id': <obj_tables.core.StringAttribute object>, 'identifiers': <wc_lang.core.IdentifierManyToManyAttribute object>, 'model': <obj_tables.core.ManyToOneAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'reaction_rate_units': <obj_tables.sci.units.UnitAttribute object>, 'references': <obj_tables.core.ManyToManyAttribute object>, 'submodel': <obj_tables.core.OneToOneAttribute object>, 'units': <obj_tables.sci.units.UnitAttribute object>}[source]¶
-
child_attrs
= {'sbml': ('id', 'name', 'model', 'submodel', 'expression', 'units', 'reaction_rate_units', 'coefficient_units', 'identifiers', 'comments'), 'wc_sim': ('id', 'model', 'submodel', 'expression', 'units', 'reaction_rate_units', 'coefficient_units')}[source]¶
-
children
= {'core_model': ('expression', 'identifiers', 'evidence', 'conclusions', 'references'), 'submodel': ('expression', 'identifiers', 'evidence', 'conclusions', 'references')}[source]¶
-
expression_term_model
[source]¶ alias of
DfbaObjectiveExpression
-
local_attributes
= {'coefficient_units': <obj_tables.core.LocalAttribute object>, 'comments': <obj_tables.core.LocalAttribute object>, 'conclusions': <obj_tables.core.LocalAttribute object>, 'evidence': <obj_tables.core.LocalAttribute object>, 'expression': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'model': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'reaction_rate_units': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>, 'submodel': <obj_tables.core.LocalAttribute object>, 'units': <obj_tables.core.LocalAttribute object>}[source]¶
-
-
coefficient_units
= <obj_tables.sci.units.UnitAttribute object>[source]
-
comments
= <wc_lang.core.CommentAttribute object>[source]
-
conclusions
= <obj_tables.core.ManyToManyAttribute object>[source]
-
evidence
= <wc_lang.core.EvidenceManyToManyAttribute object>[source]
-
export_relations_to_sbml
(sbml_model, sbml)[source]¶ Add relationships to/from object to SBML objective.
- Parameters
sbml_model (
libsbml.Model
) – SBML modelsbml (
libsbml.Objective
) – SBML objective
-
export_to_sbml
(sbml_model)[source]¶ Add this dFBA objective to a SBML model.
This uses version 2 of the ‘Flux Balance Constraints’ extension. SBML assumes that an DfbaObjective is a linear combination of reaction fluxes.
- Parameters
sbml_model (
libsbml.Model
) – SBML model- Returns
SBML objective
- Return type
libsbml.Objective
-
expression
= <obj_tables.math.expression.OneToOneExpressionAttribute object>[source]
-
get_products
(_DfbaObjective__type=None, **kwargs)[source]¶ Get the species produced by this objective function
-
id
= <obj_tables.core.StringAttribute object>[source]
-
identifiers
= <wc_lang.core.IdentifierManyToManyAttribute object>[source]
-
import_from_sbml
(sbml)[source]¶ Load from SBML objective
- Parameters
sbml (
libsbml.Objective
) – SBML objective
-
import_relations_from_sbml
(sbml, objs)[source]¶ Load relationships from SBML objective
- Parameters
sbml (
libsbml.Objective
) – SBML objectiveobjs (
dict
) – dictionary that maps WC-Lang types to dictionaries that map the ids of WC-Lang objects to WC-Lang objects
-
model
= <obj_tables.core.ManyToOneAttribute object>[source]
-
name
= <obj_tables.core.StringAttribute object>[source]
-
reaction_rate_units
= <obj_tables.sci.units.UnitAttribute object>[source]
-
references
= <obj_tables.core.ManyToManyAttribute object>[source]
-
submodel
= <obj_tables.core.OneToOneAttribute object>[source]
-
units
= <obj_tables.sci.units.UnitAttribute object>[source]
-
-
class
wc_lang.core.
DfbaObjectiveExpression
(_comments=None, **kwargs)[source]¶ Bases:
obj_tables.core.Model
,obj_tables.math.expression.Expression
,wc_lang.sbml.util.SbmlModelMixin
A mathematical expression of Reactions and DfbaObjReactions
The expression used by a
DfbaObjective
.-
dfba_obj_reactions
[source]¶ dFBA objective reactions used by this expression
- Type
list
ofDfbaObjReaction
Related attributes:
dfba_obj (
DfbaObjective
): dFBA objective
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
,obj_tables.math.expression.Meta
-
attributes
= {'dfba_obj_reactions': <obj_tables.core.OneToManyAttribute object>, 'expression': <obj_tables.core.LongStringAttribute object>, 'reactions': <obj_tables.core.OneToManyAttribute object>}[source]¶
-
child_attrs
= {'sbml': ('expression', 'reactions', 'dfba_obj_reactions'), 'wc_sim': ('expression', 'reactions', 'dfba_obj_reactions')}[source]¶
-
children
= {'core_model': ('reactions', 'dfba_obj_reactions'), 'submodel': ('reactions', 'dfba_obj_reactions')}[source]¶
-
local_attributes
= {'dfba_obj': <obj_tables.core.LocalAttribute object>, 'dfba_obj_reactions': <obj_tables.core.LocalAttribute object>, 'expression': <obj_tables.core.LocalAttribute object>, 'reactions': <obj_tables.core.LocalAttribute object>}[source]¶
-
-
classmethod
deserialize
(value, objects)[source]¶ Deserialize value
- Parameters
value (
str
) – String representationobjects (
dict
) – dictionary of objects, grouped by model
- Returns
- tuple
of cleaned value and cleaning error
- Return type
tuple
ofDfbaObjectiveExpression
, InvalidAttribute or None
-
dfba_obj_reactions
= <obj_tables.core.OneToManyAttribute object>[source]
-
expression
= <obj_tables.core.LongStringAttribute object>[source]
-
merge_attrs
(other, other_objs_in_self, self_objs_in_other)[source]¶ Merge attributes of two objects
- Parameters
other (
obj_tables.Model
) – other modelother_objs_in_self (
dict
) – dictionary that maps instances of objects in another model to objects in a modelself_objs_in_other (
dict
) – dictionary that maps instances of objects in a model to objects in another model
-
reactions
= <obj_tables.core.OneToManyAttribute object>[source]
-
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
(_comments=None, **kwargs)[source]¶ Bases:
obj_tables.core.Model
,wc_lang.sbml.util.SbmlModelMixin
Distribution of the initial concentration of a species at the beginning of each cell cycle
-
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
-
identifiers
[source]¶ identifiers
- Type
list
ofIdentifier
-
conclusions
[source]¶ conclusions
- Type
list
ofConclusion
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
-
attribute_order
= ('id', 'name', 'species', 'distribution', 'mean', 'std', 'units', 'identifiers', 'evidence', 'conclusions', 'comments', 'references')[source]¶
-
attributes
= {'comments': <wc_lang.core.CommentAttribute object>, 'conclusions': <obj_tables.core.ManyToManyAttribute object>, 'distribution': <obj_tables.sci.onto.OntoTermAttribute object>, 'evidence': <wc_lang.core.EvidenceManyToManyAttribute object>, 'id': <obj_tables.core.StringAttribute object>, 'identifiers': <wc_lang.core.IdentifierManyToManyAttribute object>, 'mean': <obj_tables.core.FloatAttribute object>, 'model': <obj_tables.core.ManyToOneAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'references': <obj_tables.core.ManyToManyAttribute object>, 'species': <obj_tables.core.OneToOneAttribute object>, 'std': <obj_tables.core.FloatAttribute object>, 'units': <obj_tables.sci.units.UnitAttribute object>}[source]¶
-
child_attrs
= {'sbml': ('id', 'name', 'model', 'species', 'distribution', 'mean', 'std', 'units', 'identifiers', 'comments'), 'wc_sim': ('id', 'model', 'species', 'distribution', 'mean', 'std', 'units')}[source]¶
-
children
= {'core_model': ('species', 'identifiers', 'evidence', 'conclusions', 'references'), 'submodel': ('identifiers', 'evidence', 'conclusions', 'references')}[source]¶
-
local_attributes
= {'comments': <obj_tables.core.LocalAttribute object>, 'conclusions': <obj_tables.core.LocalAttribute object>, 'distribution': <obj_tables.core.LocalAttribute object>, 'evidence': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'mean': <obj_tables.core.LocalAttribute object>, 'model': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>, 'species': <obj_tables.core.LocalAttribute object>, 'std': <obj_tables.core.LocalAttribute object>, 'units': <obj_tables.core.LocalAttribute object>}[source]¶
-
-
comments
= <wc_lang.core.CommentAttribute object>[source]
-
conclusions
= <obj_tables.core.ManyToManyAttribute object>[source]
-
distribution
= <obj_tables.sci.onto.OntoTermAttribute object>[source]
-
evidence
= <wc_lang.core.EvidenceManyToManyAttribute object>[source]
-
id
= <obj_tables.core.StringAttribute object>[source]
-
identifiers
= <wc_lang.core.IdentifierManyToManyAttribute object>[source]
-
mean
= <obj_tables.core.FloatAttribute object>[source]
-
model
= <obj_tables.core.ManyToOneAttribute object>[source]
-
name
= <obj_tables.core.StringAttribute object>[source]
-
references
= <obj_tables.core.ManyToManyAttribute object>[source]
-
species
= <obj_tables.core.OneToOneAttribute object>[source]
-
std
= <obj_tables.core.FloatAttribute object>[source]
-
units
= <obj_tables.sci.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
(_comments=None, **kwargs)[source]¶ Bases:
obj_tables.core.Model
,wc_lang.sbml.util.SbmlModelMixin
-
identifiers
[source]¶ identifiers
- Type
list
ofIdentifier
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
-
attribute_order
= ('id', 'name', 'temp', 'temp_units', 'identifiers', 'comments', 'references')[source]¶
-
attributes
= {'comments': <wc_lang.core.CommentAttribute object>, 'id': <obj_tables.core.RegexAttribute object>, 'identifiers': <wc_lang.core.IdentifierOneToManyAttribute object>, 'model': <obj_tables.core.OneToOneAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'references': <obj_tables.core.OneToManyAttribute object>, 'temp': <obj_tables.core.FloatAttribute object>, 'temp_units': <obj_tables.sci.units.UnitAttribute object>}[source]¶
-
child_attrs
= {'sbml': ('id', 'name', 'model', 'temp', 'temp_units', 'identifiers', 'comments'), 'wc_sim': ()}[source]¶
-
children
= {'core_model': ('identifiers', 'references'), 'submodel': ('identifiers', 'references')}[source]¶
-
local_attributes
= {'comments': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'model': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>, 'temp': <obj_tables.core.LocalAttribute object>, 'temp_units': <obj_tables.core.LocalAttribute object>}[source]¶
-
-
comments
= <wc_lang.core.CommentAttribute object>[source]
-
id
= <obj_tables.core.RegexAttribute object>[source]
-
identifiers
= <wc_lang.core.IdentifierOneToManyAttribute object>[source]
-
model
= <obj_tables.core.OneToOneAttribute object>[source]
-
name
= <obj_tables.core.StringAttribute object>[source]
-
references
= <obj_tables.core.OneToManyAttribute object>[source]
-
temp
= <obj_tables.core.FloatAttribute object>[source]
-
temp_units
= <obj_tables.sci.units.UnitAttribute object>[source]
-
-
class
wc_lang.core.
Evidence
(_comments=None, **kwargs)[source]¶ Bases:
obj_tables.core.Model
Observation that supports/disputes a conclusion
-
type
[source]¶ how the observation supports the conclusion (e.g. supporting, inconclusive, disputing)
- Type
pronto.Term
-
strength (
obj:`float): how much the observation supports the conclusion
Related attributes:
submodels (
list
ofSubmodel
): submodelsdfba_objs (
list
ofDfbaObjective
): dFBA objectivescompartments (
list
ofCompartment
): compartmentsspecies_types (
list
ofSpeciesType
): species typesspecies (
list
ofSpecies
): speciesdistribution_init_concentrations (
list
ofDistributionInitConcentration
): initial concentrationsobservables (
list
ofObservable
): observablesfunctions (
list
ofFunction
): functionsstop_conditions (
list
ofStopCondition
): stop conditionsreactions (
list
ofReaction
): reactionsrate_laws (
list
ofRateLaw
): rate lawsdfba_obj_species (
list
ofDfbaObjSpecies
): dFBA objective speciesdfba_obj_reactions (
list
ofDfbaObjReaction
): dFBA objective reactionsparameters (
list
ofParameter
): parametersconclusions (
list
ofConclusion
): conclusionschanges (
list
ofChange
): changes
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
-
attributes
= {'observation': <obj_tables.core.ManyToOneAttribute object>, 'quality': <obj_tables.core.FloatAttribute object>, 'strength': <obj_tables.core.FloatAttribute object>, 'type': <obj_tables.sci.onto.OntoTermAttribute object>}[source]¶
-
local_attributes
= {'changes': <obj_tables.core.LocalAttribute object>, 'compartments': <obj_tables.core.LocalAttribute object>, 'conclusions': <obj_tables.core.LocalAttribute object>, 'dfba_obj_reactions': <obj_tables.core.LocalAttribute object>, 'dfba_obj_species': <obj_tables.core.LocalAttribute object>, 'dfba_objs': <obj_tables.core.LocalAttribute object>, 'distribution_init_concentrations': <obj_tables.core.LocalAttribute object>, 'functions': <obj_tables.core.LocalAttribute object>, 'observables': <obj_tables.core.LocalAttribute object>, 'observation': <obj_tables.core.LocalAttribute object>, 'parameters': <obj_tables.core.LocalAttribute object>, 'quality': <obj_tables.core.LocalAttribute object>, 'rate_laws': <obj_tables.core.LocalAttribute object>, 'reactions': <obj_tables.core.LocalAttribute object>, 'species': <obj_tables.core.LocalAttribute object>, 'species_types': <obj_tables.core.LocalAttribute object>, 'stop_conditions': <obj_tables.core.LocalAttribute object>, 'strength': <obj_tables.core.LocalAttribute object>, 'submodels': <obj_tables.core.LocalAttribute object>, 'type': <obj_tables.core.LocalAttribute object>}[source]¶
-
-
observation
= <obj_tables.core.ManyToOneAttribute object>[source]
-
quality
= <obj_tables.core.FloatAttribute object>[source]
-
type
= <obj_tables.sci.onto.OntoTermAttribute object>[source]
-
-
class
wc_lang.core.
EvidenceManyToManyAttribute
(related_class, grammar=None, **kwargs)[source]¶ Bases:
obj_tables.grammar.ToManyGrammarAttribute
,obj_tables.core.ManyToManyAttribute
Many to many attribute for evidence
-
class
Transformer
(objects)[source]¶ Bases:
obj_tables.grammar.ToManyGrammarTransformer
Transforms parse trees into a list of instances of
core.Model
-
get_xlsx_validation
(sheet_models=None, doc_metadata_model=None)[source]¶ Get Excel validation
- Parameters
sheet_models (
list
ofModel
, optional) – models encoded as separate sheetsdoc_metadata_model (
type
) – model whose worksheet contains the document metadata
- Returns
validation
- Return type
wc_utils.workbook.io.FieldValidation
-
class
-
class
wc_lang.core.
FluxBounds
(_comments=None, **kwargs)[source]¶ Bases:
obj_tables.core.Model
,wc_lang.sbml.util.SbmlModelMixin
Flux bounds for reactions modeled by dFBA submodels
-
min
[source]¶ minimum flux bound for solving an FBA model; negative for reversible reactions
- Type
float
Related attributes:
reactions (
list
ofReaction
): reactions
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
-
attributes
= {'max': <obj_tables.core.FloatAttribute object>, 'min': <obj_tables.core.FloatAttribute object>, 'units': <obj_tables.sci.units.UnitAttribute object>}[source]¶
-
local_attributes
= {'max': <obj_tables.core.LocalAttribute object>, 'min': <obj_tables.core.LocalAttribute object>, 'reactions': <obj_tables.core.LocalAttribute object>, 'units': <obj_tables.core.LocalAttribute object>}[source]¶
-
-
max
= <obj_tables.core.FloatAttribute object>[source]
-
min
= <obj_tables.core.FloatAttribute object>[source]
-
units
= <obj_tables.sci.units.UnitAttribute object>[source]
-
-
class
wc_lang.core.
Function
(_comments=None, **kwargs)[source]¶ Bases:
obj_tables.core.Model
,wc_lang.sbml.util.SbmlAssignmentRuleMixin
Function: a mathematical expression of Functions, Observbles, Parameters and Python functions
-
identifiers
[source]¶ identifiers
- Type
list
ofIdentifier
-
conclusions
[source]¶ conclusions
- Type
list
ofConclusion
Related attributes:
function_expressions (
list
ofFunctionExpression
): function expressionsrate_law_expressions (
list
ofRateLawExpression
): rate law expressionsstop_condition_expressions (
list
ofStopConditionExpression
): stop condition expressions
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
,obj_tables.math.expression.ExpressionExpressionTermMeta
-
attribute_order
= ('id', 'name', 'expression', 'units', 'identifiers', 'evidence', 'conclusions', 'comments', 'references')[source]¶
-
attributes
= {'comments': <wc_lang.core.CommentAttribute object>, 'conclusions': <obj_tables.core.ManyToManyAttribute object>, 'evidence': <wc_lang.core.EvidenceManyToManyAttribute object>, 'expression': <obj_tables.math.expression.OneToOneExpressionAttribute object>, 'id': <obj_tables.core.SlugAttribute object>, 'identifiers': <wc_lang.core.IdentifierManyToManyAttribute object>, 'model': <obj_tables.core.ManyToOneAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'references': <obj_tables.core.ManyToManyAttribute object>, 'units': <obj_tables.sci.units.UnitAttribute object>}[source]¶
-
child_attrs
= {'sbml': ('id', 'name', 'model', 'expression', 'units', 'identifiers', 'comments'), 'wc_sim': ('id', 'model', 'expression', 'units')}[source]¶
-
children
= {'core_model': ('expression', 'identifiers', 'evidence', 'conclusions', 'references'), 'submodel': ('expression', 'identifiers', 'evidence', 'conclusions', 'references')}[source]¶
-
expression_term_model
[source]¶ alias of
FunctionExpression
-
local_attributes
= {'comments': <obj_tables.core.LocalAttribute object>, 'conclusions': <obj_tables.core.LocalAttribute object>, 'evidence': <obj_tables.core.LocalAttribute object>, 'expression': <obj_tables.core.LocalAttribute object>, 'function_expressions': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'model': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'rate_law_expressions': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>, 'stop_condition_expressions': <obj_tables.core.LocalAttribute object>, 'units': <obj_tables.core.LocalAttribute object>}[source]¶
-
-
comments
= <wc_lang.core.CommentAttribute object>[source]
-
conclusions
= <obj_tables.core.ManyToManyAttribute object>[source]
-
evidence
= <wc_lang.core.EvidenceManyToManyAttribute object>[source]
-
expression
= <obj_tables.math.expression.OneToOneExpressionAttribute object>[source]
-
id
= <obj_tables.core.SlugAttribute object>[source]
-
identifiers
= <wc_lang.core.IdentifierManyToManyAttribute object>[source]
-
model
= <obj_tables.core.ManyToOneAttribute object>[source]
-
name
= <obj_tables.core.StringAttribute object>[source]
-
references
= <obj_tables.core.ManyToManyAttribute object>[source]
-
units
= <obj_tables.sci.units.UnitAttribute object>[source]
-
-
class
wc_lang.core.
FunctionExpression
(_comments=None, **kwargs)[source]¶ Bases:
obj_tables.core.Model
,obj_tables.math.expression.Expression
,wc_lang.sbml.util.SbmlModelMixin
A mathematical expression of Functions, Observbles, Parameters and Python functions
The expression used by a
Function
.-
observables
[source]¶ Observables used by this function expression
- Type
list
ofObservable
-
compartments
[source]¶ Compartments used by this function expression
- Type
list
ofCompartment
Related attributes:
function (
Function
): function
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
,obj_tables.math.expression.Meta
-
attributes
= {'compartments': <obj_tables.core.ManyToManyAttribute object>, 'expression': <obj_tables.core.LongStringAttribute object>, 'functions': <obj_tables.core.ManyToManyAttribute object>, 'observables': <obj_tables.core.ManyToManyAttribute object>, 'parameters': <obj_tables.core.ManyToManyAttribute object>, 'species': <obj_tables.core.ManyToManyAttribute object>}[source]¶
-
child_attrs
= {'sbml': ('expression', 'parameters', 'species', 'observables', 'functions', 'compartments'), 'wc_sim': ('expression', 'parameters', 'species', 'observables', 'functions', 'compartments')}[source]¶
-
children
= {'core_model': ('parameters', 'species', 'observables', 'functions', 'compartments'), 'submodel': ('parameters', 'species', 'observables', 'functions', 'compartments')}[source]¶
-
local_attributes
= {'compartments': <obj_tables.core.LocalAttribute object>, 'expression': <obj_tables.core.LocalAttribute object>, 'function': <obj_tables.core.LocalAttribute object>, 'functions': <obj_tables.core.LocalAttribute object>, 'observables': <obj_tables.core.LocalAttribute object>, 'parameters': <obj_tables.core.LocalAttribute object>, 'species': <obj_tables.core.LocalAttribute object>}[source]¶
-
-
compartments
= <obj_tables.core.ManyToManyAttribute object>[source]
-
classmethod
deserialize
(value, objects)[source]¶ Deserialize value
- Parameters
value (
str
) – String representationobjects (
dict
) – dictionary of objects, grouped by model
- Returns
- tuple of cleaned value
and cleaning error
- Return type
tuple
ofFunctionExpression
, InvalidAttribute or None
-
expression
= <obj_tables.core.LongStringAttribute object>[source]
-
functions
= <obj_tables.core.ManyToManyAttribute object>[source]
-
merge_attrs
(other, other_objs_in_self, self_objs_in_other)[source]¶ Merge attributes of two objects
- Parameters
other (
obj_tables.Model
) – other modelother_objs_in_self (
dict
) – dictionary that maps instances of objects in another model to objects in a modelself_objs_in_other (
dict
) – dictionary that maps instances of objects in a model to objects in another model
-
observables
= <obj_tables.core.ManyToManyAttribute object>[source]
-
parameters
= <obj_tables.core.ManyToManyAttribute object>[source]
-
species
= <obj_tables.core.ManyToManyAttribute object>[source]
-
-
class
wc_lang.core.
Identifier
(_comments=None, **kwargs)[source]¶ Bases:
obj_tables.core.Model
,wc_lang.sbml.util.SbmlModelMixin
Reference to an entry in a namespace
Related attributes:
model (
Model
): modeltaxon (
Taxon
): taxonenv (
Environment
): environmentsubmodels (
list
ofSubmodel
): submodelscompartments (
list
ofCompartment
): compartmentsspecies_types (
list
ofSpeciesType
): species typesspecies (
list
ofSpecies
): speciesdistribution_init_concentrations (
list
ofDistributionInitConcentration
): distributions of initial concentrations of species at the beginning of each cell cycleobservables (
list
ofObservable
): observablesfunctions (
list
ofFunction
): functionsreactions (
list
ofReaction
): reactionsrate_laws (
list
ofRateLaw
): rate lawsdfba_objs (
list
ofDfbaObjective
): dFBA objectivesdfba_obj_reactions (
list
ofDfbaObjReaction
): dFBA objective reactionsdfba_obj_species (
list
ofDfbaObjSpecies
): dFBA objective speciesstop_conditions (
list
ofStopCondition
): stop conditionsparameters (
list
ofParameter
): parametersreferences (
list
ofReference
): referencesauthors (
list
ofAuthor
): authorschanges (
list
ofChange
): changes
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
-
attributes
= {'id': <obj_tables.core.StringAttribute object>, 'namespace': <obj_tables.core.StringAttribute object>}[source]¶
-
local_attributes
= {'authors': <obj_tables.core.LocalAttribute object>, 'changes': <obj_tables.core.LocalAttribute object>, 'compartments': <obj_tables.core.LocalAttribute object>, 'conclusions': <obj_tables.core.LocalAttribute object>, 'dfba_obj_reactions': <obj_tables.core.LocalAttribute object>, 'dfba_obj_species': <obj_tables.core.LocalAttribute object>, 'dfba_objs': <obj_tables.core.LocalAttribute object>, 'distribution_init_concentrations': <obj_tables.core.LocalAttribute object>, 'env': <obj_tables.core.LocalAttribute object>, 'functions': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'model': <obj_tables.core.LocalAttribute object>, 'namespace': <obj_tables.core.LocalAttribute object>, 'observables': <obj_tables.core.LocalAttribute object>, 'observation_sets': <obj_tables.core.LocalAttribute object>, 'observations': <obj_tables.core.LocalAttribute object>, 'parameters': <obj_tables.core.LocalAttribute object>, 'rate_laws': <obj_tables.core.LocalAttribute object>, 'reactions': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>, 'species': <obj_tables.core.LocalAttribute object>, 'species_types': <obj_tables.core.LocalAttribute object>, 'stop_conditions': <obj_tables.core.LocalAttribute object>, 'submodels': <obj_tables.core.LocalAttribute object>, 'taxon': <obj_tables.core.LocalAttribute object>}[source]¶
-
-
id
= <obj_tables.core.StringAttribute object>[source]
-
namespace
= <obj_tables.core.StringAttribute object>[source]
-
class
wc_lang.core.
IdentifierManyToManyAttribute
(related_name='', verbose_name='Identifiers', verbose_related_name='', description='')[source]¶ Bases:
wc_lang.core.IdentifierToManyGrammarAttribute
,obj_tables.core.ManyToManyAttribute
-
class
wc_lang.core.
IdentifierOneToManyAttribute
(related_name='', verbose_name='Identifiers', verbose_related_name='', description='')[source]¶ Bases:
wc_lang.core.IdentifierToManyGrammarAttribute
,obj_tables.core.OneToManyAttribute
-
class
wc_lang.core.
IdentifierToManyGrammarAttribute
(related_class, grammar=None, **kwargs)[source]¶ Bases:
obj_tables.grammar.ToManyGrammarAttribute
-
get_xlsx_validation
(sheet_models=None, doc_metadata_model=None)[source]¶ Get Excel validation
- Parameters
sheet_models (
list
ofModel
, optional) – models encoded as separate sheetsdoc_metadata_model (
type
) – model whose worksheet contains the document metadata
- Returns
validation
- Return type
wc_utils.workbook.io.FieldValidation
-
serialize
(identifiers, encoded=None)[source]¶ Serialize related object
- Parameters
identifiers (
list
ofIdentifier
) – Python representation of identifiersencoded (
dict
, optional) – dictionary of objects that have already been encoded
- Returns
string representation
- Return type
str
-
-
class
wc_lang.core.
InitVolume
(_comments=None, **kwargs)[source]¶ Bases:
obj_tables.core.Model
,wc_lang.sbml.util.SbmlModelMixin
Initial volume of a compartment
Related attributes:
compartments (
list
ofCompartment
): compartment
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
-
attributes
= {'distribution': <obj_tables.sci.onto.OntoTermAttribute object>, 'mean': <obj_tables.core.FloatAttribute object>, 'std': <obj_tables.core.FloatAttribute object>, 'units': <obj_tables.sci.units.UnitAttribute object>}[source]¶
-
child_attrs
= {'sbml': ('distribution', 'mean', 'std', 'units'), 'wc_sim': ('distribution', 'mean', 'std', 'units')}[source]¶
-
local_attributes
= {'compartments': <obj_tables.core.LocalAttribute object>, 'distribution': <obj_tables.core.LocalAttribute object>, 'mean': <obj_tables.core.LocalAttribute object>, 'std': <obj_tables.core.LocalAttribute object>, 'units': <obj_tables.core.LocalAttribute object>}[source]¶
-
-
distribution
= <obj_tables.sci.onto.OntoTermAttribute object>[source]
-
mean
= <obj_tables.core.FloatAttribute object>[source]
-
std
= <obj_tables.core.FloatAttribute object>[source]
-
units
= <obj_tables.sci.units.UnitAttribute object>[source]
-
class
wc_lang.core.
Model
(**kwargs)[source]¶ Bases:
obj_tables.core.Model
,wc_lang.sbml.util.SbmlModelMixin
-
identifiers
[source]¶ identifiers
- Type
list
ofIdentifier
Related attributes:
taxon (
Taxon
): taxonenv (
Environment
): environmentsubmodels (
list
ofSubmodel
): submodelscompartments (
list
ofCompartment
): compartmentsspecies_types (
list
ofSpeciesType
): species typesspecies (
list
ofSpecies
): speciesdistribution_init_concentrations (
list
ofDistributionInitConcentration
): distributions of initial concentrations of species at the beginning of each cell cycleobservables (
list
ofObservable
): observablesfunctions (
list
ofFunction
): functionsreactions (
list
ofReaction
): reactionsrate_laws (
list
ofRateLaw
): rate lawsdfba_objs (
list
ofDfbaObjective
): dFBA objectivesdfba_obj_reactions (
list
ofDfbaObjReaction
): dFBA objective reactionsdfba_obj_species (
list
ofDfbaObjSpecies
): dFBA objective speciesstop_conditions (
list
ofStopCondition
): stop conditionsparameters (
list
ofParameter
): parametersobservations (
list
ofObservation
): observationsconclusions (
list
ofConclusion
): conclusionsreferences (
list
ofReference
): referencesauthors (
list
ofAuthor
): authorschanges (
list
ofChange
): changes
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
-
attribute_order
= ('id', 'name', 'version', 'url', 'branch', 'revision', 'wc_lang_version', 'time_units', 'identifiers', 'comments', 'created', 'updated')[source]¶
-
attributes
= {'branch': <obj_tables.core.StringAttribute object>, 'comments': <wc_lang.core.CommentAttribute object>, 'created': <obj_tables.core.DateTimeAttribute object>, 'id': <obj_tables.core.SlugAttribute object>, 'identifiers': <wc_lang.core.IdentifierOneToManyAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'revision': <obj_tables.core.StringAttribute object>, 'time_units': <obj_tables.sci.units.UnitAttribute object>, 'updated': <obj_tables.core.DateTimeAttribute object>, 'url': <obj_tables.core.UrlAttribute object>, 'version': <obj_tables.core.RegexAttribute object>, 'wc_lang_version': <obj_tables.core.RegexAttribute object>}[source]¶
-
child_attrs
= {'sbml': ('id', 'name', 'version', 'url', 'branch', 'revision', 'wc_lang_version', 'time_units', 'identifiers', 'comments', 'updated', 'created'), 'wc_sim': ('id', 'version', 'wc_lang_version', 'time_units')}[source]¶
-
children
= {'core_model': ('taxon', 'env', 'compartments', 'species_types', 'species', 'distribution_init_concentrations', 'observables', 'functions', 'stop_conditions'), 'submodel': ('taxon', 'env')}[source]¶
-
local_attributes
= {'authors': <obj_tables.core.LocalAttribute object>, 'branch': <obj_tables.core.LocalAttribute object>, 'changes': <obj_tables.core.LocalAttribute object>, 'comments': <obj_tables.core.LocalAttribute object>, 'compartments': <obj_tables.core.LocalAttribute object>, 'conclusions': <obj_tables.core.LocalAttribute object>, 'created': <obj_tables.core.LocalAttribute object>, 'dfba_obj_reactions': <obj_tables.core.LocalAttribute object>, 'dfba_obj_species': <obj_tables.core.LocalAttribute object>, 'dfba_objs': <obj_tables.core.LocalAttribute object>, 'distribution_init_concentrations': <obj_tables.core.LocalAttribute object>, 'env': <obj_tables.core.LocalAttribute object>, 'functions': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'observables': <obj_tables.core.LocalAttribute object>, 'observation_sets': <obj_tables.core.LocalAttribute object>, 'observations': <obj_tables.core.LocalAttribute object>, 'parameters': <obj_tables.core.LocalAttribute object>, 'rate_laws': <obj_tables.core.LocalAttribute object>, 'reactions': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>, 'revision': <obj_tables.core.LocalAttribute object>, 'species': <obj_tables.core.LocalAttribute object>, 'species_types': <obj_tables.core.LocalAttribute object>, 'stop_conditions': <obj_tables.core.LocalAttribute object>, 'submodels': <obj_tables.core.LocalAttribute object>, 'taxon': <obj_tables.core.LocalAttribute object>, 'time_units': <obj_tables.core.LocalAttribute object>, 'updated': <obj_tables.core.LocalAttribute object>, 'url': <obj_tables.core.LocalAttribute object>, 'version': <obj_tables.core.LocalAttribute object>, 'wc_lang_version': <obj_tables.core.LocalAttribute object>}[source]¶
-
-
branch
= <obj_tables.core.StringAttribute object>[source]
-
comments
= <wc_lang.core.CommentAttribute object>[source]
-
created
= <obj_tables.core.DateTimeAttribute object>[source]
-
export_relations_to_sbml
(sbml_model, sbml)[source]¶ Add relationships to/from object to SBML model.
- Parameters
sbml_model (
libsbml.Model
) – SBML modelsbml (
libsbml.Model
) – SBML model
-
export_to_sbml
(sbml_model)[source]¶ Add this metadata about this model to a SBML model.
- Parameters
sbml_model (
libsbml.Model
) – SBML model- Returns
SBML model
- Return type
libsbml.Model
Get all authors from model and children
-
get_compartments
(_Model__type=None, **kwargs)[source]¶ Get all compartments that satisfy the matching criteria
- Parameters
__type (
types.TypeType
ortuple
oftypes.TypeType
) – subclass(es) ofModel
kwargs (
dict
ofstr
–>object
) – dictionary of attribute name/value pairs to find matching objects
- Returns
compartments
- Return type
list
ofCompartment
-
get_components
(_Model__type=None, **kwargs)[source]¶ Find model component of type with id
- Parameters
__type (
types.TypeType
ortuple
oftypes.TypeType
) – subclass(es) ofModel
kwargs (
dict
ofstr
–>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_tables.Model
-
get_conclusions
(_Model__type=None, **kwargs)[source]¶ Get all conclusions for model
- Returns
conclusions for model
- Return type
list
ofConclusion
-
get_dfba_obj_reactions
(_Model__type=None, **kwargs)[source]¶ Get all dFBA objective reactions used by submodels
- Parameters
__type (
types.TypeType
ortuple
oftypes.TypeType
) – subclass(es) ofModel
kwargs (
dict
ofstr
–>object
) – dictionary of attribute name/value pairs to find matching objects
- Returns
dFBA objective reactions
- Return type
list
ofDfbaObjReaction
-
get_dfba_obj_species
(_Model__type=None, **kwargs)[source]¶ Get all dFBA objective species used by submodels
- Parameters
__type (
types.TypeType
ortuple
oftypes.TypeType
) – subclass(es) ofModel
kwargs (
dict
ofstr
–>object
) – dictionary of attribute name/value pairs to find matching objects
- Returns
dFBA objective species
- Return type
list
ofDfbaObjSpecies
-
get_dfba_objs
(_Model__type=None, **kwargs)[source]¶ Get all dFBA objectives
- Returns
dFBA objectives
- Return type
list
ofDfbaObjective
-
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
ortuple
oftypes.TypeType
) – subclass(es) ofModel
kwargs (
dict
ofstr
–>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
ofDistributionInitConcentration
-
get_evidence
(_Model__type=None, **kwargs)[source]¶ Get all evidence for model
- Returns
evidence for model
- Return type
list
ofEvidence
-
get_observables
(_Model__type=None, **kwargs)[source]¶ Get all observables
- Parameters
__type (
types.TypeType
ortuple
oftypes.TypeType
) – subclass(es) ofModel
kwargs (
dict
ofstr
–>object
) – dictionary of attribute name/value pairs to find matching objects
- Returns
observables
- Return type
list
ofObservables
-
get_observation_sets
(_Model__type=None, **kwargs)[source]¶ Get all observation sets for model
- Returns
observation sets for model
- Return type
list
ofObservationSet
-
get_observations
(_Model__type=None, **kwargs)[source]¶ Get all observations for model
- Returns
observations for model
- Return type
list
ofObservation
-
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
ofCompartment
-
get_species_types
(_Model__type=None, **kwargs)[source]¶ Get all species types
- Parameters
__type (
types.TypeType
ortuple
oftypes.TypeType
) – subclass(es) ofModel
kwargs (
dict
ofstr
–>object
) – dictionary of attribute name/value pairs to find matching objects
- Returns
species types
- Return type
list
ofSpeciesType
-
get_stop_conditions
(_Model__type=None, **kwargs)[source]¶ Get all stop conditions
- Parameters
__type (
types.TypeType
ortuple
oftypes.TypeType
) – subclass(es) ofModel
kwargs (
dict
ofstr
–>object
) – dictionary of attribute name/value pairs to find matching objects
- Returns
stop conditions
- Return type
list
ofStopCondition
-
id
= <obj_tables.core.SlugAttribute object>[source]
-
identifiers
= <wc_lang.core.IdentifierOneToManyAttribute object>[source]
-
import_relations_from_sbml
(sbml, objs)[source]¶ Load relationships from SBML model
- Parameters
sbml (
libsbml.Model
) – SBML modelobjs (
dict
) – dictionary that maps WC-Lang types to dictionaries that map the ids of WC-Lang objects to WC-Lang objects
-
merge_attrs
(other, other_objs_in_self, self_objs_in_other)[source]¶ Merge attributes of two objects
- Parameters
other (
Model
) – other modelother_objs_in_self (
dict
) – dictionary that maps instances of objects in another model to objects in a modelself_objs_in_other (
dict
) – dictionary that maps instances of objects in a model to objects in another model
-
name
= <obj_tables.core.StringAttribute object>[source]
-
revision
= <obj_tables.core.StringAttribute object>[source]
-
time_units
= <obj_tables.sci.units.UnitAttribute object>[source]
-
updated
= <obj_tables.core.DateTimeAttribute object>[source]
-
url
= <obj_tables.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_tables.core.RegexAttribute object>[source]
-
wc_lang_version
= <obj_tables.core.RegexAttribute object>[source]
-
-
class
wc_lang.core.
Observable
(_comments=None, **kwargs)[source]¶ Bases:
obj_tables.core.Model
,wc_lang.sbml.util.SbmlAssignmentRuleMixin
Observable: a linear function of other Observbles and Species
-
identifiers
[source]¶ identifiers
- Type
list
ofIdentifier
-
conclusions
[source]¶ conclusions
- Type
list
ofConclusion
Related attributes:
observable_expressions (
list
ofObservableExpression
): observable expressionsfunction_expressions (
list
ofFunctionExpression
): function expressionsrate_law_expressions (
list
ofRateLawExpression
): rate law expressionsstop_condition_expressions (
list
ofStopConditionExpression
): stop condition expressions
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
,obj_tables.math.expression.ExpressionExpressionTermMeta
-
attribute_order
= ('id', 'name', 'expression', 'units', 'identifiers', 'evidence', 'conclusions', 'comments', 'references')[source]¶
-
attributes
= {'comments': <wc_lang.core.CommentAttribute object>, 'conclusions': <obj_tables.core.ManyToManyAttribute object>, 'evidence': <wc_lang.core.EvidenceManyToManyAttribute object>, 'expression': <obj_tables.math.expression.OneToOneExpressionAttribute object>, 'id': <obj_tables.core.SlugAttribute object>, 'identifiers': <wc_lang.core.IdentifierManyToManyAttribute object>, 'model': <obj_tables.core.ManyToOneAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'references': <obj_tables.core.ManyToManyAttribute object>, 'units': <obj_tables.sci.units.UnitAttribute object>}[source]¶
-
child_attrs
= {'sbml': ('id', 'name', 'model', 'expression', 'units', 'identifiers', 'comments'), 'wc_sim': ('id', 'model', 'expression', 'units')}[source]¶
-
children
= {'core_model': ('expression', 'identifiers', 'evidence', 'conclusions', 'references'), 'submodel': ('expression', 'identifiers', 'evidence', 'conclusions', 'references')}[source]¶
-
expression_term_model
[source]¶ alias of
ObservableExpression
-
local_attributes
= {'comments': <obj_tables.core.LocalAttribute object>, 'conclusions': <obj_tables.core.LocalAttribute object>, 'evidence': <obj_tables.core.LocalAttribute object>, 'expression': <obj_tables.core.LocalAttribute object>, 'function_expressions': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'model': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'observable_expressions': <obj_tables.core.LocalAttribute object>, 'rate_law_expressions': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>, 'stop_condition_expressions': <obj_tables.core.LocalAttribute object>, 'units': <obj_tables.core.LocalAttribute object>}[source]¶
-
-
comments
= <wc_lang.core.CommentAttribute object>[source]
-
conclusions
= <obj_tables.core.ManyToManyAttribute object>[source]
-
evidence
= <wc_lang.core.EvidenceManyToManyAttribute object>[source]
-
expression
= <obj_tables.math.expression.OneToOneExpressionAttribute object>[source]
-
id
= <obj_tables.core.SlugAttribute object>[source]
-
identifiers
= <wc_lang.core.IdentifierManyToManyAttribute object>[source]
-
model
= <obj_tables.core.ManyToOneAttribute object>[source]
-
name
= <obj_tables.core.StringAttribute object>[source]
-
references
= <obj_tables.core.ManyToManyAttribute object>[source]
-
units
= <obj_tables.sci.units.UnitAttribute object>[source]
-
-
class
wc_lang.core.
ObservableExpression
(_comments=None, **kwargs)[source]¶ Bases:
obj_tables.core.Model
,obj_tables.math.expression.Expression
,wc_lang.sbml.util.SbmlModelMixin
A mathematical expression of Observables and Species
The expression used by a Observable.
-
observables
[source]¶ other Observables used by this Observable expression
- Type
list
ofObservable
Related attributes:
observable (
Observable
): observable
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
,obj_tables.math.expression.Meta
-
attributes
= {'expression': <obj_tables.core.LongStringAttribute object>, 'observables': <obj_tables.core.ManyToManyAttribute object>, 'species': <obj_tables.core.ManyToManyAttribute object>}[source]¶
-
child_attrs
= {'sbml': ('expression', 'species', 'observables'), 'wc_sim': ('expression', 'species', 'observables')}[source]¶
-
children
= {'core_model': ('species', 'observables'), 'submodel': ('species', 'observables')}[source]¶
-
local_attributes
= {'expression': <obj_tables.core.LocalAttribute object>, 'observable': <obj_tables.core.LocalAttribute object>, 'observables': <obj_tables.core.LocalAttribute object>, 'species': <obj_tables.core.LocalAttribute object>}[source]¶
-
-
classmethod
deserialize
(value, objects)[source]¶ Deserialize value
- Parameters
value (
str
) – String representationobjects (
dict
) – dictionary of objects, grouped by model
- Returns
tuple of cleaned value and cleaning error
- Return type
tuple
ofObservableExpression
, InvalidAttribute or None
-
expression
= <obj_tables.core.LongStringAttribute object>[source]
-
merge_attrs
(other, other_objs_in_self, self_objs_in_other)[source]¶ Merge attributes of two objects
- Parameters
other (
obj_tables.Model
) – other modelother_objs_in_self (
dict
) – dictionary that maps instances of objects in another model to objects in a modelself_objs_in_other (
dict
) – dictionary that maps instances of objects in a model to objects in another model
-
observables
= <obj_tables.core.ManyToManyAttribute object>[source]
-
species
= <obj_tables.core.ManyToManyAttribute object>[source]
-
-
class
wc_lang.core.
Observation
(_comments=None, **kwargs)[source]¶ Bases:
obj_tables.core.Model
-
identifiers
[source]¶ identifiers
- Type
list
ofIdentifier
Related attributes:
observation_sets (
list
ofObservationSet
): observation setsevidence (
list
ofEvidence
): evidence
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
-
attribute_order
= ('id', 'name', 'value', 'std', 'units', 'type', 'genotype', 'env', 'experiment_type', 'experiment_design', 'data_generation_process', 'data_analysis_process', 'identifiers', 'comments', 'references')[source]¶
-
attributes
= {'comments': <wc_lang.core.CommentAttribute object>, 'data_analysis_process': <obj_tables.core.ManyToOneAttribute object>, 'data_generation_process': <obj_tables.core.ManyToOneAttribute object>, 'env': <obj_tables.core.ManyToOneAttribute object>, 'experiment_design': <obj_tables.core.LongStringAttribute object>, 'experiment_type': <obj_tables.core.LongStringAttribute object>, 'genotype': <obj_tables.core.ManyToOneAttribute object>, 'id': <obj_tables.core.SlugAttribute object>, 'identifiers': <wc_lang.core.IdentifierManyToManyAttribute object>, 'model': <obj_tables.core.ManyToOneAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'references': <obj_tables.core.ManyToManyAttribute object>, 'std': <obj_tables.core.StringAttribute object>, 'type': <obj_tables.sci.onto.OntoTermAttribute object>, 'units': <obj_tables.sci.units.UnitAttribute object>, 'value': <obj_tables.core.StringAttribute object>}[source]¶
-
children
= {'core_model': ('genotype', 'env', 'data_generation_process', 'data_analysis_process', 'identifiers', 'references'), 'submodel': ('genotype', 'env', 'data_generation_process', 'data_analysis_process', 'identifiers', 'references')}[source]¶
-
local_attributes
= {'comments': <obj_tables.core.LocalAttribute object>, 'data_analysis_process': <obj_tables.core.LocalAttribute object>, 'data_generation_process': <obj_tables.core.LocalAttribute object>, 'env': <obj_tables.core.LocalAttribute object>, 'evidence': <obj_tables.core.LocalAttribute object>, 'experiment_design': <obj_tables.core.LocalAttribute object>, 'experiment_type': <obj_tables.core.LocalAttribute object>, 'genotype': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'model': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'observation_sets': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>, 'std': <obj_tables.core.LocalAttribute object>, 'type': <obj_tables.core.LocalAttribute object>, 'units': <obj_tables.core.LocalAttribute object>, 'value': <obj_tables.core.LocalAttribute object>}[source]¶
-
-
comments
= <wc_lang.core.CommentAttribute object>[source]
-
data_analysis_process
= <obj_tables.core.ManyToOneAttribute object>[source]
-
data_generation_process
= <obj_tables.core.ManyToOneAttribute object>[source]
-
env
= <obj_tables.core.ManyToOneAttribute object>[source]
-
experiment_design
= <obj_tables.core.LongStringAttribute object>[source]
-
experiment_type
= <obj_tables.core.LongStringAttribute object>[source]
-
genotype
= <obj_tables.core.ManyToOneAttribute object>[source]
-
id
= <obj_tables.core.SlugAttribute object>[source]
-
identifiers
= <wc_lang.core.IdentifierManyToManyAttribute object>[source]
-
model
= <obj_tables.core.ManyToOneAttribute object>[source]
-
name
= <obj_tables.core.StringAttribute object>[source]
-
references
= <obj_tables.core.ManyToManyAttribute object>[source]
-
std
= <obj_tables.core.StringAttribute object>[source]
-
type
= <obj_tables.sci.onto.OntoTermAttribute object>[source]
-
units
= <obj_tables.sci.units.UnitAttribute object>[source]
-
value
= <obj_tables.core.StringAttribute object>[source]
-
-
class
wc_lang.core.
ObservationEnv
(_comments=None, **kwargs)[source]¶ Bases:
obj_tables.core.Model
,wc_lang.sbml.util.SbmlModelMixin
Environment of an observation
Related attributes:
env_observations (
list
ofObservation
): observations
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
-
attributes
= {'condition': <obj_tables.core.LongStringAttribute object>, 'growth_media': <obj_tables.core.LongStringAttribute object>, 'ph': <obj_tables.core.FloatAttribute object>, 'ph_units': <obj_tables.sci.units.UnitAttribute object>, 'temp': <obj_tables.core.FloatAttribute object>, 'temp_units': <obj_tables.sci.units.UnitAttribute object>}[source]¶
-
local_attributes
= {'condition': <obj_tables.core.LocalAttribute object>, 'env_observations': <obj_tables.core.LocalAttribute object>, 'growth_media': <obj_tables.core.LocalAttribute object>, 'ph': <obj_tables.core.LocalAttribute object>, 'ph_units': <obj_tables.core.LocalAttribute object>, 'temp': <obj_tables.core.LocalAttribute object>, 'temp_units': <obj_tables.core.LocalAttribute object>}[source]¶
-
-
condition
= <obj_tables.core.LongStringAttribute object>[source]
-
growth_media
= <obj_tables.core.LongStringAttribute object>[source]
-
ph
= <obj_tables.core.FloatAttribute object>[source]
-
ph_units
= <obj_tables.sci.units.UnitAttribute object>[source]
-
temp
= <obj_tables.core.FloatAttribute object>[source]
-
temp_units
= <obj_tables.sci.units.UnitAttribute object>[source]
-
class
wc_lang.core.
ObservationGenotype
(_comments=None, **kwargs)[source]¶ Bases:
obj_tables.core.Model
,wc_lang.sbml.util.SbmlModelMixin
Genotype of an observation
Related attributes:
genotype_observations (
list
ofObservation
): observations
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
-
attributes
= {'taxon': <obj_tables.core.StringAttribute object>, 'variant': <obj_tables.core.StringAttribute object>}[source]¶
-
local_attributes
= {'genotype_observations': <obj_tables.core.LocalAttribute object>, 'taxon': <obj_tables.core.LocalAttribute object>, 'variant': <obj_tables.core.LocalAttribute object>}[source]¶
-
-
taxon
= <obj_tables.core.StringAttribute object>[source]
-
class
wc_lang.core.
ObservationSet
(_comments=None, **kwargs)[source]¶ Bases:
obj_tables.core.Model
,wc_lang.sbml.util.SbmlModelMixin
Set of co-observed observations
-
observations
[source]¶ observations
- Type
list
ofObservation
-
identifiers
[source]¶ identifiers
- Type
list
ofIdentifier
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
-
attributes
= {'comments': <wc_lang.core.CommentAttribute object>, 'id': <obj_tables.core.SlugAttribute object>, 'identifiers': <wc_lang.core.IdentifierManyToManyAttribute object>, 'model': <obj_tables.core.ManyToOneAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'observations': <obj_tables.core.ManyToManyAttribute object>, 'references': <obj_tables.core.ManyToManyAttribute object>}[source]¶
-
children
= {'core_model': ('observations', 'identifiers', 'references'), 'submodel': ('observations', 'identifiers', 'references')}[source]¶
-
local_attributes
= {'comments': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'model': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'observations': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>}[source]¶
-
-
comments
= <wc_lang.core.CommentAttribute object>[source]
-
id
= <obj_tables.core.SlugAttribute object>[source]
-
identifiers
= <wc_lang.core.IdentifierManyToManyAttribute object>[source]
-
model
= <obj_tables.core.ManyToOneAttribute object>[source]
-
name
= <obj_tables.core.StringAttribute object>[source]
-
observations
= <obj_tables.core.ManyToManyAttribute object>[source]
-
references
= <obj_tables.core.ManyToManyAttribute object>[source]
-
-
class
wc_lang.core.
Parameter
(_comments=None, **kwargs)[source]¶ Bases:
obj_tables.core.Model
,wc_lang.sbml.util.SbmlModelMixin
-
identifiers
[source]¶ identifiers
- Type
list
ofIdentifier
-
conclusions
[source]¶ conclusions
- Type
list
ofConclusion
Related attributes:
density_compartment (
Compartment
): compartments whose density is represented by the parameterobservable_expressions (
list
ofObservableExpression
): observable expressionsfunction_expressions (
list
ofFunctionExpression
): function expressionsrate_law_expressions (
list
ofRateLawExpression
): rate law expressionsstop_condition_expressions (
list
ofStopConditionExpression
): stop condition expressions
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
,obj_tables.math.expression.ExpressionStaticTermMeta
-
attribute_order
= ('id', 'name', 'type', 'value', 'std', 'units', 'identifiers', 'evidence', 'conclusions', 'comments', 'references')[source]¶
-
attributes
= {'comments': <wc_lang.core.CommentAttribute object>, 'conclusions': <obj_tables.core.ManyToManyAttribute object>, 'evidence': <wc_lang.core.EvidenceManyToManyAttribute object>, 'id': <obj_tables.core.SlugAttribute object>, 'identifiers': <wc_lang.core.IdentifierManyToManyAttribute object>, 'model': <obj_tables.core.ManyToOneAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'references': <obj_tables.core.ManyToManyAttribute object>, 'std': <obj_tables.core.FloatAttribute object>, 'type': <obj_tables.sci.onto.OntoTermAttribute object>, 'units': <obj_tables.sci.units.UnitAttribute object>, 'value': <obj_tables.core.FloatAttribute object>}[source]¶
-
child_attrs
= {'sbml': ('id', 'name', 'model', 'type', 'value', 'std', 'units', 'identifiers', 'comments'), 'wc_sim': ('id', 'model', 'type', 'value', 'std', 'units')}[source]¶
-
children
= {'core_model': ('identifiers', 'evidence', 'conclusions', 'references'), 'submodel': ('identifiers', 'evidence', 'conclusions', 'references')}[source]¶
-
local_attributes
= {'comments': <obj_tables.core.LocalAttribute object>, 'conclusions': <obj_tables.core.LocalAttribute object>, 'density_compartment': <obj_tables.core.LocalAttribute object>, 'evidence': <obj_tables.core.LocalAttribute object>, 'function_expressions': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'model': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'rate_law_expressions': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>, 'std': <obj_tables.core.LocalAttribute object>, 'stop_condition_expressions': <obj_tables.core.LocalAttribute object>, 'type': <obj_tables.core.LocalAttribute object>, 'units': <obj_tables.core.LocalAttribute object>, 'value': <obj_tables.core.LocalAttribute object>}[source]¶
-
-
comments
= <wc_lang.core.CommentAttribute object>[source]
-
conclusions
= <obj_tables.core.ManyToManyAttribute object>[source]
-
evidence
= <wc_lang.core.EvidenceManyToManyAttribute object>[source]
-
export_relations_to_sbml
(sbml_model, sbml)[source]¶ Add relationships to/from object to SBML parameter.
- Parameters
sbml_model (
libsbml.Model
) – SBML modelsbml (
libsbml.Parameter
) – SBML parameter
-
export_to_sbml
(sbml_model)[source]¶ Add this parameter to a SBML model.
- Parameters
sbml_model (
libsbml.Model
) – SBML model- Returns
SBML parameter
- Return type
libsbml.Parameter
-
id
= <obj_tables.core.SlugAttribute object>[source]
-
identifiers
= <wc_lang.core.IdentifierManyToManyAttribute object>[source]
-
import_from_sbml
(sbml)[source]¶ Load from SBML parameter
- Parameters
sbml (
libsbml.Parameter
) – SBML parameter
-
import_relations_from_sbml
(sbml, objs)[source]¶ Load relationships from SBML parameter
- Parameters
sbml (
libsbml.Parameter
) – SBML parameterobjs (
dict
) – dictionary that maps WC-Lang types to dictionaries that map the ids of WC-Lang objects to WC-Lang objects
-
model
= <obj_tables.core.ManyToOneAttribute object>[source]
-
name
= <obj_tables.core.StringAttribute object>[source]
-
references
= <obj_tables.core.ManyToManyAttribute object>[source]
-
std
= <obj_tables.core.FloatAttribute object>[source]
-
type
= <obj_tables.sci.onto.OntoTermAttribute object>[source]
-
units
= <obj_tables.sci.units.UnitAttribute object>[source]
-
value
= <obj_tables.core.FloatAttribute object>[source]
-
-
class
wc_lang.core.
Ph
(_comments=None, **kwargs)[source]¶ Bases:
obj_tables.core.Model
,wc_lang.sbml.util.SbmlModelMixin
pH of a compartment
Related attributes:
compartments (
list
ofCompartment
): compartment
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
-
attributes
= {'distribution': <obj_tables.sci.onto.OntoTermAttribute object>, 'mean': <obj_tables.core.FloatAttribute object>, 'std': <obj_tables.core.FloatAttribute object>, 'units': <obj_tables.sci.units.UnitAttribute object>}[source]¶
-
local_attributes
= {'compartments': <obj_tables.core.LocalAttribute object>, 'distribution': <obj_tables.core.LocalAttribute object>, 'mean': <obj_tables.core.LocalAttribute object>, 'std': <obj_tables.core.LocalAttribute object>, 'units': <obj_tables.core.LocalAttribute object>}[source]¶
-
-
distribution
= <obj_tables.sci.onto.OntoTermAttribute object>[source]
-
mean
= <obj_tables.core.FloatAttribute object>[source]
-
std
= <obj_tables.core.FloatAttribute object>[source]
-
units
= <obj_tables.sci.units.UnitAttribute object>[source]
-
class
wc_lang.core.
Process
(_comments=None, **kwargs)[source]¶ Bases:
obj_tables.core.Model
,wc_lang.sbml.util.SbmlModelMixin
A process of an observation or conclusion
Related attributes:
observation_analysis (
list
ofObservation
): observationobservation_measurement (
list
ofObservation
): observationconclusions (
list
ofConclusion
): conclusions
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
-
attributes
= {'name': <obj_tables.core.LongStringAttribute object>, 'version': <obj_tables.core.StringAttribute object>}[source]¶
-
local_attributes
= {'conclusions': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'observation_data_analysis': <obj_tables.core.LocalAttribute object>, 'observation_data_generation': <obj_tables.core.LocalAttribute object>, 'version': <obj_tables.core.LocalAttribute object>}[source]¶
-
-
name
= <obj_tables.core.LongStringAttribute object>[source]
-
version
= <obj_tables.core.StringAttribute object>[source]
-
class
wc_lang.core.
RateLaw
(_comments=None, **kwargs)[source]¶ Bases:
obj_tables.core.Model
,wc_lang.sbml.util.SbmlModelMixin
Rate law
-
identifiers
[source]¶ identifiers
- Type
list
ofIdentifier
-
conclusions
[source]¶ conclusions
- Type
list
ofConclusion
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
,obj_tables.math.expression.ExpressionExpressionTermMeta
-
attribute_order
= ('id', 'name', 'reaction', 'direction', 'type', 'expression', 'units', 'identifiers', 'evidence', 'conclusions', 'comments', 'references')[source]¶
-
attributes
= {'comments': <wc_lang.core.CommentAttribute object>, 'conclusions': <obj_tables.core.ManyToManyAttribute object>, 'direction': <obj_tables.core.EnumAttribute object>, 'evidence': <wc_lang.core.EvidenceManyToManyAttribute object>, 'expression': <obj_tables.math.expression.ManyToOneExpressionAttribute object>, 'id': <obj_tables.core.StringAttribute object>, 'identifiers': <wc_lang.core.IdentifierManyToManyAttribute object>, 'model': <obj_tables.core.ManyToOneAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'reaction': <obj_tables.core.ManyToOneAttribute object>, 'references': <obj_tables.core.ManyToManyAttribute object>, 'type': <obj_tables.sci.onto.OntoTermAttribute object>, 'units': <obj_tables.sci.units.UnitAttribute object>}[source]¶
-
child_attrs
= {'sbml': ('id', 'name', 'model', 'reaction', 'direction', 'type', 'expression', 'units', 'identifiers', 'comments'), 'wc_sim': ('id', 'model', 'reaction', 'direction', 'expression', 'units')}[source]¶
-
children
= {'core_model': ('expression', 'identifiers', 'evidence', 'conclusions', 'references'), 'submodel': ('expression', 'identifiers', 'evidence', 'conclusions', 'references')}[source]¶
-
expression_term_model
[source]¶ alias of
RateLawExpression
-
local_attributes
= {'comments': <obj_tables.core.LocalAttribute object>, 'conclusions': <obj_tables.core.LocalAttribute object>, 'direction': <obj_tables.core.LocalAttribute object>, 'evidence': <obj_tables.core.LocalAttribute object>, 'expression': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'model': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'reaction': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>, 'type': <obj_tables.core.LocalAttribute object>, 'units': <obj_tables.core.LocalAttribute object>}[source]¶
-
-
comments
= <wc_lang.core.CommentAttribute object>[source]
-
conclusions
= <obj_tables.core.ManyToManyAttribute object>[source]
-
direction
= <obj_tables.core.EnumAttribute object>[source]
-
evidence
= <wc_lang.core.EvidenceManyToManyAttribute object>[source]
-
export_relations_to_sbml
(sbml_model, sbml)[source]¶ Add relationships to/from object to SBML kinetic law.
- Parameters
sbml_model (
libsbml.Model
) – SBML modelsbml (
libsbml.KineticLaw
) – SBML kinetic law
-
export_to_sbml
(sbml_model)[source]¶ Add this rate law to a SBML reaction.
- Parameters
sbml_model (
libsbml.Model
) – SBML model- Returns
SBML kinetic law
- Return type
libsbml.KineticLaw
-
expression
= <obj_tables.math.expression.ManyToOneExpressionAttribute object>[source]
-
id
= <obj_tables.core.StringAttribute object>[source]
-
identifiers
= <wc_lang.core.IdentifierManyToManyAttribute object>[source]
-
import_from_sbml
(sbml)[source]¶ Load from SBML kinetic law
- Parameters
sbml (
libsbml.KineticLaw
) – SBML kinetic law
-
import_relations_from_sbml
(sbml, objs)[source]¶ Load relationships from SBML kinetic law
- Parameters
sbml (
libsbml.KineticLaw
) – SBML kinetic lawobjs (
dict
) – dictionary that maps WC-Lang types to dictionaries that map the ids of WC-Lang objects to WC-Lang objects
-
model
= <obj_tables.core.ManyToOneAttribute object>[source]
-
name
= <obj_tables.core.StringAttribute object>[source]
-
reaction
= <obj_tables.core.ManyToOneAttribute object>[source]
-
references
= <obj_tables.core.ManyToManyAttribute object>[source]
-
type
= <obj_tables.sci.onto.OntoTermAttribute object>[source]
-
units
= <obj_tables.sci.units.UnitAttribute object>[source]
-
-
class
wc_lang.core.
RateLawDirection
[source]¶ Bases:
int
,wc_utils.util.enumerate.CaseInsensitiveEnum
Rate law directions
-
class
wc_lang.core.
RateLawExpression
(_comments=None, **kwargs)[source]¶ Bases:
obj_tables.core.Model
,obj_tables.math.expression.Expression
,wc_lang.sbml.util.SbmlModelMixin
A mathematical expression of Parameters, Species, Observables, Functions, Compartments and Python functions
The expression used by a
RateLaw
.-
compartments
[source]¶ Compartments used by this rate law expression
- Type
list
ofCompartment
Related attributes:
rate_law (
RateLaw
): the RateLaw which uses this RateLawExpression
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
,obj_tables.math.expression.Meta
-
attributes
= {'compartments': <obj_tables.core.ManyToManyAttribute object>, 'expression': <obj_tables.core.LongStringAttribute object>, 'functions': <obj_tables.core.ManyToManyAttribute object>, 'observables': <obj_tables.core.ManyToManyAttribute object>, 'parameters': <obj_tables.core.ManyToManyAttribute object>, 'species': <obj_tables.core.ManyToManyAttribute object>}[source]¶
-
child_attrs
= {'sbml': ('expression', 'parameters', 'species', 'observables', 'functions', 'compartments'), 'wc_sim': ('expression', 'parameters', 'species', 'observables', 'functions', 'compartments')}[source]¶
-
children
= {'core_model': ('parameters', 'species', 'observables', 'functions', 'compartments'), 'submodel': ('parameters', 'species', 'observables', 'functions', 'compartments')}[source]¶
-
local_attributes
= {'compartments': <obj_tables.core.LocalAttribute object>, 'expression': <obj_tables.core.LocalAttribute object>, 'functions': <obj_tables.core.LocalAttribute object>, 'observables': <obj_tables.core.LocalAttribute object>, 'parameters': <obj_tables.core.LocalAttribute object>, 'rate_laws': <obj_tables.core.LocalAttribute object>, 'species': <obj_tables.core.LocalAttribute object>}[source]¶
-
-
compartments
= <obj_tables.core.ManyToManyAttribute object>[source]
-
classmethod
deserialize
(value, objects)[source]¶ Deserialize value
- Parameters
value (
str
) – String representationobjects (
dict
) – dictionary of objects, grouped by model
- Returns
- tuple of cleaned value
and cleaning error
- Return type
tuple
ofRateLawExpression
, InvalidAttribute or None
-
expression
= <obj_tables.core.LongStringAttribute object>[source]
-
merge_attrs
(other, other_objs_in_self, self_objs_in_other)[source]¶ Merge attributes of two objects
- Parameters
other (
obj_tables.Model
) – other modelother_objs_in_self (
dict
) – dictionary that maps instances of objects in another model to objects in a modelself_objs_in_other (
dict
) – dictionary that maps instances of objects in a model to objects in another model
-
parameters
= <obj_tables.core.ManyToManyAttribute object>[source]
-
serialize
()[source]¶ Generate string representation
- Returns
value of primary attribute
- Return type
str
-
species
= <obj_tables.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
(_comments=None, **kwargs)[source]¶ Bases:
obj_tables.core.Model
,wc_lang.sbml.util.SbmlModelMixin
-
participants
[source]¶ participants
- Type
list
ofSpeciesCoefficient
-
identifiers
[source]¶ identifiers
- Type
list
ofIdentifier
-
conclusions
[source]¶ conclusions
- Type
list
ofConclusion
Related attributes:
rate_laws (
list
ofRateLaw
): rate laws; if two rate laws are present, rate_laws[1] is the forward rate law, and rate_laws[0] is the backward rate lawdfba_obj_expression (
DfbaObjectiveExpression
): dFBA objective expression
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
,obj_tables.math.expression.ExpressionDynamicTermMeta
-
attribute_order
= ('id', 'name', 'submodel', 'participants', 'reversible', 'rate_units', 'flux_bounds', 'identifiers', 'evidence', 'conclusions', 'comments', 'references')[source]¶
-
attributes
= {'comments': <wc_lang.core.CommentAttribute object>, 'conclusions': <obj_tables.core.ManyToManyAttribute object>, 'evidence': <wc_lang.core.EvidenceManyToManyAttribute object>, 'flux_bounds': <obj_tables.core.ManyToOneAttribute object>, 'id': <obj_tables.core.SlugAttribute object>, 'identifiers': <wc_lang.core.IdentifierManyToManyAttribute object>, 'model': <obj_tables.core.ManyToOneAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'participants': <wc_lang.core.ReactionParticipantAttribute object>, 'rate_units': <obj_tables.sci.units.UnitAttribute object>, 'references': <obj_tables.core.ManyToManyAttribute object>, 'reversible': <obj_tables.core.BooleanAttribute object>, 'submodel': <obj_tables.core.ManyToOneAttribute object>}[source]¶
-
child_attrs
= {'sbml': ('id', 'name', 'model', 'submodel', 'participants', 'reversible', 'rate_units', 'flux_bounds', 'identifiers', 'comments'), 'wc_sim': ('id', 'model', 'submodel', 'participants', 'reversible', 'rate_units', 'flux_bounds')}[source]¶
-
children
= {'core_model': ('participants', 'rate_laws', 'flux_bounds', 'identifiers', 'evidence', 'conclusions', 'references'), 'submodel': ('participants', 'rate_laws', 'flux_bounds', 'identifiers', 'evidence', 'conclusions', 'references')}[source]¶
-
local_attributes
= {'comments': <obj_tables.core.LocalAttribute object>, 'conclusions': <obj_tables.core.LocalAttribute object>, 'dfba_obj_expression': <obj_tables.core.LocalAttribute object>, 'evidence': <obj_tables.core.LocalAttribute object>, 'flux_bounds': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'model': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'participants': <obj_tables.core.LocalAttribute object>, 'rate_laws': <obj_tables.core.LocalAttribute object>, 'rate_units': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>, 'reversible': <obj_tables.core.LocalAttribute object>, 'submodel': <obj_tables.core.LocalAttribute object>}[source]¶
-
-
comments
= <wc_lang.core.CommentAttribute object>[source]
-
conclusions
= <obj_tables.core.ManyToManyAttribute object>[source]
-
evidence
= <wc_lang.core.EvidenceManyToManyAttribute object>[source]
-
export_relations_to_sbml
(sbml_model, sbml_rxn)[source]¶ Add relationships to/from object to SBML reaction.
- Parameters
sbml_model (
libsbml.Model
) – SBML modelsbml_rxn (
libsbml.Reaction
) – SBML reaction
-
export_to_sbml
(sbml_model)[source]¶ Add this reaction to a SBML model.
- Parameters
sbml_model (
libsbml.Model
) – SBML model- Returns
SBML reaction
- Return type
libsbml.Reaction
- Raises
ValueError – if the reaction has a backward rate law which cannot be exported to SBML
-
flux_bounds
= <obj_tables.core.ManyToOneAttribute object>[source]
-
get_modifiers
(direction=<RateLawDirection.forward: 1>)[source]¶ Get species in the expression that are not reactants in the reaction
- Returns
species in the expression that are not reactants in the reaction
- Return type
list
ofSpecies
-
get_products
()[source]¶ Get the species produced by the reaction
- Returns
product species
- Return type
list
ofSpecies
-
get_reactants
()[source]¶ Get the species consumed by the reaction
- Returns
reactant species
- Return type
list
ofSpecies
-
get_species
(_Reaction__type=None, **kwargs)[source]¶ Get species
- Parameters
__type (
types.TypeType
ortuple
oftypes.TypeType
) – subclass(es) ofModel
kwargs (
dict
ofstr
–>object
) – dictionary of attribute name/value pairs to find matching objects
- Returns
list of Species
- Return type
list
-
id
= <obj_tables.core.SlugAttribute object>[source]
-
identifiers
= <wc_lang.core.IdentifierManyToManyAttribute object>[source]
-
import_from_sbml
(sbml_rxn)[source]¶ Load from SBML reaction
- Parameters
sbml (
libsbml.Reaction
) – SBML reaction
-
import_relations_from_sbml
(sbml_rxn, objs)[source]¶ Load relationships from SBML reaction
- Parameters
sbml (
libsbml.Reaction
) – SBML reactionobjs (
dict
) – dictionary that maps WC-Lang types to dictionaries that map the ids of WC-Lang objects to WC-Lang objects
-
model
= <obj_tables.core.ManyToOneAttribute object>[source]
-
name
= <obj_tables.core.StringAttribute object>[source]
-
participants
= <wc_lang.core.ReactionParticipantAttribute object>[source]
-
rate_units
= <obj_tables.sci.units.UnitAttribute object>[source]
-
references
= <obj_tables.core.ManyToManyAttribute object>[source]
-
reversible
= <obj_tables.core.BooleanAttribute object>[source]
-
submodel
= <obj_tables.core.ManyToOneAttribute object>[source]
-
validate
()[source]¶ Check if the reaction is valid
If the submodel is ODE or SSA, check that the reaction has a forward rate law
If the submodel is ODE or SSA and the reaction is reversible, check that the reaction has a backward rate law
Check flux units are not None if flux_bounds.min or flux_bounds.max is defined
Check that flux_bounds.min <= flux_bounds.max
Check that reaction is element and charge balanced
- Returns
- None if the object is valid,
otherwise return a list of errors in an InvalidObject instance
- Return type
InvalidObject
or None
-
-
class
wc_lang.core.
ReactionParticipantAttribute
(related_name='', verbose_name='', verbose_related_name='', description='')[source]¶ Bases:
obj_tables.grammar.ToManyGrammarAttribute
,obj_tables.core.ManyToManyAttribute
Reaction participants
-
class
Transformer
(objects)[source]¶ Bases:
obj_tables.grammar.ToManyGrammarTransformer
Transforms parse trees into a list of instances of
core.Model
-
get_xlsx_validation
(sheet_models=None, doc_metadata_model=None)[source]¶ Get Excel validation
- Parameters
sheet_models (
list
ofModel
, optional) – models encoded as separate sheetsdoc_metadata_model (
type
) – model whose worksheet contains the document metadata
- Returns
validation
- Return type
wc_utils.workbook.io.FieldValidation
-
serialize
(participants, encoded=None)[source]¶ Serialize related object
- Parameters
participants (
list
ofSpeciesCoefficient
) – Python representation of reaction participantsencoded (
dict
, optional) – dictionary of objects that have already been encoded
- Returns
simple Python representation
- Return type
str
-
validate
(obj, value, tolerance=1e-10)[source]¶ Determine if value is a valid value of the attribute
- Parameters
obj (
Reaction
) – object being validatedvalue (
list
ofSpeciesCoefficient
) – value of attribute to validatetolerance (
float
, optional) – error tolerance value, default value is 1E-10
- Returns
None if attribute is valid, other return list of errors as an instance of InvalidAttribute
- Return type
InvalidAttribute
or None
-
class
-
class
wc_lang.core.
Reference
(_comments=None, **kwargs)[source]¶ Bases:
obj_tables.core.Model
author(s)
- Type
str
-
identifiers
[source]¶ identifiers
- Type
list
ofIdentifier
Related attributes:
taxon (
Taxon
): taxonenv (
Environment
): environmentsubmodels (
list
ofSubmodel
): submodelscompartments (
list
ofCompartment
): compartmentsspecies_types (
list
ofSpeciesType
): species typesspecies (
list
ofSpecies
): speciesdistribution_init_concentrations (
list
ofDistributionInitConcentration
): distributions of initial concentrations of species at the beginning of each cell cycleobservables (
list
ofObservable
): observablesfunctions (
list
ofFunction
): functionsreactions (
list
ofReaction
): reactionsrate_laws (
list
ofRateLaw
): rate lawsdfba_objs (
list
ofDfbaObjective
): dFBA objectivesdfba_obj_species (
list
ofDfbaObjSpecies
): dFBA objective speciesstop_conditions (
list
ofStopCondition
): stop conditionsparameters (
list
ofParameter
): parameterschanges (
list
ofChange
): changes
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
-
attribute_order
= ('id', 'name', 'title', 'author', 'editor', 'year', 'type', 'publication', 'publisher', 'series', 'volume', 'number', 'issue', 'edition', 'chapter', 'pages', 'identifiers', 'comments')[source]¶
-
attributes
= {'author': <obj_tables.core.StringAttribute object>, 'chapter': <obj_tables.core.StringAttribute object>, 'comments': <wc_lang.core.CommentAttribute object>, 'edition': <obj_tables.core.StringAttribute object>, 'editor': <obj_tables.core.StringAttribute object>, 'id': <obj_tables.core.SlugAttribute object>, 'identifiers': <wc_lang.core.IdentifierManyToManyAttribute object>, 'issue': <obj_tables.core.StringAttribute object>, 'model': <obj_tables.core.ManyToOneAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'number': <obj_tables.core.StringAttribute object>, 'pages': <obj_tables.core.StringAttribute object>, 'publication': <obj_tables.core.StringAttribute object>, 'publisher': <obj_tables.core.StringAttribute object>, 'series': <obj_tables.core.StringAttribute object>, 'title': <obj_tables.core.StringAttribute object>, 'type': <obj_tables.sci.onto.OntoTermAttribute object>, 'volume': <obj_tables.core.StringAttribute object>, 'year': <obj_tables.core.PositiveIntegerAttribute object>}[source]¶
-
local_attributes
= {'author': <obj_tables.core.LocalAttribute object>, 'changes': <obj_tables.core.LocalAttribute object>, 'chapter': <obj_tables.core.LocalAttribute object>, 'comments': <obj_tables.core.LocalAttribute object>, 'compartments': <obj_tables.core.LocalAttribute object>, 'conclusions': <obj_tables.core.LocalAttribute object>, 'dfba_obj_reactions': <obj_tables.core.LocalAttribute object>, 'dfba_obj_species': <obj_tables.core.LocalAttribute object>, 'dfba_objs': <obj_tables.core.LocalAttribute object>, 'distribution_init_concentrations': <obj_tables.core.LocalAttribute object>, 'edition': <obj_tables.core.LocalAttribute object>, 'editor': <obj_tables.core.LocalAttribute object>, 'env': <obj_tables.core.LocalAttribute object>, 'functions': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'issue': <obj_tables.core.LocalAttribute object>, 'model': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'number': <obj_tables.core.LocalAttribute object>, 'observables': <obj_tables.core.LocalAttribute object>, 'observation_sets': <obj_tables.core.LocalAttribute object>, 'observations': <obj_tables.core.LocalAttribute object>, 'pages': <obj_tables.core.LocalAttribute object>, 'parameters': <obj_tables.core.LocalAttribute object>, 'publication': <obj_tables.core.LocalAttribute object>, 'publisher': <obj_tables.core.LocalAttribute object>, 'rate_laws': <obj_tables.core.LocalAttribute object>, 'reactions': <obj_tables.core.LocalAttribute object>, 'series': <obj_tables.core.LocalAttribute object>, 'species': <obj_tables.core.LocalAttribute object>, 'species_types': <obj_tables.core.LocalAttribute object>, 'stop_conditions': <obj_tables.core.LocalAttribute object>, 'submodels': <obj_tables.core.LocalAttribute object>, 'taxon': <obj_tables.core.LocalAttribute object>, 'title': <obj_tables.core.LocalAttribute object>, 'type': <obj_tables.core.LocalAttribute object>, 'volume': <obj_tables.core.LocalAttribute object>, 'year': <obj_tables.core.LocalAttribute object>}[source]¶
-
-
author
= <obj_tables.core.StringAttribute object>[source]
-
chapter
= <obj_tables.core.StringAttribute object>[source]
-
comments
= <wc_lang.core.CommentAttribute object>[source]
-
edition
= <obj_tables.core.StringAttribute object>[source]
-
editor
= <obj_tables.core.StringAttribute object>[source]
-
id
= <obj_tables.core.SlugAttribute object>[source]
-
identifiers
= <wc_lang.core.IdentifierManyToManyAttribute object>[source]
-
issue
= <obj_tables.core.StringAttribute object>[source]
-
model
= <obj_tables.core.ManyToOneAttribute object>[source]
-
name
= <obj_tables.core.StringAttribute object>[source]
-
number
= <obj_tables.core.StringAttribute object>[source]
-
pages
= <obj_tables.core.StringAttribute object>[source]
-
publication
= <obj_tables.core.StringAttribute object>[source]
-
publisher
= <obj_tables.core.StringAttribute object>[source]
-
series
= <obj_tables.core.StringAttribute object>[source]
-
title
= <obj_tables.core.StringAttribute object>[source]
-
type
= <obj_tables.sci.onto.OntoTermAttribute object>[source]
-
volume
= <obj_tables.core.StringAttribute object>[source]
-
year
= <obj_tables.core.PositiveIntegerAttribute object>[source]
-
class
wc_lang.core.
Species
(tuple of species type, compartment)[source]¶ Bases:
obj_tables.core.Model
,wc_lang.sbml.util.SbmlModelMixin
-
identifiers
[source]¶ identifiers
- Type
list
ofIdentifier
-
conclusions
[source]¶ conclusions
- Type
list
ofConclusion
Related attributes:
distribution_init_concentration (
DistributionInitConcentration
): distribution of initial concentrationspecies_coefficients (
list
ofSpeciesCoefficient
): participations in reactions and observablesrate_law_expressions (
list
ofRateLawExpression
): rate law expressionsobservable_expressions (
list
ofObservableExpression
): observable expressionsstop_condition_expressions (
list
ofStopConditionExpression
): stop condition expressionsfunction_expressions (
list
ofFunctionExpression
): function expressionsdfba_obj_species (
list
ofDfbaObjSpecies
): dFBA objective species
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
,obj_tables.math.expression.ExpressionDynamicTermMeta
-
attribute_order
= ('id', 'name', 'species_type', 'compartment', 'units', 'identifiers', 'evidence', 'conclusions', 'comments', 'references')[source]¶
-
attributes
= {'comments': <wc_lang.core.CommentAttribute object>, 'compartment': <obj_tables.core.ManyToOneAttribute object>, 'conclusions': <obj_tables.core.ManyToManyAttribute object>, 'evidence': <wc_lang.core.EvidenceManyToManyAttribute object>, 'id': <obj_tables.core.StringAttribute object>, 'identifiers': <wc_lang.core.IdentifierManyToManyAttribute object>, 'model': <obj_tables.core.ManyToOneAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'references': <obj_tables.core.ManyToManyAttribute object>, 'species_type': <obj_tables.core.ManyToOneAttribute object>, 'units': <obj_tables.sci.units.UnitAttribute object>}[source]¶
-
child_attrs
= {'sbml': ('id', 'name', 'model', 'species_type', 'compartment', 'units', 'identifiers', 'comments'), 'wc_sim': ('id', 'model', 'species_type', 'compartment', 'units')}[source]¶
-
children
= {'core_model': ('species_type', 'compartment', 'distribution_init_concentration', 'identifiers', 'evidence', 'conclusions', 'references'), 'submodel': ('species_type', 'compartment', 'distribution_init_concentration', 'identifiers', 'evidence', 'conclusions', 'references')}[source]¶
-
local_attributes
= {'comments': <obj_tables.core.LocalAttribute object>, 'compartment': <obj_tables.core.LocalAttribute object>, 'conclusions': <obj_tables.core.LocalAttribute object>, 'dfba_obj_species': <obj_tables.core.LocalAttribute object>, 'distribution_init_concentration': <obj_tables.core.LocalAttribute object>, 'evidence': <obj_tables.core.LocalAttribute object>, 'function_expressions': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'model': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'observable_expressions': <obj_tables.core.LocalAttribute object>, 'rate_law_expressions': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>, 'species_coefficients': <obj_tables.core.LocalAttribute object>, 'species_type': <obj_tables.core.LocalAttribute object>, 'stop_condition_expressions': <obj_tables.core.LocalAttribute object>, 'units': <obj_tables.core.LocalAttribute object>}[source]¶
-
-
comments
= <wc_lang.core.CommentAttribute object>[source]
-
compartment
= <obj_tables.core.ManyToOneAttribute object>[source]
-
conclusions
= <obj_tables.core.ManyToManyAttribute object>[source]
-
evidence
= <wc_lang.core.EvidenceManyToManyAttribute object>[source]
-
export_relations_to_sbml
(sbml_model, sbml)[source]¶ Add relationships to/from object to SBML species.
- Parameters
sbml_model (
libsbml.Model
) – SBML modelsbml (
libsbml.Species
) – SBML species
-
export_to_sbml
(sbml_model)[source]¶ Add this species to a SBML model.
- Parameters
sbml_model (
libsbml.Model
) – SBML model- Returns
SBML species
- Return type
libsbml.Species
-
static
get
(ids, species_iterator)[source]¶ Find some Species instances
- Parameters
ids (
Iterator
of str) – an iterator over some species identifiersspecies_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
ofSpecies
or None
-
id
= <obj_tables.core.StringAttribute object>[source]
-
identifiers
= <wc_lang.core.IdentifierManyToManyAttribute object>[source]
-
import_from_sbml
(sbml)[source]¶ Load from SBML species
- Parameters
sbml (
libsbml.Species
) – SBML species
-
import_relations_from_sbml
(sbml, objs)[source]¶ Load relationships from SBML species
- Parameters
sbml (
libsbml.Species
) – SBML speciesobjs (
dict
) – dictionary that maps WC-Lang types to dictionaries that map the ids of WC-Lang objects to WC-Lang objects
-
model
= <obj_tables.core.ManyToOneAttribute object>[source]
-
name
= <obj_tables.core.StringAttribute object>[source]
-
classmethod
parse_id
(id)[source]¶ - Parameters
id (
str
) – identifier- Returns
species type id
str
: compartment id- Return type
str
- Raises
ValueError – if the id does not have the format {species.id}[{compartment.id}]
-
references
= <obj_tables.core.ManyToManyAttribute object>[source]
-
species_type
= <obj_tables.core.ManyToOneAttribute object>[source]
-
units
= <obj_tables.sci.units.UnitAttribute object>[source]
-
-
class
wc_lang.core.
SpeciesCoefficient
(_comments=None, **kwargs)[source]¶ Bases:
obj_tables.core.Model
,wc_lang.sbml.util.SbmlModelMixin
A tuple of a species and a coefficient
Related attributes:
reaction (
Reaction
): reactionobservables (
Observable
): observables
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
-
attributes
= {'coefficient': <obj_tables.core.FloatAttribute object>, 'species': <obj_tables.core.ManyToOneAttribute object>}[source]¶
-
local_attributes
= {'coefficient': <obj_tables.core.LocalAttribute object>, 'reactions': <obj_tables.core.LocalAttribute object>, 'species': <obj_tables.core.LocalAttribute object>}[source]¶
-
-
coefficient
= <obj_tables.core.FloatAttribute object>[source]
-
serialize
(show_compartment=True, show_coefficient_sign=True)[source]¶ Serialize related object
- Parameters
show_compartment (
bool
, optional) – if true, show compartmentshow_coefficient_sign (
bool
, optional) – if true, show coefficient sign
- Returns
simple Python representation
- Return type
str
-
species
= <obj_tables.core.ManyToOneAttribute object>[source]
-
class
wc_lang.core.
SpeciesType
(_comments=None, **kwargs)[source]¶ Bases:
obj_tables.core.Model
,wc_lang.sbml.util.SbmlModelMixin
Species type
-
identifiers
[source]¶ identifiers
- Type
list
ofIdentifier
-
conclusions
[source]¶ conclusions
- Type
list
ofConclusion
Related attributes:
species (
list
ofSpecies
): species
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
-
attribute_order
= ('id', 'name', 'structure', 'type', 'identifiers', 'evidence', 'conclusions', 'comments', 'references')[source]¶
-
attributes
= {'comments': <wc_lang.core.CommentAttribute object>, 'conclusions': <obj_tables.core.ManyToManyAttribute object>, 'evidence': <wc_lang.core.EvidenceManyToManyAttribute object>, 'id': <obj_tables.core.SlugAttribute object>, 'identifiers': <wc_lang.core.IdentifierManyToManyAttribute object>, 'model': <obj_tables.core.ManyToOneAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'references': <obj_tables.core.ManyToManyAttribute object>, 'structure': <obj_tables.core.ManyToOneAttribute object>, 'type': <obj_tables.sci.onto.OntoTermAttribute object>}[source]¶
-
child_attrs
= {'sbml': ('id', 'name', 'model', 'structure', 'type', 'identifiers', 'comments'), 'wc_sim': ('id', 'model', 'structure')}[source]¶
-
children
= {'core_model': ('structure', 'species', 'identifiers', 'evidence', 'conclusions', 'references'), 'submodel': ('structure', 'identifiers', 'evidence', 'conclusions', 'references')}[source]¶
-
local_attributes
= {'comments': <obj_tables.core.LocalAttribute object>, 'conclusions': <obj_tables.core.LocalAttribute object>, 'evidence': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'model': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>, 'species': <obj_tables.core.LocalAttribute object>, 'structure': <obj_tables.core.LocalAttribute object>, 'type': <obj_tables.core.LocalAttribute object>}[source]¶
-
-
comments
= <wc_lang.core.CommentAttribute object>[source]
-
conclusions
= <obj_tables.core.ManyToManyAttribute object>[source]
-
evidence
= <wc_lang.core.EvidenceManyToManyAttribute object>[source]
-
id
= <obj_tables.core.SlugAttribute object>[source]
-
identifiers
= <wc_lang.core.IdentifierManyToManyAttribute object>[source]
-
model
= <obj_tables.core.ManyToOneAttribute object>[source]
-
name
= <obj_tables.core.StringAttribute object>[source]
-
references
= <obj_tables.core.ManyToManyAttribute object>[source]
-
structure
= <obj_tables.core.ManyToOneAttribute object>[source]
-
type
= <obj_tables.sci.onto.OntoTermAttribute object>[source]
-
-
class
wc_lang.core.
StopCondition
(_comments=None, **kwargs)[source]¶ Bases:
obj_tables.core.Model
StopCondition: Simulation of a model terminates when one of its stop conditions is true.
A Boolean expression of Functions, Observbles, Parameters and Python functions. Stop conditions are optional.
-
identifiers
[source]¶ identifiers
- Type
list
ofIdentifier
-
conclusions
[source]¶ conclusions
- Type
list
ofConclusion
Related attributes:
expressions (
Expressions
): expressions
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
,obj_tables.math.expression.ExpressionExpressionTermMeta
-
attribute_order
= ('id', 'name', 'expression', 'units', 'identifiers', 'evidence', 'conclusions', 'comments', 'references')[source]¶
-
attributes
= {'comments': <wc_lang.core.CommentAttribute object>, 'conclusions': <obj_tables.core.ManyToManyAttribute object>, 'evidence': <wc_lang.core.EvidenceManyToManyAttribute object>, 'expression': <obj_tables.math.expression.OneToOneExpressionAttribute object>, 'id': <obj_tables.core.SlugAttribute object>, 'identifiers': <wc_lang.core.IdentifierManyToManyAttribute object>, 'model': <obj_tables.core.ManyToOneAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'references': <obj_tables.core.ManyToManyAttribute object>, 'units': <obj_tables.sci.units.UnitAttribute object>}[source]¶
-
children
= {'core_model': ('expression', 'identifiers', 'evidence', 'conclusions', 'references'), 'submodel': ('expression', 'identifiers', 'evidence', 'conclusions', 'references')}[source]¶
-
expression_term_model
[source]¶ alias of
StopConditionExpression
-
local_attributes
= {'comments': <obj_tables.core.LocalAttribute object>, 'conclusions': <obj_tables.core.LocalAttribute object>, 'evidence': <obj_tables.core.LocalAttribute object>, 'expression': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'model': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>, 'units': <obj_tables.core.LocalAttribute object>}[source]¶
-
-
comments
= <wc_lang.core.CommentAttribute object>[source]
-
conclusions
= <obj_tables.core.ManyToManyAttribute object>[source]
-
evidence
= <wc_lang.core.EvidenceManyToManyAttribute object>[source]
-
expression
= <obj_tables.math.expression.OneToOneExpressionAttribute object>[source]
-
id
= <obj_tables.core.SlugAttribute object>[source]
-
identifiers
= <wc_lang.core.IdentifierManyToManyAttribute object>[source]
-
model
= <obj_tables.core.ManyToOneAttribute object>[source]
-
name
= <obj_tables.core.StringAttribute object>[source]
-
references
= <obj_tables.core.ManyToManyAttribute object>[source]
-
units
= <obj_tables.sci.units.UnitAttribute object>[source]
-
-
class
wc_lang.core.
StopConditionExpression
(_comments=None, **kwargs)[source]¶ Bases:
obj_tables.core.Model
,obj_tables.math.expression.Expression
A mathematical expression of Functions, Observables, Parameters and Python functions
The expression used by a
StopCondition
.-
observables
[source]¶ Observables used by this stop condition expression
- Type
list
ofObservable
-
compartments
[source]¶ Compartments used by this stop condition expression
- Type
list
ofCompartment
Related attributes:
stop_condition (
StopCondition
): stop condition
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
,obj_tables.math.expression.Meta
-
attributes
= {'compartments': <obj_tables.core.ManyToManyAttribute object>, 'expression': <obj_tables.core.LongStringAttribute object>, 'functions': <obj_tables.core.ManyToManyAttribute object>, 'observables': <obj_tables.core.ManyToManyAttribute object>, 'parameters': <obj_tables.core.ManyToManyAttribute object>, 'species': <obj_tables.core.ManyToManyAttribute object>}[source]¶
-
child_attrs
= {'sbml': (), 'wc_sim': ('expression', 'parameters', 'species', 'observables', 'functions', 'compartments')}[source]¶
-
children
= {'core_model': ('parameters', 'species', 'observables', 'functions', 'compartments'), 'submodel': ('parameters', 'species', 'observables', 'functions', 'compartments')}[source]¶
-
local_attributes
= {'compartments': <obj_tables.core.LocalAttribute object>, 'expression': <obj_tables.core.LocalAttribute object>, 'functions': <obj_tables.core.LocalAttribute object>, 'observables': <obj_tables.core.LocalAttribute object>, 'parameters': <obj_tables.core.LocalAttribute object>, 'species': <obj_tables.core.LocalAttribute object>, 'stop_condition': <obj_tables.core.LocalAttribute object>}[source]¶
-
-
compartments
= <obj_tables.core.ManyToManyAttribute object>[source]
-
classmethod
deserialize
(value, objects)[source]¶ Deserialize value
- Parameters
value (
str
) – String representationobjects (
dict
) – dictionary of objects, grouped by model
- Returns
- tuple of
cleaned value and cleaning error
- Return type
tuple
ofStopConditionExpression
, InvalidAttribute or None
-
expression
= <obj_tables.core.LongStringAttribute object>[source]
-
functions
= <obj_tables.core.ManyToManyAttribute object>[source]
-
merge_attrs
(other, other_objs_in_self, self_objs_in_other)[source]¶ Merge attributes of two objects
- Parameters
other (
obj_tables.Model
) – other modelother_objs_in_self (
dict
) – dictionary that maps instances of objects in another model to objects in a modelself_objs_in_other (
dict
) – dictionary that maps instances of objects in a model to objects in another model
-
observables
= <obj_tables.core.ManyToManyAttribute object>[source]
-
parameters
= <obj_tables.core.ManyToManyAttribute object>[source]
-
species
= <obj_tables.core.ManyToManyAttribute object>[source]
-
-
class
wc_lang.core.
Submodel
(_comments=None, **kwargs)[source]¶ Bases:
obj_tables.core.Model
,wc_lang.sbml.util.SbmlModelMixin
-
identifiers
[source]¶ identifiers
- Type
list
ofIdentifier
-
conclusions
[source]¶ conclusions
- Type
list
ofConclusion
Related attributes:
reactions (
list
ofReaction
): reactionsdfba_obj (
DfbaObjective
): objective function for a dFBA submodel; if not initialized, then dfba_obj_reactions is used as the objective functiondfba_obj_reactions (
list
ofDfbaObjReaction
): the growth reaction for a dFBA submodelchanges (
list
ofChange
): changes
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
-
attribute_order
= ('id', 'name', 'framework', 'identifiers', 'evidence', 'conclusions', 'comments', 'references')[source]¶
-
attributes
= {'comments': <wc_lang.core.CommentAttribute object>, 'conclusions': <obj_tables.core.ManyToManyAttribute object>, 'evidence': <wc_lang.core.EvidenceManyToManyAttribute object>, 'framework': <obj_tables.sci.onto.OntoTermAttribute object>, 'id': <obj_tables.core.SlugAttribute object>, 'identifiers': <wc_lang.core.IdentifierManyToManyAttribute object>, 'model': <obj_tables.core.ManyToOneAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'references': <obj_tables.core.ManyToManyAttribute object>}[source]¶
-
child_attrs
= {'sbml': ('id', 'name', 'model', 'framework', 'identifiers', 'comments'), 'wc_sim': ('id', 'model', 'framework')}[source]¶
-
children
= {'submodel': ('model', 'reactions', 'dfba_obj', 'dfba_obj_reactions', 'identifiers', 'evidence', 'conclusions', 'references', 'changes')}[source]¶
-
local_attributes
= {'changes': <obj_tables.core.LocalAttribute object>, 'comments': <obj_tables.core.LocalAttribute object>, 'conclusions': <obj_tables.core.LocalAttribute object>, 'dfba_obj': <obj_tables.core.LocalAttribute object>, 'dfba_obj_reactions': <obj_tables.core.LocalAttribute object>, 'evidence': <obj_tables.core.LocalAttribute object>, 'framework': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'model': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'reactions': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>}[source]¶
-
-
comments
= <wc_lang.core.CommentAttribute object>[source]
-
conclusions
= <obj_tables.core.ManyToManyAttribute object>[source]
-
evidence
= <wc_lang.core.EvidenceManyToManyAttribute object>[source]
-
export_relations_to_sbml
(sbml_model, sbml)[source]¶ Add relationships to/from object to SBML model.
- Parameters
sbml_model (
libsbml.Model
) – SBML modelsbml (
libsbml.Model
) – SBML model
-
export_to_sbml
(sbml_model)[source]¶ Add metadata about the submodel to a SBML model.
- Parameters
sbml_model (
libsbml.Model
) – SBML model- Returns
SBML model
- Return type
libsbml.Model
-
framework
= <obj_tables.sci.onto.OntoTermAttribute 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
isNone
, 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
ortuple
oftypes.TypeType
) – subclass(es) ofModel
recursive (
bool
, optional) – ifTrue
, get children recursivelykwargs (
dict
ofstr
–>object
) – dictionary of attribute name/value pairs
- Returns
children
- Return type
list
ofModel
-
get_immediate_children
(kind=None, _Submodel__type=None, _Submodel__include_stop_conditions=True, **kwargs)[source]¶ Get a kind of children.
If
kind
isNone
, children are defined to be the values of the related attributes defined in each class.
-
id
= <obj_tables.core.SlugAttribute object>[source]
-
identifiers
= <wc_lang.core.IdentifierManyToManyAttribute object>[source]
-
import_relations_from_sbml
(sbml, objs)[source]¶ Load relationships from SBML model
- Parameters
sbml (
libsbml.Model
) – SBML modelobjs (
dict
) – dictionary that maps WC-Lang types to dictionaries that map the ids of WC-Lang objects to WC-Lang objects
-
model
= <obj_tables.core.ManyToOneAttribute object>[source]
-
name
= <obj_tables.core.StringAttribute object>[source]
-
references
= <obj_tables.core.ManyToManyAttribute object>[source]
-
-
class
wc_lang.core.
SubmodelsToModelRelatedManager
(object, attribute)[source]¶ Bases:
obj_tables.core.ManyToOneRelatedManager
Submodels to model related manager
-
class
wc_lang.core.
Taxon
(_comments=None, **kwargs)[source]¶ Bases:
obj_tables.core.Model
,wc_lang.sbml.util.SbmlModelMixin
Biological taxon (e.g. family, genus, species, strain, etc.)
-
identifiers
[source]¶ identifiers
- Type
list
ofIdentifier
-
class
Meta
[source]¶ Bases:
obj_tables.core.Meta
-
attributes
= {'comments': <wc_lang.core.CommentAttribute object>, 'id': <obj_tables.core.RegexAttribute object>, 'identifiers': <wc_lang.core.IdentifierOneToManyAttribute object>, 'model': <obj_tables.core.OneToOneAttribute object>, 'name': <obj_tables.core.StringAttribute object>, 'rank': <obj_tables.core.EnumAttribute object>, 'references': <obj_tables.core.OneToManyAttribute object>}[source]¶
-
child_attrs
= {'sbml': ('id', 'name', 'model', 'rank', 'identifiers', 'comments'), 'wc_sim': ()}[source]¶
-
children
= {'core_model': ('identifiers', 'references'), 'submodel': ('identifiers', 'references')}[source]¶
-
local_attributes
= {'comments': <obj_tables.core.LocalAttribute object>, 'id': <obj_tables.core.LocalAttribute object>, 'identifiers': <obj_tables.core.LocalAttribute object>, 'model': <obj_tables.core.LocalAttribute object>, 'name': <obj_tables.core.LocalAttribute object>, 'rank': <obj_tables.core.LocalAttribute object>, 'references': <obj_tables.core.LocalAttribute object>}[source]¶
-
-
comments
= <wc_lang.core.CommentAttribute object>[source]
-
id
= <obj_tables.core.RegexAttribute object>[source]
-
identifiers
= <wc_lang.core.IdentifierOneToManyAttribute object>[source]
-
model
= <obj_tables.core.OneToOneAttribute object>[source]
-
name
= <obj_tables.core.StringAttribute object>[source]
-
rank
= <obj_tables.core.EnumAttribute object>[source]
-
references
= <obj_tables.core.OneToManyAttribute object>[source]
-
-
class
wc_lang.core.
TaxonRankMeta
[source]¶ Bases:
wc_utils.util.enumerate.CaseInsensitiveEnumMeta
4.1.6. 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>
- Author
Arthur Goldberg <Arthur.Goldberg@mssm.edu>
- Date
2016-12-05
- Copyright
2016, Karr Lab
- License
MIT
-
class
wc_lang.io.
Reader
[source]¶ Bases:
obj_tables.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.Observation'>, <class 'wc_lang.core.ObservationSet'>, <class 'wc_lang.core.Conclusion'>, <class 'wc_lang.core.Reference'>, <class 'wc_lang.core.Author'>, <class 'wc_lang.core.Change'>)[source]¶
-
run
(path, models=None, ignore_missing_models=None, ignore_extra_models=None, ignore_sheet_order=None, include_all_attributes=False, ignore_missing_attributes=None, ignore_extra_attributes=None, ignore_attribute_order=None, 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
orlist
oftypes.TypeType
, optional) – type of object to read or list of types of objects to readignore_missing_models (
bool
, optional) – ifFalse
, report an error if a worksheet/ file is missing for one or more modelsignore_extra_models (
bool
, optional) – ifTrue
and all models are found, ignore other worksheets or filesignore_sheet_order (
bool
, optional) – ifTrue
, do not require the sheets to be provided in the canonical orderinclude_all_attributes (
bool
, optional) – ifTrue
, export all attributes including those not explictly included in Model.Meta.attribute_orderignore_missing_attributes (
bool
, optional) – ifFalse
, report an error if a worksheet/file doesn’t contain all of attributes in a model in modelsignore_extra_attributes (
bool
, optional) – ifTrue
, do not report errors if attributes in the data are not in the modelignore_attribute_order (
bool
) – ifTrue
, do not require the attributes to be provided in the canonical ordervalidate (
bool
, optional) – ifTrue
, validate the data
- Returns
model objects grouped by obj_tables.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_tables.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.Observation'>, <class 'wc_lang.core.ObservationSet'>, <class 'wc_lang.core.Conclusion'>, <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, write_schema=False, write_toc=True, extra_entries=0, data_repo_metadata=False, schema_package=None, protected=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 (
type
) – a wc_lang Model that’s a subclass of obj_tables.Modelmodels (
list
ofModel
, optional) – models in the order that they should appear as worksheets; all models which are not in models will follow in alphabetical orderget_related (
bool
, optional) – ifTrue
, write object and all related objectsinclude_all_attributes (
bool
, optional) – ifTrue
, export all attributes including those not explictly included in Model.Meta.attribute_ordervalidate (
bool
, optional) – ifTrue
, validate the datatitle (
str
, optional) – titledescription (
str
, optional) – descriptionkeywords (
str
, optional) – keywordsversion (
str
, optional) – versionlanguage (
str
, optional) – languagecreator (
str
, optional) – creatorwrite_schema (
bool
, optional) – ifTrue
, include additional worksheet with schemawrite_toc (
bool
, optional) – ifTrue
, include additional worksheet with table of contentsextra_entries (
int
, optional) – additional entries to displaydata_repo_metadata (
bool
, optional) – ifTrue
, try to write metadata information about the file’s Git repo; the repo must be current with origin, except for the fileschema_package (
str
, optional) – the package which defines the obj_tables schema used by the file; if notNone
, try to write metadata information about the the schema’s Git repository: the repo must be current with originprotected (
bool
, optional) – ifTrue
, protect the worksheet
-
classmethod
validate_implicit_relationships
(root_model)[source]¶ - Check that relationships to
root_model
do not need to be explicitly exported because they can be inferred by
Reader.run
. This is necessary to enable the relationships toroot_model
to not be exported in workbooks, and instead added byReader.run
.
- Raises
Exception – if there are relationships from
core.Model
or one-to-many or many-to-many relationships toroot_model
- Check that relationships to
-
validate_implicit_relationships_are_set
(model, root_model)[source]¶ Check that there is only one instance of
root_model
and that each relationship toroot_model
is set. This is necessary to enable the relationships toroot_model
to not be exported in workbooks, and instead added byReader.run
.- Parameters
model (
obj_tables.Model
) – the root model instanceroot_model (
type
) – the type of model, a subclass ofobj_tables.Model
- Raises
ValueError – if there are multiple instances of root_model in the object graph
-
-
wc_lang.io.
convert
(source, destination, protected=True)[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 fileprotected (
bool
, optional) – ifTrue
, protect the worksheet
-
wc_lang.io.
create_template
(path, write_schema=False, write_toc=True, extra_entries=10, data_repo_metadata=True, protected=True)[source]¶ Create file with model template, including row and column headings
- Parameters
path (
str
) – path to file(s)write_schema (
bool
, optional) – ifTrue
, include additional worksheet with schemawrite_toc (
bool
, optional) – ifTrue
, include additional worksheet with table of contentsextra_entries (
int
, optional) – additional entries to displaydata_repo_metadata (
bool
, optional) – ifTrue
, try to write metadata information about the file’s Git repoprotected (
bool
, optional) – ifTrue
, protect the worksheet
-
wc_lang.io.
get_root_model
(models)[source]¶ Get a root model class from an iterator over obj_tables.Model classes
The root model is obtained by name, rather than from core.Model, because models may have been obtained from obj_tables migration, which loads other versions of wc_lang.core in private imports.
- Parameters
models (
iterator
) – subclasses ofobj_tables.Model
being read or written- Returns
a subclass of obj_tables.Model whose name is root_model_name
- Return type
type
4.1.7. 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