# Extracting modules from corelation 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.

• What have you tried? Did you look at a dendrogram using the correlation coefficient as the similarity matrix? Once the clusters have been identified have you average the intensity of the genes in each module (I understand that by each type of cancer)? – llrs Feb 8 '19 at 15:47
• "Once the clusters have been identified have you average the intensity of the genes in each module" can i average patient sample ,biologically would it be correct ? "Did you look at a dendrogram using the correlation coefficient as the similarity matrix" sounds bit complicated ,can you simplify , does your library has something similar ? – krushnach Chandra Feb 9 '19 at 16:41
• "What have you tried?" getting correlation and pulling out cluster i have done that – krushnach Chandra Feb 9 '19 at 16:41
• You need to group the patients somehow to be able to compare them with other groups of patients. Usually in differential expression analysis the variance shared by a group is estimated using a model, but in the case of correlations, what is said in the article is doing an average of the correlation. When I'll have time I'll post an answer. – llrs Feb 9 '19 at 16:59
• " When I'll have time I'll post an answer" i will be glad to see how to proceed , " need to group the patients somehow to be able to compare them with other groups of patients. Usually in differential expression analysis the variance shared by a group is estimated using a model" one part is I compare them with healthy samples like normal stem cells vs leukemic stem cell , the other part is leukemic stem cell vs blast cell so there are two kind of comparison...which i have the differential expression using the deseq2 model. – krushnach Chandra Feb 11 '19 at 4:46

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 <- 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.

• "Co-expression in R is doable via gglot2 at the very least" yes that i have done coexpression of gene gene one that part i have no issue , Pearson 0.4 is sort of low but may be that is optimal for TF network which they have created, but i would be glad if you can give some idea about how did it go from gene gene correlation to module clustering ,the part i get is after gene gene correlation i will get modules consist of variable genes ,so in the paper they are checking each module with respect to the sample or tissue type.. – krushnach Chandra Feb 7 '19 at 18:14
• the correlation part is resolved as a matter of fact this where i have asked about it bioinformatics.stackexchange.com/questions/6685/… – krushnach Chandra Feb 7 '19 at 18:18
• coexpression part i have already done...so that part is not a problem , i have doubt regarding the second part where the module clustering happens ,if you can show something regarding that ,then it would be really helpful – krushnach Chandra Feb 11 '19 at 4:34
• No chance of any further help I'm afraid. This thread has cost reputation. – M__ Feb 11 '19 at 11:26
• i didn;t downvote perhaps – krushnach Chandra Feb 12 '19 at 18:02