limma: normalizeWithinArrays using composite method
1
0
Entering edit mode
Paul Boutros ▴ 340
@paul-boutros-371
Last seen 10.2 years ago
Hello, One question about normalizeWithinArrays(method="composite") function. I am getting an error with this method indicating I'm passing invalid values. The error and traceback are below. The function predLoess seems to be in modreg, but I couldn't find much detail on it. I'm not sure if this is aproblem with passing in values where R - Rb < 0 (which is the case for some of my data, and which I could filter out), or if there is some way to handle this? Any suggestions much appreciated. R 1.7.1 limma 1.1.10 OS WinXP Paul ### BEGIN SCREEN DUMP > MA.within <- normalizeWithinArrays(RG, layout, method="composite"); Error in predLoess(object$y, object$x, newx, object$s, object$weights, : NA/NaN/Inf in foreign function call (arg 3) Execution halted > traceback(); 5: predLoess(object$y, object$x, newx, object$s, object$weights, object$pars$robust, object$pars$span, object$pars$degree, object$pars$normalize, object$pars$parametric, object$pars$drop.square, object$pars$surface, object$pars$cell, object$pars$family, object$kd, object$divisor, se = se) 4: predict.loess(fit, newdata = x) 3: predict(fit, newdata = x) 2: switch(method, loess = { for (j in 1:narrays) { y <- object$M[, j] x <- object$A[, j] w <- weights[, j] object$M[, j] <- loessFit(y, x, w, span = span, iterations = iterations)$residuals } }, printtiploess = { if (is.null(layout)) stop("Layout argument not specified") ngr <- layout$ngrid.r ngc <- layout$ngrid.c nspots <- layout$nspot.r * layout$nspot.c for (j in 1:narrays) { spots <- 1:nspots for (gridr in 1:ngr) for (gridc in 1:ngc) { y <- object$M[spots, j] x <- object$A[spots, j] w <- weights[spots, j] object$M[spots, j] <- loessFit(y, x, w, span = span, iterations = iterations)$residuals spots <- spots + nspots } } }, composite = { if (is.null(layout)) stop("Layout argument not specified") ntips <- layout$ngrid.r * layout$ngrid.c nspots <- layout$nspot.r * layout$nspot.c for (j in 1:narrays) { y <- object$M[, j] x <- object$A[, j] w <- weights[, j] fit <- loess(y ~ x, weights = w, span = span, subset = controlspots, na.action = na.exclude, degree = 0, surface = "direct", family = "symmetric", trace.hat = "approximate", iterations = iterations) global <- predict(fit, newdata = x) alpha <- (rank(x) - 1)/sum(!is.na(x)) spots <- 1:nspots for (tip in 1:ntips) { y <- object$M[spots, j] x <- object$A[spots, j] w <- weights[spots, j] local <- loessFit(y, x, w, span = span, iterations = iterations) $fitted object$M[spots, j] <- object$M[spots, j] - alpha[spots] * global[spots] - (1 - alpha[spots]) * local spots <- spots + nspots } } }, robustspline = { if (is.null(layout)) stop("Layout argument not specified") for (j in 1:narrays) object$M[, j] <- normalizeRobustSpline(object$M[, j], object$A[, j], layout, df = df, method = robust) }) 1: normalizeWithinArrays(RG, layout, method = "composite") ### END SCREEN DUMP
• 1.5k views
ADD COMMENT
0
Entering edit mode
@gordon-smyth
Last seen 3 hours ago
WEHI, Melbourne, Australia

The function predLoess seems to be in modreg, but I couldn't find much detail on it. I'm not sure if this is aproblem with passing in values where R - Rb < 0

No, I suspect that the problem is with R-Rb=0 rather than with R-Rb<0. Missing values (NA) are removed by loess but infinities (-Inf) are not.

I already do a check for -Inf with ordinary loess normalization, but not with composite. I will add in some sort of check for composite normalization as well. In the meantime with your data, just make the -infinities missing or else make sure there are no R-Rb or G-Gb=0.

Cheers
Gordon

ADD COMMENT

Login before adding your answer.

Traffic: 672 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6