Definition for S4 class Anno

Description

Anno has 3 slots: annoData, termData and domainData

Value

Class Anno

Slots

annoDataAn object of S4 class AnnoData, containing data matrix with the column number equal to nrow(termData) and the row number equal to nrow(domainData).

termDataAn object of S4 class InfoDataFrame, describing information on columns in annoData.

domainDataAn object of S4 class InfoDataFrame, describing information on rows in annoData.

Creation

An object of this class can be created via: new("Anno", annoData, termData, domainData)

Methods

Class-specific methods:

  • dim(): retrieve the dimension in the object
  • annoData(): retrieve the slot 'annoData' in the object
  • termData(): retrieve the slot 'termData' (as class InfoDataFrame) in the object
  • domainData(): retrieve the slot 'domainData' (as class InfoDataFrame) in the object
  • tData(): retrieve termData (as data.frame) in the object
  • dData(): retrieve domainData (as data.frame) in the object
  • termNames(): retrieve term names (ie, row names of termData) in the object
  • domanNames(): retrieve domain names (ie, row names of domainData) in the object

Standard generic methods:

  • str(): compact display of the content in the object
  • show(): abbreviated display of the object
  • as(matrix, "Anno"): convert a matrix to an object of class Anno
  • as(dgCMatrix, "Anno"): convert a dgCMatrix (a sparse matrix) to an object of class Anno
  • [i,j]: get the subset of the same class

Access

Ways to access information on this class:

  • showClass("Anno"): show the class definition
  • showMethods(classes="Anno"): show the method definition upon this class
  • getSlots("Anno"): get the name and class of each slot in this class
  • slotNames("Anno"): get the name of each slot in this class
  • selectMethod(f, signature="Anno"): retrieve the definition code for the method 'f' defined in this class

Examples

# create an object of class Anno, only given a matrix annoData <- matrix(runif(50),nrow=10,ncol=5) as(annoData, "Anno")
An object of S4 class 'Anno' @annoData: 10 domains, 5 terms @termData (InfoDataFrame) termNames: 1 2 3 4 5 tvarLabels: names @domainData (InfoDataFrame) domainNames: 1 2 3 ... 9 10 (10 total) dvarLabels: names
# create an object of class Anno, given a matrix plus information on its columns/rows # 1) create termData: an object of class InfoDataFrame data <- data.frame(x=1:5, y=I(LETTERS[1:5]), row.names=paste("Term", 1:5, sep="_")) termData <- new("InfoDataFrame", data=data) termData
An object of S4 class 'InfoDataFrame' rowNames: Term_1 Term_2 Term_3 Term_4 Term_5 colNames: x y
# 2) create domainData: an object of class InfoDataFrame data <- data.frame(x=1:10, y=I(LETTERS[1:10]), row.names=paste("Domain", 1:10, sep="_")) domainData <- new("InfoDataFrame", data=data) domainData
An object of S4 class 'InfoDataFrame' rowNames: Domain_1 Domain_2 Domain_3 ... Domain_9 Domain_10 (10 total) colNames: x y
# 3) create an object of class Anno # VERY IMPORTANT: make sure having consistent names between annoData and domainData (and termData) annoData <- matrix(runif(50),nrow=10,ncol=5) rownames(annoData) <- rowNames(domainData) colnames(annoData) <- rowNames(termData) x <- new("Anno", annoData=annoData, domainData=domainData, termData=termData) x
An object of S4 class 'Anno' @annoData: 10 domains, 5 terms @termData (InfoDataFrame) termNames: Term_1 Term_2 Term_3 Term_4 Term_5 tvarLabels: x y @domainData (InfoDataFrame) domainNames: Domain_1 Domain_2 Domain_3 ... Domain_9 Domain_10 (10 total) dvarLabels: x y
# 4) look at various methods defined on class Anno dim(x)
[1] 10 5
annoData(x)
Term_1 Term_2 Term_3 Term_4 Term_5 Domain_1 0.38646009 0.29743303 0.83303351 0.1105348 0.6343022 Domain_2 0.58222451 0.01907135 0.84091112 0.6852883 0.7244947 Domain_3 0.07107426 0.12770868 0.11039306 0.5464801 0.8751578 Domain_4 0.23272480 0.44866704 0.10973054 0.3975184 0.4431293 Domain_5 0.84330124 0.02929973 0.77454019 0.4825122 0.6956817 Domain_6 0.54557412 0.69303444 0.92479632 0.5223680 0.4860102 Domain_7 0.04511398 0.21060201 0.87177343 0.6004444 0.3120415 Domain_8 0.60229894 0.10545978 0.07529899 0.4525172 0.4768031 Domain_9 0.32481846 0.11732409 0.08373671 0.7437398 0.2056176 Domain_10 0.88934108 0.93355149 0.94952831 0.7646140 0.2872525
termData(x)
An object of S4 class 'InfoDataFrame' rowNames: Term_1 Term_2 Term_3 Term_4 Term_5 colNames: x y
tData(x)
x y Term_1 1 A Term_2 2 B Term_3 3 C Term_4 4 D Term_5 5 E
domainData(x)
An object of S4 class 'InfoDataFrame' rowNames: Domain_1 Domain_2 Domain_3 ... Domain_9 Domain_10 (10 total) colNames: x y
dData(x)
x y Domain_1 1 A Domain_2 2 B Domain_3 3 C Domain_4 4 D Domain_5 5 E Domain_6 6 F Domain_7 7 G Domain_8 8 H Domain_9 9 I Domain_10 10 J
termNames(x)
[1] "Term_1" "Term_2" "Term_3" "Term_4" "Term_5"
domainNames(x)
[1] "Domain_1" "Domain_2" "Domain_3" "Domain_4" "Domain_5" "Domain_6" [7] "Domain_7" "Domain_8" "Domain_9" "Domain_10"
# 5) get the subset x[1:3,1:2]
An object of S4 class 'Anno' @annoData: 3 domains, 2 terms @termData (InfoDataFrame) termNames: Term_1 Term_2 tvarLabels: x y @domainData (InfoDataFrame) domainNames: Domain_1 Domain_2 Domain_3 dvarLabels: x y

See also

Anno-method