``` r
picked_power = 5
temp_cor <- cor       
cor <- WGCNA::cor         # Force it to use WGCNA cor function (fix a namespace conflict issue)
netwk_Apul <- blockwiseModules(datExpr,                # <= input here

                          # == Adjacency Function ==
                          power = picked_power,                # <= power here
                          networkType = "signed",

                          # == Tree and Block Options ==
                          deepSplit = 2,
                          pamRespectsDendro = F,
                          # detectCutHeight = 0.75,
                          minModuleSize = 30,
                          maxBlockSize = 5000,

                          # == Module Adjustments ==
                          reassignThreshold = 1e-6,
                          mergeCutHeight = 0.15,

                          # == TOM == Archive the run results in TOM file (saves time)
                          saveTOMs = F,
                          saveTOMFileBase = "ER",

                          # == Output Options
                          numericLabels = T,
                          verbose = 3)
```

```
 Calculating module eigengenes block-wise from all genes
   Flagging genes and samples with too many missing values...
    ..step 1
 ....pre-clustering genes to determine blocks..
   Projective K-means:
   ..k-means clustering..
   ..merging smaller clusters...
Block sizes:
gBlocks
   1    2    3    4    5 
4996 4903 4664 4478 4461 
 ..Working on block 1 .
    TOM calculation: adjacency..
    ..will use 48 parallel threads.
     Fraction of slow calculations: 0.000000
    ..connectivity..
    ..matrix multiplication (system BLAS)..
    ..normalization..
    ..done.
 ....clustering..
 ....detecting modules..
 ....calculating module eigengenes..
 ....checking kME in modules..
     ..removing 24 genes from module 1 because their KME is too low.
     ..removing 16 genes from module 2 because their KME is too low.
 ..Working on block 2 .
    TOM calculation: adjacency..
    ..will use 48 parallel threads.
     Fraction of slow calculations: 0.000000
    ..connectivity..
    ..matrix multiplication (system BLAS)..
    ..normalization..
    ..done.
 ....clustering..
 ....detecting modules..
 ....calculating module eigengenes..
 ....checking kME in modules..
     ..removing 245 genes from module 1 because their KME is too low.
     ..removing 126 genes from module 2 because their KME is too low.
     ..removing 14 genes from module 3 because their KME is too low.
     ..removing 9 genes from module 4 because their KME is too low.
     ..removing 3 genes from module 5 because their KME is too low.
     ..removing 21 genes from module 8 because their KME is too low.
     ..removing 12 genes from module 9 because their KME is too low.
     ..removing 9 genes from module 10 because their KME is too low.
     ..removing 12 genes from module 11 because their KME is too low.
     ..removing 2 genes from module 12 because their KME is too low.
     ..removing 3 genes from module 14 because their KME is too low.
     ..removing 1 genes from module 16 because their KME is too low.
     ..removing 1 genes from module 17 because their KME is too low.
     ..removing 1 genes from module 18 because their KME is too low.
 ..Working on block 3 .
    TOM calculation: adjacency..
    ..will use 48 parallel threads.
     Fraction of slow calculations: 0.000000
    ..connectivity..
    ..matrix multiplication (system BLAS)..
    ..normalization..
    ..done.
 ....clustering..
 ....detecting modules..
 ....calculating module eigengenes..
 ....checking kME in modules..
     ..removing 200 genes from module 1 because their KME is too low.
     ..removing 174 genes from module 2 because their KME is too low.
     ..removing 95 genes from module 3 because their KME is too low.
     ..removing 31 genes from module 4 because their KME is too low.
     ..removing 2 genes from module 5 because their KME is too low.
     ..removing 36 genes from module 7 because their KME is too low.
     ..removing 7 genes from module 8 because their KME is too low.
     ..removing 4 genes from module 11 because their KME is too low.
     ..removing 13 genes from module 12 because their KME is too low.
     ..removing 3 genes from module 15 because their KME is too low.
 ..Working on block 4 .
    TOM calculation: adjacency..
    ..will use 48 parallel threads.
     Fraction of slow calculations: 0.000000
    ..connectivity..
    ..matrix multiplication (system BLAS)..
    ..normalization..
    ..done.
 ....clustering..
 ....detecting modules..
 ....calculating module eigengenes..
 ....checking kME in modules..
     ..removing 152 genes from module 1 because their KME is too low.
     ..removing 106 genes from module 2 because their KME is too low.
     ..removing 81 genes from module 3 because their KME is too low.
     ..removing 82 genes from module 4 because their KME is too low.
     ..removing 9 genes from module 5 because their KME is too low.
     ..removing 5 genes from module 6 because their KME is too low.
 ..Working on block 5 .
    TOM calculation: adjacency..
    ..will use 48 parallel threads.
     Fraction of slow calculations: 0.000000
    ..connectivity..
    ..matrix multiplication (system BLAS)..
    ..normalization..
    ..done.
 ....clustering..
 ....detecting modules..
 ....calculating module eigengenes..
 ....checking kME in modules..
     ..removing 297 genes from module 1 because their KME is too low.
     ..removing 60 genes from module 2 because their KME is too low.
     ..removing 38 genes from module 3 because their KME is too low.
     ..removing 31 genes from module 4 because their KME is too low.
  ..reassigning 40 genes from module 1 to modules with higher KME.
  ..reassigning 27 genes from module 2 to modules with higher KME.
  ..reassigning 3 genes from module 3 to modules with higher KME.
  ..reassigning 2 genes from module 4 to modules with higher KME.
  ..reassigning 4 genes from module 5 to modules with higher KME.
  ..reassigning 3 genes from module 7 to modules with higher KME.
  ..reassigning 1 genes from module 10 to modules with higher KME.
  ..reassigning 1 genes from module 13 to modules with higher KME.
  ..reassigning 1 genes from module 14 to modules with higher KME.
  ..reassigning 7 genes from module 23 to modules with higher KME.
  ..reassigning 1 genes from module 24 to modules with higher KME.
  ..reassigning 2 genes from module 25 to modules with higher KME.
  ..reassigning 1 genes from module 28 to modules with higher KME.
  ..reassigning 1 genes from module 29 to modules with higher KME.
  ..reassigning 1 genes from module 30 to modules with higher KME.
  ..reassigning 1 genes from module 31 to modules with higher KME.
  ..reassigning 1 genes from module 36 to modules with higher KME.
  ..reassigning 5 genes from module 43 to modules with higher KME.
  ..reassigning 11 genes from module 44 to modules with higher KME.
  ..reassigning 1 genes from module 45 to modules with higher KME.
  ..reassigning 2 genes from module 46 to modules with higher KME.
  ..reassigning 1 genes from module 48 to modules with higher KME.
  ..reassigning 11 genes from module 50 to modules with higher KME.
  ..reassigning 8 genes from module 51 to modules with higher KME.
  ..reassigning 1 genes from module 53 to modules with higher KME.
 ..merging modules that are too close..
     mergeCloseModules: Merging modules whose distance is less than 0.15
       Calculating new MEs...
```

``` r
cor <- temp_cor     # Return cor function to original namespace
```