[BioC] Questions about the Affy package....

Peter Dimitrov dimitrov@gnf.org
11 Jun 2002 14:40:56 -0700


On Tue, 2002-06-11 at 12:31, Joshua Betcher wrote:
> I have been going through the code for this package and I have a few
> questions and comments:
> 
> 1) For normalize.Plob.loess, slot names that do not exist are used.
> 
> 2)  As I have looked through the help files there does not appear to be any
> examples of the use of the read.cdfile, read.affy, etc..  Does anyone happen
> to have example files that these functions could be used on?
> 
> 3)  Is there equivalent function to optim in splus?  It was mentioned in the
> code that maybe nlminb could be used; could someone explain this further?
> 
> Thanks everyone for your help
> Josh
> 

Let me add 2 bugs for normalize.Plob.invariantset:

1) When called from express(), it dumps the following error:
Error in normalize.Plob.invariantset(object, ...) : 
	unused argument(s) (span ...)

Easy fix is to add the optional "three dots" argument. 

2) Once 1 is fixed, normalize.Plob.invariantset has trouble with the
result of approx() function, which by default returns NA, when trying to
approximate outside of the initial range(rule=1). Easy fix is to set the
value of parameter rule to 2. In this case approx will return
min(y)/max(y) accordingly.

I use affy_1.1.0.tar.gz, R-1.5.0 on RH 7.2 Linux P3 machine.

Peter Dimitrov

P.S. This is the code of normalize.Plob.invariantset that I currently
use:

"normalize.Plob.invariantset" <-
    function (container, prd.td = c(0.003, 0.007), progress = FALSE,...)
{
    nc <- ncol(pm(container))
    np <- nrow(pm(container))
    refindex <- trunc(median(rank(apply(pm(container),2,mean))))
    for (i in (1:nc)[-refindex]) {
        if (progress) 
            cat("normalizing array", attr(container[[i]], "name"), 
                "...")
        tmp <- normalize.invariantset(pm(container)[, i],
		pm(container)[, refindex], prd.td)
        pm(container)[, i] <- as.numeric(approx(tmp$n.curve$y, 
                                                tmp$n.curve$x, xout =
						container@pm[, i])$y,
						rule=2)
        mm(container)[, i] <- as.numeric(approx(tmp$n.curve$y, 
                                                tmp$n.curve$x, xout =
						mm(container)[, i])$y,
						rule=2)
        container@notes <- "normalized by invariant set"
        if (progress) 
            cat("done.\n")
    }
    return(container)
}