arrayData-class {arrayMagic} | R Documentation

## Class arrayData, a simple container for raw data and related information

### Description

A simple class to store raw data, annotation information for spots and hybridisations, as well as weights.

### Creating Objects

`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`
`)`

### Slots

`intensities`:
  Object of class `array`; three-dimensional; dim = nrOfSpots x nrOfChannels x nrOfHybridisations; second dimension must contain "green" and "red" and possibly "greenBackground" and "redBackground"; default: `NULL`
`weights`:
  Object of class `matrix`; dim = nrOfSpots x nrOfHybridisations; range = [0,1]; default: `NULL`.
`spotAttr`:
  Object of class `data.frame`; dim = nrOfSpots x nrOfSpotCharacteristics; default: `NULL`
`hybAttrList`:
  list of two objects named "green" and "red" of class `data.frame`; the dimension of each `data.frame` is given by nrOfHybridisations x nrOfHybridisationCharacteristics ; default: `NULL`

### Methods

intensities<-
  (arrayData): Set the `intensities` of `arrayData`.
getIntensities
  (arrayData): Returns the `intensities` `array`.
weights<-
  (arrayData): Set the `weights` of `arrayData`.
getWeights
  (arrayData): Returns the `weights` object.
spotAttr<-
  (arrayData): Set the `spotAttr` of `arrayData`.
getSpotAttr
  (arrayData): Returns the `spotAttr` `data.frame`.
getHybAttr
  (arrayData): Returns the "intersection" of the "red" and "green" `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.
getHybAttrGreen
  (arrayData): Returns the "green" list element of `hybAttrList`, i.e. a `data.frame`.
getHybAttrRed
  (arrayData): Returns the "red" list element of `hybAttrList`, i.e. a `data.frame`.
hybAttrList<-
  (arrayData): Set the `hybAttrList` of `arrayData`.
getHybAttrList
  (arrayData): Returns the `hybAttrList` object.
show
  (arrayData): Renders information about the `arrayData` object on standard out.
[
  (arrayData,i,j): A subset operator, where i corresponds to the spots and j to the hybridisations.
cbind
  (...): Concatenates `arrayData` objects. Spots/rows are assumed to match; possibly you have to subset and reorder the objects beforehand cf. function `cbind.arrayData`.

### Author(s)

Andreas Buness <a.buness@dkfz.de>

### See Also

`exprSetRG-class`

### Examples

    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"))

[Package Contents]