Entering edit mode
4.2 years ago
Silvia Gonzalez
▴
20
Hi, I have done a WGCNA with all typical graphics. Now, I want to do the network visualization using the adjacency matrix to visualize it, but I don't know how I can do it. I know that I have to use the igraph, network and networkD3 packages but I don't know which is the code that I have to put in R.
If someone can help me I would be very grateful.
Thanks
Ok, thanks for the link that you bring me it's very useful. I follow the same steps like in the link and I have the network construction, but I don't know what it means each color (red, blue, grey) and how interpretate this network.
Also I don't understand why he transform the adjacency matrix into 0 and 1, I mean I don't understand the following steps:
First, he do this:
adjacency[adjacency < 0] = 0 adjacency[adjacency > 1] = 1
and then he do:
adj[adj > 0.1] = 1 adj[adj != 1] = 0
If you can explain me I would be very grateful
Thanks for your attention
Those steps just indirectly result in edges being removed. When you create a graph object in igraph, everything is connected to everything; so, you have to decide which edges to remove, and which to keep. Those steps mean that any edge with adjacency > 0.1 will be retained.
I think that the colours relate to the original WGCNA modules. They are assigned in the line:
I have more 'advanced' code here, which can help you to do a network analysis independently of WGCNA: Network plot from expression data in R using igraph
Hi Mr Blighe, thanks for the information. I have tried your tutorial in my own data and it’s amazing, it runs fantastic. After analyse the code I have some doubts. The main doubt is why you put “weight” when you do the negative, positive colors correlations, what it means “weight”, what do?
The second doubt I have is, what do the function(x)? And why do you put (x-min(x))/(max(x)-min(x)?
Finally, when I saw my graphics I observed that is a samples aggregation of my data, this code shows you the samples aggregation but if I want to see the genes aggregation of my samples what code/tutorial I should follow?
Thank for your dedication,
Silvia
Hello (Ciao?) Silvia,
'
weight
', in this context, relates to the Pearson correlation value between any two vertices (genes). This is due to the fact that the initial network was created from a distance matrix of Pearson correlation values, via:In other situations, '
weight
' may relate to Euclidean distances, or something else. Positive correlations are then encoded as red, while negative correlations are blue.This function scales the vertex sizes to be between 0 and 1. It ultimately means that genes that have higher expression will have larger vertices. Here is an example:
For this, you just need to transpose your input data, via
t()
Ok, I understand!
Thank you for all,
Silvia