[BioC] affy: How to back transform the matrix to a vector? (low-level imaging)

Simon Lin simon.lin at duke.edu
Wed Feb 1 01:34:05 CET 2006


I am trying to transform the vector (pm and mm) extracted from @exprs to a 
matrix (2-D layout), so an image can be plotted. It works out.



Now, when I back-transform the image matrix to the vector, there are some 
trouble. See the code below.



Seems that the matrix has to be transposed somehow. Any ideas? 
Thanks! -Simon



   library (affy)

   data (affybatch.example) # has 3 chips

   x<- affybatch.example

   m.vector <- log2( x at exprs[, 2]) # take the second array



   x.pos <- (1:nrow(x)) - (1 + getOption("BioC")$affy$xy.offset)

   y.pos <- (1:ncol(x)) - (1 + getOption("BioC")$affy$xy.offset)

   # from vector to matrix

   m <- as.matrix(rev(as.data.frame(matrix(m.vector, nrow = length(x.pos),

                ncol = length(y.pos)))))



   # ????????????????

   # from matrix to vector

   m0.vector<- as.vector (m) # this does not work, need some massage of m

   # see if it works

   sum (m.vector!= m0.vector)



More information about the Bioconductor mailing list