Question: Soft threshold in WGCNA
gravatar for madkitty
5.2 years ago by
madkitty600 wrote:


I get that error message when following the tutorial to determine the soft threshold. We have 3 dataset as controls(datExpr1, datExpr2, datExpr3) and 1 dataset containing 10 replicates (datExpr4).

I tried to limit the analysis to common genes between the 3 datasets controls and the replicates with the following lines: 


commonGenes1 = intersect (rownames(datExpr1),rownames(datExpr4))
commonGenes2 = intersect (rownames(datExpr2),rownames(datExpr4))
commonGenes3 = intersect (rownames(datExpr3),rownames(datExpr4))

datExpr1= datExpr1[commonGenes1,]
datExpr2= datExpr2[commonGenes2,]
datExpr3= datExpr3[commonGenes3,]


Then we have to find the "soft threshold" .. and that's where I got the error message, it seems that it needs too much memory. I'm suspecting I'm doing smth wrong when calling the common set of genes between the 3 datasets controls and the samples..

# Choose a set of soft-thresholding powers
> powers = c(c(1:10), seq(from = 12, to=20, by=2))

# Call the network topology analysis function
> sft = pickSoftThreshold(samExpr0, powerVector = powers, verbose = 5)
pickSoftThreshold: will use block size 29382.
pickSoftThreshold: calculating connectivity for given powers...
   ..working on genes 1 through 29382 of 34688
Error in { : task 2 failed - "cannot allocate vector of size 1.9 Gb"
In addition: There were 12 warnings (use warnings() to see them)




wgcna • 2.5k views
ADD COMMENTlink modified 5.2 years ago • written 5.2 years ago by madkitty600

You're probably running out of memory. As a general rule of thumb, any time you ever see a message like "cannot allocate vector of size ..." then that's what's happening.

ADD REPLYlink written 5.2 years ago by Devon Ryan95k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1888 users visited in the last hour