arrayData-class {arrayMagic} | R Documentation |
A simple class to store raw data, annotation information for spots and hybridisations, as well as weights.
new('arrayData',
intensities = ..., # optional; object of class array
weights = ..., # optional; object of class matrix
spotAttr = ..., # optional; object of class data.frame
hybAttrList = ..., # optional; list of two objects of class data.frame
)
intensities
:array
;
three-dimensional;
dim = nrOfSpots x nrOfChannels x nrOfHybridisations;
second dimension must contain "green" and "red" and possibly
"greenBackground" and "redBackground"; default: NULL
weights
:matrix
;
dim = nrOfSpots x nrOfHybridisations;
range = [0,1]; default: NULL
.
spotAttr
:data.frame
;
dim = nrOfSpots x nrOfSpotCharacteristics;
default: NULL
hybAttrList
:data.frame
; the dimension of
each data.frame
is given by
nrOfHybridisations x nrOfHybridisationCharacteristics ;
default: NULL
intensities
of
arrayData
. intensities
array
.weights
of
arrayData
. weights
object. spotAttr
of
arrayData
. spotAttr
data.frame
.data.frame
of hybAttrList
or if one is NULL
the other one. The "intersection"
are those columns which match in column name and its content
otherwise NULL
is returned.hybAttrList
, i.e. a data.frame
. hybAttrList
, i.e. a data.frame
. hybAttrList
of
arrayData
. hybAttrList
object. arrayData
object
on standard out.arrayData
objects.
Spots/rows are assumed to match;
possibly you have to subset and reorder
the objects beforehand
cf. function cbind.arrayData
.
Andreas Buness <a.buness@dkfz.de>
intensities <- array(data=runif(120),dim=c(20,2,3)) dimnames(intensities) <- list(NULL, c("green","red"), NULL) spotAttr <- data.frame(Name=I(rep(c("x","y","k","l","z"),4)), Index=c(1:20)) arrayDataObject <- new("arrayData", intensities=intensities, weights=intensities[,1,], spotAttr=spotAttr, hybAttrList=NULL) print(arrayDataObject) hybs <- c(1,3) spots <- c(1:10, 14) aD <- arrayDataObject[spots,hybs] print(aD) stopifnot( all( getIntensities(arrayDataObject)[spots, , hybs] == getIntensities(aD) ) ) stopifnot( all( getWeights(arrayDataObject)[spots, hybs] == getWeights(aD) ) ) stopifnot( all( getSpotAttr(arrayDataObject)[spots, ] == getSpotAttr(aD) ) ) hybAttr <- data.frame(Name=I(c("hx","hy","hz")), Index=c(1:3)) arrayDataObject <- new("arrayData", intensities=intensities, weights=intensities[,1,], spotAttr=spotAttr, hybAttrList=list(green=hybAttr,red=hybAttr)) hybAttrGreen <- data.frame(Name=I(c("hx","hy","hz")), Index=c(4:6)) aDObject <- new("arrayData", intensities=intensities, weights=intensities[,1,], spotAttr=spotAttr, hybAttrList=list(green=hybAttrGreen,red=hybAttr)) print(arrayDataObject) cbind(aDObject,aDObject) hybs <- c(1) spots <- c(1) aD <- arrayDataObject[spots,hybs] print(aD) stopifnot( all( getIntensities(arrayDataObject)[spots, , hybs] == getIntensities(aD) ) ) stopifnot( all( getWeights(arrayDataObject)[spots, hybs] == getWeights(aD) ) ) stopifnot( all( getSpotAttr(arrayDataObject)[spots, ] == getSpotAttr(aD) ) ) stopifnot( all( getHybAttr(arrayDataObject)[spots, ] == getHybAttr(aD) ) ) stopifnot( all( getHybAttrRed(arrayDataObject)[spots, ] == getHybAttrRed(aD) ) ) stopifnot( all( getHybAttrGreen(arrayDataObject)[spots, ] == getHybAttrGreen(aD) ) ) stopifnot( all( getHybAttrRed(aDObject) == hybAttr) ) stopifnot( all( getHybAttrGreen(aDObject) == hybAttrGreen) ) stopifnot( all( getHybAttr(aDObject) == data.frame(Name=I(c("hx","hy","hz"))) ) ) weights(aDObject) <- intensities[,2,] intensities(aDObject) <- intensities spotAttr(aDObject) <- spotAttr hybAttrList(aDObject) <- list(green=hybAttr,red=hybAttrGreen) aD <- new("arrayData") stopifnot(is(aD, "arrayData"))