Computing angle between Z axis and plane of a molecule.

32 views
Skip to first unread message

Yogesh Sharma

unread,
Nov 8, 2021, 5:41:45 AM11/8/21
to mdnalysis-...@googlegroups.com
Hi I am trying to get the angle between HoH plane of water and z axis of my system over 100 ns simulation. 
How can I do this using mdanalysis. I would like to plot it against time or z coordinates. Can someone guide me through it? 


--
   with  regards
Yogesh Sharma


Quyen V. Vu

unread,
Nov 9, 2021, 5:53:28 AM11/9/21
to mdnalysis-...@googlegroups.com
Hi,

You can do it by yourself if there is no optimized code available in MDAnalysis (I don't know).
This is very basic. Select water molecules of interest, compute the normal vector of the HOH plane, compute the angle between that normal vector and Z axis. 

Best,
Quyen

--
You received this message because you are subscribed to the Google Groups "MDnalysis discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mdnalysis-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mdnalysis-discussion/CACWq%2B6_8CNCpYyjtihQq%3DdvtZRPTZdmwst9as5_yRfjzLFLNMQ%40mail.gmail.com.

Yogesh Sharma

unread,
Dec 4, 2021, 5:37:08 AM12/4/21
to MDnalysis discussion
HI
thank you for the response. i tried to use dipole moment vector for the calculation

I used dipwatch gui to get dipole vector for the molecule from mol2 file
# frame    dip_x     dip_y      dip_z    |dip|
0  -0.05827735364437103  -1.521030306816101  -0.7441486716270447  1.6943100925406684

Then i used orient package  to get (z) principle axis in vmd
set I [draw principalaxes $sel] 
set A [orient $sel [lindex $I 2] {0 0 1}]

further, I can use dotproduct to get the angle between both vectors

proc angle { a b } {
set am [veclength $a]
   set bm [veclength $b]
   set dotprod [vecdot $a $b]
   return [expr 57.2958 * acos($dotprod / ($am * $bm))]
}

Now I am confused about how to define the dipole vector and the vector corresponding to z only?
Can  you help me with some short script or something?

Oliver Beckstein

unread,
Dec 5, 2021, 3:13:14 PM12/5/21
to mdnalysis-discussion
Hi Yogesh Sharma,

Did you look into using MDAnalysis.analysis.waterdynamics https://docs.mdanalysis.org/stable/documentation_pages/analysis/waterdynamics.html#angulardistribution ? You’ll have to read through the docs carefully and the papers that are referenced (the code was used in [Araya-Secchi2014] (water in a cavity) and [Milischuk2011] (water in a nanopore)).

Oliver
--
Oliver Beckstein (he/his/him)


MDAnalysis – a NumFOCUS fiscally sponsored project




Reply all
Reply to author
Forward
0 new messages