Onto-class: Definition for S4 class Onto

Description Value Slots Creation Methods Access See Also Examples

Description

Onto has 2 slots: nodeInfo and adjMatrix

Value

Class Onto

Slots

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)

Creation

An object of this class can be created via: new("Onto", nodeInfo, adjMatrix)

Methods

Class-specific methods:

Standard generic methods:

Access

Ways to access information on this class:

See Also

Onto-method

Examples

 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
# create an object of class Onto, only given a matrix
adjM <- matrix(runif(25),nrow=5,ncol=5)
as(adjM, "Onto")

# 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)
nodeI
# 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)
x
# 3) look at various methods defined on class Onto
dim(x)
adjMatrix(x)
nodeInfo(x)
nInfo(x)
nodeNames(x)
term_id(x)
term_namespace(x)
term_distance(x)
# 4) get the subset
x[1:2]

dcGOR documentation built on May 2, 2019, 6:14 p.m.

Related to Onto-class in dcGOR...