<p>Looks like a bug in the code which I will try to hunt down and fix. In the meantime, I would suggest playing with maxBlockSize argument to blockwiseModules. Try increasing it as much as your available RAM allows (see the paragraph "A second word of caution concerning block size" on page 6 of <a href="https://horvath.genetics.ucla.edu/html/CoexpressionNetwork/Rpackages/WGCNA/Tutorials/FemaleLiver-02-networkConstr-blockwise.pdf" rel="nofollow noreferrer">WGCNA tutorial I, section 2c</a>, for some guidance on how to set maxBlockSize). Hope this helps.</p>

CC BY-SA 4.0
2019-05-06T18:19:25.430Z
Thank you so much for looking over this for me, I very much appreciate your time and effort. I will try and play around with the maxBlockSize as suggested. Thank you kindly
holly
CC BY-SA 4.0
2019-05-28T00:09:21.440Z
I also got this error:
Did you manage to solve the issue @PeterLangfelder > > sessionInfo() R version 3.5.1 (2018-07-02) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 7 x64 (build > 7601) Service Pack 1 > > Matrix products: default > > locale: [1] LC_COLLATE=English_New Zealand.1252 LC_CTYPE=English_New > Zealand.1252 LC_MONETARY=English_New Zealand.1252 [4] LC_NUMERIC=C > LC_TIME=English_New Zealand.1252 > > attached base packages: [1] stats graphics grDevices utils > datasets methods base > > other attached packages: [1] WGCNA_1.67 fastcluster_1.1.25 > dynamicTreeCut_1.63-
Zoe Ward
CC BY-SA 4.0
2019-05-29T01:30:07.433Z
Please try the newest version (1.68) of WGCNA from CRAN. This bug should be fixed.
Peter Langfelder
CC BY-SA 4.0
2019-05-04T16:40:15.360Z
2019-05-04T16:40:15.360Z
Peter Langfelder
<p>I am using WGCNA and code has worked with no problems with some of my datasets however with most recent attempt when completing gene network &amp; identification of modules. I get following error code... </p>

<pre><code>net__30= blockwiseModules(t5, power=6,
                              TOMType = "signed", minModuleSize=30,
                              reassignThreshold =0, mergeCutHeight = 0.25,
                              numericLabels = TRUE, pamRespectsDendro = FALSE,
                              saveTOMs = TRUE,
                              saveTOMFileBase = "PBCreponseTOMB",
                              verbose= 3)
</code></pre>

<p>I come up with error code saying: </p>

<pre><code>            Number of items to replace is not a multiple of replacement length.
</code></pre>

<p>Does anyone please know what this indicts to? I have looked on all the WGCNA tutorial pages but cannot find this error message anywhere.</p>

<p>Thank you kindly </p>

CC BY-SA 4.0
2019-05-02T16:13:07.953Z
Could be a bug in the code. You will need to provide more detail. When you get the error, type traceback() and post what you get. Also, post the output of `sessionInfo()`.
Peter Langfelder
CC BY-SA 4.0
2019-05-03T08:17:43.743Z
Error code:     Error in clustDist[ii, ] <- if (intNetworkType == 1) 1 - abs(cr1) else 1 -  :

  number of items to replace is not a multiple of replacement length
holly
CC BY-SA 4.0
2019-05-03T08:20:19.393Z
sessionInfo()    R version 3.5.1 (2018-07-02)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.5 LTS
Matrix products: default
holly
CC BY-SA 4.0
2019-05-03T08:22:15.113Z
3: sizeRestrictedClusterMerge(datExpr, clusters = membership, clusterSizes = clusterSizes, centers = centers, maxSize = preferredSize, networkType = networkType, verbose = verbose, indent = indent) 2: projectiveKMeans(datExpr, preferredSize = maxBlockSize, checkData = FALSE, sizePenaltyPower = blockSizePenaltyPower, nCenters = nPreclusteringCenters,  verbose = verbose - 2, indent = indent + 1)
holly
CC BY-SA 4.0
2019-05-03T08:22:20.903Z
1: blockwiseModules(B_CC_4, power = 6, TOMType = "signed", minModuleSize = 10,       reassignThreshold = 0, mergeCutHeight = 0.25, numericLabels = TRUE, pamRespectsDendro = FALSE, saveTOMs = TRUE, saveTOMFileBase = "PBCreponseTOMB",
       verbose = 3)
holly
CC BY-SA 4.0
2019-05-03T08:23:11.030Z
I can't add more of the sessionInfo() as too many characters.. can you let me know which parts are key to review. Thank you so much for your kind assistance. I am abit lost with the error and re-run over and over again and re-formatted my raw data, cant see any errors there, thank you
holly
CC BY-SA 4.0
2019-05-06T14:48:22.480Z
@holly You can [edit] your question to include these details and other that might be needed to give a good answer to your question (And help future readers to find it, as comments are not indexed by searcher)
llrs
CC BY-SA 4.0
2019-05-06T23:03:45.007Z
Please try installing and using this development version of WGCNA: https://www.dropbox.com/s/fuu73li4ajjfr3z/WGCNA_1.67-90.tar.gz?dl=0 and see if it solves the issue. Thanks again for reporting the issue.
Peter Langfelder
CC BY-SA 4.0
2019-05-07T11:30:13.150Z
Thank you kindly for all your kind help, very much appreciate it
holly
<r><wgcna>
WGCNA error codes in Network Construction & moduel detection
# WGCNA error codes in Network Construction & moduel detection

