# WGCNA Galaxy Tool Error: nThreads must be numeric and at least 2

**URL:** <https://help.galaxyproject.org/t/wgcna-galaxy-tool-error-nthreads-must-be-numeric-and-at-least-2/18199>\
**Category:** Uncategorized\
**Tags:** wgcna\_network\
**Created:** [July 22, 2026, 7:31pm UTC](https://help.galaxyproject.org/t/wgcna-galaxy-tool-error-nthreads-must-be-numeric-and-at-least-2/18199 "2026-07-22T19:31:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![konidala\_bio](https://avatars.discourse-cdn.com/v4/letter/k/2bfe46/32.png) [@konidala\_bio](https://help.galaxyproject.org/u/konidala_bio)\
**Post date:** [July 22, 2026, 7:31pm UTC](https://help.galaxyproject.org/t/wgcna-galaxy-tool-error-nthreads-must-be-numeric-and-at-least-2/18199/1 "2026-07-22T19:31:00Z")

</div>

Dear Galaxy Support Team,

I am using the WGCNA Network Galaxy tool with the following Tool ID:

**toolshed.g2.bx.psu.edu/repos/iuc/wgcna\_network/wgcna\_network/1.74+galaxy0**

My job is failing with the following error:

```auto
Error in allowWGCNAThreads(nThreads = n_threads) :
  nThreads must be numeric and at least 2.
Execution halted

```

The relevant job details are as follows:

- **Job State:** Error
- **Job API ID:** 4838ba20a6d86765a7a16459a345d7cf
- **Created:** Tuesday, July 21, 2026, 11:28:50 (GMT+5:30)
- **Tool Exit Code:** 1
- **CPU Cores Allocated:** 1
- **Memory Allocated:** 3891 MB
- **Maximum Memory Usage:** 434.7 MB
- **Number of processes killed by OOM:** 0

The tool successfully loads the required packages, including `dynamicTreeCut`, `fastcluster`, `WGCNA`, and `igraph`, but the job terminates when executing:

```auto
allowWGCNAThreads(nThreads = n_threads)

```

The complete error message is:

```auto
Loading required package: dynamicTreeCut
Loading required package: fastcluster

Attaching package: 'fastcluster'

The following object is masked from 'package:stats':
    hclust

Attaching package: 'WGCNA'

The following object is masked from 'package:stats':
    cor

Attaching package: 'igraph'

The following objects are masked from 'package:stats':
    decompose, spectrum

The following object is masked from 'package:base':
    union

Error in allowWGCNAThreads(nThreads = n_threads) :
  nThreads must be numeric and at least 2.
Execution halted

```

I noticed that the Galaxy job was allocated **only 1 CPU core** , while the WGCNA tool appears to call `allowWGCNAThreads()` with a requirement of at least 2 threads. Therefore, I suspect there may be a mismatch between the tool’s threading configuration and the resources allocated to the job.

My WGCNA parameters were:

- Soft-thresholding power: 6
- Network type: Unsigned
- TOM type: Signed
- Correlation type: Pearson
- Minimum module size: 30
- Module merge cut height: 0.25
- Module eigengene network correlation threshold: 0.5
- Log2(count + 1) transformation: False
- Low-variance gene filtering: Enabled
- Variance filter quantile: 0.4
- WGCNA sample/gene QC filtering: False
- Metadata trait columns: 2
- Plot resolution: 300 DPI

Could you please check whether this is a problem with the current **WGCNA Network 1.74+galaxy0** tool configuration or with the Galaxy resource allocation?

In particular, could you please advise whether:

1. The tool requires at least 2 CPU cores to run successfully;
2. The tool is incorrectly passing the allocated CPU count (`1`) to `allowWGCNAThreads()`;
3. The Galaxy tool should automatically set `n_threads` to at least 2; or
4. There is a recommended workaround or configuration that I should use to run the analysis successfully.

I would appreciate your assistance in resolving this issue.

Thank you for your help.

Best regards,

Dr. Kranthi Kumar Konidala

---

<div class="post-metadata">

**Author:** ![jennaj](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/jennaj/32/27_2.png) [@jennaj](https://help.galaxyproject.org/u/jennaj)\
**Post date:** [July 22, 2026, 8:06pm UTC](https://help.galaxyproject.org/t/wgcna-galaxy-tool-error-nthreads-must-be-numeric-and-at-least-2/18199/2 "2026-07-22T20:06:33Z")

</div>

Hello @konidala_bio

Thanks for reporting your testing results! I agree that as a first pass guess, this is likely some problem with the job environment, possibly threading, but maybe also how the threading is communicated to the tool from that environment. We can sort this out here!

This wrapped tool is brand new in Galaxy ([about two weeks](https://github.com/galaxyproject/tools-iuc/commits/main/tools/wgcna)) and might still undergoing some final integration testing. The [distributed resource allocation](https://github.com/galaxyproject/tpv-shared-database/blob/main/tools.yml) appears to still be at the defaults.

> <https://github.com/galaxyproject/tools-iuc/blob/1cc1623b558600ae8e0181ed09ed70079118a579/tools/wgcna/wgcna_network.xml#L33-L35>

I’ll link the WGCNA technical repositories here as a reference

- Source → [GitHub - cran/WGCNA: ❗&nbsp;This&nbsp;is&nbsp;a&nbsp;read-only&nbsp;mirror&nbsp;of&nbsp;the&nbsp;CRAN&nbsp;R&nbsp;package&nbsp;repository. WGCNA&nbsp;—&nbsp;Weighted&nbsp;Correlation&nbsp;Network&nbsp;Analysis · GitHub](https://github.com/cran/WGCNA)
- ToolShed → [Galaxy Tool Shed](https://toolshed.g2.bx.psu.edu/view/iuc/wgcna_network) (wgcna\_network)
- Development → [tools-iuc/tools/wgcna at main · galaxyproject/tools-iuc · GitHub](https://github.com/galaxyproject/tools-iuc/tree/main/tools/wgcna)

**What to do**

1. Please send in a bug report from [one of the red error datasets](https://training.galaxyproject.org/training-material/faqs/galaxy/analysis_troubleshooting.html).

- You can include a link to this topic in the bug report comments for context (helps them to know we’d appreciate public updates back here for the community).

1. Then, I am running through the tool test in a history to flush out exactly what is going on to get this reported. Update: reproducible and another bug report sent in. No ticket (yet, let’s see if needed).

- Test history → [https://usegalaxy.eu/u/jenj/h/test-wgcna-network-wgcna-softpower](https://usegalaxy.eu/u/jenj/h/test-wgcna-network-wgcna-softpower)
- Tracking ticket using tool test data: _pending if needed_

If I can’t reproduce the error, we can explore your real experiment data more as a use-case example. This isn’t need yet unless you want to [share back your history](https://training.galaxyproject.org/training-material/faqs/galaxy/histories_sharing.html) for usage closer review and feedback?

More soon and thank you for reporting the problem! 🙂

---

<div class="post-metadata">

**Author:** ![nilchia](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/nilchia/32/5712_2.png) [@nilchia](https://help.galaxyproject.org/u/nilchia)\
**Post date:** [July 29, 2026, 9:12pm UTC](https://help.galaxyproject.org/t/wgcna-galaxy-tool-error-nthreads-must-be-numeric-and-at-least-2/18199/3 "2026-07-29T21:12:22Z")

</div>

Hi @konidala_bio

Thanks for reporting the issue! We have allocated more cores to the tool, and that problem should be solved.

As @jennaj said, this Galaxy tool was recently developed, and it might still get more updates.

Please don’t hesitate to ping us if you encounter any other issues with this tool or if you have any suggestions for improving the tool (like more QC plots or any downstream analysis)

Best,

Amirhossein

---

<div class="post-metadata">

**Author:** ![jennaj](https://sea2.discourse-cdn.com/flex020/user_avatar/help.galaxyproject.org/jennaj/32/27_2.png) [@jennaj](https://help.galaxyproject.org/u/jennaj)\
**Post date:** [July 30, 2026, 6:19pm UTC](https://help.galaxyproject.org/t/wgcna-galaxy-tool-error-nthreads-must-be-numeric-and-at-least-2/18199/4 "2026-07-30T18:19:46Z")

</div>

Great, thanks you @nilchia

I reran my test case, and it worked! This was with tiny data and many default options, so you can check now too @konidala_bio to see what happens. Please let us know how it goes!

Should you get a different error, my example _might_ help with data formats or parameters but we can troubleshoot more, too! I would probably need to see all of the input/job details.

- [https://usegalaxy.eu/u/jenj/h/test-wgcna-network-wgcna-softpower](https://usegalaxy.eu/u/jenj/h/test-wgcna-network-wgcna-softpower)
