1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//! Core types for gapsmith.
//!
//! Every other crate depends on this one. Kept deliberately small: only the
//! in-memory representation of a metabolic model plus the supporting ID,
//! stoichiometry, and GPR types. No I/O, no solvers, no databases.
//!
//! # Overview
//!
//! [`Model`] is the central type — an analogue of cobrar's `ModelOrg` S4
//! class. It bundles:
//!
//! - Compartments (cytosol `c0`, extracellular `e0`, periplasm `p0`).
//! - [`Metabolite`]s (compound id + compartment + chemical formula).
//! - [`Reaction`]s (id, name, bounds, objective coefficient, GPR, EC list,
//! gapseq-specific `gs.origin` provenance tag, SEED curation status).
//! - A sparse [`StoichMatrix`] in CSC layout (`sprs` under the hood),
//! one column per reaction, one row per metabolite.
//! - A [`ModelAnnot`] bundle of provenance metadata that travels with the
//! model through CBOR / SBML round-trips.
//!
//! # ID newtypes
//!
//! [`CpdId`], [`RxnId`], [`GeneId`] wrap `Arc<str>`. Cloning is cheap and
//! the types are mutually incompatible so a metabolite id can't
//! accidentally be used where a reaction id is expected.
//!
//! # Serialisation
//!
//! Every public type derives `Serialize` + `Deserialize`. CBOR (via
//! `ciborium`) is the primary storage format; JSON works too. See the
//! `gapsmith-io` crate for the round-trip helpers.
pub use ;
pub use ;
pub use ;
pub use Metabolite;
pub use ;
pub use ;
pub use StoichMatrix;