예제 #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])