Re: [PyMOL] combine distance objects
Hi, Daniel Farrell [Monday, March 07, 2005 1:23 PM] wrote: I want to create a lot of distance objects (in the hundreds) between particular atomic pairs. Obviously I can make a script like the following, inserting the exact atomic selections that I want: distance distobj12 = (atom1), (atom2) distance distobj34 = (atom3), (atom4) ... etc. However, I will end up with hundreds of distance object controls on the right side of the pymol viewer. I want to have just a SINGLE distance object that contains all of the individual distance objects combined. That way I could enable/disable the entire object with a single click, or change the color, etc. Hundreds of individual objects would be unmanageable. Is there a way to do this? Thanks, * Warren L. DeLano war...@delanoscientific.com [2005-03-07 13:46] wrote: This is a reasonable request, but no, it isn't possible right now -- sorry. If it isn't necessary to be able to turn the distances on and off, then you can name them using a preceeding underscore _ so that they are omitted from the object list. But in fact one *can* still turn them on and off, with the enable or disable command on the command line: enable _dist1 disable _dist1 And it would be straightforward to put those commands within a loop: # turn them all off: for i in range(100): cmd.disable(_dist1%s % i) # turn them all on: for i in range(100): cmd.enable(_dist1%s % i) Change 100 to whatever is appropriate. Cheers, Rob -- Robert L. Campbell, Ph.D. r...@post.queensu.ca Senior Research Associatephone: 613-533-6821 Dept. of Biochemistry, Queen's University, fax: 613-533-2497 Kingston, ON K7L 3N6 Canada http://adelie.biochem.queensu.ca/~rlc PGP Fingerprint: 9B49 3D3F A489 05DC B35C 8E33 F238 A8F5 F635 C0E2
[Re: [PyMOL] combine distance objects]
Robert Campbell wrote: Hi, Daniel Farrell [Monday, March 07, 2005 1:23 PM] wrote: I want to create a lot of distance objects (in the hundreds) between particular atomic pairs. Obviously I can make a script like the following, inserting the exact atomic selections that I want: distance distobj12 = (atom1), (atom2) distance distobj34 = (atom3), (atom4) ... etc. However, I will end up with hundreds of distance object controls on the right side of the pymol viewer. I want to have just a SINGLE distance object that contains all of the individual distance objects combined. That way I could enable/disable the entire object with a single click, or change the color, etc. Hundreds of individual objects would be unmanageable. Is there a way to do this? Thanks, * Warren L. DeLano war...@delanoscientific.com [2005-03-07 13:46] wrote: This is a reasonable request, but no, it isn't possible right now -- sorry. If it isn't necessary to be able to turn the distances on and off, then you can name them using a preceeding underscore _ so that they are omitted from the object list. But in fact one *can* still turn them on and off, with the enable or disable command on the command line: enable _dist1 disable _dist1 And it would be straightforward to put those commands within a loop: # turn them all off: for i in range(100): cmd.disable(_dist1%s % i) # turn them all on: for i in range(100): cmd.enable(_dist1%s % i) Change 100 to whatever is appropriate. Cheers, Rob Even though the scripting of this sort is flexible and will get you what you want, I'd still support Daniels's suggestion. Grouping multiple objects (not just distances) would be extremely useful because one can split the objects into functional or logical units and collectively manipulate their properties (e.g. color, state, graphical representation) and it would be more interactive than scripting the same functionality. I can imagine however, that incorporating object hierarchy/grouping into PyMol may not be a trivial task... Cheers, -Viktor -- = Viktor Hornak Center for Structural Biology SUNY at Stony Brook =
Re: [PyMOL] combine distance objects
On Tue, 8 Mar 2005, Robert Campbell wrote: Hi, Daniel Farrell [Monday, March 07, 2005 1:23 PM] wrote: I want to create a lot of distance objects (in the hundreds) between particular atomic pairs. Obviously I can make a script like the following, inserting the exact atomic selections that I want: distance distobj12 = (atom1), (atom2) distance distobj34 = (atom3), (atom4) ... etc. But in fact one *can* still turn them on and off, with the enable or disable command on the command line: enable _dist1 disable _dist1 And it would be straightforward to put those commands within a loop: # turn them all off: for i in range(100): cmd.disable(_dist1%s % i) # turn them all on: for i in range(100): cmd.enable(_dist1%s % i) Change 100 to whatever is appropriate. I was just about to write something like this. In fact, I have tons of files called something like x.py sprinkled around that do things like - from pymol import cmd num_dist = 100 def show_dist(): show all of my distance objects for i in range(num_dist): cmd.enable('_dist%s'%i) def hide_dist(): hide all of my distance objects for i in range(num_dist): cmd.disable('_dist%s'%i) cmd.extend('sd',show_dist) cmd.extend('hd',hide_dist) - You could also try something cute like def show_dist(): dists = [name for name in cmd.get_names() if cmd.get_type(name) == 'object:distance'] for name in dists: cmd.enable(name) etc. if you don't want to have to keep track of how many there are. -michael -- www.umich.edu/~mlerner |_ |Michael Lerner This isn't a democracy;| ASCII ribbon campaign ( ) | Michigan it's a cheer-ocracy. | - against HTML email X | Biophysics -Torrence, Bring It On| / \ | mler...@umich Cheers, Rob -- Robert L. Campbell, Ph.D. r...@post.queensu.ca Senior Research Associatephone: 613-533-6821 Dept. of Biochemistry, Queen's University, fax: 613-533-2497 Kingston, ON K7L 3N6 Canada http://adelie.biochem.queensu.ca/~rlc PGP Fingerprint: 9B49 3D3F A489 05DC B35C 8E33 F238 A8F5 F635 C0E2 --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ PyMOL-users mailing list PyMOL-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pymol-users
RE: [PyMOL] combine distance objects
Reading this thread gave me the idea that maybe a good feature for an upcoming release might be the addition of something like folders to the object/selection bar on the right, this way objects and selections could be grouped and affected all at once. I think this would be extremely useful for making figures where you often have multiple objects and selections all converging to illustrate one point. Plus it would help to reduce the clutter you build up if you could open and close the folder to show or hide its contents in the resource bar. -Tzuni -Original Message- From: pymol-users-ad...@lists.sourceforge.net on behalf of Michael George Lerner Sent: Tue 3/8/2005 10:42 AM To: Robert Campbell Cc: pymol-users@lists.sourceforge.net Subject: Re: [PyMOL] combine distance objects On Tue, 8 Mar 2005, Robert Campbell wrote: Hi, Daniel Farrell [Monday, March 07, 2005 1:23 PM] wrote: I want to create a lot of distance objects (in the hundreds) between particular atomic pairs. Obviously I can make a script like the following, inserting the exact atomic selections that I want: distance distobj12 = (atom1), (atom2) distance distobj34 = (atom3), (atom4) ... etc. But in fact one *can* still turn them on and off, with the enable or disable command on the command line: enable _dist1 disable _dist1 And it would be straightforward to put those commands within a loop: # turn them all off: for i in range(100): cmd.disable(_dist1%s % i) # turn them all on: for i in range(100): cmd.enable(_dist1%s % i) Change 100 to whatever is appropriate. I was just about to write something like this. In fact, I have tons of files called something like x.py sprinkled around that do things like - from pymol import cmd num_dist = 100 def show_dist(): show all of my distance objects for i in range(num_dist): cmd.enable('_dist%s'%i) def hide_dist(): hide all of my distance objects for i in range(num_dist): cmd.disable('_dist%s'%i) cmd.extend('sd',show_dist) cmd.extend('hd',hide_dist) - You could also try something cute like def show_dist(): dists = [name for name in cmd.get_names() if cmd.get_type(name) == 'object:distance'] for name in dists: cmd.enable(name) etc. if you don't want to have to keep track of how many there are. -michael -- www.umich.edu/~mlerner |_ |Michael Lerner This isn't a democracy;| ASCII ribbon campaign ( ) | Michigan it's a cheer-ocracy. | - against HTML email X | Biophysics -Torrence, Bring It On| / \ | mler...@umich Cheers, Rob -- Robert L. Campbell, Ph.D. r...@post.queensu.ca Senior Research Associatephone: 613-533-6821 Dept. of Biochemistry, Queen's University, fax: 613-533-2497 Kingston, ON K7L 3N6 Canada http://adelie.biochem.queensu.ca/~rlc PGP Fingerprint: 9B49 3D3F A489 05DC B35C 8E33 F238 A8F5 F635 C0E2 --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ PyMOL-users mailing list PyMOL-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pymol-users --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ PyMOL-users mailing list PyMOL-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pymol-users
RE: [PyMOL] combine distance objects
Daniel, This is a reasonable request, but no, it isn't possible right now -- sorry. If it isn't necessary to be able to turn the distances on and off, then you can name them using a preceeding underscore _ so that they are omitted from the object list. Cheers, Warren -- Warren L. DeLano, Ph.D. Principal Scientist . DeLano Scientific LLC . 400 Oyster Point Blvd., Suite 213 . South San Francisco, CA 94080 . Biz:(650)-872-0942 Tech:(650)-872-0834 . Fax:(650)-872-0273 Cell:(650)-346-1154 . mailto:war...@delsci.com -Original Message- From: pymol-users-ad...@lists.sourceforge.net [mailto:pymol-users-ad...@lists.sourceforge.net] On Behalf Of Daniel Farrell Sent: Monday, March 07, 2005 1:23 PM To: pymol-users@lists.sourceforge.net Subject: [PyMOL] combine distance objects I want to create a lot of distance objects (in the hundreds) between particular atomic pairs. Obviously I can make a script like the following, inserting the exact atomic selections that I want: distance distobj12 = (atom1), (atom2) distance distobj34 = (atom3), (atom4) ... etc. However, I will end up with hundreds of distance object controls on the right side of the pymol viewer. I want to have just a SINGLE distance object that contains all of the individual distance objects combined. That way I could enable/disable the entire object with a single click, or change the color, etc. Hundreds of individual objects would be unmanageable. Is there a way to do this? Thanks, -Dan Farrell Research Assistant Arizona State University --- SF email is sponsored by - The IT Product Guide Read honest candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595alloc_id=14396op=click ___ PyMOL-users mailing list PyMOL-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pymol-users