Input and output
File I/O and serialization
COBREXA.load_model
— Methodload_model(file_name::String)::MetabolicModel
Generic function for loading models that chooses a specific loader function from the file_name
extension, or throws an error.
Currently, these model types are supported:
- SBML models (
*.xml
, loaded withload_sbml_model
) - JSON models (
*.json
, loaded withload_json_model
) - MATLAB models (
*.mat
, loaded withload_mat_model
)
COBREXA.load_model
— Methodload_model(type::Type{T}, file_name::String)::T where T
Helper function tht loads the model using load_model
and return it converted to type
.
Example:
load_model(CoreModel, "mySBMLModel.xml")
COBREXA.save_model
— Methodsave_model(model::MetabolicModel, file_name::String)
Generic function for saving models that chooses a specific writer function from the file_name
extension, or throws an error.
Currently, these model types are supported:
- JSON models (
*.json
, loaded withsave_json_model
) - MATLAB models (
*.mat
, loaded withsave_mat_model
)
COBREXA.load_json_model
— Methodload_json_model(filename::String)::JSONModel
Load and return a JSON-formatted model that is stored in file_name
.
COBREXA.save_json_model
— Methodsave_json_model(model::MetabolicModel, file_name::String)
Save a JSONModel
in model
to a JSON file file_name
.
In case the model
is not JSONModel
, it will be converted automatically.
COBREXA.load_mat_model
— Methodload_mat_model(file_name::String)
Load and return a MATLAB file file_name
that contains a COBRA-compatible model.
COBREXA.save_mat_model
— Methodsave_mat_model(model::MetabolicModel, file_name::String; model_name::String="model")
Save a MATModel
in model
to a MATLAB file file_name
in a format compatible with other MATLAB-based COBRA software.
In case the model
is not MATModel
, it will be converted automatically.
model_name
is the identifier name for the whole model written to the MATLAB file; defaults to just "model".
COBREXA.load_sbml_model
— Methodload_sbml_model(file_name::String)::SBMLModel
Load and return a SBML XML model in file_name
.
Pretty printing
Base.show
— MethodPretty printing of everything metabolic-modelish.
COBREXA._pretty_substances
— Method_pretty_substances(ss::Vector{String})::String
Nicely format a substance list.
Base.show
— MethodBase.show(io::IO, ::MIME"text/plain", m::Serialized{M}) where {M}
Show the Serialized
model without unnecessarily loading it.
COBREXA._pretty_print_keyvals
— Method_pretty_print_keyvals(io, def::String, payload; kwargs...)
Nicely prints keys and values.
COBREXA._pretty_print_keyvals
— Method_pretty_print_keyvals(
io,
def::String,
payload::Dict
)
Specialization of _pretty_print_keyvals
for dictionaries.
COBREXA._pretty_print_keyvals
— Method_pretty_print_keyvals(
io,
def::String,
payload::String
)
Specialization of _pretty_print_keyvals
for plain strings.