Entering edit mode
2.6 years ago
wes
▴
90
I'm following the Tutorials for the WGCNA package (Tutorial I) for network construction. A total of 18 modules were generated. Next, I would like to identify top hub gene in each module.
If I followed the previous post, more that 18 hub gene were identified which is not really tally with the previous finding of 18 modules generated.
colorh = labels2colors(rownames(datExpr))
chooseTopHubInEachModule(
datExpr,
colorh,
omitColors = "grey",
power = 2,
type = "signed",
)
antiquewhite1 antiquewhite2 antiquewhite4 bisque4 black
"MMT00025271" "MMT00030705" "MMT00067823" "MMT00057439" "MMT00081213"
blue blue2 blue3 blue4 blueviolet
"MMT00028861" "MMT00054781" "MMT00004171" "MMT00046684" "MMT00071699"
brown brown1 brown2 brown4 chocolate4
"MMT00053547" "MMT00044818" "MMT00042999" "MMT00078844" "MMT00028559"
coral coral1 coral2 coral3 coral4
"MMT00036790" "MMT00005236" "MMT00020591" "MMT00052548" "MMT00072237"
cyan darkgreen darkgrey darkmagenta darkolivegreen
"MMT00056768" "MMT00016342" "MMT00004625" "MMT00067294" "MMT00048191"
darkolivegreen1 darkolivegreen2 darkolivegreen4 darkorange darkorange2
"MMT00059782" "MMT00071677" "MMT00064617" "MMT00054037" "MMT00076332"
darkred darkseagreen2 darkseagreen3 darkseagreen4 darkslateblue
"MMT00056866" "MMT00012463" "MMT00052488" "MMT00082420" "MMT00057450"
darkturquoise darkviolet deeppink firebrick2 firebrick3
"MMT00047884" "MMT00058337" "MMT00006397" "MMT00075508" "MMT00074641"
firebrick4 floralwhite green green4 greenyellow
"MMT00033297" "MMT00023471" "MMT00022665" "MMT00053218" "MMT00001154"
grey60 honeydew honeydew1 indianred2 indianred3
"MMT00069884" "MMT00011559" "MMT00071941" "MMT00078034" "MMT00077345"
indianred4 ivory lavenderblush1 lavenderblush2 lavenderblush3
"MMT00024107" "MMT00046878" "MMT00080624" "MMT00058428" "MMT00055467"
lightblue3 lightblue4 lightcoral lightcyan lightcyan1
"MMT00066256" "MMT00040558" "MMT00036444" "MMT00007435" "MMT00003410"
lightgreen lightpink2 lightpink3 lightpink4 lightskyblue4
"MMT00015397" "MMT00072076" "MMT00020996" "MMT00023860" "MMT00004034"
lightslateblue lightsteelblue lightsteelblue1 lightyellow magenta
"MMT00034010" "MMT00017441" "MMT00045533" "MMT00063363" "MMT00053716"
magenta3 magenta4 maroon mediumorchid mediumpurple
"MMT00015549" "MMT00017876" "MMT00048511" "MMT00036275" "MMT00041355"
mediumpurple1 mediumpurple2 mediumpurple3 mediumpurple4 midnightblue
"MMT00011887" "MMT00076735" "MMT00060741" "MMT00036913" "MMT00056798"
mistyrose navajowhite navajowhite1 navajowhite2 orange
"MMT00044489" "MMT00015548" "MMT00043149" "MMT00070510" "MMT00075941"
orangered orangered1 orangered3 orangered4 paleturquoise
"MMT00031650" "MMT00061815" "MMT00082585" "MMT00032698" "MMT00026361"
palevioletred1 palevioletred2 palevioletred3 pink pink3
"MMT00021805" "MMT00037437" "MMT00005189" "MMT00016084" "MMT00080789"
pink4 plum plum1 plum2 plum3
"MMT00003071" "MMT00067910" "MMT00048205" "MMT00042535" "MMT00033419"
plum4 purple red royalblue saddlebrown
"MMT00080097" "MMT00072785" "MMT00035101" "MMT00038868" "MMT00010542"
salmon salmon1 salmon2 salmon4 sienna2
"MMT00001185" "MMT00080541" "MMT00071245" "MMT00051771" "MMT00050328"
sienna3 sienna4 skyblue skyblue1 skyblue2
"MMT00051480" "MMT00049308" "MMT00010513" "MMT00080515" "MMT00079155"
skyblue3 skyblue4 slateblue steelblue tan
"MMT00007859" "MMT00027667" "MMT00056001" "MMT00042156" "MMT00034198"
tan4 thistle thistle1 thistle2 thistle3
"MMT00034355" "MMT00024286" "MMT00042538" "MMT00002004" "MMT00036605"
thistle4 turquoise violet white yellow
"MMT00049901" "MMT00031883" "MMT00026397" "MMT00057086" "MMT00025736"
yellow2 yellow3 yellow4 yellowgreen
"MMT00028642" "MMT00003058" "MMT00039749" "MMT00043936"
`````````````````````
Hence, I would like to know if the correct way of identify hub gene should be as below?
moduleLabels = net$colors
moduleColors = labels2colors(net$colors)
chooseTopHubInEachModule(
+ datExpr,
+ moduleColors,
+ omitColors = "grey",
+ power = 6,
+ type = "signed")
black blue brown cyan green greenyellow
"MMT00026784" "MMT00037643" "MMT00006713" "MMT00076726" "MMT00005744" "MMT00052488"
grey60 lightcyan lightgreen magenta midnightblue pink
"MMT00052525" "MMT00058688" "MMT00059368" "MMT00051830" "MMT00007970" "MMT00048286"
purple red salmon tan turquoise yellow
"MMT00020330" "MMT00052927" "MMT00060232" "MMT00010513" "MMT00061093" "MMT00042783"
``````````````````````````
The second chunck of code is correct. You get one one hub for each module you have in
moduleColors
.How many modules do you have?
I obtained 18 modules (excluding the grey modules) from the network construction and hence 2nd code should be correct. Just that I could not understand why the previous post suggest
On the other hand, I also converted the WGCNA object to Cytoscape and use NetworkAnalyzer plugin to identify hub gene (gene with highest degree) to cross-check. Some of the hub gene identified from Rscript (chooseTopHubInEachModule) matched with the output of the NetworkAnalyzer (highest degree that ranked no.1) while some hub gene that identified in Rscript ranked top10 in NetworkAnalyzer instead of ranking no.1. Just wondering what cause this slight differences?
That first chunck of code is just wrong. With
colorh = labels2colors(rownames(datExpr))
you get a vector of colors corresponding to each row in datExpr. So, ifdatExpr
has 300 samples (rownames
) you will get 300 different colors incolorh
. This is not how modules are detected in WGCNA. The label2colors function was implemented because in the WGCNA pipeline modules are first named with numbers. Then, these numbers are converted in to colors withlabels2colors
Different ways to calculate the hubiness of a node in a network. In WGCNA the intramodular connectivity of a node is the sum of connection strengths (correlation values) to other nodes within the same module. The gene with the highest intramodular connectivity is the TopHub
Thanks for the explanation.
In WGCNA the intramodular connectivity of a node is the sum of connection strengths (correlation values) to other nodes within the same module. May I know what is the formula for the statement above?
or
That equation is implemented in
intramodularConnectivity
andintramodularConnectivity.fromExpr
to calculate the intramodular connectivity of a gene