Exemplo n.º 1
0
def pdbBoxString(box):
    # Box vectors
    u, v, w  = box[0:3], box[3:6], box[6:9]

    # Box vector lengths
    nu, nv, nw = [math.sqrt(FUNC.norm2(i)) for i in (u, v, w)]

    # Box vector angles
    alpha = nv*nw == 0 and 90 or math.acos(FUNC.cos_angle(v, w))/d2r
    beta  = nu*nw == 0 and 90 or math.acos(FUNC.cos_angle(u, w))/d2r
    gamma = nu*nv == 0 and 90 or math.acos(FUNC.cos_angle(u, v))/d2r

    return pdbBoxLine % (10*FUNC.norm(u), 10*FUNC.norm(v), 10*FUNC.norm(w), alpha, beta, gamma)
Exemplo n.º 2
0
 def bbGetAngle(self, r, ca, ss):
     import FUNC, IO
     import math
     # Elnedyn takes angles from structure, with fc=40
     return (math.acos(
         FUNC.cos_angle([i - j for i, j in zip(ca[0], ca[1])],
                        [i - j
                         for i, j in zip(ca[2], ca[1])])) / IO.d2r, 40)
    def bbGetAngle(self, r, ca, ss):
        import FUNC, IO
        import math

        # Elnedyn takes angles from structure, with fc=40
        return (
            math.acos(FUNC.cos_angle([i - j for i, j in zip(ca[0], ca[1])], [i - j for i, j in zip(ca[2], ca[1])]))
            / IO.d2r,
            40,
        )
Exemplo n.º 4
0
 def bbGetAngle(self,r,ca,ss):
     # Check is it DNA residue
     if r[0] in MAP.dnares3:
         return ca in self.dnaBbAngleDictC.keys() and self.dnaBbAngleDictC[ca] or None
     # RNA is not implemented properly yet
     elif r[0] in MAP.rnares3:
         return ca in self.rnaBbAngleDictC.keys() and self.rnaBbAngleDictC[ca] or None
     # For protein
     else:
         import FUNC,IO 
         import math
         # Elnedyn takes angles from structure, with fc=40
         return (math.acos(FUNC.cos_angle([i-j for i,j in zip(ca[0],ca[1])],[i-j for i,j in zip(ca[2],ca[1])]))/IO.d2r, 40)