Anno-class | R Documentation |
Anno
has 3 slots: annoData, termData and domainData
Class Anno
annoData
An object of S4 class AnnoData
,
containing data matrix with the column number equal to nrow(termData)
and the row number equal to nrow(domainData).
termData
An object of S4 class
InfoDataFrame
, describing information on columns in
annoData.
domainData
An object of S4 class
InfoDataFrame
, describing information on rows in
annoData.
An object of this class can be created via: new("Anno", annoData,
termData, domainData)
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
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
Anno-method
# create an object of class Anno, only given a matrix annoData <- matrix(runif(50),nrow=10,ncol=5) as(annoData, "Anno") # 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 # 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 # 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 # 4) look at various methods defined on class Anno dim(x) annoData(x) termData(x) tData(x) domainData(x) dData(x) termNames(x) domainNames(x) # 5) get the subset x[1:3,1:2]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.