| Title: | Access the AOP-Wiki Through Its REST API |
|---|---|
| Description: | Provides functions to retrieve Adverse Outcome Pathways (AOPs), Key Events, Key Event Relationships, stressors, chemicals and genes from the AOP-Wiki through its REST API, without writing SPARQL queries. Each exported function corresponds to one API endpoint, and results are returned as tibbles that fit directly into an R workflow. Pagination, input validation and session caching are handled internally, and every result carries the version of the AOP-Wiki data it came from, so that analyses can be reported reproducibly. |
| Authors: | Sidra Adil [aut, cre] (ORCID: <https://orcid.org/0000-0002-3044-3561>), Egon Willighagen [ctb] (ORCID: <https://orcid.org/0000-0001-7542-0286>), Tooba Abbassi-Daloii [ctb] (ORCID: <https://orcid.org/0000-0002-4904-3269>), Marvin Martens [aut] (ORCID: <https://orcid.org/0000-0003-2230-0840>) |
| Maintainer: | Sidra Adil <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.99.0 |
| Built: | 2026-11-03 19:49:40 UTC |
| Source: | https://github.com/BiocStaging/R4AOP |
List Adverse Outcomes
ao_list( q = NULL, level = NULL, aop = NULL, taxon = NULL, organ = NULL, cell_type = NULL, gene = NULL )ao_list( q = NULL, level = NULL, aop = NULL, taxon = NULL, organ = NULL, cell_type = NULL, gene = NULL )
q |
Free-text search term. |
level |
Biological level of organisation. |
aop |
Only Key Events belonging to this AOP id. |
taxon, organ, cell_type
|
Biological context filters. |
gene |
Only Key Events linked to this gene. |
A tibble with one row per Adverse Outcome.
ao_list(q = "carcinoma")ao_list(q = "carcinoma")
Responses are cached for the current R session. Clear the cache to force fresh requests, for example after the AOP-Wiki data has been updated.
aop_cache_clear()aop_cache_clear()
Invisibly TRUE.
aop_cache_clear()aop_cache_clear()
Chemicals of an AOP
aop_chemicals(aop_id)aop_chemicals(aop_id)
aop_id |
AOP identifier. |
A tibble of chemicals.
aop_chemicals(1)aop_chemicals(1)
Retrieves the Key Event Components of each Key Event of an AOP and returns them in a single table. One request is made per Key Event, so the first call for a large AOP takes a few seconds. Responses are cached for the session.
aop_components(aop_id)aop_components(aop_id)
aop_id |
AOP identifier. |
A tibble as returned by ke_components(), with the columns
ke_title and role added.
aop_components(38)aop_components(38)
Reports which version of the AOP-Wiki dataset a result came from. Use it when reporting results, so an analysis can be reproduced later.
aop_data_version(x = NULL)aop_data_version(x = NULL)
x |
A tibble returned by an R4AOP function. If missing, the current version is fetched from the API. |
A version string, e.g. "2026.09.12".
aops <- aop_list(q = "liver") aop_data_version(aops) aop_data_version()aops <- aop_list(q = "liver") aop_data_version(aops) aop_data_version()
Version, license, data dumps and entity counts of the AOP-Wiki RDF dataset.
aop_dataset_info()aop_dataset_info()
A tibble with one row.
aop_dataset_info()aop_dataset_info()
Counts the distinct genes linked to each Key Event of an AOP, separately for
each detection method (regex, ner or both).
aop_gene_summary(aop_id)aop_gene_summary(aop_id)
aop_id |
AOP identifier. |
A tibble with the columns ke_id, ke_title, role,
detected_by and n_genes.
aop_gene_summary(38)aop_gene_summary(38)
Genes linked to an AOP
aop_genes(aop_id, method = NULL)aop_genes(aop_id, method = NULL)
aop_id |
AOP identifier. |
method |
How genes were linked: one of "any", "regex", "ner" or "both". |
A tibble of genes.
aop_genes(1)aop_genes(1)
Get a single Adverse Outcome Pathway
aop_get(aop_id, include = NULL)aop_get(aop_id, include = NULL)
aop_id |
AOP identifier, e.g. |
include |
Optional extra content to request from the API. |
A tibble with one row.
aop_get(1)aop_get(1)
Key Event Relationships of an AOP
aop_kers(aop_id)aop_kers(aop_id)
aop_id |
AOP identifier. |
A tibble of KERs.
aop_kers(1)aop_kers(1)
Key Events of an AOP
aop_key_events(aop_id, role = NULL)aop_key_events(aop_id, role = NULL)
aop_id |
AOP identifier. |
role |
Optional filter: one of "mie", "ke" or "ao". |
A tibble of Key Events.
aop_key_events(1) aop_key_events(1, role = "mie")aop_key_events(1) aop_key_events(1, role = "mie")
Retrieve AOPs from the AOP-Wiki, optionally filtered. All filters are optional; unused ones are not sent to the API.
aop_list( q = NULL, status = NULL, taxon = NULL, ke = NULL, mie = NULL, ao = NULL, stressor = NULL, chemical = NULL, modified_since = NULL, resolve_titles = FALSE )aop_list( q = NULL, status = NULL, taxon = NULL, ke = NULL, mie = NULL, ao = NULL, stressor = NULL, chemical = NULL, modified_since = NULL, resolve_titles = FALSE )
q |
Free-text search term, e.g. "liver". |
status |
OECD status of the AOP. |
taxon |
Taxon filter. |
ke, mie, ao
|
Identifier of a Key Event, Molecular Initiating Event or Adverse Outcome that the AOP must contain. |
stressor |
Stressor identifier. |
chemical |
Chemical identifier (CAS number). |
modified_since |
Only AOPs modified after this date ("YYYY-MM-DD"). |
resolve_titles |
If |
A tibble with one row per AOP.
aop_list(q = "liver") aop_list(q = "liver fibrosis", resolve_titles = TRUE)aop_list(q = "liver") aop_list(q = "liver fibrosis", resolve_titles = TRUE)
Methods described for measuring the Key Events of an AOP.
aop_methods(aop_id)aop_methods(aop_id)
aop_id |
AOP identifier. |
A tibble of measurement methods.
aop_methods(1)aop_methods(1)
Shows, for every Key Event of an AOP, the biological process, the biological object and the action that describe it, together with their ontology identifiers. Key Events are ordered from the molecular initiating event to the adverse outcome, and those two are marked in their titles, coloured green and red when the marquee package is installed. Components that AOP-Wiki does not record are left blank.
aop_plot_components(aop_id, wrap = 26)aop_plot_components(aop_id, wrap = 26)
aop_id |
AOP identifier. |
wrap |
Width in characters at which long terms are wrapped. |
A ggplot object.
aop_plot_components(38)aop_plot_components(38)
Draws a bar chart of the distinct genes linked to each Key Event of an AOP, coloured by detection method. Every Key Event of the AOP is shown, so a Key Event without gene links appears with an empty bar. The molecular initiating event and the adverse outcome are marked in the Key Event titles, and coloured green and red when the marquee package is installed. Requires the ggplot2 package.
aop_plot_genes(aop_id)aop_plot_genes(aop_id)
aop_id |
AOP identifier. |
A ggplot object, which can be further modified in the usual way.
aop_plot_genes(38)aop_plot_genes(38)
Free-text search over AOPs, Key Events, KERs, stressors and chemicals at once.
aop_search(q, types = NULL, limit = 100)aop_search(q, types = NULL, limit = 100)
q |
Search term (1 to 200 characters). |
types |
Restrict to certain entity types, e.g. "aop" or "key_event". |
limit |
Maximum number of results. |
A tibble of matches, with a type column and a relevance score.
aop_search("liver")aop_search("liver")
Stressors of an AOP
aop_stressors(aop_id)aop_stressors(aop_id)
aop_id |
AOP identifier. |
A tibble of stressors.
aop_stressors(1)aop_stressors(1)
Returns the Key Events of an AOP in causal order, from the molecular initiating event to the adverse outcome, with the biological level of organisation and the role of each event. The title of the AOP, its OECD status, its taxonomic applicability, its stressors and the version of the data are attached as attributes and shown when the result is printed.
aop_summary(aop_id)aop_summary(aop_id)
aop_id |
AOP identifier. |
The order is computed from the Key Event Relationships, since the Key Events themselves are not stored in sequence. An AOP that branches has no single chain, so the order is then one valid sequence among several, and the printed output says so.
A tibble with the columns step, ke_id, ke_title, level and
role, of class aop_summary.
aop_summary(38)aop_summary(38)
AOPs linked to a chemical
chemical_aops(cas)chemical_aops(cas)
cas |
CAS registry number, e.g. "56-23-5". |
A tibble of AOPs.
chemical_aops("56-23-5")chemical_aops("56-23-5")
Get a single chemical
chemical_get(cas)chemical_get(cas)
cas |
CAS registry number, e.g. "56-23-5". |
A tibble with one row.
chemical_get("56-23-5")chemical_get("56-23-5")
Key Events linked to a chemical
chemical_key_events(cas, role = NULL)chemical_key_events(cas, role = NULL)
cas |
CAS registry number, e.g. "56-23-5". |
role |
Optional filter: one of "mie", "ke" or "ao". |
A tibble of Key Events.
chemical_key_events("56-23-5")chemical_key_events("56-23-5")
List or search chemicals
chemical_list( q = NULL, aop = NULL, stressor = NULL, inchikey = NULL, chebi = NULL, pubchem = NULL, chemspider = NULL, wikidata = NULL, chembl = NULL, drugbank = NULL, kegg = NULL, hmdb = NULL, lipidmaps = NULL )chemical_list( q = NULL, aop = NULL, stressor = NULL, inchikey = NULL, chebi = NULL, pubchem = NULL, chemspider = NULL, wikidata = NULL, chembl = NULL, drugbank = NULL, kegg = NULL, hmdb = NULL, lipidmaps = NULL )
q |
Free-text search term. |
aop |
Only chemicals used in this AOP id. |
stressor |
Only chemicals linked to this stressor id. |
inchikey, chebi, pubchem, chemspider, wikidata
|
Identifier filters. |
chembl, drugbank, kegg, hmdb, lipidmaps
|
Further identifier filters. Look the chemical up by an identifier in that database. |
A tibble with one row per chemical.
chemical_list(q = "benzene")chemical_list(q = "benzene")
WikiPathways containing a chemical
chemical_pathways(cas)chemical_pathways(cas)
cas |
CAS registry number, e.g. "56-23-5". |
A tibble of pathways.
chemical_pathways("56-23-5")chemical_pathways("56-23-5")
Get a single gene
gene_get(gene)gene_get(gene)
gene |
Gene symbol or HGNC identifier, e.g. "TP53". |
A tibble with one row.
gene_get("TP53")gene_get("TP53")
List genes
gene_list(q = NULL, aop = NULL, ke = NULL, method = NULL)gene_list(q = NULL, aop = NULL, ke = NULL, method = NULL)
q |
Free-text search term, e.g. a gene symbol. |
aop |
Only genes linked to this AOP id. |
ke |
Only genes linked to this Key Event id. |
method |
How genes were linked: "any", "regex", "ner" or "both". |
A tibble with one row per gene.
gene_list(q = "TP53") gene_list(aop = 37)gene_list(q = "TP53") gene_list(aop = 37)
Adverse Outcomes linked to a Key Event
ke_adverse_outcomes(ke_id, as = NULL)ke_adverse_outcomes(ke_id, as = NULL)
ke_id |
Key Event identifier. |
as |
Which AOPs to consider: "mie" (only AOPs where this KE is the MIE) or "any" (every AOP containing it). |
A tibble of Adverse Outcomes.
ke_adverse_outcomes(334)ke_adverse_outcomes(334)
AOPs containing a Key Event
ke_aops(ke_id, role = NULL)ke_aops(ke_id, role = NULL)
ke_id |
Key Event identifier. |
role |
Optional filter: one of "mie", "ke" or "ao". |
A tibble of AOPs.
ke_aops(334)ke_aops(334)
Chemicals of a Key Event
ke_chemicals(ke_id)ke_chemicals(ke_id)
ke_id |
Key Event identifier. |
A tibble of chemicals.
ke_chemicals(334)ke_chemicals(334)
Key Event Components describe a Key Event in ontology terms: a biological process, an optional biological object, and the action that links them. The API returns them nested inside a single Key Event record, and this function returns them as one row per component.
ke_components(ke_id)ke_components(ke_id)
ke_id |
Key Event identifier. |
A tibble with the columns ke_id, action, process, process_id,
object and object_id. The identifiers are ontology terms, for example
"GO:0008219". Components that name no object have NA in object and
object_id.
ke_components(55)ke_components(55)
Follows Key Event Relationships forwards.
ke_downstream(ke_id, depth = 1)ke_downstream(ke_id, depth = 1)
ke_id |
Key Event identifier. |
depth |
How many relationships to follow (1 to 3, default 1). |
A tibble of Key Events.
ke_downstream(334, depth = 2)ke_downstream(334, depth = 2)
Returns the genes linked to each Key Event of an AOP as a
GSEABase::GeneSetCollection, with one gene set per Key Event. This is the
form that Bioconductor enrichment tools expect, so the result can be passed
straight to functions such as GSVA::gsva() or limma::camera() without
reshaping.
ke_gene_sets(aop_id, method = NULL)ke_gene_sets(aop_id, method = NULL)
aop_id |
AOP identifier. |
method |
How genes were linked: one of "any", "regex", "ner" or "both". |
Each gene set is named KE_<id>, carries the Key Event title as its short
description, and records the Key Event role and the version of the AOP-Wiki
data in its long description. Key Events without gene links are omitted,
since an empty gene set is not useful for enrichment. Use
aop_gene_summary() to see which Key Events those are.
A GeneSetCollection with one GeneSet per Key Event that has
linked genes.
aop_genes() for the same information as a tibble.
gsc <- ke_gene_sets(38) names(gsc)gsc <- ke_gene_sets(38) names(gsc)
Get a single Key Event
ke_get(ke_id)ke_get(ke_id)
ke_id |
Key Event identifier. |
A tibble with one row.
ke_get(334)ke_get(334)
List Key Events
ke_list( q = NULL, role = NULL, level = NULL, aop = NULL, taxon = NULL, organ = NULL, cell_type = NULL, gene = NULL )ke_list( q = NULL, role = NULL, level = NULL, aop = NULL, taxon = NULL, organ = NULL, cell_type = NULL, gene = NULL )
q |
Free-text search term. |
role |
Optional filter: one of "mie", "ke" or "ao". |
level |
Biological level of organisation. |
aop |
Only Key Events belonging to this AOP id. |
taxon, organ, cell_type
|
Biological context filters. |
gene |
Only Key Events linked to this gene. |
A tibble with one row per Key Event.
ke_list(q = "apoptosis") ke_list(aop = 1)ke_list(q = "apoptosis") ke_list(aop = 1)
Molecular Initiating Events linked to a Key Event
ke_mies(ke_id, as = NULL)ke_mies(ke_id, as = NULL)
ke_id |
Key Event identifier. |
as |
Which AOPs to consider: "ao" (only AOPs where this KE is the AO) or "any" (every AOP containing it). |
A tibble of MIEs.
ke_mies(334)ke_mies(334)
Stressors of a Key Event
ke_stressors(ke_id)ke_stressors(ke_id)
ke_id |
Key Event identifier. |
A tibble of stressors.
ke_stressors(334)ke_stressors(334)
Follows Key Event Relationships backwards.
ke_upstream(ke_id, depth = 1)ke_upstream(ke_id, depth = 1)
ke_id |
Key Event identifier. |
depth |
How many relationships to follow (1 to 3, default 1). |
A tibble of Key Events.
ke_upstream(334, depth = 2)ke_upstream(334, depth = 2)
Get a single Key Event Relationship
ker_get(ker_id)ker_get(ker_id)
ker_id |
KER identifier. |
A tibble with one row.
ker_get(158)ker_get(158)
List Key Event Relationships
ker_list( aop = NULL, upstream = NULL, downstream = NULL, ke = NULL, gene = NULL )ker_list( aop = NULL, upstream = NULL, downstream = NULL, ke = NULL, gene = NULL )
aop |
Only KERs belonging to this AOP id. |
upstream |
Only KERs starting at this Key Event id. |
downstream |
Only KERs ending at this Key Event id. |
ke |
Only KERs involving this Key Event id, in either position. |
gene |
Only KERs linked to this gene. |
A tibble with one row per KER.
ker_list(aop = 1) ker_list(ke = 334)ker_list(aop = 1) ker_list(ke = 334)
List Molecular Initiating Events
mie_list( q = NULL, level = NULL, aop = NULL, taxon = NULL, organ = NULL, cell_type = NULL, gene = NULL )mie_list( q = NULL, level = NULL, aop = NULL, taxon = NULL, organ = NULL, cell_type = NULL, gene = NULL )
q |
Free-text search term. |
level |
Biological level of organisation. |
aop |
Only Key Events belonging to this AOP id. |
taxon, organ, cell_type
|
Biological context filters. |
gene |
Only Key Events linked to this gene. |
A tibble with one row per MIE.
mie_list(q = "receptor")mie_list(q = "receptor")
Lists every AOP in which a stressor is used, together with the adverse
outcomes those AOPs end in. The AOP identifiers come from the aop_ids
field of the stressor record, and the titles and adverse outcomes are taken
from the AOP list, which is cached for the session. The stressor may be
given as an identifier or as a name, in which case the name is looked up
with stressor_list().
stressor_aops(stressor)stressor_aops(stressor)
stressor |
Stressor identifier, or a stressor name. |
A tibble with the columns stressor_id, stressor_title, aop_id,
aop_title, ao_id and ao_title, with one row per AOP and adverse
outcome. An AOP with no adverse outcome recorded keeps one row, with NA
in the two ao columns. A stressor used in no AOP gives zero rows.
stressor_aops(150) stressor_aops("hexachlorobenzene")stressor_aops(150) stressor_aops("hexachlorobenzene")
Get a single stressor
stressor_get(stressor_id)stressor_get(stressor_id)
stressor_id |
Stressor identifier. |
A tibble with one row.
stressor_get(150)stressor_get(150)
List stressors
stressor_list(q = NULL, aop = NULL, chemical = NULL, has_chemical = NULL)stressor_list(q = NULL, aop = NULL, chemical = NULL, has_chemical = NULL)
q |
Free-text search term. |
aop |
Only stressors used in this AOP id. |
chemical |
Only stressors linked to this chemical (CAS number). |
has_chemical |
If TRUE, only stressors that have a chemical mapping. |
A tibble with one row per stressor.
stressor_list(q = "benzene") stressor_list(aop = 1)stressor_list(q = "benzene") stressor_list(aop = 1)