Onto
has 2 slots: nodeInfo and adjMatrix
Class Onto
nodeInfo
An object of S4 class
InfoDataFrame
, describing information on nodes/terms.
adjMatrix
An object of S4 class AdjData
,
containing adjacency data matrix (for a direct graph), with rows for
parent (arrow-outbound) and columns for children (arrow-inbound)
An object of this class can be created via: new("Onto", nodeInfo,
adjMatrix)
Class-specific methods:
dim()
: retrieve the dimension in the object
adjMatrix()
: retrieve the slot 'adjMatrix' in the
object
nodeInfo()
: retrieve the slot 'nodeInfo' (as class
InfoDataFrame) in the object
nInfo()
: retrieve nodeInfo (as data.frame) in the
object
nodeNames()
: retrieve node/term names (ie, row names of
nodeInfo) in the object
term_id()
: retrieve term id (ie, column 'term_id' of
nodeInfo) in the object, if any
term_name()
: retrieve term id (ie, column 'term_name' of
nodeInfo) in the object, if any
term_namespace()
: retrieve term id (ie, column
'term_namespace' of nodeInfo) in the object, if any
term_distance()
: retrieve term id (ie, column
'term_distance' of nodeInfo) in the object, if any
Standard generic methods:
str()
: compact display of the content in the object
show()
: abbreviated display of the object
as(matrix, "Onto")
: convert a matrix to an object of
class Onto
as(dgCMatrix, "Onto")
: convert a dgCMatrix (a sparse
matrix) to an object of class Onto
[i]
: get the subset of the same class
Ways to access information on this class:
showClass("Onto")
: show the class definition
showMethods(classes="Onto")
: show the method definition
upon this class
getSlots("Onto")
: get the name and class of each slot in
this class
slotNames("Onto")
: get the name of each slot in this
class
selectMethod(f, signature="Onto")
: retrieve the
definition code for the method 'f' defined in this class
# create an object of class Onto, only given a matrix adjM <- matrix(runif(25),nrow=5,ncol=5) as(adjM, "Onto")An object of S4 class 'Onto' @adjMatrix: a direct matrix of 5 terms (parents/from) X 5 terms (children/to) @nodeInfo (InfoDataFrame) nodeNames: 1 2 3 4 5 nodeAttr: term_id# create an object of class Onto, given a matrix plus information on nodes # 1) create nodeI: an object of class InfoDataFrame data <- data.frame(term_id=paste("Term", 1:5, sep="_"), term_name=I(LETTERS[1:5]), term_namespace=rep("Namespace",5), term_distance=1:5, row.names=paste("Term", 1:5, sep="_")) nodeI <- new("InfoDataFrame", data=data) nodeIAn object of S4 class 'InfoDataFrame' rowNames: Term_1 Term_2 Term_3 Term_4 Term_5 colNames: term_id term_name term_namespace term_distance# 2) create an object of class Onto # VERY IMPORTANT: make sure having consistent names between nodeInfo and adjMatrix adjM <- matrix(runif(25),nrow=5,ncol=5) colnames(adjM) <- rownames(adjM) <- rowNames(nodeI) x <- new("Onto", adjMatrix=adjM, nodeInfo=nodeI) xAn object of S4 class 'Onto' @adjMatrix: a direct matrix of 5 terms (parents/from) X 5 terms (children/to) @nodeInfo (InfoDataFrame) nodeNames: Term_1 Term_2 Term_3 Term_4 Term_5 nodeAttr: term_id term_name term_namespace term_distance# 3) look at various methods defined on class Onto dim(x)[1] 5 5adjMatrix(x)Term_1 Term_2 Term_3 Term_4 Term_5 Term_1 0.5378686 0.3559571 0.1466445 0.87588657 0.7085989 Term_2 0.7232435 0.3623360 0.3810996 0.08324089 0.4138110 Term_3 0.4976214 0.9922084 0.5166277 0.57128948 0.1261319 Term_4 0.2510645 0.1328220 0.4586717 0.25054983 0.7096981 Term_5 0.1073252 0.4619702 0.8470875 0.21365910 0.6273038nodeInfo(x)An object of S4 class 'InfoDataFrame' rowNames: Term_1 Term_2 Term_3 Term_4 Term_5 colNames: term_id term_name term_namespace term_distancenInfo(x)term_id term_name term_namespace term_distance Term_1 Term_1 A Namespace 1 Term_2 Term_2 B Namespace 2 Term_3 Term_3 C Namespace 3 Term_4 Term_4 D Namespace 4 Term_5 Term_5 E Namespace 5nodeNames(x)[1] "Term_1" "Term_2" "Term_3" "Term_4" "Term_5"term_id(x)[1] "Term_1" "Term_2" "Term_3" "Term_4" "Term_5"term_namespace(x)[1] "Namespace" "Namespace" "Namespace" "Namespace" "Namespace"term_distance(x)[1] 1 2 3 4 5# 4) get the subset x[1:2]An object of S4 class 'Onto' @adjMatrix: a direct matrix of 2 terms (parents/from) X 2 terms (children/to) @nodeInfo (InfoDataFrame) nodeNames: Term_1 Term_2 nodeAttr: term_id term_name term_namespace term_distance
Onto-method