Hi All,
I'm using R package 'igraph' and 'qgraph' to draw the metabolite compound network graph. The network basically depends on adjacency matrix and layout matrix. I'm wondering is that possible that, for example, I first draw 10 compounds with fixed position (fixed x,y coordinates), then draw the remaining compound dynamically (let the algorithm to decide where to put them)?
Thank you all!
Thank you. However, in my situation, we have 2,000 compounds in total. We have 100 compounds that belong to different KEGG pathway modules (we want compounds that belong to the same pathway module to be closer together). The remaining 1,900 compounds has a "quadruple tree" structure connected with these 100 compound. As a result, it would be hard to adjust the position of these 100 compounds after plotting all these 2,000 compounds.
I will at least try to plot based on the partial layout matrix to see whether it works.
If there are too many nodes to be able to adjust them manually, I would question the usefulness of this visual representation, i.e. I am not sure you'll get anything that can be visually interpreted with such a graph. You might want to consider a graph with fewer nodes, for example nodes could represent clusters of compounds.
Anyways, you don't have to use the GUI. Once you've generated the layout matrix, you can programmatically modify it or you can write your own layout function which you can also use with the layout_() function:
If you want nodes to cluster by pathway, you could also adjust the edge weights so that layout algorithms such as Fruchterman-Reingold would group pathway members together.
Thank you Jean and that's exactly what I want! After adjusting the adj matrix to connect each compound node to representative pathway nodes, the compound nodes belong to the same pathway will cluster together by FR algorithm. The whole graph now looks much better since each clustered area represents a functional pathway/module.
Perhaps you should print your 2000 metabolite network on a very large poster board, like one of those classic metabolite / enzyme network posters.