README.md 2.45 KB
Newer Older
Berk Onat's avatar
Berk Onat committed
1
# pymolfile
Berk Onat's avatar
Berk Onat committed
2 3 4 5 6 7
#### Version: 0.0.6
* TNG library links are fixed in CMake compile.

#### Version: 0.0.5
* Fixed bugs in MolfileOpen class.

Berk Onat's avatar
Berk Onat committed
8 9 10 11
#### Version: 0.0.4
* Secure the file opens/closes on reader by OpenMolTraj class using 'with'. This provides a stable recall of PyMolfile in series of files.
* Silence all core plugins in molfile_plugins folder at CMake level. This is the default setting now.
* Bug fixed on recursive initialiation of OpenMolFile on trajectory reads. It is safe now to have concurrent multiple calls from MDDataAccess. 
12 13 14 15 16 17 18 19

#### Version: 0.0.3
What is new?
* Added script to change printf/fprintf to stdout and stderr at C level on molfile plugins to make the package compatiable with NOMAD parsers.
* Added "nowarnings" option to OpenMolfile to prevent user warnings.

Anything in mind for additional improvements? 
* C level silencing modifications are mandatory. This might be optional with a setup.py parameter.
Berk Onat's avatar
Berk Onat committed
20
* pymolfile only supports read functions at plugins. Write functions might also be added to convert data to other formats.
21 22 23 24

Needs precaution when using?
* Recursive initialization of OpenMolfile leads to breaks at trajectory class when an outer calling function fails (Ex: in MDDataAccess package) since trajectory file can still be open and can not be closed properly without a delete call.

Berk Onat's avatar
Berk Onat committed
25
#### Version: 0.0.2
Berk Onat's avatar
Berk Onat committed
26

Berk Onat's avatar
Berk Onat committed
27 28 29 30
Python interface for molfile plugins. 

### Molfile Plugins:

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

Berk Onat's avatar
Berk Onat committed
34 35
### Dependencies:

Berk Onat's avatar
Berk Onat committed
36
* numpy 
Berk Onat's avatar
Berk Onat committed
37
* cmake >3.1
Berk Onat's avatar
Berk Onat committed
38
* swig >3.0
Berk Onat's avatar
Berk Onat committed
39
* tng_io (installs with pymolfile setup)
Berk Onat's avatar
Berk Onat committed
40
* NetCDF (Optional but recomended for full experience)
Berk Onat's avatar
Berk Onat committed
41
* Expat
Berk Onat's avatar
Berk Onat committed
42
* Babel (Optional but recomended for full experience)
Berk Onat's avatar
Berk Onat committed
43
* Tcl/Tk >8.5 (Optional)
Berk Onat's avatar
Berk Onat committed
44

Berk Onat's avatar
Berk Onat committed
45 46 47
### Download:

```
Berk Onat's avatar
Berk Onat committed
48
git clone git@gitlab.mpcdf.mpg.de:nomad-lab/pymolfile.git
Berk Onat's avatar
Berk Onat committed
49 50
```

Berk Onat's avatar
Berk Onat committed
51 52 53
### Installation:

```
Berk Onat's avatar
Berk Onat committed
54
cd pymolfile
Berk Onat's avatar
Berk Onat committed
55 56 57
python3 setup.py install
```

Berk Onat's avatar
Berk Onat committed
58
### Example usage:
Berk Onat's avatar
Berk Onat committed
59

Berk Onat's avatar
Berk Onat committed
60
```python
Berk Onat's avatar
Berk Onat committed
61 62
import pymolfile

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

Berk Onat's avatar
Berk Onat committed
65 66 67 68
print(moltopo.topology.structure)
print(moltopo.topology.bonds)
print(moltopo.topology.angles)

Berk Onat's avatar
Berk Onat committed
69
moltraj = pymolfile.OpenMolfile('test/DPDP.nc', topology=moltopo)
Berk Onat's avatar
Berk Onat committed
70 71 72 73 74 75 76 77 78 79 80

    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
81

Berk Onat's avatar
Berk Onat committed
82
```
Berk Onat's avatar
Berk Onat committed
83