Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aslozada/coor2graph
COOR2GRAPH - This software converts a molecular dynamics trajectory in GRO format into an adjacency matrix. The adjacency matrix is called by networkx python library.
https://github.com/aslozada/coor2graph
graphs ising-model-2d lennard-jones-fluid molecular-dynamics monte-carlo-simulation periodic-boundary-conditions
Last synced: 1 day ago
JSON representation
COOR2GRAPH - This software converts a molecular dynamics trajectory in GRO format into an adjacency matrix. The adjacency matrix is called by networkx python library.
- Host: GitHub
- URL: https://github.com/aslozada/coor2graph
- Owner: aslozada
- License: gpl-3.0
- Created: 2024-10-28T00:30:37.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-12-17T13:32:37.000Z (23 days ago)
- Last Synced: 2024-12-17T14:29:22.724Z (23 days ago)
- Topics: graphs, ising-model-2d, lennard-jones-fluid, molecular-dynamics, monte-carlo-simulation, periodic-boundary-conditions
- Language: Fortran
- Homepage:
- Size: 173 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# coor2graph
This software build an adjacency matrix from coordinate file. The coordinate file can be obtained from a molecular dynamics or stochastic simulation.
Using the adjacency matrix and the Python library Networkx, this program enables the analysis of graphs or complex networks resulting from the molecular simulation.
Periodic boundary effects can be evaluated.* Options
- [x] pair
- [ ] triad
- [ ] 2D lattice
- [ ] 3D lattice
- [ ] Non-cubic pbcThis software supports the build system CMake.
**Compilers**
1. gfortran(<=14.2.1 20240805)
2. ifort(<=2021.13.0 20240602)### CMake
The CMake build system requires both make and CMake to be installed, the latter has to be version 3.30.3 or newer.
Build `coor2graph` with CMake works with the following chain of commands:
```bash
cmake -B build -DBUILD_STATIC=ON
make -C build
```coord2graph uses the `networkx` python library. Required dependencies:
* numpy
* pandas
* networkx
* matplotlib
* scipy (for large matrix)#### Alternative
Create an enviroment
* In ubuntu
```conda create --name myenvironment python=3```
```conda activate myenvironment```to install required packages (if necessary):
```conda install [=version]```### GRO file format
```
MD of 9 ising spins, t= 0.0
9
1ISING SP1 1 0.000 0.000 0.000 0.0000 0.0000 0.0000
2ISING SP1 2 0.100 0.000 0.000 0.0000 0.0000 0.0000
3ISING SP1 3 0.200 0.000 0.000 0.0000 0.0000 0.0000
4ISING SP1 4 0.000 0.100 0.000 0.0000 0.0000 0.0000
5ISING SP1 5 0.100 0.100 0.000 0.0000 0.0000 0.0000
6ISING SP1 6 0.200 0.100 0.000 0.0000 0.0000 0.0000
7ISING SP1 7 0.000 0.200 0.000 0.0000 0.0000 0.0000
8ISING SP1 8 0.100 0.200 0.000 0.0000 0.0000 0.0000
9ISING SP1 9 0.200 0.200 0.000 0.0000 0.0000 0.0000
0.40000 0.40000 0.40000
```
Positions (x,y,z) and box(3) units in nm### How to use?
### Basic use
```coor2graph --input .gro --rcut <#> --pbc --pair --graph --measure --frequency <#|-1>```### Currently avaliable graph measures (TODO) (Update from networkx.org)
* Degree centrality
degree | in_degree | out_degree
* Eigenvector centrality
eigenvector | katz
* Closeness centrality
closeness |incremental_closeness
* Current flow closeness
flow_centrality | information
* Betweennessbetweenness | betweeness_subset | edge_betweenness
* Current flow betweennessflow_betweenness edge_flow_betweenness
* Othersharmonic_centrality | dispersion | laplacian
#### Example (Ising model)
First-neighbor interaction![lattice_model](https://github.com/user-attachments/assets/d167f95e-ea9a-4b8c-b741-99ee7b053892)
#### Closeness
![prefix_1](https://github.com/user-attachments/assets/56d2b87c-0d38-4e54-bbb4-07c52ec8ce49)#### Example (3-sites water model)
![graphs](https://github.com/user-attachments/assets/c34049fb-dfe1-4a94-82e4-0a49088c6b3c)#### Properties along a trajectory
![histogram](https://github.com/user-attachments/assets/bc0c0655-ea7d-4162-ba48-a46713f79d65)### PBC effects on centrality degree
(with pbc conditions)
![wpbc_1](https://github.com/user-attachments/assets/a0b49eff-c0eb-4476-ae05-77bfb62f7a5d)
(without pbc conditions)
![woutpbc_1](https://github.com/user-attachments/assets/cd325594-ee55-47e8-9158-71a081fcd6ef).