Search code examples
scipygraph-theoryspatialnetworkxkdtree

python NetworkX using atomic coordinates


I'm having trouble figuring out how to use the python NetworkX package to generate a graph using atomic coordinates from molecular dynamics simulations. Ideally it would be nice if I could "hand-over" the atomic coordinates and get a graph with nodes being atoms and edges being the nearest neighbors. I also need to generate the shortest path rings. One solution might be to use the Scipy.spatial.KDTree module to get the nearest neighbors and manual insert the nodes and edges from such results. Does anyone have other thoughts?

Thanks for any help!

-SB


Solution

  • In case you are still looking for this, I wrote a python script that does exactly what you ask for: shortest-path rings from atomic coordinates.

    http://sourceforge.net/projects/polypy/

    I'm working on a C++ version.