Hydrogen bond analysis from XYZ trajectory file

Skip to first unread message

Rajorshi Chattopadhyay

Sep 16, 2022, 6:48:25 AMSep 16
to mdnalysis-...@googlegroups.com
Dear all,

I am trying to do H-bond analysis (count H-bonds in each frame and H-bond lifetimes) in water. However, I have a trajectory file containing unwrapped coordinates in xyz format (fom Cp2k). I have the following questions:

1. I guess H-bond analysis requires wrapped coordinates to identify nearest neighbours. Is this done by the code implicitly during H-bond calculation ? As XYZ file does not have unit cell information, is there a way to add this information after universe creation ?
2. XYZ file also does not contain topology information like bonds and angles. Is this required for H-bond analysis ?

Thank you in advance for your help and suggestions.
With Regards,
Rajorshi Chattopadhyay,
PhD Researcher in Mineralogy/Crystallography,
Institut für Geologie und Mineralogie,
Universität zu Köln, Germany

Hugo Macdermott-Opeskin

Sep 28, 2022, 7:32:12 AMSep 28
to MDnalysis discussion
Hi Rajorshi

1.1 You will need some kind of periodic boundary condition to identify your hbonds correctly in most cases. Hbonds will automatically take PBCs into account if present.  Follow up question what exactly do you mean by "wrapped" vs "unwrapped " in this context?
1.2 You can add your periodic boundaries by specifiying the box in MDAnalysis format and assigning it to ts.dimensions IF you know what it is. For example:

u = mda.Universe('blah.xyz')
for ts in u.trajectory:
    mybox = np.asarray([ABCalphabetagamma])  # how do you know A,B,C, ... ?
    ts.dimensions = mybox

My main question is how do you know what your PBCs are if they are not in your XYZ file or another format. It may be easier to convert to some other file format. Perhaps you can give me clearer idea of your workflow. 
2. Topology information is not strictly required as you can set `donor_sel` and `acceptor_sel` directly to be your donors and acceptors of interest. See https://docs.mdanalysis.org/2.0.0/documentation_pages/analysis/hydrogenbonds.html
Reply all
Reply to author
0 new messages