Error: cannot allocate vector of size ...MB
0
1
Entering edit mode
@fahimefalahi-9511
Last seen 8.3 years ago

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)
limma • 5.4k views
ADD COMMENT
1
Entering edit mode

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. 

ADD REPLY
0
Entering edit mode

Do you think there is any trick to solve it? 

 

ADD REPLY
0
Entering edit mode

Yes. Get a 64-bit version of R on a computer with more RAM.

ADD REPLY
0
Entering edit mode

Where exactly is the error occurring? During the assignment to keep? What does eset21610$Heart_Failure look like? The data set must have a huge number of samples if your logical vector is 500 Mb in size.

ADD REPLY
0
Entering edit mode

yes during making keep. My expression matrix actually contains more than 400K rows and 255 columns

ADD REPLY
0
Entering edit mode

yes during making keep. My expression matrix actually contains more than 400K rows and 255 rows

ADD REPLY
0
Entering edit mode

What about the number of columns?

ADD REPLY
0
Entering edit mode

255 columns

ADD REPLY
0
Entering edit mode

If you only have 255 columns, your keep vector should not be 500 Mb in size. Running:

object.size(logical(255))

... indicates that it's barely over 1 kb. What is the size of the Heart_Failure vector?

ADD REPLY
0
Entering edit mode

the heart-failure vector is not part of my data.  that comes in the information that I got from this website!

ADD REPLY
0
Entering edit mode

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 in keep, then you should examine why that is happening. If Heart_Failure is not 255 elements long, then there's obviously something wrong.

ADD REPLY

Login before adding your answer.

Traffic: 631 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6