Re: : [PyMOL] Surface Vertex Coordinates
The Povray intermediate file generated when you do 'ray renderer = 1' contains all vertices, normals and colouring information for cartoon and surface object types. However you do need to produce a parsing script to extract these in to a useful form for importing into other programs. Have a look at the front cover of Mol Cell vol 20(4) - I generated a cartoon of the protein in PyMol, output it as a povray file, and then converted it to VRML using a jiffy produced by Chris Richardson, and then used it as an object in the Blender 3D modelling package to generate the picture. Of course it would be a whole lot easier if PyMol output VRML directly . Warren ? Laurence Pearl On 15 Mar 2006, at 17:01, Benjamin Hitz wrote: I am interested in the coordinates of the vertices of the mesh representation of the molecular surface. Is there any method to read them out? Thanks Me too. With coloring and/or other "property" information as well. -- Ben Hitz Senior Scientific Programmer ** Saccharomyces Genome Database ** GO Consortium Stanford University ** h...@genome.stanford.edu --- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel? cmd=lnk&kid=110944&bid=241720&dat=121642 ___ PyMOL-users mailing list PyMOL-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pymol-users -- Laurence H. Pearl Section of Structural Biology, Institute of Cancer Research Chester Beatty Laboratories, 237 Fulham Road, London SW3 6JB, UK Phone +44-(0)20 7153 5422 : Secretary +44-(0)20 7153 5443 FAX +44-(0)20 7153 5457 : E-Mail laurence.pe...@icr.ac.uk -- " Live Simply and do Serious Things .. " - Dorothy Crowfoot Hodgkin --
Re: [PyMOL] Slow transparency
It was just me - loading a .pse created with the previous version seemed to be the problem. When I loaded a new coordinate file into that session, everything seemed to click back to normal. On 23 May 2005, at 12:56, Laurence Pearl wrote: Is it just me or has the new release of MacPyMol gone very slow when rendering transparent surfaces ? --- --- Laurence H. Pearl Section of Structural Biology, Institute of Cancer Research Chester Beatty Laboratories, 237 Fulham Road, London SW3 6JB, UK Phone +44-(0)20 7153 5422 : Secretary +44-(0)20 7153 5443 FAX +44-(0)20 7153 5457 : E-Mail laurence.pe...@icr.ac.uk --- --- " Live Simply and do Serious Things .. " - Dorothy Crowfoot Hodgkin --- --- --- This SF.Net email is sponsored by Oracle Space Sweepstakes Want to be the first software developer in space? Enter now for the Oracle Space Sweepstakes! http://ads.osdn.com/?ad_id=7412&alloc_id=16344&op=click ___ PyMOL-users mailing list PyMOL-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pymol-users -- Laurence H. Pearl Section of Structural Biology, Institute of Cancer Research Chester Beatty Laboratories, 237 Fulham Road, London SW3 6JB, UK Phone +44-(0)20 7153 5422 : Secretary +44-(0)20 7153 5443 FAX +44-(0)20 7153 5457 : E-Mail laurence.pe...@icr.ac.uk -- " Live Simply and do Serious Things .. " - Dorothy Crowfoot Hodgkin --
[PyMOL] Slow transparency
Is it just me or has the new release of MacPyMol gone very slow when rendering transparent surfaces ? -- Laurence H. Pearl Section of Structural Biology, Institute of Cancer Research Chester Beatty Laboratories, 237 Fulham Road, London SW3 6JB, UK Phone +44-(0)20 7153 5422 : Secretary +44-(0)20 7153 5443 FAX +44-(0)20 7153 5457 : E-Mail laurence.pe...@icr.ac.uk -- " Live Simply and do Serious Things .. " - Dorothy Crowfoot Hodgkin --
[PyMOL] cylindrical helix problem
When I set 'cartoon_cynlindrical_helices' to 1, I'm getting cylinders with coloured ends, but black sides I'm using version 0.92 on OSX 10.2.8 any ideas ?? -- Laurence H. Pearl Section of Structural Biology, Institute of Cancer Research Chester Beatty Laboratories, 237 Fulham Road, London SW3 6JB, UK Phone +44-207-970 6045 : Secretary +44-207-970 6046 FAX +44-207-970 6051 : E-Mail laurence.pe...@icr.ac.uk -- " Live Simply and do Serious Things .. " - Dorothy Crowfoot Hodgkin --
Re: [PyMOL] wild card
Beware of sweeping statements - I work with nucleic acids (mostly bound to proteins) and I am continually irritated by the use of * in nucleic acid names, and I think I qualify as anyone. Now that the ASCII code has settled down somewhat, " ' " could take it's rightful place in PDB files, liberating " * " to its otherwise universal role as wild-card. Laurence Pearl On Wednesday, February 18, 2004, at 05:25 pm, Eric Zollars wrote: Anyone who works with nucleic acids will certainly prefer the current situation. From the PDB format guidelines: * The asterisk (*) is used in place of the prime character (') for naming atoms of the sugar group. The prime was avoided historically because of non-uniformity of its external representation. Eric David A. Horita wrote: Warren, Personally, I'd much rather have wild-card selections in atom names and have to deal individually with the ill-conceived PDB files than the other way around. Regards, David Horita -Original Message- From: pymol-users-ad...@lists.sourceforge.net [mailto:pymol-users-ad...@lists.sourceforge.net] On Behalf Of Warren DeLano Sent: Wednesday, February 18, 2004 10:56 AM To: 'John Berrisford'; pymol-users@lists.sourceforge.net Subject: RE: [PyMOL] selecting multiple atoms ie oxygen John, color red, 5paa and elem o The problem with using asterices as wildcards in atom names is that some ill-conceived PDB files actually use them in atom names. However, PyMOL does support the use of a terminal wildcard in some cases, such as with the delete command... create obj01, none create obj02, none delete obj* And with residue names color red, as* color blue, gl* color pink, hi* Cheers, Warren -Original Message- From: pymol-users-ad...@lists.sourceforge.net [mailto:pymol-users-ad...@lists.sourceforge.net] On Behalf Of John Berrisford Sent: Wednesday, February 18, 2004 3:42 AM To: pymol-users@lists.sourceforge.net Subject: [PyMOL] selecting multiple atoms ie oxygen I wish to select multiple oxygens (labelled O1, O2 etc.. within my pdb file) and colour them red for example. Is there any easy way of doing this other than typing out a list of all the oxygens I wish to select? eg. color red, (5paa and (name o1+o1a+o2+o3+o4+o5+o1p+o2p+o3p)) I know in molscript its posible to use a o* label to select all oxygens, is such a switch possible in pymol. It doesn't work, or I am using the wrong syntax if its possible. Any thoughts would be appreciated. John --- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click ___ PyMOL-users mailing list PyMOL-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pymol-users --- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click ___ PyMOL-users mailing list PyMOL-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pymol-users --- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id56&alloc_id438&op=click ___ PyMOL-users mailing list PyMOL-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pymol-users -- Laurence H. Pearl Section of Structural Biology, Institute of Cancer Research Chester Beatty Laboratories, 237 Fulham Road, London SW3 6JB, UK Phone +44-207-970 6045 : Secretary +44-207-970 6046 FAX +44-207-970 6051 : E-Mail laurence.pe...@icr.ac.uk -- " Live Simply and do Serious Things .. " - Dorothy Crowfoot Hodgkin --
[PyMOL] VRML output
Happy New Year Is there a facility for outputting a 3d-molecular object from PyMol in VRML ? I want to load this into a general animation/rendering package (Blender) which will read VRML. Alternatively, does anyone know of a good Linux/Mac Povray->VRML convertor so I could convert the .pov file optionally generated by PyMol's ray command. Laurence Pearl Laurence H. Pearl Section of Structural Biology, Institute of Cancer Research Chester Beatty Laboratories, 237 Fulham Road, London SW3 6JB, UK Phone +44-207-970 6045 : Secretary +44-207-970 6046 : FAX +44-207-970 6051 "Live Simply and do Serious Things .. " - Dorothy Crowfoot Hodgkin
[PyMOL] Object orientation matrices
Is there any way of accessing the matrices that define the orientation and position of an individual object relative to the world in PyMol in the same way that get_view and set_view do for the overall view matrix ? -- Laurence H. Pearl Section of Structural Biology, Institute of Cancer Research Chester Beatty Laboratories, 237 Fulham Road, London SW3 6JB, UK Phone +44-207-970 6045 : Secretary +44-207-970 6046 FAX +44-207-970 6051 : E-Mail laurence.pe...@icr.ac.uk -- " Live Simply and do Serious Things .. " - Dorothy Crowfoot Hodgkin --
Re: [PyMOL] you know what would be cool?
I'm still not sure about all this 'cool' stuff - Python looks to me like the illegitimate spawn of C and BASIC, but then I used to program in 6502 machine code so what do I know . Below is a variant of camera_travel (as Pythonised by Lieven Buts) which takes an explicit final view matrix as an argument rather than a PyMol selection as in the original version. This allows you to specify the exact view you want, rather than relying on the combination of PyMol 'orient' and 'zoom' command to generate it for you. This is particularly useful for defining a base view to which you can return. For those with tricky E-mail clients the routine is also attached as a text file. Cheers, Laurence def camera_view_travel(first,nframes=30,new_view=(\ 1.0,0.0,0.0,\ 0.0,1.0,0.0,\ 0.0,0.0,1.0,\ 0.0,0.0, -50.0,\ 0.0,0.0,0.0,\ 40.0, 100.0,0.0 )): """ Generate progressive view matrices to move the camera smoothly from the current view to a new view provided as an argument. first - start frame nframes - duration new_view - PyMol view matrix that defines the view at the end of the sequence """ try: first=int(first) except: print "camera_travel: first frame must be an integer" return -1 try: nframes=int(nframes) except: print "camera_travel: number of frames" ff=float(1.0/nframes) old_view = cmd.get_view(2) # print ( "view : (" + "%8.3f, "*17 + "%8.3f)" ) % (old_view) # print "oldtran : %8.3f %8.3f %8.3f" % (old_view[12], old_view[13], old_view[14]) # capture new zoom/clip parameters ozc1 = new_view[11] ozc2 = new_view[15] ozc3 = new_view[16] # calculate shift in zoom/clip parameters dzc1 = (ozc1 - old_view[11]) * ff dzc2 = (ozc2 - old_view[15]) * ff dzc3 = (ozc3 - old_view[16]) * ff ozc1 = old_view[11] ozc2 = old_view[15] ozc3 = old_view[16] # capture new translation vector component ox = new_view[12] oy = new_view[13] oz = new_view[14] # calculate shift vector dx = ox - old_view[12] dy = oy - old_view[13] dz = oz - old_view[14] dx = dx*ff dy = dy*ff dz = dz*ff ox = old_view[12] oy = old_view[13] oz = old_view[14] # capture old and new rotation matrix components in quaternion form # m[0][0] = v[0] m[0][1] = v[1] m[0][2] = v[2] # m[1][0] = v[3] m[1][1] = v[4] m[1][2] = v[5] # m[2][0] = v[6] m[2][1] = v[7] m[2][2] = v[8] qx1,qy1,qz1,qw1 = quaternion(old_view) qx2,qy2,qz2,qw2 = quaternion(new_view) # calc cosine cosom = qx1 * qx2 + qy1 * qy2 + qz1 * qz2 + qw1 * qw2 limit = 0.001 if cosom>1.0+limit: raise ValueError,"Cosine of omega way out of range (positive)" elif cosom>1.0: print "Warning: cosom corrected from ",cosom,"to", cosom = 1.0 print cosom if cosom<-1.0-limit: raise ValueError,"Cosine of omega way out of range (negative)" elif cosom<-1.0: print "Warning: cosom corrected from ",cosom,"to", cosom = 1.0 print cosom # adjust signs if (cosom < 0.0): cosom = -cosom to0 = -qx2 to1 = -qy2 to2 = -qz2 to3 = -qw2 else: to0 = qx2 to1 = qy2 to2 = qz2 to3 = qw2 # calc coefficients omega = acos(cosom) sinom = sin(omega) if sinom==0.0: sinom=limit print "Warning: sinom corrected!" # restore old view cmd.set_view( ("%8.3f, " * 17 + "%8.3f") % tuple(old_view) ) # loop interpolating over nframes generating interpolated quaternion for a in range(nframes+1): scale0 = sin((1.0 - float(a*ff)) * omega) / sinom scale1 = sin(float(a*ff) * omega) / sinom rx = scale0 * qx1 + scale1 * to0; ry = scale0 * qy1 + scale1 * to1; rz = scale0 * qz1 + scale1 * to2; rw = scale0 * qw1 + scale1 * to3; # convert back to matrix x2 = rx + rx y2 = ry + ry z2 = rz + rz xx = rx * x2 xy = rx * y2 xz = rx * z2 yy = ry * y2 yz = ry * z2 zz = rz * z2 wx = rw * x2
Re: [PyMOL] you know what would be cool?
Well even this late in my career I still aspire to be cool, so here it is much as requested, a python routine to make the camera travel from place to place in your molecule. The arguments to the routine are : FIRST: frame number for start of the sequence NFRAMES : number of frames the sequence takes SEL : a valid PyMol atom selection, encased in quotes, which defines the view at the end of the sequence ZFLAG : a flag to indicate whether the final view should be 'zoomed' or not. ZLEVEL : the degree of zoom - exactly the same as the 'buffer' parameter in PyMol cmd.zoom The routine generates view matrices that interpolate between the current view and the view specified by the atom selection, updating the view as it finishes so it can be applied iteratively to travel from way-point to way-point. I've also included a little routine which applies camera_travel sequentially to each residue along a polypeptide chain - the movie is quite large, and when running fast on a Mac G5 can make you a little sea-sick, but it does illustrate the power of the routine. The major technical problem comes from the need to interpolate general rotation matrices, which is solved by using a quaternion representation. The code for this is adapted from an article in a magazine called GameDeveloper by Nick Bobick. I should add that I don't actually know how to program in python and have no idea how its 'tuples' work, so this is a very FORTRAN-like routine - feel free to improve it. # camera_travel - Laurence Pearl, November 2003 import cmd import math def camera_travel(first,nframes=30,sel='(all)',zflag=0,zlevel=2): # first - start frame # nframes - duration # sel - atom selection that defines the orientation at the end of the sequence new_view = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] old_view = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] nxt = [1,2,0] q = [0,0,0,1] first=int(first) nframes=int(nframes) ff=float(1.0/nframes) old_view = cmd.get_view(2) # print "view : (%8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f)" % (old_view) # print "oldtran : %8.3f %8.3f %8.3f" % (old_view[12], old_view[13], old_view[14]) # do orient operation on selection cmd.orient(sel,0) # if zoom to selection is required add this into view matrix if zflag != 0: cmd.zoom(sel,zlevel,0,1) # get new view new_view = cmd.get_view() # capture new zoom/clip parameters ozc1 = new_view[11] ozc2 = new_view[15] ozc3 = new_view[16] # calculate shift in zoom/clip parameters dzc1 = (ozc1 - old_view[11]) * ff dzc2 = (ozc2 - old_view[15]) * ff dzc3 = (ozc3 - old_view[16]) * ff ozc1 = old_view[11] ozc2 = old_view[15] ozc3 = old_view[16] # capture new translation vector component ox = new_view[12] oy = new_view[13] oz = new_view[14] # calculate shift vector dx = ox - old_view[12] dy = oy - old_view[13] dz = oz - old_view[14] dx = dx*ff dy = dy*ff dz = dz*ff ox = old_view[12] oy = old_view[13] oz = old_view[14] # capture old rotation matrix component # m[0][0] = v[0] m[0][1] = v[1] m[0][2] = v[2] # m[1][0] = v[3] m[1][1] = v[4] m[1][2] = v[5] # m[2][0] = v[6] m[2][1] = v[7] m[2][2] = v[8] # convert to quaternion form tr = old_view[0]+old_view[4]+old_view[8] if tr > 0.0 : s = math.sqrt(tr + 1.0) qw1 = s / 2.0 s = 0.5 / s qx1 = (old_view[5] - old_view[7]) * s qy1 = (old_view[6] - old_view[2]) * s qz1 = (old_view[1] - old_view[3]) * s else : i = 0 if (old_view[4] > old_view[0]): i = 1 if (old_view[8] > old_view[i+3*i]): i = 2 j = nxt[i] k = nxt[j] s = math.sqrt ((old_view[i+i*3] - (old_view[j+j*3] + old_view[k+k*3])) + 1.0) q[i] = s * 0.5 if (s != 0.0): s = 0.5 / s q[3] = (old_view[k+3*j] - old_view[j+3*k]) * s q[j] = (old_view[j+3*i] + old_view[i+3*j]) * s q[k] = (old_view[k+3*i] + old_view[i+3*k]) * s qx1 = q[0] qy1 = q[1] qz1 = q[2] qw1 = q[3] # capture new rotation matrix component # m[0][0] = v[0] m[0][1] = v[1] m[0][2] = v[2] # m[1][0] = v[3] m[1][1] = v[4] m[1][2] = v[5] # m[2][0] = v[6] m[2][1] = v[7] m[2][2] = v[8] #
[PyMOL] turn light routine
I'm having a problem with the routine described a few months ago for rotating the direction of the light source when the picture is rotated for making a stereo pair. The problem is as follows : PyMOL>run turn_y_light.py Traceback (most recent call last): File "/Applications/PyMOL/Darwin/modules/pymol/parser.py", line 186, in pars e execfile(args[nest][0],pymol_names,pymol_names) File "", line 1 def turn_y_light(rot): # assuming "rot" has angle in degrees rot_rad = math.pi*rot/180.0 (X0,Y0,Z0)=cmd.get_setting_tuple("light")[1] X1= X0*math.cos(rot_rad) + Z0*math.sin(rot_rad) Y1= Y0 Z1= Z0*math.cos(rot_rad) - X0*math.sin(rot_rad) cmd.set("light",[X1,Y1,Z1]) ^ SyntaxError: invalid syntax Any suggestions as to what I'm doing wrong ? --- Laurence H. Pearl Section of Structural Biology, Institute of Cancer Research Chester Beatty Laboratories, 237 Fulham Road London SW3 6JB, UK Phone +44-207-970 6045 : Secretary +44-207-970 6046 FAX +44-207-970 6051 : E-Mail l.pe...@icr.ac.uk --- " Live Simply and do Serious Things .. " - Dorothy Crowfoot Hodgkin ---
[PyMOL] rotate light routine
I'm trying to run the routine described a few months ago for rotating the light source when rotating a picture to give stereo, and I keep hitting an error that I do not understand, as follows :. PyMOL>run turn_y_light.py Traceback (most recent call last): File "/Applications/PyMOL/Darwin/modules/pymol/parser.py", line 186, in pars e execfile(args[nest][0],pymol_names,pymol_names) File "", line 1 def turn_y_light(rot): # assuming "rot" has angle in degrees rot_rad = math.pi*rot/180.0 (X0,Y0,Z0)=cmd.get_setting_tuple("light")[1] X1= X0*math.cos(rot_rad) + Z0*math.sin(rot_rad) Y1= Y0 Z1= Z0*math.cos(rot_rad) - X0*math.sin(rot_rad) cmd.set("light",[X1,Y1,Z1]) ^ SyntaxError: invalid syntax Any suggestions ? --- Laurence H. Pearl Section of Structural Biology, Institute of Cancer Research Chester Beatty Laboratories, 237 Fulham Road London SW3 6JB, UK Phone +44-207-970 6045 : Secretary +44-207-970 6046 FAX +44-207-970 6051 : E-Mail l.pe...@icr.ac.uk --- " Live Simply and do Serious Things .. " - Dorothy Crowfoot Hodgkin ---
[PyMOL] secondary structure colouring
Can anyone help me with the selection commands in PyMOL to select (and subsequently colour) residues by their secondary structure ? Many Thanks, Laurence -- --- Laurence H. Pearl Section of Structural Biology, Institute of Cancer Research Chester Beatty Laboratories, 237 Fulham Road London SW3 6JB, UK Phone +44-207-970 6045 : Secretary +44-207-970 6046 FAX +44-207-970 6051 : E-Mail l.pe...@icr.ac.uk --- " Live Simply and do Serious Things .. " - Dorothy Crowfoot Hodgkin ---
[PyMOL] ragged ends on rendered stick pictures
Fellow PyMOL enthusiasts, I'm getting a weird problem when I make 'stick' pictures rendered with the built-in PyMOL ray-tracer. Sometimes (but not always ?!?!?) the tips of some sticks come out as jagged and incomplete, instead of having smooth rounded ends. This doesn't look like a problem with the ray-tracing itself, as these jagged sticks cast jagged shadows. I'd be grateful for suggestions/fixes and would be happy to provide examples on request. I get the problem with the X-window and native Mac OSX versions. Laurence Pearl --- Laurence H. Pearl Section of Structural Biology, Institute of Cancer Research Chester Beatty Laboratories, 237 Fulham Road London SW3 6JB, UK Phone +44-207-970 6045 : Secretary +44-207-970 6046 FAX +44-207-970 6051 : E-Mail l.pe...@icr.ac.uk --- " Live Simply and do Serious Things .. " - Dorothy Crowfoot Hodgkin ---