This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Error: cannot allocate vector of size 22.3 Gb

Hello! I am new to R and trying to do WGCNA, all the codes run until i get to "dissTOM = 1-TOMsimilarityFromExpr(datExpr0, power = 6)" this part. Once that is run I get following error "Error: cannot allocate vector of size 22.3 Gb".

I tried allocating memory to the programm, changing its limits, and also run the whole script in external SSD but still the error remains. Can someone please help me if they have faced the same issue? I don't know what to do more.

wgcna memory error r

It's referring to RAM. Does your machine have ~ 23GB of RAM? If not, you'll keep encountering this error. Do you have lots of objects loaded into memory? Do you have lots of programs running in the background? Try and free up as much RAM as you can. I doubt any of this will help if R is trying to allocate a vector that big.

1 answer

If you do not have access to a more powerful machine, try to reduce the number of transcripts in your datExpr0 (e.g. remove low expressed transcripts or keep transcripts expressed in at least > 80% of your samples)

It may be late for the response, but thankyou. reducing the transcripts worked. somehow the initial metrics was taken as duplicates. so removed the duplicates too which resolved the issue. Thank you so much.

Log in to answer this question.