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

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:

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:

allowWGCNAThreads(nThreads = n_threads)

The complete error message is:

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

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) and might still undergoing some final integration testing. The distributed resource allocation appears to still be at the defaults.

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

What to do

  1. Please send in a bug report from one of the red error datasets.
  • 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).

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 for usage closer review and feedback?

More soon and thank you for reporting the problem! :slight_smile:

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

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.