"Ontology"
Ontology-class.Rd
Ontologies are stored as Ontology
and Ontologies
instances, and contain various information as provided by the Ontology
Lookup Service.
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". The only exception to this rule is the Drosophila Phenotype Ontology, whose namespace and prefix are "dpo" and "FBcv" respectively. 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 Ontologies
function will initialise all available ontolgies as an
Ontologies
object, while a call to Ontology
with an
ontology namespace or prefix (but see Details section) as argument
will initialise the ontology of interest as an Ontology
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")
). An Ontologies
can
also be coerced to lists of Ontology
ojects with as(.,
"list")
.
loaded
:Object of class NULL
or
character
containing the date the ontology was loaded on
the backend side. Accessed with the olsLoaded
method.
updated
:Object of class NULL
or
character
containing the date the ontology was last updated
on the backend side. Accessed with the olsUpdated
method.
status
:Object of class NULL
or
character
documenting the status of the ontology on the
backend side. For example "LOADED"
, "FAILED"
or
"NOTLOADED"
. Accessed with the olsStatus
method.
message
:Object of class NULL
or
character
documentating the status of the ontology on the
backend side.
version
:Object of class NULL
or
character
documenting the version of the ontology. Note
that there is also a version
field in the config
slot below. Use olsVersion
to access the appropriate
date.
numberOfTerms
:Object of class "integer"
documenting the number of terms available in the ontology.
numberOfProperties
:Object of class "integer"
documenting the number of properties available in the ontology.
numberOfIndividuals
:Object of class "integer"
documenting the number of individuals available in the ontology.
config
:Object of class "list"
containing
further ontology configuration and metadata.
signature(object = "numeric")
:
signature(object = "character")
:
signature(object = "Ontology")
: returns the
description of an ontology. Also works for Ontologies
objects and character
describing an ontology namespace or
prefix (see Details).
signature(object = "Ontology")
: retruns the
prefix of an ontology. Also works for Ontologies
objects
describing an ontology namespace or prefix (see Details).
signature(object = "Ontology")
: returns the
root of the ontology as a Terms
instance. object
could also be a character
with an
ontology namespace or prefix (see Details). If object
is of
class Ontologies
, it returns a list
of
Terms
.
signature(object = "Ontology")
: returns the
version of the ontology. Also works with an ontology namespace or
prefix (see Details) as a character
or an object of class
Ontologies
, in which case it returns a list of versions.
signature(object = "Ontology")
: 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 Ontologies
.
signature(object = "Ontology")
: 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 Ontologies
.
signature(object = "Ontology")
: returns the
status of the ontology. Also works with a character
containing the ontology namespace or prefix (see Details) or an
object of class Ontologies
.
signature(object = "Ontology")
: returns the
namespace of the ontology. Also works with a character
containing the ontology namespace or prefix (see Details) or an
object of class Ontologies
.
signature(object = "Ontology")
: returns the
title of an ontology. Also works with a character
containing the ontology namespace or prefix (see Details) or an
object of class Ontologies
.
signature(object = "Ontology")
: prints a short
summary of Ontology
and Ontologies
objects.
signature(object = "Ontologies")
: returns the
number of ontolgies described by the Ontologies
object.
signature(target = "Ontologies", current =
"Ontologies")
: ...
## Get all ontolgies
ol <- Ontologies()
ol
#> Object of class 'Ontologies' with 278 entries
#> RXNO, SBO ... PROCO, VBO
head(as(ol, "data.frame"))
#> Prefix Namespace Title
#> rxno RXNO rxno RXNO
#> sbo SBO sbo Systems Biology Ontology
#> scdo SCDO scdo Sickle Cell Disease Ontology
#> aeo AEO aeo Anatomical Entity Ontology
#> afo AFO afo Allotrope Merged Ontology Suite
#> agro AGRO agro Agronomy Ontology
length(ol)
#> [1] 278
## Individual ontologies
(go <- ol[["go"]])
#> Ontology: Gene Ontology (go)
#> The Gene Ontology (GO) provides a framework and set of concepts for
#> describing the functions of gene products from all organisms.
#> Loaded: 2022-09-16 Updated: 2022-09-16 Version: 2022-07-01
#> 50918 terms 68 properties 0 individuals
(efo <- ol[["efo"]])
#> Ontology: Experimental Factor Ontology (efo)
#> The Experimental Factor Ontology (EFO) provides a systematic
#> description of many experimental variables available in EBI databases,
#> and for external projects such as the NHGRI GWAS catalogue. It combines
#> parts of several biological ontologies, such as anatomy, disease and
#> chemical compounds. The scope of EFO is to support the annotation,
#> analysis and visualization of data handled by many groups at the EBI
#> and as the core ontology for OpenTargets.org
#> Loaded: 2022-08-26 Updated: 2022-08-26 Version: 3.45.0
#> 36350 terms 221 properties 0 individuals
## some basic information
olsVersion(go)
#> [1] "2022-07-01"
olsDesc(go)
#> [1] "The Gene Ontology (GO) provides a framework and set of concepts for describing the functions of gene products from all organisms."
olsTitle(go)
#> [1] "Gene Ontology"
olsPrefix(go)
#> [1] "GO"
olsNamespace(go)
#> [1] "go"
olsRoot(go)
#> Object of class 'Terms' with 3 entries
#> From the GO ontology
#> GO:0003674, GO:0008150, GO:0005575
## works with Ontology objects or their namespace
identical(olsRoot("go"), olsRoot(go))
#> [1] TRUE
identical(olsVersion("go"), olsVersion(go))
#> [1] TRUE
## Directly initialise a single ontology
go1 <- Ontology("go") ## using the namespace (preferred)
go2 <- Ontology("GO") ## using the prefix (see Details)
all.equal(go, go1)
#> [1] TRUE
all.equal(go, go2)
#> [1] TRUE