README.md 981 Bytes
Newer Older
Berk Onat's avatar
Berk Onat committed
1
# pymolfile (Version: 0.0.1)
Berk Onat's avatar
Berk Onat committed
2

Berk Onat's avatar
Berk Onat committed
3 4 5 6
Python interface for molfile plugins. 

### Molfile Plugins:

Berk Onat's avatar
Berk Onat committed
7
For more information about VMD molfile plugins with UIUC Open Source License   
Berk Onat's avatar
Berk Onat committed
8 9
please see <http://www.ks.uiuc.edu/Research/vmd/plugins/molfile/>

Berk Onat's avatar
Berk Onat committed
10 11 12 13 14
### Dependencies:

```
numpy 
cmake >2.8.12
Berk Onat's avatar
Berk Onat committed
15 16 17
NetCDF (Optional)
Expat (Optional)
Babel (Optional)
Berk Onat's avatar
Berk Onat committed
18
Tcl/Tk >8.5 (Optional)
Berk Onat's avatar
Berk Onat committed
19 20 21 22 23 24 25 26
```

### Installation:

```
python3 setup.py install
```

Berk Onat's avatar
Berk Onat committed
27
### Example usage:
Berk Onat's avatar
Berk Onat committed
28

Berk Onat's avatar
Berk Onat committed
29
```python
Berk Onat's avatar
Berk Onat committed
30 31
import pymolfile

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

Berk Onat's avatar
Berk Onat committed
34 35 36 37
print(moltopo.topology.structure)
print(moltopo.topology.bonds)
print(moltopo.topology.angles)

Berk Onat's avatar
Berk Onat committed
38
moltraj = pymolfile.OpenMolfile('test/DPDP.nc', topology=moltopo)
Berk Onat's avatar
Berk Onat committed
39 40 41 42 43 44 45 46 47 48 49

    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
50

Berk Onat's avatar
Berk Onat committed
51
```
Berk Onat's avatar
Berk Onat committed
52