Esempio n. 1
0
    def test_ComplexEvolving(self):
        """Dock.ComplexEvolving test"""
        import time

        from Biskit.Dock import ComplexEvolving

        c = t.load(t.testRoot() + '/com/ref.complex')

        self.ce = ComplexEvolving(c.rec_model,
                                  c.lig(),
                                  c,
                                  info={'comment': 'test'})

        time.sleep(2)

        lig = self.ce.lig().transform(MU.randomRotation(), [0, 0, 0])
        self.ce2 = ComplexEvolving(self.ce.rec_model,
                                   lig,
                                   self.ce,
                                   info={'comment': 'test2'})

        if self.local:
            print '\nGenerations: '
            for x in self.ce2:
                print x['date']

            print 'Comments: ', self.ce2.valuesOf('comment')

        self.assertEqual(self.ce2.valuesOf('comment'), [None, 'test', 'test2'])
Esempio n. 2
0
    def test_ComplexEvolving(self):
        """Dock.ComplexEvolving test"""
        import time

        from Biskit.Dock import ComplexEvolving

        c = t.load( t.testRoot() + '/com/ref.complex' )

        self.ce= ComplexEvolving( c.rec_model, c.lig(), c,
                                  info={'comment':'test'} )

        time.sleep( 2 )

        lig = self.ce.lig().transform( MU.randomRotation(), [0,0,0] )
        self.ce2 = ComplexEvolving( self.ce.rec_model, lig, self.ce,
                                    info={'comment':'test2'})

        if self.local:
            print '\nGenerations: '
            for x in self.ce2:
                print x['date']

            print 'Comments: ', self.ce2.valuesOf('comment')
             
        self.assertEqual( self.ce2.valuesOf('comment'),
                          [None, 'test', 'test2'])
Esempio n. 3
0
    def __random_matrix( self ):
        """
        Random rotation matrix.

        @return: 4 x 4 array of float, random rotation and translation matrix
        @rtype: array
        """
        r = ma.randomRotation()
##         r = N.array([[1,0,0],[0,1,0],[0,0,1]],'f')
        t = self.__random_translation()

        ## create 3 x 4 matrix: 0:3, 0:3 contains rot; 3,0:3 contains trans
        result = N.concatenate( (r, N.transpose( [ t.tolist() ] )), 1)

        ## make it square
        result = N.concatenate( (result, N.array([[0,0,0,1]], N.Float32)), 0 )

        return result
Esempio n. 4
0
    def __random_matrix(self):
        """
        Random rotation matrix.

        @return: 4 x 4 array of float, random rotation and translation matrix
        @rtype: array
        """
        r = ma.randomRotation()
        ##         r = N.array([[1,0,0],[0,1,0],[0,0,1]],'f')
        t = self.__random_translation()

        ## create 3 x 4 matrix: 0:3, 0:3 contains rot; 3,0:3 contains trans
        result = N.concatenate((r, N.transpose([t.tolist()])), 1)

        ## make it square
        result = N.concatenate((result, N.array([[0, 0, 0, 1]], N.Float32)), 0)

        return result
Esempio n. 5
0
            for x in self.ce2:
                print x['date']

            print 'Comments: ', self.ce2.valuesOf('comment')

        self.assertEqual(self.ce2.valuesOf('comment'), [None, 'test', 'test2'])


if __name__ == '__main__':

    import time

    from Biskit.Dock import ComplexEvolving

    c = t.load(t.testRoot() + '/com/ref.complex')

    ce = ComplexEvolving(c.rec_model, c.lig(), c, info={'comment': 'test'})

    time.sleep(2)

    lig = ce.lig().transform(MU.randomRotation(), [0, 0, 0])
    ce2 = ComplexEvolving(ce.rec_model, lig, ce, info={'comment': 'test2'})

    print '\nGenerations: '
    for x in ce2:
        print x['date']

    print 'Comments: ', ce2.valuesOf('comment')

    #BT.localTest()
Esempio n. 6
0
        self.assertEqual( self.ce2.valuesOf('comment'),
                          [None, 'test', 'test2'])


if __name__ == '__main__':
    
    import time

    from Biskit.Dock import ComplexEvolving

    c = t.load( t.testRoot() + '/com/ref.complex' )

    ce= ComplexEvolving( c.rec_model, c.lig(), c,
                              info={'comment':'test'} )

    time.sleep( 2 )

    lig = ce.lig().transform( MU.randomRotation(), [0,0,0] )
    ce2 = ComplexEvolving( ce.rec_model, lig, ce,
                                info={'comment':'test2'})

    print '\nGenerations: '
    for x in ce2:
        print x['date']

    print 'Comments: ', ce2.valuesOf('comment')
         

    #BT.localTest()