Expand description
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, extracellulare0, periplasmp0). Metabolites (compound id + compartment + chemical formula).Reactions (id, name, bounds, objective coefficient, GPR, EC list, gapseq-specificgs.originprovenance tag, SEED curation status).- A sparse
StoichMatrixin CSC layout (sprsunder the hood), one column per reaction, one row per metabolite. - A
ModelAnnotbundle 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.
Re-exports§
pub use compartment::Compartment;pub use compartment::CompartmentId;pub use gpr::Gpr;pub use gpr::GprParseError;pub use id::CpdId;pub use id::GeneId;pub use id::RxnId;pub use metabolite::Metabolite;pub use model::Model;pub use model::ModelAnnot;pub use model::ModelError;pub use reaction::Reaction;pub use reaction::Reversibility;pub use reaction::SeedStatus;pub use stoich::StoichMatrix;
Modules§
- compartment
- Compartment identifiers.
- gpr
- Gene-protein-reaction (GPR) Boolean expressions.
- id
- Newtype wrappers for the three identifier namespaces used throughout gapseq.
- metabolite
- Metabolite metadata.
- model
- In-memory metabolic model.
- reaction
- Reaction metadata.
- stoich
- Sparse stoichiometric matrix.