コード例 #1
0
    def calc_axial_plane(self, other_center):
        """
        (Residue, Point) -> Plane
        
        given another point, calculate the axial plane based on self.center
        """

        vec = self.get_center() - other_center
        return get_perp_plane(vec, self.center)
コード例 #2
0
    def get_atb_res_spat_dist(self):
        """
        (CylinderSpatialDistritbution) -> Counter

        return the count of antibody residues that fall in the respective rings in the cylinder
        """
        if not hasattr(self, "atb_res_spat_dist"):
            plane = get_perp_plane(self.get_atb_center() - self.get_paratope_center(), self.get_paratope_center())
            cylinder = self.make_cylinder(self.get_paratope_center(), plane)
            self.atb_res_cnt_spat_dist = cylinder.get_count_distribution(self.atb.residues)
            self.atb_res_spat_dist = cylinder.get_residue_distribution(self.atb.residues)

        return self.atb_res_cnt_spat_dist, self.atb_res_spat_dist
コード例 #3
0
    def get_tri_spat_dist(self):
        """
        (CylinderSpatialDistritbution) -> Counter

        return the count of antigen residue triangle that fall in the respective rings in the cylinder
        """
        if not hasattr(self, "tri_spat_dist"):
            plane = get_perp_plane(self.get_atg_center() - self.get_epitope_center(), self.get_epitope_center())
            cylinder = self.make_cylinder(self.get_epitope_center(), plane)
            self.tri_cnt_spat_dist = cylinder.get_count_distribution(self.get_triangles())
            self.tri_spat_dist = cylinder.get_residue_distribution(self.get_triangles())
            
        return self.tri_cnt_spat_dist, self.tri_spat_dist
コード例 #4
0
    def gcb_gen_cylinder(self):
        """
        Generate the cylinder geometry data(center and axial plane)

        Point: middle point of the line segment between `paratope geometric center` and `epitope geometric center`
        Plane: the plane 1, which is perpendicular to the above line segment and 2, in which the `Point` lies in

        """
        from ve.fp.geom import Vector, get_perp_plane

        #the line between epitope center and paratope center
        line = Vector(self.get_epi_center() - self.get_para_center())

        #get the paratope and epitope center as the cylinder center

        self.cylinder_center = self.get_paraepi_center()

        #get the axial plane
        self.axial_plane = get_perp_plane(line, self.cylinder_center)
コード例 #5
0
    def get_axial_plane(self):
        """get the axial plane(中轴面)of the compelx"""

        if hasattr(self, "axial_plane"):
            return self.axial_plane

        # first set the epitope and paratope center

        # vector between epitope center and paratope center
        norm_vec = self.get_epi_center() - self.get_para_center()

        # the point that the plane passes through
        point = self.get_paraepi_center()

        # calculate the axial plane based on the point and the vector
        from ve.fp.geom import get_perp_plane

        plane = get_perp_plane(norm_vec, point)

        # set it
        self.axial_plane = plane

        return self.axial_plane