Pergunta

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

Foi útil?

Solução

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.

Outras dicas

Your idea to use scipy.spatial.KDTree sounds good. Take a look at this example which should get you most of the way there: NetworkX Random Geometric Graph Implementation using K-D Trees

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top