Esempio n. 1
0
    def __call__(self, input):
        """ 
        Two operations:
        1. scorefxn( pose ):  #
            ** noteworthy: the pose object here is Pose
            > assign Residue object for each position, and 
            > return a total score of it
        2. scorefxn( frag_idx ): 
            > return frag score for the frag_idx to a pose

        """
        assert isPose(input) or isFragIdx(input)

        if isPose(input):  # a residual pose
            """ 1. update the residue of the verbose_pose to be composed of Residue objects
                2. return a total score """

            residual_pose = input
            self.update_pose(residual_pose)  # the frag_idx in the input has been update to self.__pose

            # use the new ScoreTable to rescore it residual_pose
            output_pose = Pose()
            for frag_idx in self.__pose:
                output_pose.update_residue(self.score_evaluator(frag_idx, True))

            return output_pose

        elif isFragIdx(input):
            """ return a residue score """
            return self.score_evaluator(input)
Esempio n. 2
0
    def residualize_pose(self):
        """ Pose() has methods to evaluate the state """
        residual_pose = Pose()

        for frag_idx in self.__pose:
            residual_pose.update_residue(self.score_evaluator(frag_idx, True))

        return residual_pose