Perl scripting. RMSD of a set of ligands

Dear all,

I'm writing a perl script for the DS client that calculates the RMDS between different poses of a ligand.

In practices, starting from a set of 15 poses of the ligand loaded in a Molecule Window, the script should be able to calculate the rmsd between the first and the each of the other poses.

However, when I run the script, the DS client crashes and makes the gnome desktop environment block. Does anyone have an idea about the source of the problem?

Thanks in advance,

Davide

----------------------------------SCRIPT-----------------------------------------------------------------

#!/usr/bin/perl -w

# NOTE: This script MUST be run from the DS client

use strict;

use MdmDiscoveryScript;

use SbdDiscoveryScript;

my \\\$document = DiscoveryScript::LastActiveDocument(MdmModelType);

my \\\$molecules = \\\$document->Molecules();

Usage(

"This example requires an open Molecule Window containing docked protein poses"

) unless ( \\\$molecules->Count > 0 );

my \\\$master = \\\$molecules->[0];

for (my \\\$id = 0; \\\$id < 15; ++\\\$id)

{

my \\\$molecule = \\\$molecules->Item(\\\$id);

my \\\$mol1 = \\\$master;

my \\\$mol2 = \\\$molecule;

my \\\$rmsdAll = \\\$document->CalculateHeavyAtomRmsd( \\\$mol1, \\\$mol2 );

print "\\\$mol1 \\\$mol2 \\\$rmsdAll\\n";

}

-------------------------END OF THE SCRIPT---------------------------------------------------------