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

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

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

Examples

# create an object of class Dnetwork, only given a matrix adjM <- matrix(runif(25),nrow=5,ncol=5) as(adjM, "Dnetwork")
An object of S4 class 'Dnetwork' @adjMatrix: a weighted symmetric matrix of 5 domains X 5 domains @nodeInfo (InfoDataFrame) nodeNames: 1 2 3 4 5 nodeAttr: id
# 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
An object of S4 class 'InfoDataFrame' rowNames: Domain_1 Domain_2 Domain_3 Domain_4 Domain_5 colNames: id level description
# 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
An object of S4 class 'Dnetwork' @adjMatrix: a weighted symmetric matrix of 5 domains X 5 domains @nodeInfo (InfoDataFrame) nodeNames: Domain_1 Domain_2 Domain_3 Domain_4 Domain_5 nodeAttr: id level description
# 3) look at various methods defined on class Dnetwork dim(x)
[1] 5 5
adjMatrix(x)
Domain_1 Domain_2 Domain_3 Domain_4 Domain_5 Domain_1 0.1782126 0.5215257 0.99312545 0.9936558 0.7311222 Domain_2 0.2426368 0.1038301 0.87358029 0.3223268 0.7216429 Domain_3 0.4238056 0.4971474 0.04944723 0.1821299 0.5056892 Domain_4 0.8680128 0.3320362 0.16621599 0.1620010 0.1043226 Domain_5 0.7999696 0.4599695 0.81706586 0.4049371 0.1859689
nodeInfo(x)
An object of S4 class 'InfoDataFrame' rowNames: Domain_1 Domain_2 Domain_3 Domain_4 Domain_5 colNames: id level description
nInfo(x)
id level description Domain_1 Domain_1 SCOP A Domain_2 Domain_2 SCOP B Domain_3 Domain_3 SCOP C Domain_4 Domain_4 SCOP D Domain_5 Domain_5 SCOP E
nodeNames(x)
[1] "Domain_1" "Domain_2" "Domain_3" "Domain_4" "Domain_5"
id(x)
[1] "Domain_1" "Domain_2" "Domain_3" "Domain_4" "Domain_5"
level(x)
[1] "SCOP" "SCOP" "SCOP" "SCOP" "SCOP"
description(x)
[1] "A" "B" "C" "D" "E"
# 4) get the subset x[1:2]
An object of S4 class 'Dnetwork' @adjMatrix: a weighted symmetric matrix of 2 domains X 2 domains @nodeInfo (InfoDataFrame) nodeNames: Domain_1 Domain_2 nodeAttr: id level description

See also

Dnetwork-method