Reaction Equivalence
reactions_equivalent(reaction1, reaction2)
Check if two reactions are equivalent.
Two reactions are equivalent if they meet the following conditions:
- They have the same number of reactants.
- They have the same initial assembly, and the same entering assembly (or both have none).
- The binding sites involved in the exchange are equivalent:
- Intra-molecular: the trio
[metal, leaving, entering]must be equivalent. - Inter-molecular: the pair
[metal, leaving]of the initial assembly must be equivalent, and the entering binding site of the entering assembly must be equivalent to that of the other reaction.
- Intra-molecular: the trio
Here, two binding site lists (e.g. [metal1, leaving1] and [metal2, leaving2]) are equivalent if there is at least one isomorphism which maps each binding site in the first list to a binding site in the second list. The order of the binding sites in the list DOES matter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
reaction1
|
IntraReaction | InterReaction
|
The first reaction to compare. |
required |
reaction2
|
IntraReaction | InterReaction
|
The second reaction to compare. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the reactions are equivalent, False otherwise. |
Notes
Reaction equivalence can be determined only by the left-hand side information (i.e., initial assembly, entering assembly, and MLE), so the right-hand side information (i.e., product assembly, leaving assembly) is not considered in this function.
Source code in src/nasap_net/reaction_equivalence/core.py
compute_reaction_list_diff(reactions1, reactions2)
Compute the difference between two lists of reactions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
reactions1
|
Iterable[Reaction]
|
The first list of reactions. |
required |
reactions2
|
Iterable[Reaction]
|
The second list of reactions. |
required |
Returns:
| Type | Description |
|---|---|
ReactionListDiff
|
An object containing reactions only in the first list and reactions only in the second list. |