The rols package provides an interface to PRIDE's Ontology Lookup Servive (OLS) and can be used to query one or multiple ontologies, stored as `olsOntology` and `olsOntologies` instances, and containing various information as provided by OLS.
# S4 method for class 'missing'
olsOntologies(object)
# S4 method for class 'character'
olsOntology(object)
# S4 method for class 'olsOntology'
olsOntology(object)
# S4 method for class 'olsOntology'
show(object)
# S4 method for class 'olsOntologies'
show(object)
# S4 method for class 'character'
olsVersion(object)
# S4 method for class 'olsOntology'
olsVersion(object)
# S4 method for class 'olsOntologies'
olsVersion(object)
# S4 method for class 'character'
olsLoaded(object)
# S4 method for class 'olsOntology'
olsLoaded(object)
# S4 method for class 'olsOntologies'
olsLoaded(object)
# S4 method for class 'olsOntology'
olsLinks(object)
# S4 method for class 'olsOntology'
olsConfig(object)
# S4 method for class 'character'
olsUpdated(object)
# S4 method for class 'olsOntology'
olsUpdated(object)
# S4 method for class 'olsOntologies'
olsUpdated(object)
# S4 method for class 'character'
olsPrefix(object)
# S4 method for class 'olsOntology'
olsPrefix(object)
# S4 method for class 'olsOntologies'
olsPrefix(object)
# S4 method for class 'character'
olsDesc(object)
# S4 method for class 'olsOntology'
olsDesc(object)
# S4 method for class 'olsOntologies'
olsDesc(object)
# S4 method for class 'character'
olsTitle(object)
# S4 method for class 'olsOntology'
olsTitle(object)
# S4 method for class 'olsOntologies'
olsTitle(object)
# S4 method for class 'character'
olsStatus(object)
# S4 method for class 'olsOntology'
olsStatus(object)
# S4 method for class 'olsOntologies'
olsStatus(object)
# S4 method for class 'character'
olsNamespace(object)
# S4 method for class 'olsOntology'
olsNamespace(object)
# S4 method for class 'olsOntologies'
olsNamespace(object)
# S4 method for class 'character'
ontologyUrl(object)
# S4 method for class 'olsOntology'
ontologyUrl(object)
# S4 method for class 'olsOntologies'
lapply(X, FUN, ...)
# S4 method for class 'olsOntologies'
[(x, i, j = "missing", drop = "missing")
# S4 method for class 'olsOntologies'
[[(x, i, j = "missing", drop = "missing")
# S4 method for class 'olsOntologies'
length(x)
an instance of class `olsOntologies` or `olsOntology`. For some functions, a ontology identifier is applicable.
`olsOntologies` object.
a `function` to be applied to each `olsOntology` element of `X`.
additional arguments passed to `FUN`.
an `olsOntologies` object.
index of elecements to subset.
ignored.
ignored.
Ontologies are referred to by their namespace, which is lower case: the Gene Onology is "go", the Mass spectrometry ontology is "ms", etc. The ontologies also have prefixes, which are upper case: the Gene Onology prefix "GO", the Mass spectrometry ontology prefix "MS". One exception to this rule is the Drosophila Phenotype Ontology, whose namespace and prefix are "dpo" and "FBcv" respectively (there might be more). This is particularly confusing as the FlyBase Controlled Vocabulary has "fbcv" and "FBcv" as namespace and prefix respectively.
When using a character to initialise an ontology or query a term, "fbcv" (this is case insensitive) will refer to the the FlyBase Controlled Vocabulary. The the Drosophila Phenotype Ontology will have to be referred as "dpo" (also case insensitive).
Objects can be created in multiple ways. The [olsOntologies()] function will initialise all available ontolgies as an `olsOntologies` object, while a call to [olsOntology()] with an ontology namespace or prefix as argument will initialise the ontology of interest as an `olsOntology` instance.
`Ontolgies` instances can be subset with `[` and `[[` (using their namespace, see Details) and iterated over with `lapply`. `Ontolgies` can be converted into a simple `data.frame` containing the ontology prefixes, namespaces and titles using `as(., "data.frame")`. `olsOntologies` can also be coerced to lists of `olsOntology` ojects with `as(., "list")`.
- `olsDesc(object = "olsOntology")` returns the description of an ontology. Also works for `olsOntologies` objects and a `character` describing an ontology namespace or prefix (see Details).
- `olsPrefix(object = "olsOntology")` retruns the prefix of an ontology. Also works for `olsOntologies` objects and a `character` describing an ontology namespace or prefix (see Details).
- `olsVersion(object = "olsOntology")` returns the version of the ontology. Also works with an a `character` defining an ontology namespace or prefix (see Details) or an object of class `olsOntologies`, in which case it returns a list of versions.
- `olsLoaded(object = "olsOntology")` returns the loading date of the ontology. Also works with a `character` containing the ontology namespace or prefix (see Details) or an object of class `olsOntologies`.
- `olsUpdated(object = "olsOntology")` returns the update date of the ontology. Also works with a `character` containing the ontology namespace or prefix (see Details) or an object of class `olsOntologies`.
- `olsStatus(object = "olsOntology")` returns the status of the ontology. Also works with a `character` containing the ontology namespace or prefix (see Details) or an object of class `olsOntologies`.
- `olsTitle(object = "olsOntology")` returns the title of an ontology. Also works with a `character` containing the ontology namespace or prefix (see Details) or an object of class `olsOntologies`.
- `olsNamespace(object = "olsOntology")` returns the namespace of an ontology. Also works with a `character` containing the ontology namespace or prefix (see Details) or an object of class `olsOntologies`.
- `olsLinks(object = "olsOntology")` returns a named `character` with hyperlink to the ontology itself, and other associated concepts such as its terms.
- `olsConfig(object = "olsOntology")` returns a list of additional unstructured, partly redundant information about the ontology.
- `ontologyUrl(object = "olsOntology") return the hyperlink to the ontology itself. It can also be used with a `character` defining the namespace or prefix of an ontology, in which case it is created from the base OLS API URL.
Once an ontology has been created an an `olsOntology` instance, all its terms can be requested using the `Terms()` constructor. See [Terms()] for details.
- OLS3 API (the OLS4 API should function identically to the OLS3): <http://www.ebi.ac.uk/ols4/ols3help>
- REST API for OLS: <https://www.ebi.ac.uk/ols4/swagger-ui/index.html>
#############################
## All ontologies
(onts <- olsOntologies())
#> ⠙ Iterating 6 done (3/s) | 2s
#> ⠹ Iterating 9 done (3.2/s) | 2.9s
#> ⠹ Iterating 13 done (3.6/s) | 3.6s
#> Object of class 'olsOntologies' with 255 entries
#> ADO, AGRO ... CCF, CPONT
#############################
## Alzheimer's Disease Ontology (ADO)
## 1. From the ontologies object
(ado1 <- onts[['ado']])
#> olsOntology: Alzheimer's Disease Ontology (ADO) (ado)
#> Alzheimer's Disease Ontology is a knowledge-based ontology that
#> encompasses varieties of concepts related to Alzheimer'S Disease,
#> foundamentally structured by upper level Basic Formal Ontology(BFO).
#> This Ontology is enriched by the interrelational entities that
#> demonstrate the nextwork of the understanding on Alzheimer's disease
#> and can be readily applied for text mining.
#> Loaded: 2024-04-24 Updated: 2024-04-24 Version: 2.0.1
#> 1963 terms 186 properties 2 individuals
## 2. Create from its namespace
(ado2 <- olsOntology('ado')) ## also works with ADO
#> olsOntology: Alzheimer's Disease Ontology (ADO) (ado)
#> Alzheimer's Disease Ontology is a knowledge-based ontology that
#> encompasses varieties of concepts related to Alzheimer'S Disease,
#> foundamentally structured by upper level Basic Formal Ontology(BFO).
#> This Ontology is enriched by the interrelational entities that
#> demonstrate the nextwork of the understanding on Alzheimer's disease
#> and can be readily applied for text mining.
#> Loaded: 2024-04-24 Updated: 2024-04-24 Version: 2.0.1
#> 1963 terms 186 properties 2 individuals
all.equal(ado1, ado2)
#> [1] TRUE
olsVersion(ado1)
#> [1] "2.0.1"
olsPrefix(ado1)
#> [1] "ADO"
olsNamespace(ado1)
#> [1] "ado"
olsTitle(ado1)
#> [1] "Alzheimer's Disease Ontology (ADO)"
olsDesc(ado1)
#> [1] "Alzheimer's Disease Ontology is a knowledge-based ontology that encompasses varieties of concepts related to Alzheimer'S Disease, foundamentally structured by upper level Basic Formal Ontology(BFO). This Ontology is enriched by the interrelational entities that demonstrate the nextwork of the understanding on Alzheimer's disease and can be readily applied for text mining."
olsLinks(ado1)
#> self
#> "https://www.ebi.ac.uk/ols4/api/ontologies/ado?lang=en"
#> terms
#> "https://www.ebi.ac.uk/ols4/api/ontologies/ado/terms"
#> properties
#> "https://www.ebi.ac.uk/ols4/api/ontologies/ado/properties"
#> individuals
#> "https://www.ebi.ac.uk/ols4/api/ontologies/ado/individuals"
str(olsConfig(ado1))
#> List of 24
#> $ id : chr "ado"
#> $ versionIri : chr "http://purl.obolibrary.org/obo/ado/releases/2023-09-20/ado.owl"
#> $ namespace : chr "ado"
#> $ preferredPrefix : chr "ADO"
#> $ title : chr "Alzheimer's Disease Ontology (ADO)"
#> $ description : chr "Alzheimer's Disease Ontology is a knowledge-based ontology that encompasses varieties of concepts related to Al"| __truncated__
#> $ homepage : chr "https://github.com/Fraunhofer-SCAI-Applied-Semantics/ADO"
#> $ version : chr "2.0.1"
#> $ mailingList : NULL
#> $ tracker : chr "https://github.com/Fraunhofer-SCAI-Applied-Semantics/ADO/issues"
#> $ logo : NULL
#> $ creators : list()
#> $ annotations : NULL
#> $ fileLocation : chr "http://purl.obolibrary.org/obo/ado.owl"
#> $ oboSlims : logi FALSE
#> $ labelProperty : chr "http://www.w3.org/2000/01/rdf-schema#label"
#> $ definitionProperties : list()
#> $ synonymProperties : list()
#> $ hierarchicalProperties: list()
#> $ baseUris : list()
#> $ hiddenProperties : list()
#> $ preferredRootTerms : list()
#> $ isSkos : logi FALSE
#> $ allowDownload : logi FALSE