loessQuantile.MAData: Estimates the (25%,50%,75%) quantile M(A) curves using loess

Description Usage Arguments Author(s) See Also Examples

Description

Estimates the (25%,50%,75%) quantile M(A) curves using loess. This method is used by *getAdjustedSpotVariability().

Usage

1
2
## S3 method for class 'MAData'
loessQuantile(this, slides=NULL, subset=NULL, method=c("each", "average"), factor=1.4826, family="symmetric", ...)

Arguments

slides

The slides which should be included in the calculations. If NULL, all slides are included.

subset

Indices of spots to be used for the estimates. Selecting a random subset may speed up the estimation and still give the same result. If NULL, all spots are included.

method

If "each", estimates of the quantiles are given for each of the slides. If "average", an estimate of the quantiles is given for all spots as if they came from the same slide.

factor

numeric factor to multiply to the upper and lower quantiles. If the data is Gaussian distributed the default factor 1.4826 makes the upper and lower quantile to correspond to one standard deviation.

family

Family to be used by loess. By default, a robust family is used.

...

Other arguments passed to loess().

Author(s)

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

See Also

*getAdjustedSpotVariability(). For more information see MAData.

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
32
33
34
35
   SMA$loadData("mouse.data")
   layout <- Layout$read("MouseArray.Layout.dat", path=system.file("data-ex", package="aroma"))
   raw <- RawData(mouse.data, layout=layout)

   # Create four sets of slides where slide 2 and 4 are shifted R=G=a
   a <- 2^11
   ma <- list()
   ma[[1]] <- getSignal(raw, bgSubtract=TRUE)
   ma[[2]] <- clone(ma[[1]])
   shift(ma[[2]], R=a, G=a)
   ma[[3]] <- clone(ma[[1]])
   normalizeWithinSlide(ma[[3]], method="p")
   ma[[4]] <- clone(ma[[3]])
   shift(ma[[4]], R=a, G=a)

   setMethodS3("lines", "LoessQuantile", function(object, ...) {
     lines(object$x, object$centre, ...);
     lines(object$x, object$above, ...);
     lines(object$x, object$below, ...);
   })

   # Four plots
   subplots(4)
   Alim <- Mlim <- NA
   for (k in 1:length(ma)) {
     Alim <- range(c(Alim, ma[[k]]$A), na.rm=TRUE)
     Mlim <- range(c(Mlim, ma[[k]]$M), na.rm=TRUE)
   }
 
   for (k in 1:length(ma)) {
     plot(ma[[k]], slide=1, xlim=Alim, ylim=Mlim, col=k+1)
     fit <- loessQuantile(ma[[k]], slide=1)[[1]]
     lines(fit, lwd=2)
   }
 

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