Hi, I try to make a design matrix! I get an error regarding the mismatch in dimension of my DNA data (expression matrix) and design!
I read the below information*** on this website ( to make a keep vector and so on) and tried to follow the advice.
However when I try to make a keep vector for my own data I get this error: "Error: cannot allocate vector of size 453.2 Mb".
Thanks
***When you construct a design matrix with model.matrix
, any NA
values in the input vectors will be dropped. This results in fewer libraries (i.e., rows) in the design matrix than there are columns in your expression matrix. Attempting to use lmFit
will result in a mismatch in dimensions and the reported error. To avoid this, you should remove those libraries that are NA
for heart failure:
keep <- !is.na(eset21610$Heart_Failure) # done after assignment of NA to replace "NA" new.eset21610 <- eset21610[,keep] new.design <- model.matrix(~ Heart_Failure, pData(new.eset21610)) new.fit <- lmFit(new.eset21610, new.design)
This error in general means you have run out of memory. (If you are on windows running 32-bit R, R can only allocate 3GB all told). It means there isn't enough memory left to allocate 453.2 MB.
Do you think there is any trick to solve it?
Yes. Get a 64-bit version of R on a computer with more RAM.
Where exactly is the error occurring? During the assignment to
keep
? What doeseset21610$Heart_Failure
look like? The data set must have a huge number of samples if your logical vector is 500 Mb in size.yes during making keep. My expression matrix actually contains more than 400K rows and 255 columns
yes during making keep. My expression matrix actually contains more than 400K rows and 255 rows
What about the number of columns?
255 columns
If you only have 255 columns, your
keep
vector should not be 500 Mb in size. Running:... indicates that it's barely over 1 kb. What is the size of the
Heart_Failure
vector?the heart-failure vector is not part of my data. that comes in the information that I got from this website!
It doesn't matter where you got it from, the fact is that you're using it to construct
keep
. If R is trying to construct a 500 Mb object inkeep
, then you should examine why that is happening. IfHeart_Failure
is not 255 elements long, then there's obviously something wrong.