Skip to main content

eQuilibrator API - A command-line API with minimal dependencies for calculation of standard thermodynamic potentials of biochemical reactions using the data found on eQuilibrator. Does not require any network connections.

Project description

eQuilibrator-API
================
[![pipeline status](https://gitlab.com/elad.noor/equilibrator-api/badges/master/pipeline.svg)](https://gitlab.com/elad.noor/equilibrator-api/commits/master)
[![Join the chat at https://gitter.im/equilibrator-devs/equilibrator-api](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/equilibrator-devs/equilibrator-api?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)


A command-line API with minimal dependencies for calculation of standard
thermodynamic potentials of biochemical reactions using the data found on
[eQuilibrator](http://equilibrator.weizmann.ac.il/).
Does not require any network connections.

## Current Features

* Example scripts for singleton and bulk calculations.
* Calculation of standard Gibbs potentials of reactions (together with confidence intervals).
* Calculation of standard reduction potentials of half-cells.

To access more advanced features, such as adding new compounds that are not
available in the KEGG database, try using our full-blown
[Component Contribution](https://github.com/eladnoor/component-contribution)
package.

## Cite us

If you plan to use results from equilibrator-api in a scientific publication,
please cite our paper:

Noor E, Haraldsdóttir HS, Milo R, Fleming RMT. Consistent estimation of Gibbs
energy using component contributions. PLoS Comput Biol. 2013;9: e1003098.

## Installation

The easiest way to get eQuilibrator-API up an running is using PyPI:
```
pip install equilibrator-api
```

Alternatively, you could install from source:
```
git clone https://gitlab.com/elad.noor/equilibrator-api.git
cd equilibrator-api
python setup.py install
```

## Example Usage

Import the API and create an instance. Creating the EquilibratorAPI class
instance reads all the data that is used to calculate thermodynamic potentials of reactions.

```python
from equilibrator_api import ComponentContribution, Reaction, ReactionMatcher
eq_api = ComponentContribution(pH=6.5, ionic_strength=0.2) # loads data
```

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)
```

Alternatively, you can use plaintext to describe the reaction, just like in eQuilibrator:
```python
reaction_matcher = ReactionMatcher()
rxn = reaction_matcher.match('ATP + H2O = ADP + orthophosphate')
```

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 in this KEGG-style format and
so 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 safely proceed to
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)
print("dG0' = %.1f \u00B1 %.1f kJ/mol\n" % (dG0_prime, dG0_uncertainty))
```

You can also calculate the [reversibility index](https://doi.org/10.1093/bioinformatics/bts317) for this reaction.

```python
ln_RI = rxn.reversibility_index()
print('ln(Reversibility Index) = %.1f\n' % ln_RI)
```

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.

### Example of pathway analysis using Max-min Driving Force:
First, download an example configuration file (in SBtab format):
```
curl https://gitlab.com/elad.noor/equilibrator-api/raw/master/equilibrator_api/tests/EMP_glycolysis_full_SBtab.tsv > example.tsv
```

Then inside the python3 shell:
```python
from equilibrator_api import Pathway
pp = Pathway.from_sbtab('example.tsv')
mdf_res = pp.calc_mdf()
print('MDF = ', mdf_res.mdf)
mdf_res.mdf_plot.show()
```

## Dependencies:
- python 3.6
- numpy (preferably >= 1.15.0)

### Only if running MDF analysis:
- scipy (preferably >= 1.0.0)
- optlang (1.2.3)
- sbtab (0.9.41)
- matplotlib (3.0.0)
- pandas (0.23.4)

### Only if planning to use ReactionMatcher:
- nltk (3.2.5)
- pyparsing (2.2.0)


Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

equilibrator_api-0.1.7.tar.gz (13.9 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

equilibrator_api-0.1.7-py3.6.egg (28.1 MB view details)

Uploaded Egg

equilibrator_api-0.1.7-py3-none-any.whl (28.1 MB view details)

Uploaded Python 3

File details

Details for the file equilibrator_api-0.1.7.tar.gz.

File metadata

  • Download URL: equilibrator_api-0.1.7.tar.gz
  • Upload date:
  • Size: 13.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.19.4 CPython/3.6.7

File hashes

Hashes for equilibrator_api-0.1.7.tar.gz
Algorithm Hash digest
SHA256 337f5ffc0f2d9e28392d58e60d7af2c8253fe5854acfc99ad308f726f25310d4
MD5 359d706c1299bff499ae00c8802b3bc8
BLAKE2b-256 c30c9a5fde4b8304405b344764434bfdad3bac1da296c691171404ec7571040e

See more details on using hashes here.

File details

Details for the file equilibrator_api-0.1.7-py3.6.egg.

File metadata

  • Download URL: equilibrator_api-0.1.7-py3.6.egg
  • Upload date:
  • Size: 28.1 MB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.19.4 CPython/3.6.7

File hashes

Hashes for equilibrator_api-0.1.7-py3.6.egg
Algorithm Hash digest
SHA256 4dcb4f37f9a0de13a2003f5ec75c3bb5c0413ff9f8c9f2f4794b06c7c4e21563
MD5 8299be0c30889eb7e9338895e73b280f
BLAKE2b-256 3bafd815cdaf9eb270e6dcdd8d66eaf65de6067085c0761f2e26c28bab5e2fad

See more details on using hashes here.

File details

Details for the file equilibrator_api-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: equilibrator_api-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 28.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.19.4 CPython/3.6.7

File hashes

Hashes for equilibrator_api-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 93d6a3ad6aaf9e3c323b39bfdf7849af3c138e229a680ca6340930f4fafebbce
MD5 c9e5e218af7492cf9be06f8bc7483c59
BLAKE2b-256 e50cc54a6492531e5e14e169e6bf208b14287a9159b26ce31c59b32d5b40588d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page