Entering edit mode
Matthias Kohl
▴
160
@matthias-kohl-1678
Last seen 10.2 years ago
Dear affy developer,
the function pmcorrect.mas has
pm.corrected <- applycbindpps.pm - pps.im, delta), 1, max)
It would be clearly more efficient to replace this with one of the
following proposals:
## slightly faster
pm.corrected <- pmaxpps.pm - pps.im, delta)
## clearly faster
pm.corrected <- pps.pm - pps.im
pm.corrected[pm.corrected < delta] <- delta
## fastest
pm.corrected <- pmax.intpps.pm - pps.im, delta)
#######################
## Timing
x <- rnorm(20)
y <- rnorm(20)
delta <- 0.01
t1 <- system.time(for(i in seq_len(1e5)) apply(cbind(x - y, delta), 1,
max) )
t2 <- system.time(for(i in seq_len(1e5)) {z <- x - y; z[z < delta] <-
delta} )
t3 <- system.time(for(i in seq_len(1e5)) pmax(x-y, delta) )
t4 <- system.time(for(i in seq_len(1e5)) pmax.int(x-y, delta) )
t1/t2
t1/t3
t1/t4
This change does really decrease computation time, as function
pmcorrect.mas is called very often. Assume an Affybatch with N arrays
where each array has M different IDs. Then pmcorrect.mas is called N x
M
- times.
Best regards,
Matthias
--
Dr. Matthias Kohl
www.stamats.de