[R] Quick help needed in coding quantile normalization

helpwperl Ssabri1 at jhu.edu
Sat Oct 26 06:18:52 CEST 2013


I'm trying to code quantile normalization without using any fancy functions
(e.g., normalizeBetweenArrays(), normalize.quantities(), etc.). I'm having a
hard time trying to re-order the columns of my means matrix to match the
original unsorted matrix. I assume I will have to somehow utilize order() or
rank() but I'm having a hard time doing so. I'm essentially attempting to
mirror what is being performed on the third slide of page seven of this
(http://www.biostat.jhsph.edu/~ririzarr/Teaching/688/normalization.pdf)
lecture. I've posted below my current code:

samp <- cbind(samp1, samp2, samp3, samp4)
colnames(samp) <- c("samp1", "samp2", "samp3", "samp4")

samp.sorted <- apply(samp, 2, sort) 

row.means <- rowMeans(samp.sorted, na.rm = FALSE)
row.means <- as.matrix(row.means)
row.means <- cbind(row.means, row.means, row.means, row.means)

Any help would be greatly appreciated. 



--
View this message in context: http://r.789695.n4.nabble.com/Quick-help-needed-in-coding-quantile-normalization-tp4679072.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list