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