Generic accessors
To prevent the complexities of object representation, COBREXA.jl
uses a set of generic interface functions that can extract various important information from any supported model type. This approach ensures that the analysis functions can work on any data.
For example, you can check the reactions and metabolites contained in any model type (SBMLModel
, JSONModel
, CoreModel
, StandardModel
, and any other) using the same accessor:
using COBREXA
!isfile("e_coli_core.json") &&
download("http://bigg.ucsd.edu/static/models/e_coli_core.json", "e_coli_core.json");
js = load_model("e_coli_core.json")
reactions(js)
95-element Vector{String}: "PFK" "PFL" "PGI" "PGK" "PGL" "ACALD" "AKGt2r" "PGM" "PIt2r" "ALCD2x" ⋮ "MALt2_2" "MDH" "ME1" "ME2" "NADH16" "NADTRHD" "NH4t" "O2t" "PDH"
std = convert(CoreModel, js)
reactions(std)
95-element Vector{String}: "PFK" "PFL" "PGI" "PGK" "PGL" "ACALD" "AKGt2r" "PGM" "PIt2r" "ALCD2x" ⋮ "MALt2_2" "MDH" "ME1" "ME2" "NADH16" "NADTRHD" "NH4t" "O2t" "PDH"
All accessors allow systematic access to information about reactions, stoichiometry, metabolite properties and chemistry, genes, and various model annotations.
The most notable ones include:
reactions
,metabolites
andgenes
return respective vectors of identifiers of reactions, metabolites and genes present in the model,stoichiometry
returns the S matrixbalance
returns the right-hand vector of the linear model in formAx=b
bounds
return lower and upper bounds of reaction ratesmetabolite_charge
andmetabolite_formula
return details about metabolitesobjective
returns the objective of the model (usually labeled asc
)reaction_gene_association
describes the dependency of a reaction on gene products
A complete, up-to-date list of accessors can be always generated using methodswith
:
using InteractiveUtils
accessors = [
x.name for x in methodswith(MetabolicModel, COBREXA) if
endswith(String(x.file), "MetabolicModel.jl")
]
println.(accessors);
balance bounds coupling coupling_bounds fluxes gene_annotations gene_name gene_notes genes metabolite_annotations metabolite_charge metabolite_compartment metabolite_formula metabolite_name metabolite_notes metabolites n_coupling_constraints n_fluxes n_genes n_metabolites n_reactions objective precache! reaction_annotations reaction_flux reaction_gene_association reaction_name reaction_notes reaction_stoichiometry reaction_subsystem reactions stoichiometry
It is possible that not all the accessors are implemented for all the model types. If this is the case, usually nothing
or an empty data structure is returned. If you need a specific accessor, just overload the function you require!
This page was generated using Literate.jl.