Rhea REST API

Content:

Introduction

The Rhea website has RESTful URLs that can be bookmarked, linked and used in programs for all entries, queries and tools available through the website. The data is available in all formats provided on the website, i.e. individual reactions in RXN and RD formats and search result tables in customizable tab-separated values format.

Please consider to provide a contact email address as part of the User-Agent header that your programs set. This will allow us to contact you in case of problems (see our privacy notice).

REST URL syntax

Entries

The URL for an individual entry consists of the dataset name rhea, the entry's unique identifier (without prefix) and the format type, e.g.

https://www.rhea-db.org/rhea/10661.rxn
https://www.rhea-db.org/rhea/10661.rd

Please note that the MDL CT file formats RXN and RD represent only unidirectional processes. For this reason, bidirectional reactions and reactions with undefined directions cannot be described in these formats.

Tables

The URL for a query result consists of the dataset name rhea and the actual query. The following query parameters are supported:

ParameterValuesDescription
querystringQuery string. An empty query string will retrieve all entries in a data set.
columnscomma-separated list of column namesColumns to include in result.
formattsvResult format: tsv returns data for the selected columns as tab-separated values.
limitintegerMaximum number of results to retrieve.

The easiest way to compose your query string and columns list is to try the query interactively and then click the 'Share' icon to get the base URL to which you can then add the format parameter.

Column names

Column labelColumn IDValue
Reaction identifierrhea-idreaction identifier (with prefix RHEA)
Equationequationtextual description of the reaction equation
ChEBI namechebisemicolon-separated list of ChEBI names used as reaction participants
ChEBI identifierchebi-idsemicolon-separated list of ChEBI identifiers used as reaction participants
EC numberecsemicolon-separated list of EC numbers (with prefix EC)
Enzymesuniprotnumber of proteins (UniProtKB entries) annotated with the Rhea reaction
Gene OntologygoGO identifier (with prefix GO) and label
PubMedpubmedsemicolon-separated list of PubMed identifiers (without prefix)
Cross-reference (EcoCyc)reaction-xref(EcoCyc)
Cross-reference (MetaCyc)reaction-xref(MetaCyc)
Cross-reference (KEGG)reaction-xref(KEGG)
Cross-reference (Reactome)reaction-xref(Reactome)
Cross-reference (N-CSA/MACiE)reaction-xref(M-CSA)

Rhea website examples

For testing you can use the limit= field to retrieve only a small number of records.

Retrieve Rhea reaction identifiers and equation text

URL

curl "https://www.rhea-db.org/rhea/?query=&columns=rhea-id,equation&format=tsv&limit=10" -o test.tsv

Python 3

import requests
url= "https://www.rhea-db.org/rhea?"
parameter = {
  "query":'',
  "columns":"rhea-id,equation",
  "format":'tsv',
  "limit":10,
}
response = requests.get(url,params=parameter)

Retrieve Rhea reactions that have enzymes curated in UniProtKB

URL

curl "https://www.rhea-db.org/rhea/?query=uniprot:*&columns=rhea-id,equation,uniprot&format=tsv&limit=10" -o test.tsv

Python 3

import requests
url= "https://www.rhea-db.org/rhea?"
parameter = {
  "query":'uniprot:*',
  "columns":"rhea-id,equation,uniprot",
  "format":'tsv',
  "limit":10,
}
response = requests.get(url,params=parameter)

UniProt website examples

  • The reviewed:true condition limits the search to the UniProtKB/Swiss-Prot section.
  • The fragment:false condition excludes proteins for which only a part of their sequence is known.

Retrieve UniProtKB/Swiss-Prot entries with curated Rhea reactions

URL

curl "https://rest.uniprot.org/uniprotkb/search?fields=accession,rhea&format=tsv&query=((cc_catalytic_activity:"rhea:*") AND (fragment:false) AND (reviewed:true))&size=10" -o test.tab

Python 3

import requests
url= "https://rest.uniprot.org/uniprotkb/search?"

parameter = {
  "query":'((cc_catalytic_activity:"rhea:*") AND (fragment:false) AND (reviewed:true))',
  "fields":"accession,rhea",
  "format":'tsv',
  "size":10,
}
response = requests.get(url,params=parameter)

Please note that the UniProt REST service may return more than one Rhea identifier per UniProt entry, including identifiers of undefined and directional (LR, RL) reactions. Multiple values are separated by space.

Retrieve UniProtKB/Swiss-Prot sequences annotated with RHEA:10020

URL

curl "https://rest.uniprot.org/uniprotkb/search?format=fasta&query=((cc_catalytic_activity:"rhea:10020") AND (fragment:false) AND (reviewed:true))" -o uniprot_rhea_10020.fasta

Python 3

import requests
url= "https://rest.uniprot.org/uniprotkb/search?"

parameter = {
        "query":'((cc_catalytic_activity:"rhea:10020") AND (fragment:false) AND (reviewed:true))',
        "format":'fasta',
}
response = requests.get(url,params=parameter)