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
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
def testMultiCoordsetsWithWeights(self): assert_equal( calcCenter(ATOMS.getCoordsets(), weights=ones(len(ATOMS))), CENTERS)
def testMultiCoordsets(self): assert_equal(calcCenter(ATOMS.getCoordsets()), CENTERS)
def testCenterWithWeights(self): assert_equal(calcCenter(ATOMS, weights=ones(len(ATOMS))), CENTERS[0])
def testCenter(self): assert_equal(calcCenter(ATOMS), CENTERS[0])
def testMultiCoordsetsWithWeights(self): assert_equal(calcCenter(ATOMS.getCoordsets(), weights=ones(len(ATOMS))), CENTERS)