substrate_expansion

Position-safe expansion and reduction for Substrates CSV inputs.

Module Contents

class substrate_expansion.ExpandedSubstrate

One flattened protein/substrate pair and its original positions.

class substrate_expansion.SubstrateExpansionPlan

A positional mapping between reaction rows and flattened substrates.

substrate_expansion.split_substrate_list(value: Any) list[str]

Split a semicolon list, trimming and ignoring empty separator fragments.

substrate_expansion.reduce_substrate_predictions(*, plan: SubstrateExpansionPlan, target: str, child_predictions: Sequence[Any], child_sources: Sequence[str], child_errors: dict[int, str] | None, child_details: Sequence[str] | None, reaction_count: int) ReducedSubstrateResults

Reduce flattened child results back to their original reaction rows.