Dnetwork-class: Definition for S4 class Dnetwork

Dnetwork-classR Documentation

Definition for S4 class Dnetwork

Description

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

Value

Class Dnetwork

Slots

nodeInfo

An object of S4 class InfoDataFrame, describing information on nodes/domains.

adjMatrix

An object of S4 class AdjData, containing symmetric adjacency data matrix for an indirect domain network

Creation

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

Methods

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

Access

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

See Also

Dnetwork-method

Examples

# 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]

hfang-bristol/dcGOR documentation built on July 16, 2022, 6:43 p.m.