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

Usage example:

Berk Onat's avatar
Berk Onat committed
5
```python
Berk Onat's avatar
Berk Onat committed
6 7
import pymolfile

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

Berk Onat's avatar
Berk Onat committed
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
print(moltopo.topology.structure)
print(moltopo.topology.bonds)
print(moltopo.topology.angles)

moltraj = pym.OpenMolfile('test/DPDP.nc', topology=moltopo)

    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
26

Berk Onat's avatar
Berk Onat committed
27
```
Berk Onat's avatar
Berk Onat committed
28