Description Objects from the Class Slots Methods and functions Author(s) Examples
The Term
class describes an ontology term. A set of terms are
instantiated as a Terms
class.
Objects can be created using the term
and terms
functions. The latter is used with an object of class
Ontology
or a character
describing a valid
ontology prefix to download and instantiate all terms of an ontology
of interest. The former takes an Ontology
object (or an
ontology prefix) and a term identifer to instantiate that specific
term. See also the 'Methods and functions' sections.
For any given Term
object, the children
, parents
,
ancestors
, descendants
, partOf
and
derivesFrom
terms can be generated and returned as Terms
objects.
Terms
instances can be subset with [
and [[
and
iterated over with lapply
.
iri
:Object of class "character"
~~
label
:Object of class "character"
~~
description
:Object of class "NullOrList"
~~
annotation
:Object of class "list"
~~
synonym
:Object of class "NullOrList"
~~
ontology_name
:Object of class "character"
~~
ontology_prefix
:Object of class "character"
~~
ontology_iri
:Object of class "character"
~~
is_obsolete
:Object of class "logical"
~~
is_defining_ontology
:Object of class "logical"
~~
has_children
:Object of class "logical"
~~
is_root
:Object of class "logical"
~~
short_form
:Object of class "character"
~~
obo_id
:Object of class "NullOrChar"
~~
links
:Object of class "list"
~~
signature(object = "Ontology", id = "character")
:
...
signature(x = "Ontology", pagesize = "numeric")
: ...
signature(object = "Term")
: ...
signature(object = "Term")
: ...
signature(object = "Term")
: ...
signature(object = "Term")
: ...
signature(object = "Term")
: ...
signature(object = "Term")
: ...
signature(object = "Term")
: ...
signature(object = "Term")
: ...
signature(object = "Term")
: ...
signature(object = "Term")
: Returns a new
Terms
instance with the object
's
children. NULL
if there are not children.
signature(object = "Term")
: Returns a new
Terms
instance with the object
's
parents. NULL
if there are not parents.
signature(object = "Term")
: Returns a new
Terms
instance with the object
's
ancestors. NULL
if there are not ancestors.
signature(object = "Term")
: Returns a new
Terms
instance with the object
's
descendants. NULL
if there are not descendants.
signature(object = "Term")
: Returns a new
Terms
instance with terms the object
's is a part
of. NULL
if none.
signature(object = "Term")
: Returns a new
Terms
instance with terms the object
's is derived
from. NULL
if none.
signature(object = "Term")
: ...
signature(object = "Terms")
: ...
signature(target = "Term", current =
"Term")
: ...
signature(target = "Terms", current =
"Terms")
: ...
signature(object = "Terms")
: returns the number
of ontolgies described by the Terms
object.
signature(x = "Terms")
: returns a new
Terms
object where all duplicated Term
instances,
i.e. those with the same term id (even when stemming from
different ontologies), have been removed (only the first occurence
is retained).
as(x, "data.fram")
Coerces a single Term
or
Terms
into a data.frame
of length 1 (for the former)
or length length(x)
for the latter. The result will contain
the following columns: id, label, description of the term(s),
their ontology, whether they are obsolete, have children or are
root node, the first synonym only, their iri and whether they are
defining the ontology. Any missing value will be reported as
NA
.
Laurent Gatto <lg390@cam.ac.uk>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | ## (all) terms
(gotrms <- terms("go", pagesize = 10000))
## Not run:
## or, using on ontology object
go <- Ontology("go")
gotrms <- terms(go, pagesize = 10000)
## End(Not run)
as(gotrms[1:10], "data.frame") ## data,frame with 10 rows
## (one) term
(trm <- gotrms[[1]])
termPrefix(trm)
gotrms[1:3]
gotrms[["GO:0005230"]]
as(trm, "data.frame") ## data,frame with 1 row
## using an Ontology object
go <- Ontology("GO")
term(go, "GO:0032801")
## using an ontology prefix
term("GO", "GO:0032801")
isObsolete(gotrms[["GO:0005230"]])
isObsolete(gotrms[["GO:0005232"]])
isRoot(gotrms[["GO:0005230"]])
isRoot(gotrms[["GO:0005232"]])
i <- isRoot(gotrms) & !isObsolete(gotrms)
gotrms[i]
for (ii in which(i))
show(gotrms[[ii]])
## or, directly querying the ontology
olsRoot(go)
parents(trm)
ancestors(trm)
children(trm)
descendants(trm)
partOf(gotrms[["GO:0044429"]])
partOf(term("BTO", "BTO:0000142"))
derivesFrom(term("BTO", "BTO:0002600"))
derivesFrom(term("BTO", "BTO:0001023"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.