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: ModelUnits
initial_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]
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 PyClass 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 PyClassAlloc for Model
[src]impl PyClassSend for Model
[src]
impl PyClassSend for Model
[src]type ThreadChecker = ThreadCheckerStub<Model>
impl PyProtoMethods for Model
[src]
impl PyProtoMethods for Model
[src]fn for_each_proto_slot<Visitor: FnMut(PyType_Slot)>(visitor: Visitor)
[src]
fn get_buffer() -> Option<&'static PyBufferProcs>
[src]
impl PyTypeInfo 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
const NAME: &'static str
[src]
const MODULE: Option<&'static str>
[src]
const DESCRIPTION: &'static str
[src]
const FLAGS: usize
[src]
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
[src]
pub fn is_type_of(object: &PyAny) -> bool
[src]
pub fn is_exact_type_of(object: &PyAny) -> bool
[src]
impl StructuralPartialEq for Model
[src]
impl StructuralPartialEq for Model
[src]Auto Trait Implementations
impl RefUnwindSafe for Model
impl RefUnwindSafe for Model
impl UnwindSafe for Model
impl UnwindSafe for Model
Blanket Implementations
impl<T> PyTypeObject for T where
T: PyTypeInfo,
[src]
impl<T> PyTypeObject for T where
T: PyTypeInfo,
[src]