::A Python script to calculate and visualize the
This repository contains a Jupyter Notebook (f4.ipynb
) that calculates the
The
The
where
The torsion angle
The value of
-
$F_4 = 0.7$ : Complete crystalline hydrate structure -
$F_4 = 0$ : Liquid water -
$F_4 = -0.4$ : Complete ice structure
By calculating and analyzing the
- Calculates the
$F_4$ order parameter for each frame in a water molecule trajectory - Plots the raw
$F_4$ values over the trajectory frames - Computes and plots a moving average of the
$F_4$ values for smoother visualization
-
git clone to your local computer. Then, the source Jupyter file and source examples would be downloaded.
git clone https://github.com/wjgoarxiv/pyf4.git
-
Open
f4.ipynb
in your Jupyter environment. -
Place your water molecule trajectory file (in example, the
prod_trjconv_SOL.gro
file was used) in thesource_trj
directory. -
Now, by running 1. Execute this if the
.gro
file has not been segregated part to segregate the trajectory GRO file into separated GRO files (per frame). Check the./segregated/
folder. There segregatedframe_*.gro
files are located. -
Run the 2. Run and find F4 values per frame part to calculate
$F_4$ order parameter per frame. It looks like this:1,0.16803680968136386 2,0.298460690279075 3,-0.548265463039205 4,0.2206492688636402 5,0.07142864914968847 6,0.17844661437250695 7,-0.05736835645757173 8,-0.28873006258953005 9,-0.3107745768183056 ...
-
Also, check the generated CSV file entitled
frame_f4_values
. -
Now, run 3. Plot
F4 - frame
graph part to generate plots. You can check (1) raw plot and (2) rolling average plot. It's highly recommended to use a rolling average plot for your research; since the raw data might export the outlier values outside the allowed$F_4$ values of liquid water, ice, or hydrates.
This project is licensed under the MIT License.
Feel free to explore the code and adapt it to your specific needs. If you have any questions or suggestions, please open an issue or contact me.
Happy simulations! :-)