## [PyMOL] Orienting protein on surface

 [PyMOL] Orienting protein on surface From: Martin Hediger - 2010-12-15 15:42:04 ```Dear all Let protein P be of C1 symmetry, so no symmetry elements. It can be approximated by a cube C, where every face of C has its own value, say 1 to 6. Lets assume, the positive x-direction is coming out of the computer screen, the plane of the screen is the yz plane, the lower left corner is now (0,0,0). Lets say, C lies in first quadrant of the xy plane, and face 1 is visible facing towards the reader. I now want to generate all possible orientations of the protein on the xy surface, so 6 in total. Are there any tools built into PyMOL? I went through the scripts library and saw a couple of things I might be using as a guide line, but so far nothing definitive. Its not a difficult thing to do, I just thought maybe there is something I can build on (instead of contributing to script inflation). Thanks for any hints on this. Martin ```

 [PyMOL] Fab elbow angle From: Sampson, Jared - 2010-12-14 18:56:43 ```Hello all - I'm trying to calculate the elbow angle of an Fab locally (i.e. without uploading to a server) and decided to try it in PyMOL. I got stuck, and thought maybe someone much wiser than I might be able to shed some light on the error(s) of my ways. I've been trying to use some of the functions in transformations.py by Christoph Gohlke (quite a thorough toolset!); what I have so far is the following .pml script: run transformations.py import numpy import transformations fetch 3ghe, async=0 # break the fab into 4 pieces create vl, chain L and resi 1-107 create vh, chain H and resi 1-113 create cl, chain L and !vl create ch, chain H and !vh # align the pieces super vl,vh super cl,ch python # get the transformation matrices mat_v = cmd.get_object_matrix("vl") mat_c = cmd.get_object_matrix("cl") # turns Pymol's output into a 4x4 python array def mat_to_R(mat): R = [[mat[0],mat[1],mat[2],mat[3]], [mat[4],mat[5],mat[6],mat[7]], [mat[8],mat[9],mat[10],mat[11]], [mat[12],mat[13],mat[14],mat[15]]] return R Rv = mat_to_R(mat_v) Rc = mat_to_R(mat_c) # calculate the axis & angle angle_v,direction_v,point_v = transformations.rotation_from_matrix(Rv) angle_c,direction_c,point_c = transformations.rotation_from_matrix(Rc) # calculate the elbow angle elbow = numpy.degrees(numpy.dot(direction_v,direction_c)) print "Elbow angle:",elbow python end I'm getting the following error, but I'm not sure how to address it: Traceback (most recent call last): File "/sw64/lib/pymol-py26/modules/pymol/parser.py", line 155, in parse exec(py_block,self.pymol_names,self.pymol_names) File "", line 19, in File "transformations.py", line 348, in rotation_from_matrix raise ValueError("no unit eigenvector corresponding to eigenvalue 1") ValueError: no unit eigenvector corresponding to eigenvalue 1 Any help would be greatly appreciated! Thanks, Jared -- Jared Sampson Xiangpeng Kong Lab NYU Langone Medical Center New York, NY 10016 212-263-7898 ------------------------------------------------------------ This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is proprietary, confidential, and exempt from disclosure under applicable law. Any unauthorized review, use, disclosure, or distribution is prohibited. If you have received this email in error please notify the sender by return email and delete the original message. Please note, the recipient should check this email and any attachments for the presence of viruses. The organization accepts no liability for any damage caused by any virus transmitted by this email. ================================= ```
 Re: [PyMOL] Fab elbow angle From: Thomas Holder - 2010-12-15 13:04:05 ```Hi Jared, this is a numerical problem. Look in transformations.py for the lines where values get compared to 1e-8 and change this number to something like 1e-7. And in your script the angle calculation missed the arccos: elbow = 180 - numpy.degrees(numpy.arccos(numpy.dot(direction_v,direction_c))) Cheers, Thomas On Tue, Dec 14, 2010 at 7:57 PM, Sampson, Jared wrote: > Hello all - I'm trying to calculate the elbow angle of an Fab locally (i.e. without uploading to a server) and decided to try it in PyMOL.  I got stuck, and thought maybe someone much wiser than I might be able to shed some light on the error(s) of my ways. > > I've been trying to use some of the functions in transformations.py by Christoph Gohlke (quite a thorough toolset!); what I have so far is the following .pml script: > > run transformations.py > > import numpy > import transformations > > fetch 3ghe, async=0 > > # break the fab into 4 pieces > create vl, chain L and resi 1-107 > create vh, chain H and resi 1-113 > create cl, chain L and !vl > create ch, chain H and !vh > > # align the pieces > super vl,vh > super cl,ch > > python > > # get the transformation matrices > mat_v = cmd.get_object_matrix("vl") > mat_c = cmd.get_object_matrix("cl") > > # turns Pymol's output into a 4x4 python array > def mat_to_R(mat): >    R = [[mat[0],mat[1],mat[2],mat[3]], >         [mat[4],mat[5],mat[6],mat[7]], >         [mat[8],mat[9],mat[10],mat[11]], >         [mat[12],mat[13],mat[14],mat[15]]] >    return R > > Rv = mat_to_R(mat_v) > Rc = mat_to_R(mat_c) > > # calculate the axis & angle > angle_v,direction_v,point_v = transformations.rotation_from_matrix(Rv) > angle_c,direction_c,point_c = transformations.rotation_from_matrix(Rc) > > # calculate the elbow angle > elbow = numpy.degrees(numpy.dot(direction_v,direction_c)) > print "Elbow angle:",elbow > > python end > > I'm getting the following error, but I'm not sure how to address it: > > Traceback (most recent call last): >  File "/sw64/lib/pymol-py26/modules/pymol/parser.py", line 155, in parse >    exec(py_block,self.pymol_names,self.pymol_names) >  File "", line 19, in >  File "transformations.py", line 348, in rotation_from_matrix >    raise ValueError("no unit eigenvector corresponding to eigenvalue 1") > ValueError: no unit eigenvector corresponding to eigenvalue 1 > > Any help would be greatly appreciated! > > Thanks, > > Jared > > -- > Jared Sampson > Xiangpeng Kong Lab > NYU Langone Medical Center > New York, NY 10016 > 212-263-7898 ```
 [PyMOL] Orienting protein on surface From: Martin Hediger - 2010-12-15 15:42:04 ```Dear all Let protein P be of C1 symmetry, so no symmetry elements. It can be approximated by a cube C, where every face of C has its own value, say 1 to 6. Lets assume, the positive x-direction is coming out of the computer screen, the plane of the screen is the yz plane, the lower left corner is now (0,0,0). Lets say, C lies in first quadrant of the xy plane, and face 1 is visible facing towards the reader. I now want to generate all possible orientations of the protein on the xy surface, so 6 in total. Are there any tools built into PyMOL? I went through the scripts library and saw a couple of things I might be using as a guide line, but so far nothing definitive. Its not a difficult thing to do, I just thought maybe there is something I can build on (instead of contributing to script inflation). Thanks for any hints on this. Martin ```