Build & edit ecModel (Python)#
geckopy objects in geckopy.ec_model.
Functions#
Function |
Summary |
|---|---|
Stage 12: add the single |
|
Stage 10: add the single |
|
Stage 9: add |
|
Stage 11: add |
|
Stages 6 + 8 (gecko-light layout): allocate ec.rxns and ec.rxn_enz_mat. |
|
Stage 6: allocate ec.rxns and per-reaction slots. |
|
Update ec.rxn_enz_mat with subunit stoichiometries from ComplexPortal. |
|
Translate ec.kcat values into stoichiometric coefficients. |
|
Stage 8: populate ec.rxn_enz_mat. |
|
Map a split reaction id back to its conventional GEM id. |
|
A cobra model with enzyme-constraint data attached. |
|
Stateless proxy for one enzyme in an EcModel. |
|
Lazy DictList-like view over EcModel enzymes. |
|
Fill in missing kcats by combining known kcats across sibling isozymes. |
|
Return all reactions catalyzed by a given enzyme, as a DataFrame. |
|
Flip reactions that are constrained to only carry negative flux. |
|
Dict-like view of |
|
Build an enzyme-constrained model from a conventional GEM. |
|
Stage 7: fill per-enzyme fields from UniProt (with optional KEGG fallback). |
|
Clear gene-protein-reaction rules from pseudoreactions. |
|
Set kcat values for one or more reactions in ec.kcat. |
|
Set the upper bound of |
|
Split a gecko-light prefixed ec.rxn id into |
Reference#
add_protein_pool_exchange_reaction#
add_protein_pool_exchange_reaction(model: 'EcModel')
Stage 12: add the single prot_pool_exchange reaction.
Stoichiometry: (nothing) -> prot_pool with bounds (0, 1000).
Positive flux imports protein into the pool, mirroring how cobrapy
writes ordinary exchange reactions for extracellular metabolites.
Parameters
modelAn EcModel with stage 10 already run. Mutated in place.
add_protein_pool_pseudometabolite#
add_protein_pool_pseudometabolite(model: 'EcModel')
Stage 10: add the single prot_pool pseudometabolite.
Parameters
modelAn EcModel with adapter set. Mutated in place.
add_protein_pseudometabolites#
add_protein_pseudometabolites(model: 'EcModel')
Stage 9: add prot_<enzyme> pseudometabolites to the model.
Adds one pseudometabolite per unique enzyme in model.ec.enzymes,
in the compartment named by adapter.params.enzyme_comp. Enzymes
that already have a prot_<enzyme> metabolite in the model are
skipped (idempotent).
Parameters
modelAn EcModel with
ec.enzymesalready populated (stage 7) andadapterset. Mutated in place.
Returns
list of strSorted IDs of the pseudometabolites actually added (excludes any that already existed).
add_protein_usage_reactions#
add_protein_usage_reactions(model: 'EcModel')
Stage 11: add usage_prot_<enzyme> reactions.
Each usage reaction has stoichiometry prot_pool -> prot_<enzyme>
with bounds (0, 1000); positive flux represents enzyme
production.
The GPR of each usage reaction is set to the single gene whose
enzyme is the produced pseudometabolite, so that
model.genes retains that gene even if no metabolic reaction
references it anymore after upstream filtering.
Parameters
modelAn EcModel with stage 9 already run. Mutated in place.
Returns
list of strSorted IDs of added usage reactions.
allocate_ec_and_coupling_light#
allocate_ec_and_coupling_light(model: 'EcModel')
Stages 6 + 8 (gecko-light layout): allocate ec.rxns and ec.rxn_enz_mat.
Light models do not split isozyme reactions in the cobra layer (expand_model is skipped), so the per-isozyme bookkeeping moves into ec instead:
Each cobra reaction with N isozymes (i.e.
len(gpr_to_dnf(rxn.gpr)) == N) produces N rows in ec.rxns. Row k has the id"{k:03d}_{rxn.id}"(1-indexed, three-digit zero-padded counter).Row k's slice of
ec.rxn_enz_matis 1.0 for each gene in that isozyme's AND-clause; other genes are 0.
ec.kcat is initialized to 0 ("no kcat assigned"), and
ec.source / ec.notes / ec.eccodes to empty strings — same
convention as allocate_ec_for_catalyzed_reactions.
Stage 7 (populate_enzyme_data) runs unchanged on light models, so
ec.genes / ec.enzymes / ec.mw / ec.sequence must
already be populated before this function builds the coupling matrix.
Call order in make_ec_model for light: populate_enzyme_data
first, then this function.
Parameters
modelAn EcModel preprocessed through stage 4 (irreversibility), with stage 5 (expand_model) skipped and stage 7 already complete. Mutated in place.
Returns
list of strThe prefixed reaction IDs written into
model.ec.rxns.
allocate_ec_for_catalyzed_reactions#
allocate_ec_for_catalyzed_reactions(model: 'EcModel')
Stage 6: allocate ec.rxns and per-reaction slots.
Applies only to full (non-light) ecModels; gecko-light uses
allocate_ec_and_coupling_light instead.
Walks the model (which must already have been through stages 1-5) and selects every reaction that has at least one gene associated. Each selected reaction gets an entry in ec.rxns; ec.kcat is initialized to 0 (0 marks "no kcat assigned"), and ec.source/notes/eccodes to empty strings. The per-enzyme arrays (including ec.concs) are left untouched (stage 7 populates them).
Parameters
modelAn EcModel, already preprocessed through stage 5. Mutated in place.
Returns
list of strThe reaction IDs written into ec.rxns, in model order.
apply_complex_data#
apply_complex_data(model: 'EcModel', *, path: Optional[Path]=None, complex_data: Optional[list[ComplexPortalEntry]]=None, apply: bool=True, min_match_to_propose: float=0.75)
Update ec.rxn_enz_mat with subunit stoichiometries from ComplexPortal.
For each catalyzed reaction in ec.rxns, look up its enzyme set
in the ComplexPortal data. Three outcomes:
Exact match The model's enzyme set equals a complex's protein list, with no extras on either side. Apply the complex's stoichiometry.
Proposed
Superset: every model enzyme is in a complex that lists additional
subunits not in the model (the complex with the fewest extra
subunits is reported). Partial: min_match_to_propose (default
0.75) of the model enzymes are in a complex that has no subunits
beyond the model's number, with extras or substitutions on the model
side (the complex with the highest match is reported). A reaction
can get one proposal of each kind, as in GECKO's
applyComplexData. Logged as WARNING; not applied.
No match Skipped silently.
Parameters
modelAn EcModel produced by
make_ec_model. Mutated in place.pathPath to a ComplexPortal JSON file. If None and complex_data is also None, defaults to
adapter.params.path / "data" / "ComplexPortal.json".complex_dataPre-loaded list of ComplexPortalEntry. Overrides
path.applyIf True (default), call
apply_kcat_constraintsafterward. Needed because changingrxn_enz_matinvalidates the existing kcat coefficients.min_match_to_proposeMinimum fraction of model enzymes in a complex for it to be reported as a proposal. MATLAB hardcodes 0.75.
Raises
FileNotFoundErrorIf neither
complex_datanor a validpathis provided.
apply_kcat_constraints#
apply_kcat_constraints(model: 'EcModel', update_rxns: list[str] | None=None)
Translate ec.kcat values into stoichiometric coefficients.
For each reaction in ec.rxns with a valid kcat and at least one
associated enzyme, writes a negative coefficient at
S[prot_<enzyme>, rxn] of magnitude::
subunits * MW / (kcat * 3600)
where subunits is the corresponding entry of ec.rxn_enz_mat
(1 for a single subunit, higher for multi-copy complexes), MW
is the enzyme molecular weight from ec.mw (in Da), and the
factor 3600 converts kcat from 1/s (its conventional unit and the
unit used in ec.kcat) to 1/h so it aligns with cobrapy's
mmol/gDW/h flux convention.
Entries with kcat == 0 or kcat == NaN are treated as "no kcat assigned"; their stoichiometric coefficients are set to 0 (i.e., the enzyme places no constraint on that reaction).
The function is idempotent: existing non-zero coefficients at
S[prot_<enzyme>, rxn] are first cleared for the reactions being
updated, then freshly written from current ec.kcat. Running it
twice yields the same result as running it once. Setting a kcat
back to NaN/0 and re-applying clears the previously written
coefficient.
Parameters
modelAn EcModel produced by
make_ec_model, with at least some kcat values assigned tomodel.ec.kcat. Mutated in place.update_rxnsReaction IDs (from
model.ec.rxns) to update. A gecko-light model also takes the IDs of its cobra reactions (see_apply_kcat_constraints_light).Noneor an empty sequence updates all entries, asapplyKcatConstraintsdoes with an emptyupdateRxns; a caller that builds the list from a filter must skip the call when the filter finds nothing.
Raises
ValueErrorIf
update_rxnscontains IDs not present inec.rxns.
Warns
UserWarning If every kcat to be applied is 0 or NaN. Old coefficients are still cleared in this case; nothing is written afterward.
build_rxn_enzyme_coupling#
build_rxn_enzyme_coupling(model: 'EcModel')
Stage 8: populate ec.rxn_enz_mat.
For each reaction ID in ec.rxns and each gene in ec.genes, writes 1.0 at (i, j) if the reaction's GPR contains that gene. After stage 5, every reaction has at most one AND-clause, so this is simply "which enzymes are subunits of the complex catalyzing this reaction."
Downstream functions (e.g. applyComplexData) may later overwrite these 1.0 entries with actual subunit stoichiometries.
Parameters
modelAn EcModel with ec.rxns and ec.genes already populated (stages 6 and 7). Mutated in place.
canonicalize_rxn_id#
canonicalize_rxn_id(rxn_id: str)
Map a split reaction id back to its conventional GEM id.
Returns (base_id, is_reverse). Strips a trailing _EXP_<n>
and then a trailing _REV (so _REV_EXP_<n> is handled too).
Reaction ids that merely contain _REV elsewhere — e.g. a real
id like R_REVERTASE — are left intact, unlike a blanket
str.replace("_REV", "").
EcModel#
A cobra model with enzyme-constraint data attached.
Subclasses cobra.Model so anything you do with a regular
cobra model still works. Adds two attributes:
Attributes
ec: EcDataThe enzyme-constraint data: kcats, enzyme MW, sequence, proteomics concentrations, and the sparse matrix saying which enzymes catalyse which reactions. See
geckopy.ec_model.ec_data.EcData.adapter: ModelAdapter or NoneThe adapter the ecModel was built with (organism parameters, paths, etc.).
Noneif the model was loaded from disk and no adapter was attached at load time.enzymes: EnzymeViewLazy view that lets you reach individual enzymes via
model.enzymes.get_by_id("P00350"). Each call returns a liveEnzymeproxy; reads and writes always go through the underlyingecdata.
Enzyme#
Stateless proxy for one enzyme in an EcModel.
All reads and writes go through model.ec and the underlying
cobra model. Do not cache instances; rebuild via
model.enzymes.get_by_id(uniprot).
EnzymeView#
Lazy DictList-like view over EcModel enzymes.
Always reflects live state of model.ec.enzymes.
fill_kcats_from_isozymes#
fill_kcats_from_isozymes(model: 'EcModel', *, apply: bool=False, aggregate: str='mean')
Fill in missing kcats by combining known kcats across sibling isozymes.
Low-level: collect_kcats and assign_kcats run this function; call
it directly only to change kcats by hand.
Two reactions are siblings if their ec.rxns IDs are identical
after stripping any _EXP_<n> suffix. The _REV suffix is
NOT stripped: forward and reverse reactions share chemistry but
can have different kcats, so they are kept distinct.
For each reaction with no kcat assigned (ec.kcat == 0), find
its siblings whose kcat is set (> 0). If any exist, take their
mean and assign it. Set ec.source to "isozymes" for the
filled entries. Only a kcat of 0 is filled, as in getKcatAcrossIsozymes:
a NaN kcat is not a missing kcat and is left as it is. A NaN sibling
does not contribute to the mean here; in getKcatAcrossIsozymes it
does, so there the mean is NaN and the row is not filled.
Reactions whose siblings all also lack a kcat stay at 0. Reactions with a single isozyme (no siblings beyond themselves) also stay at 0.
Parameters
modelAn EcModel produced by
make_ec_model. Mutated in place. Must not be a gecko-light model.applyIf True, call
apply_kcat_constraintsafter updating ec.kcat so the new values reflect in the S matrix. Default False, as ingetKcatAcrossIsozymes, which only changesec.kcat.aggregateHow to combine sibling kcats:
"mean"(matches MATLAB GECKO),"median"(more robust for log-distributed rate constants), or"max". Default"mean".
Raises
NotImplementedErrorIf
model.ec.gecko_lightis True. Isozyme-averaging does not apply to the light formulation since it does not split reactions per isozyme.
get_reactions_from_enzyme#
get_reactions_from_enzyme(model: 'EcModel', protein_id: str)
Return all reactions catalyzed by a given enzyme, as a DataFrame.
Parameters
modelAn EcModel with populated ec.enzymes and ec.rxn_enz_mat.
protein_idUniProt accession (or whatever IDs are in ec.enzymes), matched case-insensitively (matching MATLAB's
getReactionsFromEnzyme, which usesstrcmpi).
Returns
pandas.DataFrameOne row per catalyzed reaction, with columns:
rxn_id: the reaction ID.kcat: the kcat value (1/s) from ec.kcat (0 if unset).name: the reaction name from the cobra model.gpr: the gene-protein-reaction rule.
Empty DataFrame with the right columns if the enzyme catalyzes no reactions in the current model.
Raises
ValueErrorIf
protein_idis not found in ec.enzymes (case-insensitive). A deliberate Python-API choice, not a parity gap to close: MATLAB'sgetReactionsFromEnzymereturns five empty outputs instead of raising on an unmatched proteinId. See raven-gecko-parity#70.
invert_backwards_only_reactions#
invert_backwards_only_reactions(model: 'cobra.Model')
Flip reactions that are constrained to only carry negative flux.
A reaction with lb < 0 and ub == 0 is physically identical
to a forward-only reaction with inverted stoichiometry and bounds
[0, -lb]. Rewriting it in that canonical form keeps downstream
irreversibility handling simple.
Reactions with lb == 0 (already forward) or with both bounds
negative or both positive are not touched.
Parameters
modelA cobra.Model, mutated in place.
Returns
list of strSorted IDs of reactions that were inverted.
Kcats#
Dict-like view of {reaction_id: kcat_per_s} for one enzyme.
Reads return model.ec.kcat[rxn_idx] for any reaction in which
this enzyme participates (non-zero column in rxn_enz_mat).
Writes update model.ec.kcat for the cell, then call
apply_kcat_constraints for that reaction. Raises
ValueError if the target reaction has more than one enzyme:
per-enzyme kcats are ambiguous in that case; the user must edit
model.ec.kcat[idx] and call apply_kcat_constraints
themselves.
make_ec_model#
make_ec_model(model: cobra.Model, adapter: 'ModelAdapter', *, gecko_light: bool=False, uniprot_db: Optional[UniprotDB]=None, kegg_db: 'Optional[KeggDB]'=None)
Build an enzyme-constrained model from a conventional GEM.
Runs the 12-stage GECKO pipeline end to end and returns the
populated EcModel. The output has:
Reactions split per isozyme where applicable (
_EXP_<N>suffix) and per direction for reversible ones (_REV).One
prot_<uniprot>pseudo-metabolite per enzyme.One
usage_prot_<uniprot>reaction per enzyme drawing from the shared protein pool.A
prot_poolpseudo-metabolite and aprot_pool_exchangereaction acting as the global protein budget.A populated
model.ecsubstructure (kcats, MW, sequences, coupling matrix).
The kcat values themselves are NOT filled in here — they stay
at 0 (0 marks "no kcat assigned") until update_kcat_sources
gathers the kcat source files and assign_kcats decides and
applies one kcat per reaction, or you set them manually via
set_kcat_for_reactions.
Parameters
modelA conventional cobra.Model (the starting GEM). Left unchanged: the function operates on an internal copy, so the caller's model is never mutated (matching the MATLAB GECKO
makeEcModelvalue semantics).adapterA loaded ModelAdapter. Carries organism parameters (taxonomy id, biomass reaction, sigma factor, ...) and the path to the UniProt cache.
gecko_lightBuild a light ecModel instead of a full one. The light layout skips the isozyme split (cobra reactions stay singular), omits the per-enzyme
prot_<id>pseudometabolites andusage_prot_<id>reactions, and keeps only the sharedprot_pool. The per-isozyme bookkeeping moves intoecinstead: each cobra reaction with N isozymes produces N rows inec.rxnsdistinguished by a 3-digit counter prefix (e.g.001_RXN1,002_RXN1). Suitable for large GEMs (HumanGEM, Recon3D) where the full layout's LP size becomes impractical. Seedev/gecko_light_status.md.uniprot_dbPre-loaded UniprotDB. If None, the function loads
adapter.params.path / "data" / "uniprot.tsv", and first downloads it with the[uniprot]settings of the adapter (id,type,gene_id_field,reviewed) when the file is missing, as GECKO'sloadDatabasesdoes.kegg_dbPre-loaded KeggDB. Optional fallback source for protein information and EC numbers. When provided, stage 7 fills genes that UniProt missed (with
ec.enzymesset to the UniProt accession held in the KEGG row, or to the KEGG gene id when that accession is empty), and the EC-number lookup (fill_eccodes_from_database) consults KEGG when the UniProt result is empty or ends with-. If None, the function loadsadapter.params.path / "data" / "kegg.tsv", and first downloads it with the[kegg]settings of the adapter (id,gene_id) when the file is missing; with an emptykegg.idit warns and uses no KEGG data, as GECKO'sloadDatabasesdoes.
Returns
EcModelThe built ecModel.
model.ec.kcatis all 0; fill it in before solving.
Raises
FileNotFoundErrorIf
uniprot_dbis None, nouniprot.tsvis found under the adapter's data folder and[uniprot] idis empty (by default), as GECKO'sloadDatabasesraisesloadDatabases:noUniprotID.RuntimeErrorIf a download fails.
ValueErrorAs
makeEcModeldoes, if the compartment named byadapter.params.enzyme_compis not one of the model's compartment names (a compartment ID that differs from its name is refused), if a metabolite ID starts withprot_, if a reaction ID starts withusage_prot_orprot_poolor ends in_REVor_EXP_<digits>, or if the model has no genes or none of them is found in the databases. Also propagated from individual pipeline stages on inconsistencies (e.g. genes referenced in GPRs that don't exist in the model).
Genes referenced in the model's GPRs but not found in UniProt are
:
left enzyme-unconstrained: they are reported as a single warning
:
summary, and each affected reaction is annotated via
:
```rxn.notes["geckopy_warning"]``.` :
populate_enzyme_data#
populate_enzyme_data(model: 'EcModel', uniprot_db: 'UniprotDB', *, kegg_db: 'KeggDB | None'=None)
Stage 7: fill per-enzyme fields from UniProt (with optional KEGG fallback).
For every gene in the model (sorted alphabetically for reproducibility), a lookup is performed:
adapter.get_uniprot_compatible_genestransforms model gene IDs into a form that should match the UniProt "Gene Names" column.If an
uniprotConversion.tsvis present, it instead transforms model gene IDs directly to UniProt IDs and matches on the "Entry" column.
Matched genes are added to ec.genes / ec.enzymes / ec.mw / ec.sequence (same length as ec.genes), and ec.concs is allocated as NaN of matching length. Unmatched genes are returned as a list.
When kegg_db is supplied, each gene UniProt could not match is
looked up in the KEGG database via
adapter.get_kegg_compatible_genes. KEGG hits feed ec.enzymes
with the UniProt accession stored on the KEGG entry; if that is
empty, the bare KEGG gene ID (KeggDB.kegg_genes) is used as a
fallback identifier. The returned list then names only the genes
that neither source could fill.
Reactions whose GPR references an unmatched gene get a warning note
added to rxn.notes[geckopy_warning]. If such a reaction has at
least one other matched gene, it will still be enzyme-constrained
through that gene. If all its genes are unmatched it will be
unconstrained.
Parameters
modelAn EcModel. Must have
adapterset. Mutated in place.uniprot_dbLoaded UniProt database.
kegg_dbOptional pre-loaded KEGG database, consulted as a fallback for genes UniProt does not match.
None(default) skips the KEGG lookup entirely.
Returns
list of strModel gene IDs (pre-transformation) that did not match.
remove_pseudoreaction_gprs#
remove_pseudoreaction_gprs(model: 'cobra.Model', adapter: 'ModelAdapter')
Clear gene-protein-reaction rules from pseudoreactions.
A reaction is treated as a pseudoreaction if either:
its name contains the substring
pseudoreaction(case-sensitive); orits ID is listed in the first column of
data/pseudoRxns.tsvinside the adapter's project folder, if that file exists.
Parameters
modelA cobra.Model that will be mutated in place: the gene reaction rule of each matched reaction is cleared (empty string). This automatically updates the reaction's
.genesset via cobrapy's GPR handling.adapterProvides the project path used to locate the optional TSV.
Returns
list of strSorted IDs of reactions whose GPR was cleared. Intended for logging and test assertions.
set_kcat_for_reactions#
set_kcat_for_reactions(model: 'EcModel', rxn_ids: Sequence[str], kcat: Union[float, Sequence[float]], *, apply: bool=False)
Set kcat values for one or more reactions in ec.kcat.
As GECKO's setKcatForReactions, each ID in rxn_ids is matched
against ec.rxns without regard to letter case:
An ID that ends in
_EXP_<n>matches the ec.rxns entry with exactly that ID.Any other ID matches every ec.rxns entry whose ID, after removing a trailing
_EXP_<n>, equals it. So in a full model"R2"matchesR2,R2_EXP_1andR2_EXP_2. In a gecko-light model the ec.rxns IDs have a###_prefix (001_R2), which is part of the ID:"R2"matches nothing there and"001_R2"matches that one row.An ID that matches nothing is ignored.
The kcat argument follows numpy-style broadcasting: a single
float applies to every matched reaction; a sequence of length equal
to the total number of matched reactions gives one value per
resolved match, in ec.rxns order; a sequence of length
len(rxn_ids) otherwise gives one value per input ID (broadcast
across that ID's own matches). When both lengths fit, the per-match
form applies, so an ID that matches nothing never shifts the values.
That last form lets one un-suffixed rxn_id that expands to
multiple isozymes take a list of per-isozyme values, matching
MATLAB setKcatForReactions's positional semantics exactly:
values are assigned to matches in whatever order they occur in
ec.rxns, with no check that this is the order the caller
intended. This is real but fragile as an API surface -- prefer
passing the suffixed reaction IDs explicitly when the mapping
matters, so intent doesn't depend on ec.rxns's row order.
ec.source is set to "manual" for every reaction changed by
this call, which drops any tuning status the source had.
Parameters
modelAn EcModel with ec.rxns populated. Mutated in place.
rxn_idsReaction identifiers to update.
kcatNew kcat value(s) in 1/s. Scalar or sequence (see above).
applyIf True, call
apply_kcat_constraintsfor the changed reactions after updating ec.kcat / ec.source so the change is reflected in the S matrix immediately. If False (default, as in MATLAB, which only changes ec.kcat and ec.source), the caller invokesapply_kcat_constraintsafterwards.
Returns
list of strIDs of the reactions whose kcat was changed (the post-expansion set), in the order in which they were updated.
Raises
ValueErrorIf kcat has a length other than 1,
len(rxn_ids), or the total number of resolved matches.
set_prot_pool_size#
set_prot_pool_size(model: 'EcModel', *, p_tot: float | None=None, f: float | None=None, sigma: float | None=None)
Set the upper bound of prot_pool_exchange (the protein budget).
Ported from GECKO MATLAB: src/change_model/setProtPoolSize.m.
The protein pool exchange represents the cell's total enzyme supply. Its upper bound is what limits how much protein the model can deploy at once. The formula is:
bound = p_tot * f * sigma * 1000
where:
p_totis the total cellular protein content (g/gDCW),fis the fraction of that protein that's made up of enzymes in the model (g model-enzyme / g total-protein),sigmais the average enzyme saturation factor (0-1) — how close enzymes run to their Vmax in vivo,the
1000converts units (ec.mwis in Da and fluxes are in mmol/gDW/h, so multiplyingp_tot(g/gDW) by 1000 brings it to mg/gDW, matching the mg/mmol that Da represents).
When called with no arguments, the function reads p_tot,
f, and sigma from the adapter. Any of the three can
be overridden via keyword.
Parameters
modelAn EcModel with
prot_pool_exchangealready added (stage 12).p_tot, f, sigmaOverride values. If None, read from
model.adapter.params.
Returns
floatThe bound that was set (for logging or assertions).
Raises
ValueErrorIf the model has no adapter and any argument is None, or if
prot_pool_exchangeis not in the model.
split_light_rxn_id#
split_light_rxn_id(prefixed_id: str)
Split a gecko-light prefixed ec.rxn id into (isozyme_index, cobra_id).
Light models prefix each ec.rxns entry with a fixed-width zero-padded
counter (e.g. "001_RXN1" -> (1, "RXN1")). Helpers that need
to look up the underlying cobra reaction use this to strip the prefix.
Raises ValueError on an unprefixed id.