Description Value Slots Creation Methods Access See Also Examples
Dnetwork is an S4 class to store a domain network, such as the
one from semantic similairty between pairs of domains by
dcDAGdomainSim. It has 2 slots: nodeInfo and adjMatrix
Class Dnetwork
nodeInfoAn object of S4 class
InfoDataFrame, describing information on nodes/domains.
adjMatrixAn object of S4 class AdjData,
containing symmetric adjacency data matrix for an indirect domain
network
An object of this class can be created via: new("Dnetwork",
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
id(): retrieve domain id (ie, column 'id' of nodeInfo)
in the object, if any
level(): retrieve domain level (ie, column 'level' of
nodeInfo) in the object, if any
description(): retrieve domain description (ie, column
'description' 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, "Dnetwork"): convert a matrix to an object of
class Dnetwork
as(dgCMatrix, "Dnetwork"): convert a dgCMatrix (a sparse
matrix) to an object of class Dnetwork
[i]: get the subset of the same class
Ways to access information on this class:
showClass("Dnetwork"): show the class definition
showMethods(classes="Dnetwork"): show the method
definition upon this class
getSlots("Dnetwork"): get the name and class of each
slot in this class
slotNames("Dnetwork"): get the name of each slot in this
class
selectMethod(f, signature="Dnetwork"): retrieve the
definition code for the method 'f' defined in this class
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 Dnetwork, only given a matrix
adjM <- matrix(runif(25),nrow=5,ncol=5)
as(adjM, "Dnetwork")
# create an object of class Dnetwork, given a matrix plus information on nodes
# 1) create nodeI: an object of class InfoDataFrame
data <- data.frame(id=paste("Domain", 1:5, sep="_"),
level=rep("SCOP",5), description=I(LETTERS[1:5]),
row.names=paste("Domain", 1:5, sep="_"))
nodeI <- new("InfoDataFrame", data=data)
nodeI
# 2) create an object of class Dnetwork
# 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("Dnetwork", adjMatrix=adjM, nodeInfo=nodeI)
x
# 3) look at various methods defined on class Dnetwork
dim(x)
adjMatrix(x)
nodeInfo(x)
nInfo(x)
nodeNames(x)
id(x)
level(x)
description(x)
# 4) get the subset
x[1:2]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.