Becksteinlab / hop

Solvent network analysis. Hop is a python package based on MDAnalysis to analyze solvation dynamics.
https://hop.readthedocs.io
GNU General Public License v3.0
14 stars 5 forks source link

visualization of hopping network #14

Open orbeckst opened 8 years ago

orbeckst commented 8 years ago

via @iorga:

How can we visualize the network encoded by the file hopgraph.xgmml ? I tried with Cytoscape, it recognizes the columns etc, but the drawing shows only one big rectangle.

I also installed graphviz, but I'm not sure about how to use the modules, like "dot" for example. Is it correct to type

dot -Tpng -o x.png test.xgmml

The result is :

Warning: test.xgmml: syntax error in line 1 near '>'

Or do I have to format the xgmml file into a specific format ?

orbeckst commented 8 years ago

@iwelland – can you help? Didn't you fix something in the xgml exporter?

ghost commented 8 years ago

Hi,

There are several strategies to visualize hop networks.

  1. Import networkx. Load the HoppingGraph. Filter the graph using the filter method. Then use: A=nx.to_agraph(hopgraph.filtered_graph) A.layout() A.draw('filename.png')

A.layout() normally calls the 'neato' layout. These look much nicer than Cytoscape even for large graphs. You can change the layout and I think each layout has various nice properties.

  1. Use my tcl visualization tools. I believe my tcl visualization methods were merged with the master branch.

With your hopgraph, use h.write_tcl(filename='your_filename'). You can tweak the color of the edges and nodes, the size of the nodes, and also select subsets of nodes to highlight with a different color. There are some unfinished tools which try to color by weight but they don't produce very clear results.

  1. Use cytoscape.

To use cytoscape, you need to use the import tool. Then you need to change the layout of the graph, since otherwise it will 'helpfully' stack all the nodes on top of each other.

Best, Ian

iorga commented 8 years ago

Many thanks @ianWelland. Edithe will test your suggestions and will come back with comments ASAP.

ghost commented 8 years ago

Any updates?