pub struct Model {
pub annot: ModelAnnot,
pub compartments: Vec<Compartment>,
pub mets: Vec<Metabolite>,
pub rxns: Vec<Reaction>,
pub genes: Vec<GeneId>,
pub s: StoichMatrix,
}Fields§
§annot: ModelAnnot§compartments: Vec<Compartment>§mets: Vec<Metabolite>§rxns: Vec<Reaction>§genes: Vec<GeneId>Genes referenced by any reaction’s GPR.
s: StoichMatrixSparse stoichiometric matrix in CSC (one column per reaction).
Implementations§
Source§impl Model
impl Model
Sourcepub fn new(id: impl Into<String>) -> Self
pub fn new(id: impl Into<String>) -> Self
Empty model with the three standard compartments (c0, e0, p0).
pub fn rxn_count(&self) -> usize
pub fn met_count(&self) -> usize
Sourcepub fn rxn_index(&self) -> HashMap<RxnId, usize>
pub fn rxn_index(&self) -> HashMap<RxnId, usize>
Lookup map from reaction id → index. Built on demand (O(n)); callers that need many lookups should cache the result.
pub fn met_index(&self) -> HashMap<CpdId, usize>
Sourcepub fn check_shape(&self) -> Result<(), ModelError>
pub fn check_shape(&self) -> Result<(), ModelError>
Sanity-check that the stoichiometric matrix shape matches the model.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Model
impl<'de> Deserialize<'de> for Model
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Model
impl RefUnwindSafe for Model
impl Send for Model
impl Sync for Model
impl Unpin for Model
impl UnsafeUnpin for Model
impl UnwindSafe for Model
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more