I have read some papers using WGCNA to explore relationship between metabolomics and clinical outcomes. I wanted to use this method in my work as well. Following the tutorial of WGCNA, I can understand most of the method except the module-trait association. Because I have limited knowledge in network analysis or PCA, I don't understand why this correlation can be done. To perform a correlation, you need to have two sets of values. I suppose they are the module eigengene and trait. It is easy to get that trait values are different in each sample, but why would module eigengene be different by sample given that it is the first principal component of the expression matrix?

I think I must have made a wrong assumption here, possibly equal value of module eigengene across samples. If it is a wrong assumption, can someone explain how it is module eigengene calculated?

I see. I had a misunderstanding of the first principal component of the expression matrix. It makes sense now. Thank you!