Entering edit mode
Simon Lin
▴
210
@simon-lin-461
Last seen 10.2 years ago
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)