-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Welcome to the Pynoramix wiki!
Download the tar.gz here.
The program is able to reproduce the analysis proposed in the paper: Structural Inhomogeneity of Water by Complex Network Analysis. Francesco Rao, Sean Garrett-Roe, and Peter Hamm. J. Phys. Chem. B, 2010, 114 (47), pp 15598–15604.
This software is free software under the GPL license.
Pynoramix is under development, please feel free to contact us for further suggestions at: pynoramix@gmail.com
For the impatient, some simple code to start with.
Make sure the files called pyn_anw and xtc2bin have executable rights and compile pyn_fort.f90:
>>> f2py -c -m pyn_fort pyn_fort.f90
First, fire-up your python shell:
$ ipython
then, load the libraries:
>>> from pyn_cl_set import *
>>> from pyn_cl_unit import *
>>> from pyn_cl_net import *
Create the system topology from the pdb file:
>>> wbox=cl_set('tip4p_ew.pdb')
The list of properties of wbox can be checked with:
>>> dir(wbox)
This way, general variables can be found as:
>>> wbox.num_atoms
>>> wbox.num_residues
Or specific data about the atoms and residues as:
>>> wbox.residue[0].name
>>> wbox.residue[0].pdb_index
>>> wbox.residue[0].list_atoms
>>> wbox.atom[0].name
>>> wbox.atom[0].pdb_index
>>> wbox.atom[0].resid_name
>>> wbox.atom[0].resid_pdb_index
>>> wbox.atom[0].bfactor
Apply the analysis over the trajectory:
>>> wbox.water_analysis(traj_name='md_test.xtc')
This function can analyse xtc or binary files and the options init_frame=X and last_frame=X can be used.
We can now access to the information related to the hydrogen bonds (Skinner def.) of a given frame or frame and molecule:
>>> wbox.get_hbonds(frame=10,molecule=9)
>>> wbox.get_hbonds(frame=10)
We can also check the microstate of a certain molecule at a given frame:
>>> wbox.get_mss(frame=10,molecule=9)
>>> wbox.get_mss(frame=10)
And the indexes of the molecules in a shell (behind the microstate) can also be obtained:
>>> wbox.get_shell(frame=10,molecule=9)
>>> wbox.get_shell(frame=10)
Note: Given the high size in memory provided by this analysis, the data have been stored in some auxiliary binary files. The latter commands extract the data reading the files in order to make the analysis feasible. These files can be accesed at any moment just taking care of the right variables:
>>> wbox.file_hbonds
>>> wbox.file_mss
>>> wbox.file_shell
Extract from the system wbox the network as a new object:
>>> net=wbox.get_network()
In the output you get general information about the CSN, like this:
>>> # Number of nodes: 8912
>>> # Number of links: 58300
>>> # Max. conectivity: 208
As a result you get a new object from class network with some new properties, which you can check with
>>> dir(net)
Here is some examples for checking weight of the node, key of the node and links out:
>>> net.weight[10]
>>> net.key[10]
>>> net.links_out[10]
If the auxiliary files with network data were existing before, the network can be created straightforward from them:
>>> net=cl_net(file_net='aux_net.oup', file_keys='aux_key_mss.oup')
From net object a symmetric network can be created with command:
>>> net_symm=net.symmetrize()
To obtain the gradient clusters from this network one can run the command:
>>> net_symm.gradient_clusters()
To analyze the gradient clusters following commands can be used:
>>> net_symm.clust_info[10]
>>> net_symm.node_belongs2[10]
>>> net_symm.num_clusters
>>> net_symm.representants[10]
>>> net_symm.cluster_weight[1]
This way, for example, we can check the weightiest cluster following the commands:
>>> weightiest_cluster=net_symm.cluster_weight.argmax()
>>> net_symm.cluster_weight[weightiest_cluster]
>>> net_symm.clust_info[weightiest_cluster]
>>> net_symm.representants[weightiest_cluster]
>>> net_symm.key[net_symm.representants[weightiest_cluster]]
... To be continued...