Group: Difference between revisions
Jump to navigation
Jump to search
m (New page: == Overview == The Group command creates or updates a "group" object. == Usage == <source lang="python"> group name, members, action </source> == Example == <source lang="python"> gr...) |
Hongbo zhu (talk | contribs) m (add operation instructions for editing group) |
||
(8 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
The [[Group]] command creates or updates a "group" object. The grouped objects are collected underneath a '''+''' sign in the object tree (see images) in the Pymol Internal Gui. | |||
The [[Group]] command creates or updates a "group" object. | |||
[[Group]] is tremendously helpful with multi-state or multi-structure sessions. Wildcards work great, for example: | |||
<source lang="python"> | |||
# put all of objState into the group "ensemble". | |||
group ensemble, objState* | |||
</source> | |||
<gallery> | |||
Image:group_off.png|Three EF-Hand proteins loaded into PyMOL | |||
Image:group_on1.png|Applied the group command to the proteins via: "group efHand, *" | |||
Image:group_on2.png|The plus was clicked and expanded to show the hierarchy of objects. | |||
</gallery> | |||
== Usage == | == Usage == | ||
Line 7: | Line 18: | ||
</source> | </source> | ||
== | == Examples == | ||
=== Creating, opening and closing === | |||
<source lang="python"> | <source lang="python"> | ||
group efHand, 1cll 1ggz 1sra | group efHand, 1cll 1ggz 1sra | ||
# allow addition and removal from the group | # allow addition and removal from the group | ||
# If a group is open, objects can be added to or removed from | |||
# it by right-click+drag from the control panel | |||
group efHand, open | group efHand, open | ||
# disallow addition/removal from the group | # disallow addition/removal from the group | ||
group efHand, close | group efHand, close | ||
</source> | |||
=== More advanced usage of groups and naming === | |||
<source lang="python"> | |||
# names with dots are treated special | |||
set group_auto_mode, 2 | |||
# load the example protein | |||
load $TUT/1hpv.pdb, 1hpv.other | |||
# create the new entry called ".protein" in group 1hpv | |||
extract 1hpv.protein, 1hpv.other and polymer | |||
# create ".ligand in the 1hpv group | |||
extract 1hpv.ligand, 1hpv.other and organic | |||
# supports wildcards | |||
show sticks, *.ligand | |||
hide lines, *.protein | |||
show surface, *.protein within 6 of *.ligand | |||
show lines, byres *.protein within 4 of *.ligand | |||
set two_sided_lighting | |||
set transparency, 0.5 | |||
set surface_color, white | |||
# Also, to lexicographically sort the names in the control panel: | |||
order *, yes | |||
</source> | </source> | ||
Line 23: | Line 78: | ||
== See Also == | == See Also == | ||
[[ungroup]] [[order]] [[select]] | [[ungroup]] [[order]] [[select]] | ||
[[Category:Commands|Group]] |
Latest revision as of 03:17, 4 May 2017
The Group command creates or updates a "group" object. The grouped objects are collected underneath a + sign in the object tree (see images) in the Pymol Internal Gui.
Group is tremendously helpful with multi-state or multi-structure sessions. Wildcards work great, for example:
# put all of objState into the group "ensemble".
group ensemble, objState*
Usage
group name, members, action
Examples
Creating, opening and closing
group efHand, 1cll 1ggz 1sra
# allow addition and removal from the group
# If a group is open, objects can be added to or removed from
# it by right-click+drag from the control panel
group efHand, open
# disallow addition/removal from the group
group efHand, close
More advanced usage of groups and naming
# names with dots are treated special
set group_auto_mode, 2
# load the example protein
load $TUT/1hpv.pdb, 1hpv.other
# create the new entry called ".protein" in group 1hpv
extract 1hpv.protein, 1hpv.other and polymer
# create ".ligand in the 1hpv group
extract 1hpv.ligand, 1hpv.other and organic
# supports wildcards
show sticks, *.ligand
hide lines, *.protein
show surface, *.protein within 6 of *.ligand
show lines, byres *.protein within 4 of *.ligand
set two_sided_lighting
set transparency, 0.5
set surface_color, white
# Also, to lexicographically sort the names in the control panel:
order *, yes
Notes
Group objects can usually be used as arguments to commands. It can be processed as a group or as a selection, in which case all the atoms from all objects in the group will be used.