- Notifications
You must be signed in to change notification settings - Fork22
Convert an xyz file into a molecular graph and create a 3D visualisation of the graph.
License
NotificationsYou must be signed in to change notification settings
zotko/xyz2graph
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
A Python package to convert XYZ molecular files into NetworkX graphs with interactive 3D visualization using Plotly.
- Interactive 3D molecular visualization using Plotly
- NetworkX graph conversion for analysis
- Command-line interface
pip install xyz2graph
- Python 3.8+
- Dependencies: NumPy, Plotly, NetworkX
importnumpyasnpfromxyz2graphimportMolGraph# Create molecular graph and read XYZ filemg=MolGraph()mg.read_xyz('molecule.xyz')# Generate interactive 3D visualizationfig=mg.to_plotly()fig.show()# Convert to NetworkX graphG=mg.to_networkx()G.nodes[0]# Output: {'element': 'C', 'xyz': (0.1718396797, 1.4440789224, 0.2473852864)}G.edges[(0,1)]# Output: {'length': np.float64(1.49623)}
# Save visualization as HTMLxyz2graph molecule.xyz# Specify output filexyz2graph molecule.xyz --output viz.html# Open directly in browserxyz2graph molecule.xyz --browser
Read thedocumentation for guides, API reference, and examples.
🪲Report a bug
✨Request a feature
Contributions are welcome! Please see theContributing Guide for guidelines.
About
Convert an xyz file into a molecular graph and create a 3D visualisation of the graph.
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.