Commit 4ecc7153 authored by Avi Flamholz's avatar Avi Flamholz

More cleanup to usage.

parent 755aa8a3
......@@ -10,41 +10,48 @@ A command-line API with minimal dependencies for calculation of standard thermod
# Example Usage
Import the API and create an instance.
Import the API and create an instance. Creating the EquilibratorAPI class instance reads in all the data that is used to calculate thermodynamic potentials of reactions.
```python
from equilibrator_api import EquilibratorAPI, Reaction
eq_api = EquilibratorAPI()
```
Now you can parse a reaction from a KEGG-style reaction string. The example given is ATP hydrolysis to ADP and Pi
You can parse a reaction from a KEGG-style reaction string. The example given is ATP hydrolysis to ADP and inorganic phosphate.
```python
rxn_str = "C00002 + C00001 = C00008 + C00009"
rxn = Reaction.parse_formula(rxn_str)
```
Finally you can calculate various things for this reaction
We highly recommend that you check that the reaction is atomically balanced (conserves atoms) and charge balanced (redox neutral). We've found that it's easy to accidentally write unbalanced reactions and we always check ourselves.
```python
if not rxn.check_full_reaction_balancing():
print '%s is not balanced', rxn
```
Now we know that the reaction is "kosher" and we can calculate the standard change in Gibbs potential due to this reaction.
```python
# You control the pH and ionic strength!
# ionic strength is in Molar units.
dG0_prime, dG0_uncertainty = eq_api.dG0_prime(
rxn, pH=6.5, ionic_strength=0.2)
print u"dG0' = %.1f \u00B1 %.1f kJ/mol\n" % (
dG0_prime, dG0_uncertainty)
```
# reversibility index is a measure of reaction reversibility
# that accounts for stoichiometry.
# https://doi.org/10.1093/bioinformatics/bts317
You can also calculate the [reversibility index](https://doi.org/10.1093/bioinformatics/bts317) for this reaction.
```python
ln_RI = rxn.reversibility_index(pH=6.5, ionic_strength=0.2)
print u'ln(Reversibility Index) = %.1f\n' % ln_RI
```
# dependenceis:
The reversibility index is a measure of the degree of the reversibility of the reaction that is normalized for stoichiometry. If you are interested in assigning reversibility to reactions we recommend this measure because 1:2 reactions are much "easier" to reverse than reactions with 1:1 or 2:2 reactions. You can see the paper linked above for more information.
# dependencies:
- python 2.7
- numpy (preferably >= 1.12.0)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment