This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Trouble with WGCNA gene dendrogram

I am trying to plot my gene dendrogram while following the online tutorials for WGCNA. When using the function "table(bwnet$colors)" it shows that there should be 24 modules for my data. When I continue running the code for plotting the dendrogram (code below) I somehow keep getting a plot that looks like this. It seems to me that this is not consistent with there being 24 modules.

    bwnet = blockwiseModules(datExpr0, maxBlockSize = 2000,
                     power = 6, TOMType = "unsigned", minModuleSize = 30,
                     reassignThreshold = 0, mergeCutHeight = 0.25,
                     numericLabels = TRUE,
                     saveTOMs = TRUE,
                     saveTOMFileBase = "TOM-blockwise",
                     verbose = 3)


# open a graphics window
sizeGrWindow(12, 9)
# Convert labels to colors for plotting
mergedColors = labels2colors(bwnet$colors)
# Plot the dendrogram and the module colors underneath
plotDendroAndColors(bwnet$dendrograms[[1]], mergedColors[bwnet$blockGenes[[1]]],
                    "Module colors",
                    dendroLabels = FALSE, hang = 0.03,
                    addGuide = TRUE, guideHang = 0.05)

table(bwnet$colors)



![> 0    1    2    3    4    5    6    7    8    9   10   11   12   13   14   15   16   17   18   19   20   21   22 
1287 4001 3115 2498 1774 1706 1135  735  484  305  299  269  265  157  117  111  104  101   77   71   68   63   61 
  23   24 
  60   44]

![enter image description here][1] enter image description here

soft rnaseq wgcna thresholding
table(bwnet$unmergedColors)

  0    1    2    3    4    5    6    7    8    9   10   11   12   13   14   15   16   17   18   19   20   21   22 
     359 1273  718 1698  302 1041  533  424  781  579  159  108  106   92   89  365  366  302  279  164  123   90   79 
      23   24   25   26   27   28   29   30   31   32   33   34   35   36   37   38   39   40   41   42   43   44   45 
      79   52   37  225  215  178  174  161  156  119  116   87   80   74   73   72   62   58   51  741  416  363  283 
      46   47   48   49   50   51   52   53   54   55   56   57   58   59   60   61   62   63   64   65   66   67   68 
      36   34  948  260  162  136  113  102  631  434  396  110   88   74  242  194  191  157  136  100   88   85   82 
      69   70   71   72   73 
      58   45   35   35   33

my guess is that you are plotting the dendrongram of the genes from block 1 bwnet$blockGenes[[1]] which happen to belong to grey (0), blue (2) and brown (1) modules.

By default, the maximum block size is 5000so the maximum number of genes you can plot in the dendrogram can't exceed that number

I am just guessing because I never used the function blockwiseModules

I decided to choose blockwiseModules because my RNA seq is analyzing 18000+ probes. So that would mean I may have to plot each block separately to get a visual? I was mostly concerned that something mathematically went wrong that I missed in the network construction because my dendrogram looked so different from the ones in the tutorials but perhaps it is because my dataset is so much larger and the maximum block size?

the code looks fine, and the dendrogram look like that because you are plotting only the genes from two modules that have opposite expression patterns = a gene dendrogram with only two main branches.

edit:

because my RNA seq is analyzing 18000+ probes.

How much RAM do you have?

I am working on a laptop with only 8 gigs

I am working on a laptop with only 8 gigs

Yeah, 8 gigs is not enough for 18k probes

I may have access to a 16 gig workstation- would that be enough?

So you would suggest I use the automatic network construction on a stronger computer versus using the blockwiseModules? If I do that would I need to increase the maximum block size in order to plot more than one module?

If you have enough RAM for 18k probes you can follow the step-by-step network construction.

Peter Langfelder explains very well why WGCNA analysis on a single block (all genes) is preferred over the blockwiseModules approach: link

With access to 16gigs of RAM could I use the automatic network construction and increase the maxblocksize to 18k instead of 5000 default?

you can set maxBlockSize to the total number of genes you have in datExpr

0 answers

No answers yet.

Log in to answer this question.