README.md 1023 Bytes
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 23 24 25
### Download:

```
git clone 
```

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

```
python3 setup.py install
```

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

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

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

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

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

    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
55

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