Struct rust_sbml::Model[][src]

pub struct Model {
    pub id: Option<String>,
    pub metaid: Option<String>,
    pub name: Option<String>,
    pub model_units: ModelUnits,
    pub initial_assignments: HashMap<String, InitialAssignment>,
    pub parameters: HashMap<String, Parameter>,
    pub species: HashMap<String, Species>,
    pub reactions: HashMap<String, Reaction>,
    pub compartments: HashMap<String, Compartment>,
    pub unit_definitions: HashMap<String, HashMap<UnitSIdRef, Unit>>,
    pub constraints: Vec<Constraint>,
    pub objectives: Option<Vec<String>>,
}

Abstraction over the SBML specification. It traverses each top-level listOF_ and provides HashMaps<id, object> instead. In addition the model units are gathered in an ModelUnits struct.

Example

use rust_sbml::Model;
use std::fs;

let ecoli = fs::read_to_string("examples/EcoliCore.xml").unwrap();
let document = Model::parse(&ecoli).unwrap();
println!("{:?}", document.objectives);
assert_eq!(
    document
        .objectives
        .unwrap()
        .iter()
        .map(|reac_id| reac_id.to_owned())
        .next(),
    Some("R_BIOMASS_Ecoli_core_w_GAM".to_string())
);

Fields

id: Option<String>metaid: Option<String>name: Option<String>model_units: ModelUnitsinitial_assignments: HashMap<String, InitialAssignment>parameters: HashMap<String, Parameter>species: HashMap<String, Species>reactions: HashMap<String, Reaction>compartments: HashMap<String, Compartment>unit_definitions: HashMap<String, HashMap<UnitSIdRef, Unit>>constraints: Vec<Constraint>objectives: Option<Vec<String>>

Implementations

impl Model[src]

pub fn get_list_of_compartments(&self) -> Vec<&Compartment>[src]

Emulating the API of libSBML

Example

use rust_sbml::Model;
use std::fs;

let ecoli = fs::read_to_string("examples/EcoliCore.xml").unwrap();
let document = Model::parse(&ecoli).unwrap();
println!("{:?}", document.get_list_of_compartments())

pub fn get_list_of_species(&self) -> Vec<&Species>[src]

Emulating the API of libSBML

Example

use rust_sbml::Model;
use std::fs;

let ecoli = fs::read_to_string("examples/EcoliCore.xml").unwrap();
let document = Model::parse(&ecoli).unwrap();
println!("{:?}", document.get_list_of_species())

pub fn get_list_of_reactions(&self) -> Vec<&Reaction>[src]

Emulating the API of libSBML

Example

use rust_sbml::Model;
use std::fs;

let ecoli = fs::read_to_string("examples/EcoliCore.xml").unwrap();
let document = Model::parse(&ecoli).unwrap();
println!("{:?}", document.get_list_of_reactions())

pub fn parse(doc: &str) -> Result<Self, Box<dyn Error>>[src]

Use ModelRaw to parse the SBML document and then format it into Model.

Trait Implementations

impl Debug for Model[src]

impl Default for Model[src]

impl<'a> ExtractExt<'a> for &'a Model[src]

type Target = PyRef<'a, Model>

impl<'a> ExtractExt<'a> for &'a mut Model[src]

type Target = PyRefMut<'a, Model>

impl HasMethodsInventory for Model[src]

type Methods = Pyo3MethodsInventoryForModel

impl IntoPy<Py<PyAny>> for Model[src]

impl PartialEq<Model> for Model[src]

impl PyClass for Model[src]

type Dict = PyClassDummySlot

Specify this class has #[pyclass(dict)] or not.

type WeakRef = PyClassDummySlot

Specify this class has #[pyclass(weakref)] or not.

type BaseNativeType = PyAny

The closest native ancestor. This is PyAny by default, and when you declare #[pyclass(extends=PyDict)], it’s PyDict. Read more

impl PyClassAlloc for Model[src]

impl PyClassSend for Model[src]

type ThreadChecker = ThreadCheckerStub<Model>

impl PyProtoMethods for Model[src]

impl PyTypeInfo for Model[src]

type Type = Model

Type of objects to store in PyObject struct

type BaseType = PyAny

Base class

type Layout = PyCell<Self>

Layout

type BaseLayout = PyCellBase<PyAny>

Layout of Basetype.

type Initializer = PyClassInitializer<Self>

Initializer for layout

type AsRefTarget = PyCell<Self>

Utility type to make Py::as_ref work

impl StructuralPartialEq for Model[src]

Auto Trait Implementations

impl RefUnwindSafe for Model

impl Send for Model

impl Sync for Model

impl Unpin for Model

impl UnwindSafe for Model

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> PyErrArguments for T where
    T: IntoPy<Py<PyAny>> + Send + Sync
[src]

impl<T> PyTypeObject for T where
    T: PyTypeInfo
[src]

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.