getSpots.GeneGroups: Gets a list of items each containing spot indices for a group

Description Usage Arguments Value Author(s) See Also Examples

Description

Gets a list of items each containing spot indices for a group.

Usage

1
2
## S3 method for class 'GeneGroups'
getSpots(this, groups=NULL, unlist=FALSE, ...)

Arguments

groups

An optional vector of group indices specifying for which groups the spot indicies should be returned. If NULL, all groups are used.

Value

Returns a list of length nbrOfGroups(this).

Author(s)

Henrik Bengtsson (http://www.braju.com/R/)

See Also

*indexOf(), *setId(). For more information see GeneGroups.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
SMA$loadData("mouse.data")

layout <- Layout$read("MouseArray.Layout.dat", path=system.file("data-ex", package="aroma"))
replicates <- GeneGroups(layout)
raw <- RawData(mouse.data, layout=layout)

# Get the signal (here by default non-background corrected)
ma <- getSignal(raw)
normalizeWithinSlide(ma, "m")
normalizeAcrossSlides(ma)

print(replicates)

cat("Calculating the standardized residuals...")
idx <- getSpots(replicates)
M <- ma$M     # To improve speed!
residuals <- lapply(idx, FUN=function(i) {
  x <- M[i,]; ok <- !is.na(x)
  c <- median(x[ok]); s <- mad(x[ok], center=c)
  x <- (x-c)/s
  attr(x, "center") <- c; attr(x, "scale") <- s
  x
})
for (k in seq(idx)) M[idx[[k]],] <- residuals[[k]]
cat("done\n")

ma.res <- clone(ma)
ma.res$M <- M
subplots(ma)
for (s in seq(ma))
  plotSpatial(ma.res, slide=s)

HenrikBengtsson/aroma documentation built on May 7, 2019, 12:56 a.m.