Case 2: EC reaction information in KEGG
Starting from an Enzyme Commission (EC) number, this walkthrough finds the associated KEGG reactions, their compounds, and the orthology group.
1. Reactions associated with an EC number
kegg_link takes the target database (reaction) and the EC number as ec:X.X.X.X, and returns every reaction linked to that enzyme:
rxns = KEGGAPI.kegg_link("reaction", "ec:3.2.1.14")
DataFrame(rxns.data, rxns.colnames)4×2 DataFrame
| Row | Target ID | Source ID |
|---|---|---|
| String | String | |
| 1 | ec:3.2.1.14 | rn:R01206 |
| 2 | ec:3.2.1.14 | rn:R02334 |
| 3 | ec:3.2.1.14 | rn:R06081 |
| 4 | ec:3.2.1.14 | rn:R06082 |
2. Reaction information
The second column of rxns.data holds the reaction identifiers (rn:R…). Pass them to kegg_get to retrieve the full entries; .data is a vector with one flat-file String per reaction:
info = KEGGAPI.kegg_get(rxns.data[2])
println(join(first(split(info.data[1], "\n"), 6), "\n"))ENTRY R01206 Reaction
NAME [1,4-(N-acetyl-beta-D-glucosaminyl)]n glycanohydrolase
DEFINITION Chitin + H2O <=> N-Acetyl-D-glucosamine + Chitin
EQUATION C00461 + C00001 <=> C00140 + C00461
REMARK Same as: R06081
RCLASS RC00467 C00140_C004613. Compounds involved in a reaction
cpds = KEGGAPI.kegg_link("compound", "rn:R01206")
DataFrame(cpds.data, cpds.colnames)4×2 DataFrame
| Row | Target ID | Source ID |
|---|---|---|
| String | String | |
| 1 | rn:R01206 | cpd:C00001 |
| 2 | rn:R01206 | cpd:C00140 |
| 3 | rn:R01206 | cpd:C00461 |
| 4 | rn:R01206 | cpd:C00461 |
Retrieve the compound entries the same way as the reactions:
cpd_info = KEGGAPI.kegg_get(cpds.data[2])
println(join(first(split(cpd_info.data[1], "\n"), 6), "\n"))ENTRY C00001 Compound
NAME H2O;
Water
FORMULA H2O
EXACT_MASS 18.0106
MOL_WEIGHT 18.024. Reaction image
The :image option returns the PNG bytes for a reaction, which you can save to disk:
img = KEGGAPI.kegg_get("rn:R01206", :image)
open("R01206.png", "w") do io
write(io, img.data)
end5. Orthology group for a reaction
ko = KEGGAPI.kegg_link("ko", "rn:R01206")
DataFrame(ko.data, ko.colnames)4×2 DataFrame
| Row | Target ID | Source ID |
|---|---|---|
| String | String | |
| 1 | rn:R01206 | ko:K01183 |
| 2 | rn:R01206 | ko:K13381 |
| 3 | rn:R01206 | ko:K20547 |
| 4 | rn:R01206 | ko:K29107 |