Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help
Special pages
SBGrid Resources
SBGrid Consortium
SBGrid Data Bank
Software Webinars
PyMOL Webinar
PyMOL Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
AlphaToAll
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
= The Code = <source lang="python"> from pymol import cmd, CmdException def alphaToAll(sel, col="b",forceRebuild=False): """ alphaToAll -- expand any property of the alpha carbons to all atoms in the residue PARAMS sel The selection or object (include "*" for all objects) to operate on. This will read the alpha carbon's "COL" property and expand that down to all atoms in the given residues in sel. col Any valid PyMOL property. For example, 'b' or 'q' or 'color', etc. DEFAULT: b, for B-factor as we most often overwrite that column forceRebuild If a color changes, this will rebuild the objects for us. For speed, we DEFAULT this to False. RETURNS None, just epxands the properties as dicsussed above. NOTES This script is useful for instances where we update the b-factor column for the alpha carbons and then want to expand that color to all atoms for smoother looking images. AUTHOR: Jason Vertrees, 2009. """ col = '(' + ','.join(col.split()) + ')' space = {'props': dict()} cmd.iterate('byca (%s)' % (sel), 'props[model,segi,chain,resi] = ' + col, space=space) cmd.alter(sel, col + ' = props.get((model,segi,chain,resi), ' + col + ')', space=space) if forceRebuild != False: cmd.rebuild(sel) cmd.extend("alphaToAll", alphaToAll) </source> [[Category:Script_Library]] [[Category:ObjSel_Scripts]]
Summary:
Please note that all contributions to PyMOL Wiki are considered to be released under the GNU Free Documentation License 1.2 (see
PyMOL Wiki:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
AlphaToAll
(section)
Add topic