[][src]Crate kair

Constraint-Based Reconstruction and Analysis. It uses the rust_sbml to read a SBML document and translates it into a LP formulation using lp_modeler

COBRA methods available

Examples

Read and optimize e_coli_core model

use kair::ModelLP;
use std::{str::FromStr, fs::File, io::{BufReader, prelude::*}};

let file = std::fs::File::open("examples/EcoliCore.xml").unwrap();
let mut buf_reader = BufReader::new(file);
let mut contents = String::new();
buf_reader.read_to_string(&mut contents).unwrap();
let model = ModelLP::from_str(&contents).unwrap();
println!(
    "Model {} ({}) has {:?} constraints and {:?} variables",
    &model.id,
    &model.name,
    &model.constraints.len(),
    &model.variables.len()
);
for (name, val) in model.optimize().unwrap().iter() {
    println!("{} = {}", name, val)
}

Additional links

Structs

ModelLP

LP problem as a Flux Balance Analysis formulation.

Traits

Fbc

Indicate that the struct can be translated to a flux balance variable (generally, reactions)

Functions

fba

Optimize the model according to Flux Balance Analysis (FBA). FBA: https://pubmed.ncbi.nlm.nih.gov/20212490/