Extracting modules from correlation and then module clustering This is the paper where they have first done co-expression analysis of TF and then found coexpressed modules which were further subjected to module clustering ,paper 

So now im clear about the first part of doing the coexpression ,the part which they have written on the paper Im quoting 


  Using Pearson correlation coefficient of 0.4 as a cutoff to define a
  positive correlation between TF pairs, we obtained 37 tightly
  related TF modules that showed excellent co-expression patterns (Fig.
  4a and Supplementary Data 4).We summed the average intensity of each
  module and then performed hierarchical clustering to reveal the
  relationship among the 37 TF modules


As of now If i have done something like this ,i use all the modules coming up with no threshold as such which they have written 0.4, if i get it, then the first figure is a gene-gene pair correlation, how to filter it ,because if i get try to set a threshold i will have to look for every pair irrespective of the module found ,

How to do it in R im not sure about it, any suggestion would be really helpful,next one is how are they going for the next one which is module clustering ,as there are 37 TF modules ,each of them having different gene distribution ,here the second figure the modules are in the rows if i understand ,so how have they done it i would like to get an idea about it.

Earlier i have asked a question , i have the data as if that can be used to show me how it can be done that would be really helpful.
Co-expression in R is doable via gglot2 at the very least... I see if I can find the code.

Essentially you are performing a co-variance analysis, however Pearson' at 0.4 is a LOW cut-off and it should be 0.7.

I've got a lot on right now, so it will take a week or so before I foward the relevant code. R will have other methods outside ggplot2 however.



I was thinking ggcorr() and ggpairs() which both in the GGally package of R-cran. The output is very cute, well its ggplot2 which is trendy.

library (ggplot2)
library (GGally)
library (dplyr)

df &lt;- select(mydata, 1:5)
cor(df) # raw output 
ggcorr(df)


output: heatmap similar to Fig. a

ggpairs(df)


output: very fancy matrix plot Its pairwise scatterplots, diagrams and numbers, which is not represented in Fig. a to c, but its a very fancy version of Fig. d ... Its simplistic analysis, but its a very cute plot.

ggcorr uses pairwise (obviously) Pearson by default, which is the most versatile.

I can definitely say that 0.7 for Pearson for a straight correlation (not a covariance analysis) is conservative low and as a reviewer I would immediately complain about anything lower. A heatmap is different depending on its interpretation. 

The multivariate analysis of Pearson pairwise correlation, which is what you are requesting is a different question. UPGMA style analysis directly on the heatmap, is fine if there is "one heatspot", but otherwise has limitations IMO.