(Asked by: username_0 on 2019-05-02)

I am using WGCNA and code has worked with no problems with some of my datasets however with most recent attempt when completing gene network & identification of modules. I get following error code... 
net__30= blockwiseModules(t5, power=6,
                              TOMType = "signed", minModuleSize=30,
                              reassignThreshold =0, mergeCutHeight = 0.25,
                              numericLabels = TRUE, pamRespectsDendro = FALSE,
                              saveTOMs = TRUE,
                              saveTOMFileBase = "PBCreponseTOMB",
                              verbose= 3)

I come up with error code saying: 
            Number of items to replace is not a multiple of replacement length.

Does anyone please know what this indicts to? I have looked on all the WGCNA tutorial pages but cannot find this error message anywhere.
Thank you kindly

**Tags:** r, wgcna
> **Comments:**
> **username_1**: Could be a bug in the code. You will need to provide more detail. When you get the error, type traceback() and post what you get. Also, post the output of `sessionInfo()`.  
> **username_0**: Error code:     Error in clustDist[ii, ] <- if (intNetworkType == 1) 1 - abs(cr1) else 1 -  :    number of items to replace is not a multiple of replacement length  
> **username_0**: sessionInfo()    R version 3.5.1 (2018-07-02) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 16.04.5 LTS Matrix products: default  
> **username_0**: 3: sizeRestrictedClusterMerge(datExpr, clusters = membership, clusterSizes = clusterSizes, centers = centers, maxSize = preferredSize, networkType = networkType, verbose = verbose, indent = indent) 2: projectiveKMeans(datExpr, preferredSize = maxBlockSize, checkData = FALSE, sizePenaltyPower = blockSizePenaltyPower, nCenters = nPreclusteringCenters,  verbose = verbose - 2, indent = indent + 1)  
> **username_0**: 1: blockwiseModules(B_CC_4, power = 6, TOMType = "signed", minModuleSize = 10,       reassignThreshold = 0, mergeCutHeight = 0.25, numericLabels = TRUE, pamRespectsDendro = FALSE, saveTOMs = TRUE, saveTOMFileBase = "PBCreponseTOMB",        verbose = 3)  
> **username_0**: I can't add more of the sessionInfo() as too many characters.. can you let me know which parts are key to review. Thank you so much for your kind assistance. I am abit lost with the error and re-run over and over again and re-formatted my raw data, cant see any errors there, thank you  
> **username_2**: @holly You can [edit] your question to include these details and other that might be needed to give a good answer to your question (And help future readers to find it, as comments are not indexed by searcher)  
> **username_1**: Please try installing and using this development version of WGCNA: https://www.dropbox.com/s/fuu73li4ajjfr3z/WGCNA_1.67-90.tar.gz?dl=0 and see if it solves the issue. Thanks again for reporting the issue.  
> **username_0**: Thank you kindly for all your kind help, very much appreciate it  

---

## 1 answers

### Answer by username_1 on 2019-05-04. Score: 2 | Accepted answer

Looks like a bug in the code which I will try to hunt down and fix. In the meantime, I would suggest playing with maxBlockSize argument to blockwiseModules. Try increasing it as much as your available RAM allows (see the paragraph "A second word of caution concerning block size" on page 6 of [WGCNA tutorial I, section 2c](https://horvath.genetics.ucla.edu/html/CoexpressionNetwork/Rpackages/WGCNA/Tutorials/FemaleLiver-02-networkConstr-blockwise.pdf), for some guidance on how to set maxBlockSize). Hope this helps.

> **Comments:**
> **username_0**: Thank you so much for looking over this for me, I very much appreciate your time and effort. I will try and play around with the maxBlockSize as suggested. Thank you kindly  
> **username_3**: I also got this error: Did you manage to solve the issue @PeterLangfelder > > sessionInfo() R version 3.5.1 (2018-07-02) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 7 x64 (build > 7601) Service Pack 1 > > Matrix products: default > > locale: [1] LC_COLLATE=English_New Zealand.1252 LC_CTYPE=English_New > Zealand.1252 LC_MONETARY=English_New Zealand.1252 [4] LC_NUMERIC=C > LC_TIME=English_New Zealand.1252 > > attached base packages: [1] stats graphics grDevices utils > datasets methods base > > other attached packages: [1] WGCNA_1.67 fastcluster_1.1.25 > dynamicTreeCut_1.63-  
> **username_1**: Please try the newest version (1.68) of WGCNA from CRAN. This bug should be fixed.  

---

