API Reference
SBML
sbml
load_model(filename)
Source code in src/fluxbound/io/sbml.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | |
save_model(model, filename)
Source code in src/fluxbound/io/sbml.py
374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 | |
Simulation
FBA(model, objective=None, minimize=False, parsimonious=False, obj_frac=1.0, constraints=None, solver=None, get_values=True, shadow_prices=False)
Run a Flux Balance Analysis (FBA) simulation:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
a constraint-based model |
required | |
objective
|
str | dict | None
|
objective coefficients or single reaction to optimize |
None
|
minimize
|
bool
|
whether to minimize the objective function |
False
|
parsimonious
|
bool
|
run parsimonious FBA (pFBA) |
False
|
obj_frac
|
float
|
minimum fraction of FBA objective (for pFBA) |
1.0
|
constraints
|
dict | None
|
environmental or additional constraints |
None
|
solver
|
Solver | None
|
re-use a solver pre-initialized with the model (for speed) |
None
|
get_values
|
bool | list
|
set to false if you only care about the objective value (for speed) |
True
|
shadow_prices
|
bool
|
calculate shadow prices |
False
|
Returns:
| Type | Description |
|---|---|
Solution
|
Solution |
Source code in src/fluxbound/simulation/fba.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | |
FVA(model, obj_frac=0, reactions=None, constraints=None)
Run Flux Variability Analysis (FVA).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
obj_frac
|
float
|
minimum fraction of the default objective |
0
|
reactions
|
list | None
|
list of reactions to analyze (default: all) |
None
|
constraints
|
dict | None
|
additional constraints |
None
|
Returns:
| Type | Description |
|---|---|
|
flux variation |
Source code in src/fluxbound/simulation/fva.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | |
Deletion
deletion
gene_deletion(model, genes, parsimonious=False, constraints=None, skip_silent=False, get_values=True, solver=None)
Source code in src/fluxbound/simulation/deletion.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | |
reaction_deletion(model, reactions, parsimonious=False, constraints=None, get_values=True, solver=None)
Source code in src/fluxbound/simulation/deletion.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | |
essential_genes(model, growth_frac=0.01, constraints=None)
Source code in src/fluxbound/simulation/deletion.py
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | |
essential_reactions(model, growth_frac=0.01, constraints=None)
Source code in src/fluxbound/simulation/deletion.py
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | |
Base classes
model
Gene(gene_id, name=None)
Source code in src/fluxbound/core/model.py
47 48 | |
Metabolite(met_id, compartment, name=None)
Source code in src/fluxbound/core/model.py
41 42 43 | |
Compartment(comp_id, name=None, external=False, size=1.0)
Source code in src/fluxbound/core/model.py
27 28 29 30 31 32 33 34 35 36 37 | |
Reaction(rxn_id, name=None, stoichiometry=None, lb=-inf, ub=inf, gpr=None, rtype=ReactionType.OTHER)
Source code in src/fluxbound/core/model.py
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | |
Model(model_id, name=None)
Source code in src/fluxbound/core/model.py
168 169 170 171 172 173 174 175 176 177 178 | |
Environment()
Source code in src/fluxbound/core/environment.py
10 11 | |
empty(model, inplace=False)
staticmethod
Generate an empty growth medium for a given model
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inplace
|
bool
|
apply to model or return environment object |
False
|
Returns:
| Type | Description |
|---|---|
Environment | None
|
Environment (if not inplace) |
Source code in src/fluxbound/core/environment.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | |
complete(model, max_uptake=10.0, inplace=False)
staticmethod
Generate a complete growth medium for a given model
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
max_uptake
|
float
|
maximum uptake rate |
10.0
|
inplace
|
bool
|
apply to model or return environment object |
False
|
Returns:
| Type | Description |
|---|---|
Environment | None
|
Environment (if not inplace) |
Source code in src/fluxbound/core/environment.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | |
from_compounds(compounds, fmt_func, max_uptake=10.0)
staticmethod
Initialize environment from list of medium compounds
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
compounds
|
list
|
list of compounds in the medium |
required |
fmt_func
|
FunctionType
|
function to convert metabolite ids to exchange reaction ids |
required |
max_uptake
|
float
|
maximum uptake rate for given compounds |
10.0
|
Source code in src/fluxbound/core/environment.py
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | |
from_model(model)
staticmethod
Source code in src/fluxbound/core/environment.py
20 21 22 23 24 25 26 27 28 29 | |
apply(model, exclusive=True, inplace=True, warning=True)
Apply environmental conditions to a given model
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
exclusive
|
bool
|
block uptake compounds not specified in this environment |
True
|
warning
|
bool
|
print warning for exchange reactions not found in the model |
True
|
inplace
|
bool
|
apply to model, otherwise return a constraints dict |
True
|
Source code in src/fluxbound/core/environment.py
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | |
simplify(inplace=False)
Remove reactions with blocked uptake.
Source code in src/fluxbound/core/environment.py
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | |