8 import rosetta.core.scoring.solid_surface
12 BodyPosition = rosetta.numeric
17 file =
open(file,
'r').readlines()
20 loaded_file.append(
strip(line))
26 if pdb[n][:6]==
'SURFA0':
27 Ax =
float(pdb[n][30:38])
28 Ay =
float(pdb[n][38:46])
29 Az =
float(pdb[n][46:54])
30 SURFA0 = BodyPosition.xyzVector_double(Ax,Ay,Az)
31 if pdb[n][:6]==
'SURFA1':
32 Bx =
float(pdb[n][30:38])
33 By =
float(pdb[n][38:46])
34 Bz =
float(pdb[n][46:54])
35 SURFA1 = BodyPosition.xyzVector_double(Bx,By,Bz)
36 if pdb[n][:6]==
'SURFA2':
37 Cx =
float(pdb[n][30:38])
38 Cy =
float(pdb[n][38:46])
39 Cz =
float(pdb[n][46:54])
40 SURFA2 = BodyPosition.xyzVector_double(Cx,Cy,Cz)
42 return (SURFA0,SURFA1, SURFA2)
48 moving protein to the projected center of geometry of surface by symmetry
54 center_of_geo_prot = BodyPosition.xyzVector_double(0,0,0)
55 for i
in range(1, pose.total_residue()+1):
56 if (pose.residue(i).is_protein() ==
True):
57 ca_pose = pose.residue(i).atom(
'CA').
xyz()
58 center_of_geo_prot = center_of_geo_prot + ca_pose
59 center_of_geo_prot = (center_of_geo_prot/prot_length)
60 return center_of_geo_prot
64 center_of_geo_surf = BodyPosition.xyzVector_double(0,0,0)
65 for i
in range(1, pose.total_residue()+1):
66 if (pose.residue(i).is_ligand() ==
True):
67 surf_pose = pose.residue(i).
xyz(pose.residue(i).nbr_atom())
68 center_of_geo_surf = center_of_geo_surf + surf_pose
69 center_of_geo_surf = (center_of_geo_surf/(pose.total_residue() - prot_length))
70 return center_of_geo_surf
74 anti_parallel_vector = vector * -1
75 return anti_parallel_vector
83 unit_vector = vector.normalize()
87 dot_product = vector1.dot_product(vector2)
91 inner_product = vector1.inner_product(vector2)
95 cross_product = vector1.cross_product(vector2)
103 vAB = pointB - pointA
104 vAC = pointC - pointA
122 intersection = point1 + vectorB * t
133 intersection = point1 + vectorB * t
139 Aplane = normal_to_3points.x
140 Bplane = normal_to_3points.y
141 Cplane = normal_to_3points.z
142 Dplane = -(Aplane*pointA.x + Bplane*pointA.y + Cplane*pointA.z)
143 return (Aplane, Bplane, Cplane, Dplane)
147 t = -(plane_abcd[0] * point_out_of_plane.x + plane_abcd[1]* point_out_of_plane.y \
148 + plane_abcd[2]*point_out_of_plane.z + plane_abcd[3])/(plane_abcd[0]*\
149 plane_abcd[0] + plane_abcd[1]*plane_abcd[1] + plane_abcd[2]*plane_abcd[2])
150 point_of_intersection = point_out_of_plane - t * antiparallel_normal_vector
151 return point_of_intersection
156 def print_surf_move(tDistanceB, tDistanceC, Psurface_Nprotein, centerG_surface, CA_centerG_protein, plane0, findProteinZ):
157 print "tDistanceB = "+str(tDistanceB)+
" tDistanceC= "+str(tDistanceC)
158 print "distance protein is away from the surface: "+str(
length(findProteinZ))
159 print "centerG_surface:"
160 print centerG_surface
161 print "CA_centerG_protein:"
162 print CA_centerG_protein
163 print "the equation plane of surface"
164 print "with with pt= the intersection point of the antiparallel normal vector and the surface plane:"
165 print "("+str(plane0[0])+
")*("+str(Psurface_Nprotein.x)+
"-x)+("+str(plane0[1])+
")*("+str(Psurface_Nprotein.y)+
"-y)+("+str(plane0[2])+
")*("+str(Psurface_Nprotein.z)+
"-z)+("+str(plane0[3])+
")=0"
166 print "distance protein is away from the surface: "+str(
length(findProteinZ))
171 Prot_trans=RigidBodyTransMover(pose,dock_jump)
172 Prot_trans.trans_axis(Translate)
173 Prot_trans.step_size(
length(Translate))
174 Prot_trans.apply(pose)
178 Prot_trans=RigidBodyTransMover(pose,dock_jump)
179 Prot_trans.trans_axis(axis)
180 Prot_trans.step_size(mag)
181 Prot_trans.apply(pose)
188 prot_length = end-start+1
191 CA_centerG_protein =
centerG_P(pose,prot_length)
194 centerG_surface =
centerG_S(pose,prot_length)
197 surface3pointA0 = SURFA0
198 surface3pointB0 = SURFA1
199 surface3pointC0 = SURFA2
202 vAB0 = surface3pointB0 - surface3pointA0
203 vAC0 = surface3pointC0 - surface3pointA0
206 surface3pointA = centerG_surface
207 surface3pointB = centerG_surface + vAB0
208 surface3pointC = centerG_surface + vAC0
211 vAB = surface3pointB - surface3pointA
212 vAC = surface3pointC - surface3pointA
215 Nprotein_to_surface =
normalto3points(surface3pointA, surface3pointB, surface3pointC)
221 plane0 =
plane3points(surface3pointA, surface3pointB, surface3pointC)
227 findProteinZ = Psurface_Nprotein - CA_centerG_protein
230 IntersectPoint1 =
point2lines3(centerG_surface,Psurface_Nprotein, vAC, vAB)
231 IntersectPoint2 =
point2lines3(centerG_surface,Psurface_Nprotein, vAB, vAC)
238 tCvector = IntersectPoint1 - Psurface_Nprotein
239 tDistanceC =
length(tCvector)
240 tBvector = IntersectPoint2 - Psurface_Nprotein
241 tDistanceB =
length(tBvector)
254 translation conditions
258 Translate = BodyPosition.xyzVector_double(0.0,0.0,0.0)
260 if (tDistanceC <= ACdistance
and tDistanceB <= ABdistance):
261 New_centerG_protein = CA_centerG_protein
270 if (tDistanceC > ACdistance):
272 cc = tDistanceC / ACdistance
274 floor_ceil_icc = cc - icc
275 IntersectPoint1 = (cc-icc)*(IntersectPoint1 - centerG_surface)/cc + centerG_surface;
277 if (tDistanceB > ABdistance):
279 bb = tDistanceB / ABdistance
281 floor_ceil_ibb = bb - ibb
282 IntersectPoint2 = (bb-ibb)*(IntersectPoint2 - centerG_surface)/bb + centerG_surface;
284 fvAB = IntersectPoint2 - centerG_surface
285 fvAC = IntersectPoint1 - centerG_surface
286 tDistanceC =
length( fvAC )
287 tDistanceB =
length( fvAB )
290 FinalPointPlane1 = point2lines3 ( IntersectPoint1, IntersectPoint2, fvAB, fvAC );
291 New_centerG_protein = FinalPointPlane1 - findProteinZ;
294 Translate = New_centerG_protein - CA_centerG_protein
xyzVector< Real > xyz(Real const &r1, Real const &omega1, Real const &t, Real const &dz1, Real const &delta_omega1, Real const &delta_z1)
Returns the x-, y-, and z-coordinates of a point on a helix given r1, omega1, and t...
bool open(utility::io::izstream &db_stream, std::string const &db_file, bool warn)
Open a database file on a provided stream.
std::string & strip(std::string &s, std::string const &chars)
Strip Specified Characters from a string's Tails.
def point_intersect_plane