Calculate the number of hydrogen bonds in the box

Hello everyone:

After completing the molecular dynamics simulation, I intend to calculate the number of hydrogen bonds for all species; however, the script built into Materials Studio (MS) is only capable of performing calculations for a single frame.

Therefore, is there any method available to calculate the number of hydrogen bonds in trajectory files without the need to separately define fragments?

Looking forward to your reply

Yi Mu

Answers 1
TM
TM 2026-11-02

In the following OnlineHelp, 
    Tutorials > Scripting tutorials > Using Perl Scripting to Calculate the Interaction Energy Between Two Layers
, you can find essenses to focus on each frame of an .xtd file. The core of your interest will contain a following script, 
    ...
    for (my $counter = 1; $counter <= $numFrames; ++$counter) {
        $doc->Trajectory->CurrentFrame = $counter;
        printf( "%d\n", $doc -> AsymmetricUnit -> HydrogenBonds -> Count ); 
    }
    ...