README.md 1.05 KB
Newer Older
Berk Onat's avatar
Berk Onat committed
1
# pymolfile
Berk Onat's avatar
Berk Onat committed
2
#### Version: 0.0.1
Berk Onat's avatar
Berk Onat committed
3

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

### Molfile Plugins:

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

Berk Onat's avatar
Berk Onat committed
11 12
### Dependencies:

Berk Onat's avatar
Berk Onat committed
13 14 15 16 17 18
* numpy 
* cmake >2.8.12
* NetCDF (Optional)
* Expat (Optional)
* Babel (Optional)
* Tcl/Tk >8.5 (Optional)
Berk Onat's avatar
Berk Onat committed
19

Berk Onat's avatar
Berk Onat committed
20 21 22
### Download:

```
Berk Onat's avatar
Berk Onat committed
23
git clone git@gitlab.mpcdf.mpg.de:berko/pymolfile.git
Berk Onat's avatar
Berk Onat committed
24 25
```

Berk Onat's avatar
Berk Onat committed
26 27 28
### Installation:

```
Berk Onat's avatar
Berk Onat committed
29
cd pymolfile
Berk Onat's avatar
Berk Onat committed
30 31 32
python3 setup.py install
```

Berk Onat's avatar
Berk Onat committed
33
### Example usage:
Berk Onat's avatar
Berk Onat committed
34

Berk Onat's avatar
Berk Onat committed
35
```python
Berk Onat's avatar
Berk Onat committed
36 37
import pymolfile

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

Berk Onat's avatar
Berk Onat committed
40 41 42 43
print(moltopo.topology.structure)
print(moltopo.topology.bonds)
print(moltopo.topology.angles)

Berk Onat's avatar
Berk Onat committed
44
moltraj = pymolfile.OpenMolfile('test/DPDP.nc', topology=moltopo)
Berk Onat's avatar
Berk Onat committed
45 46 47 48 49 50 51 52 53 54 55

    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
56

Berk Onat's avatar
Berk Onat committed
57
```
Berk Onat's avatar
Berk Onat committed
58