[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[IMP-dev] simple transformation test fails



hey,

can someone please help me figuring out what is the problem with the attached test.
I am keep getting an error:
UsageException: Attempt to use uninitialized vector.
The error seem to come from VectorD, but I really think that all vector are initialized.

If I initialize Rotation3D from 4 number everything is ok.

Attachment: 1z5s_A.pdb
Description: Binary data

import IMP
import IMP.test
import sys
import IMP.em
import IMP.multifit
import IMP.helper
import unittest
import os

class SampleTests(IMP.test.TestCase):
    """Tests for sampled density maps"""

    def setUp(self):
        """initialize IMP environment create particles"""
        IMP.test.TestCase.setUp(self)
        #init IMP model ( the environment)
        self.mdl = IMP.Model()
        self.sel=IMP.atom.CAlphaSelector()
        self.mh = IMP.atom.read_pdb(self.get_input_file_name("1z5s_A.pdb"),
                             self.mdl,self.sel)
        IMP.atom.add_radii(self.mh)
        #self.rbs=IMP.helper.set_rigid_bodies(self.mhs)
        #set the restraint
        #self.r=IMP.multifit.create_weighted_excluded_volume_restraint(
        #    self.rbs[0],self.rbs[1])

    def test_transformation(self):
        """Check simple transformation"""
        IMP.set_log_level(IMP.VERBOSE)
        #move chain A and calculate weighted excluded volume
        ps1=IMP.core.get_leaves(self.mh)
        print len(ps1)
        t=IMP.algebra.Transformation3D(
            #IMP.algebra.Rotation3D(IMP.algebra.Vector4D(0.881024,-0.405223,0.154964,-0.188619)), ##DOES NOT WORK
            IMP.algebra.Rotation3D(0.881024,-0.405223,0.154964,-0.188619),  ##WORKS
            IMP.algebra.Vector3D(20.1398, 111.715, 60.5263))
        for p in ps1:
            xyz=IMP.core.XYZ(p.get_particle())
            xyz.set_coordinates(t.transform(xyz.get_coordinates()))
            
if __name__ == '__main__':
    unittest.main()

??

thanks
keren.