R4AOP gives R users access to the AOP-Wiki through its REST API. Adverse Outcome Pathways, Key Events, Key Event Relationships, stressors, chemicals and genes are retrieved by calling a function with arguments, and are returned as tibbles that fit straight into an R workflow. The AOP-Wiki RDF data are normally queried with SPARQL; for the routine tasks covered here, the package removes that step.
# install.packages("remotes")
remotes::install_github("SidraAdil/R4AOP")
Find the Adverse Outcome Pathways that describe liver fibrosis, then follow one of them to its Key Events and genes.
library(R4AOP)
fibrosis <- aop_list(q = "liver fibrosis")
fibrosis[, c("id", "title", "oecd_status")]
#> # A tibble: 4 × 3
#> id title oecd_status
#> <int> <chr> <chr>
#> 1 38 Protein Alkylation leading to Liver Fibrosis WPHA/WNT E…
#> 2 144 Endocytic lysosomal uptake leading to liver fibrosis Under Revi…
#> 3 383 Inhibition of Angiotensin-converting enzyme 2 leading to li… Under Deve…
#> 4 494 AhR activation leading to liver fibrosis <NA>
aop_summary() gives the overview of one AOP: its Key Events in causal
order, from the molecular initiating event to the adverse outcome, with
the OECD status, the taxonomic applicability and the stressors in the
header.
aop_summary(38)
#> AOP 38: Protein Alkylation leading to Liver Fibrosis
#> OECD status: WPHA/WNT Endorsed
#> Taxa: Rattus norvegicus (10116)
#> Taxa (text): WCS_9606
#> Stressors: Allyl Alcohol; Carbon tetrachloride; Dimethyl nitrosamine; Retinol; Thioacetamide
#> Data version: 2026.10.31-ca48500
#>
#> # A tibble: 7 × 5
#> step ke_id ke_title level role
#> <int> <int> <chr> <chr> <chr>
#> 1 1 244 Alkylation, Protein Molecular mie
#> 2 2 55 Increase, Cell injury/death Cellular ke
#> 3 3 1492 Tissue resident cell activation Cellular ke
#> 4 4 1493 Increased Pro-inflammatory mediators Tissue ke
#> 5 5 265 Increase, Hepatic stellate cell activation Cellular ke
#> 6 6 68 Increase, Collagen accumulation Tissue ke
#> 7 7 344 Increase, Liver fibrosis Organ ao
genes <- aop_genes(38)
nrow(genes)
#> [1] 245
table(genes$detected_by)
#>
#> both ner regex
#> 54 182 9
Genes are linked to individual Key Events, so each Key Event can be treated as a candidate gene set. The molecular initiating event and the adverse outcome are marked in the titles, in green and red, and a Key Event without gene links is shown with an empty bar:
aop_plot_genes(38)

Key Events are also described in ontology terms, as a biological process, an optional biological object and an action. Blank cells mark components that AOP-Wiki does not record:
aop_plot_components(38)

The same data can be entered from the other side. Starting from a
stressor, stressor_aops() returns the AOPs it is used in and the
adverse outcomes they end in:
stressor_aops("hexachlorobenzene")[, c("aop_id", "aop_title", "ao_title")]
#> # A tibble: 1 × 3
#> aop_id aop_title ao_title
#> <int> <chr> <chr>
#> 1 131 Aryl hydrocarbon receptor activation leading to uroporphyria Uroporphy…
The gene links can also be returned as a GeneSetCollection, one gene
set per Key Event, which passes straight to Bioconductor enrichment
tools:
gsc <- ke_gene_sets(38)
names(gsc)
#> [1] "KE_55" "KE_68" "KE_265" "KE_344" "KE_1492" "KE_1493"
| Topic | Functions |
|---|---|
| AOPs |
aop_list(), aop_get(), aop_key_events(), aop_kers(), aop_stressors(), aop_chemicals(), aop_genes(), aop_methods()
|
| Key Events |
ke_list(), mie_list(), ao_list(), ke_get(), ke_aops(), ke_upstream(), ke_downstream(), ke_mies(), ke_adverse_outcomes(), ke_stressors(), ke_chemicals()
|
| Relationships |
ker_list(), ker_get()
|
| Stressors and chemicals |
stressor_list(), stressor_get(), stressor_aops(), chemical_list(), chemical_get(), chemical_aops(), chemical_key_events(), chemical_pathways()
|
| Genes and search |
gene_list(), gene_get(), ke_gene_sets(), aop_search()
|
| Key Event Components |
ke_components(), aop_components(), aop_plot_components()
|
| Summaries |
aop_summary(), aop_gene_summary(), aop_plot_genes()
|
| Dataset |
aop_dataset_info(), aop_data_version(), aop_cache_clear()
|
Responses are cached for the session, and list endpoints are paginated
automatically, so a call such as ke_list() returns all Key Events
rather than the first page.
AOP-Wiki is curated continuously. Every result carries the version of the data it came from, which can be reported alongside an analysis:
aop_data_version(fibrosis)
#> [1] "2026.10.31-ca48500"
Data come from the AOP-Wiki RDF API, maintained by the Department of Translational Genomics (TGX) at Maastricht University, and are licensed CC BY-SA 4.0. The package code is licensed MIT.
When using R4AOP, please cite both the package and AOP-Wiki.