straindesign.speedy_fva

Accelerated FVA using scan LPs and bound scanning.

Standard FVA solves 2*n independent LPs (max and min for each reaction). This implementation reduces LP count via a two-phase approach:

Phase 1 — Scan LPs (cheap, resolve ~50-70% of bounds):
  1. v=0 feasibility: free resolutions when zero flux is feasible

  2. min(sum(|x|)): pushes reactions toward zero, resolves lb=0/ub=0 bounds

  3. Push-to-bounds: directed objectives push unresolved reactions toward their variable bounds, with dual simplex warm-start for fast re-solves

Each scan LP solution is processed by bound scanning (vectorized at-bound check that marks reactions whose flux equals their variable bound).

Phase 2 — Individual LPs for remaining unresolved objectives:

Sequential (warm-started) or parallel (SDPool) dispatch depending on problem size and thread count. Sequential mode includes co-optimization scanning: each LP vertex is checked for other reactions at their bounds.

Module Contents

straindesign.speedy_fva.speedy_fva(model, **kwargs)[source]

Accelerated FVA using global scan LPs and KKT-based optimality propagation.

Returns the same DataFrame as straindesign.lptools.fva.

Parameters:
  • model (cobra.Model)

  • solver (str, optional)

  • constraints (str or list, optional)

  • compress (bool or None, optional (default None)) – Compress the model (coupled compression + conservation removal) before running FVA, then expand results back. None = auto (True if n >= 200).

  • precheck (bool or None, optional (default None)) – Run global scan LPs (min/max sum(|x|)) in Phase 1 to pre-resolve many objectives without individual LPs. None = auto (always True).

  • threads (int or None, optional (default None)) – Number of parallel workers for Phase 2 dispatch. None = auto (Configuration().processes if n >= 1000, else 1).

  • verbose (bool, optional (default False))

Return type:

pandas.DataFrame with columns ‘minimum’ and ‘maximum’, indexed by reaction ID.