A parser for chemical reaction formulae. Supports various reaction arrow formats and compound notation styles.
ReactionParser
01 Syntax
02 Methods
| Name | Overloads | Summary |
|---|---|---|
| Parse | 1 | Parses a reaction formula string into a ParsedReaction object |
| TryParse | 1 | Tries to parse a reaction formula string |
| ParseFormula | 1 | Parses a reaction formula and returns the stoichiometry as a dictionary |
| FindArrowIndex | 1 | Finds the index of the reaction arrow in the formula |
| ParseSide | 1 | Parses one side of a reaction (either reactants or products) |
| SplitByPlus | 1 | Splits a string by '+' while respecting charges and other special cases |
| ParseCompound | 1 | Parses a single compound with optional coefficient and phase |
| Normalize | 1 | Normalizes a reaction formula by standardizing whitespace and arrow format |
03 Fields
| Name | Overloads | Summary |
|---|---|---|
| PossibleReactionArrows | 2 | Possible reaction arrows that can be used in reaction formulae |
04 Members
String)Parses a reaction formula string into a ParsedReaction object
| Name | Type | Description |
|---|---|---|
formula | String | The reaction formula string (e.g., "glucose + ATP => glucose-6-phosphate + ADP") |
A ParsedReaction object containing the parsed reaction data
String, ParsedReaction)Tries to parse a reaction formula string
| Name | Type | Description |
|---|---|---|
formula | String | The reaction formula string |
result | ParsedReaction | The parsed reaction if successful |
True if parsing succeeded, false otherwise
String)Parses a reaction formula and returns the stoichiometry as a dictionary
| Name | Type | Description |
|---|---|---|
formula | String | The reaction formula string |
A dictionary mapping compound IDs to their stoichiometric coefficients
String, String)Finds the index of the reaction arrow in the formula
String)Parses one side of a reaction (either reactants or products)
String)Splits a string by '+' while respecting charges and other special cases
String)Parses a single compound with optional coefficient and phase
String)Normalizes a reaction formula by standardizing whitespace and arrow format
| Name | Type | Description |
|---|---|---|
formula | String | The reaction formula to normalize |
The normalized formula
Possible reaction arrows that can be used in reaction formulae