From: Tony G. <to...@ca...> - 2004-05-10 19:25:02
|
Hey Fellow PyMolers, I should be able to figure this out but I simply haven't after much fiddling and googling. I'm trying to create a cell surface for a cover figure and in Molscript I usually did this by making a PDF file with a single atom, rendering it in CPK, and then blowing its atom_radius way up to several thousand angstroms to create a slightly curved surface on which molecules could be positioned. I'm trying this in PyMol and can't figure out the command sequence. Basically, how do I alter the radius for a single atom, especially because I don't want all atoms I draw as a surface to have the same radius? Alternatively I've been trying to do this with the CGO utility using one of Gareth's scripts I found on the web: from pymol.cgo import * from pymol import cmd def cgo_sphere(x,y,z,r,name="cgo_sphere"): # Create a CGO object obj = [ SPHERE, float(x), float(y), float(z), float(r) ] # Load it into PyMOL cmd.load_cgo(obj,name) # Add to PyMOL API cmd.extend("cgo_sphere",cgo_sphere) But in adding these lines sequentially to the PyMol command line, or running it as a script, it fails at: def cgo_sphere(x,y,z,r,name="cgo_sphere"): and I get the following error message def cgo_sphere(x,y,z,r,name="cgo_sphere"): Traceback (most recent call last): File "/Users/delwarl/pymol/products/MacPyMOL.app/pymol/modules/pymol/parser.py", line 144, in parse exec(com2[nest]+"\n",pymol_names,pymol_names) File "<string>", line 1 def cgo_sphere(x,y,z,r,name="cgo_sphere"): ^ SyntaxError: unexpected EOF while parsing Is there some other way the script is supposed to be used. . .I'm using MacPyMol 0.95. Thanks for any tips/help. Tony |
From: Warren D. <wa...@de...> - 2004-05-10 20:15:57
|
Tony, In order to enter multi-line Python code on the command line, you need to use explicit end-of-line continuations. Otherwise, PyMOL won't know where your Python code stops and PyMOL commands again begin. from pymol.cgo import * from pymol import cmd set cgo_sphere_quality, 3 def cgo_sphere(x,y,z,r,name="cgo_sphere"): \ # Create a CGO object \ obj = [ \ SPHERE, float(x), float(y), float(z), float(r) \ ] \ # Load it into PyMOL \ cmd.load_cgo(obj,name) # Add to PyMOL command language cmd.extend("cgo_sphere",cgo_sphere) # end Python, begin PYMOL commands cgo_sphere 0,0,0,500,test -- For example, I can paste the above directly into the PyMOL command line (on win32), in order to get a sphere on the screen. A better alternative it to simply put all of that Python code into a ".py" file and "run" it from within PyMOL. NOTE: PyMOL doesn't currently render large and small objects together very efficiently, and there's precious little that you can do about it at the present time. Increasing hash_max won't help, though decreasing it can give a modest gain in performance. Sticking exclusively to CPK can also help. Cheers, Warren -- mailto:wa...@de... Warren L. DeLano, Ph.D. Principal Scientist DeLano Scientific LLC Voice (650)-346-1154 Fax (650)-593-4020 > -----Original Message----- > From: pym...@li... > [mailto:pym...@li...] On Behalf Of > Tony Giannetti > Sent: Monday, May 10, 2004 12:25 PM > To: pym...@li... > Subject: [PyMOL] Creating cell surface > > Hey Fellow PyMolers, > I should be able to figure this out but I simply haven't > after much fiddling and googling. I'm trying to create a > cell surface for a cover figure and in Molscript I usually > did this by making a PDF file with a single atom, rendering > it in CPK, and then blowing its atom_radius way up to several > thousand angstroms to create a slightly curved surface on > which molecules could be positioned. > > I'm trying this in PyMol and can't figure out the command sequence. > Basically, how do I alter the radius for a single atom, > especially because I don't want all atoms I draw as a surface > to have the same radius? > > Alternatively I've been trying to do this with the CGO > utility using one of Gareth's scripts I found on the web: > > from pymol.cgo import * > from pymol import cmd > > def cgo_sphere(x,y,z,r,name="cgo_sphere"): > > # Create a CGO object > obj = [ > SPHERE, float(x), float(y), float(z), float(r) > ] > > # Load it into PyMOL > cmd.load_cgo(obj,name) > > # Add to PyMOL API > cmd.extend("cgo_sphere",cgo_sphere) > > > But in adding these lines sequentially to the PyMol command > line, or running it as a script, it fails at: > > def cgo_sphere(x,y,z,r,name="cgo_sphere"): > > and I get the following error message > > def cgo_sphere(x,y,z,r,name="cgo_sphere"): > Traceback (most recent call last): > File > "/Users/delwarl/pymol/products/MacPyMOL.app/pymol/modules/pymo > l/parser.py", > line 144, in parse > exec(com2[nest]+"\n",pymol_names,pymol_names) > File "<string>", line 1 > def cgo_sphere(x,y,z,r,name="cgo_sphere"): > ^ > SyntaxError: unexpected EOF while parsing > > > Is there some other way the script is supposed to be used. . > .I'm using > MacPyMol 0.95. > > Thanks for any tips/help. > Tony > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by Sleepycat Software > Learn developer strategies Cisco, Motorola, Ericsson & Lucent > use to deliver > higher performing products faster, at low TCO. > http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3 > _______________________________________________ > PyMOL-users mailing list > PyM...@li... > https://lists.sourceforge.net/lists/listinfo/pymol-users > |
From: Tony G. <to...@ca...> - 2004-05-11 22:01:31
|
Thanks to Warren's help I was able to create a nice CGO sphere that makes a convincing cell membrane. And for most of today I was even able to render molecules placed near the membrane, AND it even created shadows on the CGO surface cast by the molecules. However, after a couple of hours it seems to have stopped working. Initially it would think about it and then crashn. Now, whenever I hit 'ray' when the large cgo sphere is on-screen it automatically crashes PyMol. I'm doing this on our lab's dual G5 using MacPyMol. I went back to my laptop, which was rendering the sphere just fine last night, and now it automatically crashes when I try to render just the sphere. I installed a fresh version of PyMol on the G5 (by unpacking the archive again) and that didn't help either, nor did rebooting the machine. Any ideas? I'm on a tad bit of a deadline and would like to get this rendered soon, preferably with the shadows. I don't have the patched version of pov-ray at the moment and anyways the output from PyMol was looking really good before it acted all weird. On 5/10/04 1:12 PM, "Warren DeLano" <wa...@de...> was all like: > Tony, > > In order to enter multi-line Python code on the command line, you > need to use explicit end-of-line continuations. Otherwise, PyMOL won't know > where your Python code stops and PyMOL commands again begin. > > from pymol.cgo import * > from pymol import cmd > > set cgo_sphere_quality, 3 > > def cgo_sphere(x,y,z,r,name="cgo_sphere"): \ > # Create a CGO object \ > obj = [ \ > SPHERE, float(x), float(y), float(z), float(r) \ > ] \ > # Load it into PyMOL \ > cmd.load_cgo(obj,name) > > # Add to PyMOL command language > cmd.extend("cgo_sphere",cgo_sphere) > > # end Python, begin PYMOL commands > > cgo_sphere 0,0,0,500,test > > -- > > For example, I can paste the above directly into the PyMOL command line (on > win32), in order to get a sphere on the screen. > > A better alternative it to simply put all of that Python code into a ".py" > file and "run" it from within PyMOL. > > NOTE: PyMOL doesn't currently render large and small objects together very > efficiently, and there's precious little that you can do about it at the > present time. Increasing hash_max won't help, though decreasing it can give > a modest gain in performance. Sticking exclusively to CPK can also help. > > Cheers, > Warren > > -- > mailto:wa...@de... > Warren L. DeLano, Ph.D. > Principal Scientist > DeLano Scientific LLC > Voice (650)-346-1154 > Fax (650)-593-4020 > > >> -----Original Message----- >> From: pym...@li... >> [mailto:pym...@li...] On Behalf Of >> Tony Giannetti >> Sent: Monday, May 10, 2004 12:25 PM >> To: pym...@li... >> Subject: [PyMOL] Creating cell surface >> >> Hey Fellow PyMolers, >> I should be able to figure this out but I simply haven't >> after much fiddling and googling. I'm trying to create a >> cell surface for a cover figure and in Molscript I usually >> did this by making a PDF file with a single atom, rendering >> it in CPK, and then blowing its atom_radius way up to several >> thousand angstroms to create a slightly curved surface on >> which molecules could be positioned. >> >> I'm trying this in PyMol and can't figure out the command sequence. >> Basically, how do I alter the radius for a single atom, >> especially because I don't want all atoms I draw as a surface >> to have the same radius? >> >> Alternatively I've been trying to do this with the CGO >> utility using one of Gareth's scripts I found on the web: >> >> from pymol.cgo import * >> from pymol import cmd >> >> def cgo_sphere(x,y,z,r,name="cgo_sphere"): >> >> # Create a CGO object >> obj = [ >> SPHERE, float(x), float(y), float(z), float(r) >> ] >> >> # Load it into PyMOL >> cmd.load_cgo(obj,name) >> >> # Add to PyMOL API >> cmd.extend("cgo_sphere",cgo_sphere) >> >> >> But in adding these lines sequentially to the PyMol command >> line, or running it as a script, it fails at: >> >> def cgo_sphere(x,y,z,r,name="cgo_sphere"): >> >> and I get the following error message >> >> def cgo_sphere(x,y,z,r,name="cgo_sphere"): >> Traceback (most recent call last): >> File >> "/Users/delwarl/pymol/products/MacPyMOL.app/pymol/modules/pymo >> l/parser.py", >> line 144, in parse >> exec(com2[nest]+"\n",pymol_names,pymol_names) >> File "<string>", line 1 >> def cgo_sphere(x,y,z,r,name="cgo_sphere"): >> ^ >> SyntaxError: unexpected EOF while parsing >> >> >> Is there some other way the script is supposed to be used. . >> .I'm using >> MacPyMol 0.95. >> >> Thanks for any tips/help. >> Tony >> >> >> >> >> ------------------------------------------------------- >> This SF.Net email is sponsored by Sleepycat Software >> Learn developer strategies Cisco, Motorola, Ericsson & Lucent >> use to deliver >> higher performing products faster, at low TCO. >> http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3 >> _______________________________________________ >> PyMOL-users mailing list >> PyM...@li... >> https://lists.sourceforge.net/lists/listinfo/pymol-users >> > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by Sleepycat Software > Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to deliver > higher performing products faster, at low TCO. > http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3 > _______________________________________________ > PyMOL-users mailing list > PyM...@li... > https://lists.sourceforge.net/lists/listinfo/pymol-users > |
From: Warren D. <wa...@de...> - 2004-05-11 22:13:19
|
Tony, Try reducing the hash_max variable by a factor of 2, 3, or 4. The problem with large spheres is that a separate hash entry is created for = each hash cell within the sphere -- that's technically wrong, but it is how PyMOL's na=EFve algorithm currently works. As a result, you can easily = exceed available RAM, which results in a crash. =20 Cheers, Warren -- mailto:wa...@de... Warren L. DeLano, Ph.D. Principal Scientist DeLano Scientific LLC Voice (650)-346-1154=20 Fax (650)-593-4020 =20 > -----Original Message----- > From: pym...@li...=20 > [mailto:pym...@li...] On Behalf Of=20 > Tony Giannetti > Sent: Tuesday, May 11, 2004 3:01 PM > To: pym...@li... > Subject: Re: [PyMOL] Creating cell surface >=20 > Thanks to Warren's help I was able to create a nice CGO=20 > sphere that makes a convincing cell membrane. And for most=20 > of today I was even able to render molecules placed near the=20 > membrane, AND it even created shadows on the CGO surface cast=20 > by the molecules. >=20 > However, after a couple of hours it seems to have stopped working. > Initially it would think about it and then crashn. Now,=20 > whenever I hit 'ray' when the large cgo sphere is on-screen=20 > it automatically crashes PyMol. > I'm doing this on our lab's dual G5 using MacPyMol. I went=20 > back to my laptop, which was rendering the sphere just fine=20 > last night, and now it automatically crashes when I try to=20 > render just the sphere. I installed a fresh version of PyMol=20 > on the G5 (by unpacking the archive again) and that didn't=20 > help either, nor did rebooting the machine. >=20 > Any ideas? I'm on a tad bit of a deadline and would like to=20 > get this rendered soon, preferably with the shadows. I don't=20 > have the patched version of pov-ray at the moment and anyways=20 > the output from PyMol was looking really good before it acted=20 > all weird. >=20 >=20 > On 5/10/04 1:12 PM, "Warren DeLano"=20 > <wa...@de...> was all > like: >=20 > > Tony, > >=20 > > In order to enter multi-line Python code on the command=20 > line, you need=20 > > to use explicit end-of-line continuations. Otherwise, PyMOL won't=20 > > know where your Python code stops and PyMOL commands again begin. > >=20 > > from pymol.cgo import * > > from pymol import cmd > >=20 > > set cgo_sphere_quality, 3 > >=20 > > def cgo_sphere(x,y,z,r,name=3D"cgo_sphere"): \ > > # Create a CGO object \ > > obj =3D [ \ > > SPHERE, float(x), float(y), float(z), float(r) \ > > ] \ > > # Load it into PyMOL \ > > cmd.load_cgo(obj,name) > >=20 > > # Add to PyMOL command language > > cmd.extend("cgo_sphere",cgo_sphere) > >=20 > > # end Python, begin PYMOL commands > >=20 > > cgo_sphere 0,0,0,500,test > >=20 > > -- > >=20 > > For example, I can paste the above directly into the PyMOL command=20 > > line (on win32), in order to get a sphere on the screen. > >=20 > > A better alternative it to simply put all of that Python=20 > code into a ".py" > > file and "run" it from within PyMOL. > >=20 > > NOTE: PyMOL doesn't currently render large and small=20 > objects together=20 > > very efficiently, and there's precious little that you can=20 > do about it=20 > > at the present time. Increasing hash_max won't help, though=20 > > decreasing it can give a modest gain in performance. =20 > Sticking exclusively to CPK can also help. > >=20 > > Cheers, > > Warren > >=20 > > -- > > mailto:wa...@de... > > Warren L. DeLano, Ph.D. > > Principal Scientist > > DeLano Scientific LLC > > Voice (650)-346-1154 > > Fax (650)-593-4020 > >=20 > >=20 > >> -----Original Message----- > >> From: pym...@li... > >> [mailto:pym...@li...] On Behalf Of Tony=20 > >> Giannetti > >> Sent: Monday, May 10, 2004 12:25 PM > >> To: pym...@li... > >> Subject: [PyMOL] Creating cell surface > >>=20 > >> Hey Fellow PyMolers, > >> I should be able to figure this out but I simply haven't after=20 > >> much fiddling and googling. I'm trying to create a cell=20 > surface for=20 > >> a cover figure and in Molscript I usually did this by making a PDF=20 > >> file with a single atom, rendering it in CPK, and then blowing its=20 > >> atom_radius way up to several thousand angstroms to create=20 > a slightly=20 > >> curved surface on which molecules could be positioned. > >>=20 > >> I'm trying this in PyMol and can't figure out the command sequence. > >> Basically, how do I alter the radius for a single atom, especially=20 > >> because I don't want all atoms I draw as a surface to have=20 > the same=20 > >> radius? > >>=20 > >> Alternatively I've been trying to do this with the CGO=20 > utility using=20 > >> one of Gareth's scripts I found on the web: > >>=20 > >> from pymol.cgo import * > >> from pymol import cmd > >>=20 > >> def cgo_sphere(x,y,z,r,name=3D"cgo_sphere"): > >>=20 > >> # Create a CGO object > >> obj =3D [ > >> SPHERE, float(x), float(y), float(z), float(r) > >> ] > >>=20 > >> # Load it into PyMOL > >> cmd.load_cgo(obj,name) > >>=20 > >> # Add to PyMOL API > >> cmd.extend("cgo_sphere",cgo_sphere) > >>=20 > >>=20 > >> But in adding these lines sequentially to the PyMol=20 > command line, or=20 > >> running it as a script, it fails at: > >>=20 > >> def cgo_sphere(x,y,z,r,name=3D"cgo_sphere"): > >>=20 > >> and I get the following error message > >>=20 > >> def cgo_sphere(x,y,z,r,name=3D"cgo_sphere"): > >> Traceback (most recent call last): > >> File > >> "/Users/delwarl/pymol/products/MacPyMOL.app/pymol/modules/pymo > >> l/parser.py", > >> line 144, in parse > >> exec(com2[nest]+"\n",pymol_names,pymol_names) > >> File "<string>", line 1 > >> def cgo_sphere(x,y,z,r,name=3D"cgo_sphere"): > >> ^ > >> SyntaxError: unexpected EOF while parsing > >>=20 > >>=20 > >> Is there some other way the script is supposed to be used. . > >> .I'm using > >> MacPyMol 0.95. > >>=20 > >> Thanks for any tips/help. > >> Tony > >>=20 > >>=20 > >>=20 > >>=20 > >> ------------------------------------------------------- > >> This SF.Net email is sponsored by Sleepycat Software Learn=20 > developer=20 > >> strategies Cisco, Motorola, Ericsson & Lucent use to=20 > deliver higher=20 > >> performing products faster, at low TCO. > >> http://www.sleepycat.com/telcomwpreg.php?From=3Dosdnemail3 > >> _______________________________________________ > >> PyMOL-users mailing list > >> PyM...@li... > >> https://lists.sourceforge.net/lists/listinfo/pymol-users > >>=20 > >=20 > >=20 > >=20 > >=20 > > ------------------------------------------------------- > > This SF.Net email is sponsored by Sleepycat Software Learn=20 > developer=20 > > strategies Cisco, Motorola, Ericsson & Lucent use to deliver higher=20 > > performing products faster, at low TCO. > > http://www.sleepycat.com/telcomwpreg.php?From=3Dosdnemail3 > > _______________________________________________ > > PyMOL-users mailing list > > PyM...@li... > > https://lists.sourceforge.net/lists/listinfo/pymol-users > >=20 >=20 >=20 >=20 >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by Sleepycat Software Learn=20 > developer strategies Cisco, Motorola, Ericsson & Lucent use=20 > to deliver higher performing products faster, at low TCO. > http://www.sleepycat.com/telcomwpreg.php?From=3Dosdnemail3 > _______________________________________________ > PyMOL-users mailing list > PyM...@li... > https://lists.sourceforge.net/lists/listinfo/pymol-users >=20 |