Пример #1
0
    def build(cls, data_handler, matrix_params):
        """
        - "distance": Euclidean distance of the geometrical center of one body.
    
                "parameters":{
                    "fit_selection":  String,
                    "body_selection": String,
                }
    
                "fit_selection": The Prody selection string used to describe the atoms to be superposed.
                "body_selection": Another Prody selection string that describes the element that will be used
                to get the euclidean distances.
        
        """
        # Build calculator with fitting coordinate sets ...
        fit_selection_coordsets = data_handler.get_data(
        ).getFittingCoordinates()

        # and calculation coordsets (we want them to be moved along with the fitting ones)
        body_selection_coordsets = data_handler.get_data(
        ).getCalculationCoordinates()

        calculator = RMSDCalculator(
            calculatorType="QTRFIT_OMP_CALCULATOR",
            fittingCoordsets=fit_selection_coordsets,
            calculationCoordsets=body_selection_coordsets)

        # Superpose iteratively (will modify all coordinates)
        calculator.iterativeSuperposition()

        #centers = body_selection_coordsets.mean(1)
        from prody.measure import calcCenter
        centers = calcCenter(body_selection_coordsets)

        return centers
Пример #2
0
    def build(cls, data_handler, matrix_params):
        """
        - "distance": Euclidean distance of the geometrical center of one body.
    
                "parameters":{
                    "fit_selection":  String,
                    "body_selection": String,
                }
    
                "fit_selection": The Prody selection string used to describe the atoms to be superposed.
                "body_selection": Another Prody selection string that describes the element that will be used
                to get the euclidean distances.
        
        """
        # Build calculator with fitting coordinate sets ...
        fit_selection_coordsets = data_handler.get_data().getFittingCoordinates()

        # and calculation coordsets (we want them to be moved along with the fitting ones)
        body_selection_coordsets = data_handler.get_data().getCalculationCoordinates()

        calculator = RMSDCalculator(calculatorType = "QTRFIT_OMP_CALCULATOR",
                 fittingCoordsets = fit_selection_coordsets,
                 calculationCoordsets = body_selection_coordsets)

        # Superpose iteratively (will modify all coordinates)
        calculator.iterativeSuperposition()
        
        #centers = body_selection_coordsets.mean(1)
        from prody.measure import calcCenter
        centers = calcCenter(body_selection_coordsets)
        
        return centers
Пример #3
0
    def testMultiCoordsetsWithWeights(self):

        assert_equal(
            calcCenter(ATOMS.getCoordsets(), weights=ones(len(ATOMS))),
            CENTERS)
Пример #4
0
    def testMultiCoordsets(self):

        assert_equal(calcCenter(ATOMS.getCoordsets()), CENTERS)
Пример #5
0
    def testCenterWithWeights(self):

        assert_equal(calcCenter(ATOMS, weights=ones(len(ATOMS))), CENTERS[0])
Пример #6
0
    def testCenter(self):

        assert_equal(calcCenter(ATOMS), CENTERS[0])
Пример #7
0
    def testMultiCoordsetsWithWeights(self):

        assert_equal(calcCenter(ATOMS.getCoordsets(),
                                weights=ones(len(ATOMS))), CENTERS)
Пример #8
0
    def testMultiCoordsets(self):

        assert_equal(calcCenter(ATOMS.getCoordsets()), CENTERS)
Пример #9
0
    def testCenterWithWeights(self):

        assert_equal(calcCenter(ATOMS, weights=ones(len(ATOMS))),
                     CENTERS[0])
Пример #10
0
    def testCenter(self):

        assert_equal(calcCenter(ATOMS), CENTERS[0])