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¶
Change a value of an attribute of a model
- Author
Jonathan Karr <karr@mssm.edu>
- Date
2018-06-19
- Copyright
2018, Karr Lab
- License
MIT
-
class
wc_lang.transform.change_value.
ChangeValueTransform
(attr_path=None, value=None)[source]¶ Bases:
wc_lang.transform.core.Transform
Change a value of an attribute of a model
-
attr_path
[source]¶ list that represents the path to an attribute or nested attribute of a model
Examples:
model.name --> 'name'
model.reactions.get_one(id='rxn_1').reversible --> (('reactions', {'id': 'rxn_1'}), 'reversible')
model.parameters.get_one(id='param_1').value --> (('parameters', {'id': 'param_1'}), 'value')
model .reactions.get_one(id='rxn_1') .rate_laws.get_one(direction=RateLawDirection.forward) .expression .parameters.get_one(id='param_1') .value --> ( ('reactions', {'id': 'rxn_1'}, ('rate_laws', {'direction': RateLawDirection.forward}), 'expression', ('parameters', {'id': 'param_1'}), 'value', )
- Type
list
oflist
ofstr
-
__eq__
(other, tol=0.0)[source]¶ Compare two
ChangeValueTransform
objects- Parameters
other (
Object
) – other objecttol (
float
, optional) – equality tolerance
- Returns
true if
ChangeValueTransform
objects are semantically equal- Return type
bool
-
static
attr_path_from_str
(str)[source]¶ Generate attr_path from its string representation
- Parameters
str (
str
) – string representation of attr_path- Returns
attr_path
- Return type
Object
-
4.1.1.4.3. wc_lang.transform.core module¶
Transform models.
- Author
Jonathan Karr <karr@mssm.edu>
- Date
2016-11-10
- Copyright
2016, Karr Lab
- License
MIT
-
class
wc_lang.transform.core.
CompositeTransform
[source]¶ Bases:
wc_lang.transform.core.Transform
Transform which is composed of multiple transforms
-
COMPONENT_TRANSFORMS
= ()[source]
-
4.1.1.4.4. wc_lang.transform.create_implicit_dfba_ex_rxns module¶
Create implicit exchange reactions for dFBA submodels.
- Author
Arthur Goldberg <Arthur.Goldberg@mssm.edu>
- Author
Jonathan Karr <jonrkarr@gmail.com>
- Date
2018-11-28
- Copyright
2017-2018, Karr Lab
- License
MIT
-
class
wc_lang.transform.create_implicit_dfba_ex_rxns.
CreateImplicitDfbaExchangeReactionsTransform
[source]¶ Bases:
wc_lang.transform.core.Transform
Create implicit exchange reactions for dFBA submodels.
To enable FBA to represent a closed system, create implicit forward exchange reactions
Metabolites transported from the extracellular environment (generate a “-> species_type[e]” reaction for each extracellular species involved in each dFBA submodel)
TODO: Metabolites recycled from the byproducts of other submodels and products produced for other submodels
4.1.1.4.5. wc_lang.transform.create_implicit_dist_zero_init_concs module¶
Create the implicit zero concentrations in a model
- Author
Arthur Goldberg <Arthur.Goldberg@mssm.edu>
- Author
Jonathan Karr <jonrkarr@gmail.com>
- Date
2018-11-28
- Copyright
2017-2018, Karr Lab
- License
MIT
-
class
wc_lang.transform.create_implicit_dist_zero_init_concs.
CreateImplicitDistributionZeroInitConcentrationsTransform
[source]¶ Bases:
wc_lang.transform.core.Transform
Create the implicit zero concentrations in a model
4.1.1.4.6. wc_lang.transform.merge_submodels module¶
Merge groups of algorithmically-like submodels into individual submodels.
- Author
Jonathan Karr <karr@mssm.edu>
- Date
2018-06-19
- Copyright
2018, Karr Lab
- License
MIT
-
class
wc_lang.transform.merge_submodels.
MergeAlgorithmicallyLikeSubmodelsTransform
[source]¶ Bases:
wc_lang.transform.core.Transform
Merge groups of algorithmically-like submodels into individual submodels
4.1.1.4.7. wc_lang.transform.nullify_attrs module¶
Generate a reduced model by nullifying specific attributes
- Author
Jonathan Karr <karr@mssm.edu>
- Date
2019-03-20
- Copyright
2019, Karr Lab
- License
MIT
-
class
wc_lang.transform.nullify_attrs.
NullifyAttrsTransform
(attrs_to_keep)[source]¶ Bases:
wc_lang.transform.core.Transform
Generate a reduced model by nullifying specific attributes
-
attrs_to_keep
[source]¶ name of meta attribute which encodes lists of the attributes to keep (not nullify)
- Type
str
-
4.1.1.4.8. wc_lang.transform.prep_for_sbml module¶
Transform model into SBML-compatible representation and discard information that cannot be exported to SBML.
- Author
Jonathan Karr <karr@mssm.edu>
- Author
Arthur Goldberg <Arthur.Goldberg@mssm.edu>
- Date
2019-03-20
- Copyright
2019, Karr Lab
- License
MIT
-
class
wc_lang.transform.prep_for_sbml.
PrepForSbmlTransform
[source]¶ Bases:
wc_lang.transform.core.CompositeTransform
Transform model into SBML-compatible representation and discard information that cannot be exported to SBML
-
COMPONENT_TRANSFORMS
= (<wc_lang.transform.create_implicit_dist_zero_init_concs.CreateImplicitDistributionZeroInitConcentrationsTransform object>, <wc_lang.transform.create_implicit_dfba_ex_rxns.CreateImplicitDfbaExchangeReactionsTransform object>, <wc_lang.transform.split_reversible_reactions.SplitReversibleReactionsTransform object>, <wc_lang.transform.nullify_attrs.NullifyAttrsTransform object>)[source]¶
-
4.1.1.4.9. wc_lang.transform.prep_for_wc_sim module¶
Prepare a model for simulation by wc_sim.
- Author
Arthur Goldberg <Arthur.Goldberg@mssm.edu>
- Author
Jonathan Karr <jonrkarr@gmail.com>
- Date
2018-11-28
- Copyright
2017-2018, Karr Lab
- License
MIT
-
class
wc_lang.transform.prep_for_wc_sim.
PrepForWcSimTransform
[source]¶ Bases:
wc_lang.transform.core.CompositeTransform
Prepare a model for simulation by making implicit information in the model explicit.
Create explicit distributions of initial zero concentrations for species that don’t have explicit distributions of initial concentrations (i.e. implicit distributions of initial zero concentrations)
Create implicit exchange reactions for dFBA submodels
Clip the flux bounds for the reactions in dFBA submodels to the default flux range
Split reversible reactions into separate forward and reverse reactions
-
COMPONENT_TRANSFORMS
= (<wc_lang.transform.create_implicit_dist_zero_init_concs.CreateImplicitDistributionZeroInitConcentrationsTransform object>, <wc_lang.transform.create_implicit_dfba_ex_rxns.CreateImplicitDfbaExchangeReactionsTransform object>, <wc_lang.transform.set_finite_dfba_flux_bounds.SetFiniteDfbaFluxBoundsTransform object>, <wc_lang.transform.split_reversible_reactions.SplitReversibleReactionsTransform object>, <wc_lang.transform.nullify_attrs.NullifyAttrsTransform object>)[source]¶
4.1.1.4.10. wc_lang.transform.set_finite_dfba_flux_bounds module¶
Clip the flux bounds for the reactions in dFBA submodels
- Author
Arthur Goldberg <Arthur.Goldberg@mssm.edu>
- Author
Jonathan Karr <jonrkarr@gmail.com>
- Date
2018-11-28
- Copyright
2017-2018, Karr Lab
- License
MIT
-
class
wc_lang.transform.set_finite_dfba_flux_bounds.
SetFiniteDfbaFluxBoundsTransform
[source]¶ Bases:
wc_lang.transform.core.Transform
Clip the flux bounds for the reactions in dFBA submodels to the default flux range
Bounds need to be clipped because some linear programming solvers require finite minimum and maximum flux bounds. The default bounds are provided in the wc_lang configuration.
Specifically, the default minimum and maximum flux bounds are applied as follows:
reversible reactions:
flux_min = max(flux_min, flux_min_bound_reversible)
flux_max = min(flux_max, flux_max_bound)
irreversible reactions:
flux_min = max(flux_min, flux_min_bound_irreversible)
flux_max = min(flux_max, flux_max_bound)
4.1.1.4.11. wc_lang.transform.split_reversible_reactions module¶
Transform models.
- Author
Jonathan Karr <karr@mssm.edu>
- Author
Arthur Goldberg <Arthur.Goldberg@mssm.edu>
- Date
2018-06-19
- Copyright
2018, Karr Lab
- License
MIT
-
class
wc_lang.transform.split_reversible_reactions.
SplitReversibleReactionsTransform
(excluded_frameworks=None)[source]¶ Bases:
wc_lang.transform.core.Transform
Split reversible reactions in submodels into separate forward and backward reactions
-
run
(model)[source]¶ Split reversible reactions in submodels into separate forward and backward reactions
- Parameters
model (
Model
) – model definition- Returns
same model definition, but with reversible reactions split into separate forward and backward reactions, their flux bounds adjusted accordingly, and the dFBA objective expression adjusted accordingly
- Return type
Model
-