README.md 709 Bytes
Newer Older
Berk Onat's avatar
Berk Onat committed
1
# pymolfile
Berk Onat's avatar
Berk Onat committed
2

Berk Onat's avatar
Berk Onat committed
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
### Dependencies:

```
numpy 
cmake >2.8.12
NetCDF Library
Expat Library
```

### Installation:

```
python3 setup.py install
```

Berk Onat's avatar
Berk Onat committed
18
### Example usage:
Berk Onat's avatar
Berk Onat committed
19

Berk Onat's avatar
Berk Onat committed
20
```python
Berk Onat's avatar
Berk Onat committed
21
22
import pymolfile

Berk Onat's avatar
Berk Onat committed
23
moltopo = pymolfile.OpenMolfile('test/DPDP.pdb')
Berk Onat's avatar
Berk Onat committed
24

Berk Onat's avatar
Berk Onat committed
25
26
27
28
print(moltopo.topology.structure)
print(moltopo.topology.bonds)
print(moltopo.topology.angles)

Berk Onat's avatar
Berk Onat committed
29
moltraj = pymolfile.OpenMolfile('test/DPDP.nc', topology=moltopo)
Berk Onat's avatar
Berk Onat committed
30
31
32
33
34
35
36
37
38
39
40

    if moltraj.trajectory is not None:
        step=0
        while True:
            positions = moltraj.trajectory.iread()
            if positions is not None:
                print("STEP:",step)
                print(positions)
                step += 1
            else:
                break
Berk Onat's avatar
Berk Onat committed
41

Berk Onat's avatar
Berk Onat committed
42
```
Berk Onat's avatar
Berk Onat committed
43