Struct kair::model::ModelLp[][src]

pub struct ModelLp {
    pub id: String,
    pub name: String,
    pub metabolites: HashMap<String, Species>,
    pub reactions: HashMap<String, ReactionLp>,
    pub variables: HashMap<String, Variable>,
    pub config: HashMap<String, Parameter>,
    pub objective: String,
    pub stoichiometry: HashMap<String, Vec<Expression>>,
}

LP problem as a Flux Balance Analysis formulation.

See: What is flux balance analysis?, Orth et al., 2010

Being $f(\overrightarrow{z})$ a function to optimize (historically, biomass or ATPase), $S$ and stoichimetry matrix and $\overrightarrow{v}$ the flux vector representing the reactions in the reconstruction:

$$ \text{Max.} f(\overrightarrow{z}) \newline \text{subject to}\medspace S\overrightarrow{v} = 0 \newline \text{where}\medspace lb_j \le v_j \le ub_j $$

Fields

id: String

Id from SBML document

name: String

Name from SBML document

metabolites: HashMap<String, Species>

Metabolites from the SBML document

reactions: HashMap<String, ReactionLp>

Reactions from the SBML document

variables: HashMap<String, Variable>

Parsed from reactions, variables of LP problem

config: HashMap<String, Parameter>

Parameters from the SBML document

objective: String

Reaction id to be used as the objective in the LP problem

stoichiometry: HashMap<String, Vec<Expression>>

Parsed stoichiometry matrix

Implementations

impl ModelLp[src]

pub fn new(input_sbml: Model) -> Self[src]

Read and call the LP builder.

Example

use kair::ModelLp;
use std::str::FromStr;

// contents is a &str containing a SBML document
ModelLp::from_str(&contents).unwrap();

pub fn populate_model(&mut self, problem: &mut ProblemVariables)[src]

Build LP problem as an FBA formulation.

pub fn get_objective(&self) -> Variable[src]

Get objective variable given the objective identifier

pub fn get_objective_reaction(&mut self) -> Result<&mut ReactionLp, SBMLError>[src]

Get objective variable given the objective identifier

pub fn add_constraints<S: Solver>(&self, model: &mut S::Model)[src]

Add the constraints to th problem

Trait Implementations

impl Clone for ModelLp[src]

impl From<Model> for ModelLp[src]

impl FromStr for ModelLp[src]

type Err = Box<dyn Error>

The associated error which can be returned from parsing.

Auto Trait Implementations

impl RefUnwindSafe for ModelLp

impl Send for ModelLp

impl Sync for ModelLp

impl Unpin for ModelLp

impl UnwindSafe for ModelLp

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.