17.1.1.3.1.3. cobra.io.mat
¶
17.1.1.3.1.3.1. Module Contents¶
17.1.1.3.1.3.1.1. Functions¶
extract the compartment from the id string |
|
|
translate an array x into a MATLAB cell array |
|
Load a cobra model stored as a .mat file |
|
Save the cobra model as a .mat file. |
|
|
|
create a dict mapping model attributes to arrays |
|
create a model from the COBRA toolbox struct |
|
ensure success of a pymatbridge operation |
|
send the model to a MATLAB workspace through pymatbridge |
-
cobra.io.mat.
load_matlab_model
(infile_path, variable_name=None, inf=inf)[source]¶ Load a cobra model stored as a .mat file
- Parameters
infile_path (str) – path to the file to to read
variable_name (str, optional) – The variable name of the model in the .mat file. If this is not specified, then the first MATLAB variable which looks like a COBRA model will be used
inf (value) – The value to use for infinite bounds. Some solvers do not handle infinite values so for using those, set this to a high numeric value.
- Returns
The resulting cobra model
- Return type
cobra.core.Model.Model
-
cobra.io.mat.
save_matlab_model
(model, file_name, varname=None)[source]¶ Save the cobra model as a .mat file.
This .mat file can be used directly in the MATLAB version of COBRA.
- Parameters
model (cobra.core.Model.Model object) – The model to save
file_name (str or file-like object) – The file to save to
varname (string) – The name of the variable within the workspace
-
cobra.io.mat.
from_mat_struct
(mat_struct, model_id=None, inf=inf)[source]¶ create a model from the COBRA toolbox struct
The struct will be a dict read in by scipy.io.loadmat