https://pymolwiki.org/api.php?action=feedcontributions&user=TakanoriNakane&feedformat=atomPyMOLWiki - User contributions [en]2024-03-29T07:34:20ZUser contributionsMediaWiki 1.35.7https://pymolwiki.org/index.php?title=Dynamic_mesh&diff=10828Dynamic mesh2012-08-25T11:59:54Z<p>TakanoriNakane: Supported map_auto_expand_sym</p>
<hr />
<div>'''dynamic_mesh''' displays [[isomesh]] around the center of the view. When the view is moved, the isomesh will be updated automatically.<br />
You can also change contour level by PageDown/PageUp keys. This script is intended to implement interface similar to Coot for examing electron density maps.<br />
<br />
Note: PyMOL's [[Density Wizard]] (Menu > Wizard > Density) provides similar functionality. It is implemented using [[wizard]] framework, while this uses [[CallBack]] object.<br />
<br />
== Usage ==<br />
<br />
dynamic_mesh mapname [, level [, radius [, sym_source]]]<br />
<br />
where<br />
<br />
map_name = string: name of volumetric object(map) to display <br />
level = float: contour level of isomesh {default: 0.8}<br />
radius = float: radius of isomesh around the center of the view {default: 8}<br />
sym_source = string: name of object from which symmetry<br />
information is derived {default: None}<br />
<br />
== Example ==<br />
<br />
<syntaxhighlight lang="python"><br />
fetch 1HWK, async=1<br />
fetch 1HWK, 1hwk_map, type=2fofc, async=1<br />
run dynamic_mesh.py<br />
dynamic_mesh 1hwk_map, sym_source=1hwk<br />
show sticks, resn 117<br />
show ribbon<br />
zoom chain A and resn 117<br />
</syntaxhighlight><br />
<br />
Note: On PyMOL <= 1.4, you have to download the electron density map from the Uppsala Electron Density Server manually.<br />
<br />
== Script ==<br />
<br />
<syntaxhighlight lang="python"><br />
# Dynamic Mesh by Takanori Nakane, License: BSD-2 Clause<br />
# version 0.2: 20120825<br />
<br />
'''<br />
This script was tested on PyMOL 1.2 and 1.5.<br />
<br />
Example:<br />
<br />
fetch 1HWK, async=1<br />
fetch 1HWK, 1hwk_map, type=2fofc, async=1<br />
run dynamic_mesh.py<br />
dynamic_mesh 1hwk_map, sym_source=1hwk<br />
show sticks, resn 117<br />
show ribbon<br />
zoom chain A and resn 117<br />
<br />
Note: On PyMOL <= 1.4, you have to download the electron density<br />
map from the Uppsala Electron Density Server manually.<br />
'''<br />
<br />
from pymol.callback import Callback<br />
from pymol import cmd<br />
<br />
class DynamicMesh(Callback):<br />
def __init__(self, meshname, level, radius, sym_source):<br />
self.center = cmd.get_position()<br />
self.level = level<br />
self.radius = radius<br />
self.mesh = meshname<br />
cmd.set("auto_zoom", 0)<br />
cmd.pseudoatom("__center__", pos = self.center, quiet = 1)<br />
if sym_source != None:<br />
cmd.set("map_auto_expand_sym", 1)<br />
cmd.set_symmetry("__center__", *cmd.get_symmetry(sym_source))<br />
cmd.hide("everything", "__center__")<br />
cmd.set_key("pgup", self.contour_plus)<br />
cmd.set_key("pgdn", self.contour_minus)<br />
# TODO: Where should I unregister them?<br />
self.update()<br />
<br />
def contour_plus(self):<br />
self.level += 0.1<br />
print "Map level: " + str(self.level)<br />
self.update()<br />
<br />
def contour_minus(self):<br />
if (self.level < 0.15):<br />
return<br />
self.level -= 0.1<br />
print "Map level: " + str(self.level)<br />
self.update()<br />
<br />
def update(self):<br />
self.center = cmd.get_position()<br />
cmd.alter_state(0, "__center__", "(x, y, z) = p", space={'p': self.center})<br />
cmd.isomesh("dynamic_mesh", self.mesh, self.level, "__center__", carve = self.radius)<br />
<br />
def __call__(self):<br />
tmp = cmd.get_position()<br />
r = (self.center[0] - tmp[0]) * (self.center[0] - tmp[0]) + \<br />
(self.center[1] - tmp[1]) * (self.center[1] - tmp[1]) + \<br />
(self.center[2] - tmp[2]) * (self.center[2] - tmp[2])<br />
if (r > 0.3): # increase this number if it is too slow<br />
self.update()<br />
<br />
def get_extent(self):<br />
tmp = cmd.get_position()<br />
return [[tmp[0] - self.radius, tmp[1] - self.radius, tmp[2] - self.radius], \<br />
[tmp[0] + self.radius, tmp[1] + self.radius, tmp[2] + self.radius]]<br />
<br />
def dynamic_mesh(meshname, level = 0.8, radius = 8, sym_source = None):<br />
'''<br />
DESCRIPTION<br />
<br />
Make 'dynamic' mesh from volumetric data such as electron density map.<br />
The mesh will dynamically follow the center of the view.<br />
Contour leveo of isomesh can be changed by PageDown and PageUp keys.<br />
<br />
NOTE: Crystallographic operations can be applied to the map.<br />
<br />
USAGE<br />
<br />
dynamic_mesh mapname [, level [, radius [, sym_source]]]<br />
<br />
ARGUMENTS<br />
<br />
map_name = string: name of volumetric object(map) to display<br />
<br />
level = float: contour level of isomesh {default: 0.8}<br />
<br />
radius = float: radius of isomesh around the center of the view {default: 8}<br />
<br />
sym_source = string: name of object from which symmetry<br />
information is derived {default: None}<br />
<br />
SEE ALSO<br />
<br />
isomesh<br />
'''<br />
<br />
cmd.delete("dynamic_mesh") # TODO: support multiple meshs<br />
cmd.delete("dymesh_callback")<br />
cmd.load_callback(DynamicMesh(meshname, float(level), float(radius), sym_source), 'dymesh_callback')<br />
<br />
cmd.extend('dynamic_mesh', dynamic_mesh)<br />
cmd.auto_arg[0]['dynamic_mesh'] = [ cmd.map_sc, 'map object', ', ']<br />
cmd.auto_arg[3]['dynamic_mesh'] = [ cmd.object_sc, 'object', ', ']<br />
</syntaxhighlight><br />
<br />
== See Also ==<br />
<br />
* [[isomesh]]<br />
* [[get_position]]<br />
* [[Density Wizard]]<br />
* [[map_auto_expand_sym]]<br />
* Coot http://lmb.bioch.ox.ac.uk/coot/<br />
<br />
[[Category:Script_Library]]<br />
[[Category:UI_Scripts]]</div>TakanoriNakanehttps://pymolwiki.org/index.php?title=Isomesh&diff=10827Isomesh2012-08-25T01:34:56Z<p>TakanoriNakane: map around the center, map extension</p>
<hr />
<div>'''isomesh''' creates a mesh isosurface object from a map object.<br />
<br />
===USAGE===<br />
isomesh name, map, level [,(selection) [,buffer [,state [,carve ]]]] <br />
<br />
*name = the name for the new mesh isosurface object.<br />
*map = the name of the map object to use for computing the mesh.<br />
*level = the contour level.<br />
*selection = an atom selection about which to display the mesh with an additional "buffer" (if provided).<br />
*state = the state into which the object should be loaded (default=1) (set state=0 to append new mesh as a new state)<br />
*carve = a radius about each atom in the selection for which to include density. If "carve" is not provided, then the whole brick is displayed.<br />
<br />
=== Examples ===<br />
<source lang="python"><br />
# load the map<br />
load mymap.xplor, themap<br />
# view the isomesh map<br />
isomesh themapobject, themap, 2.0, site, carve=1.6<br />
</source><br />
[[Image:Isomesh_ex1.png|thumb|right|300px|Output from the 2nd example]]<br />
<source lang="python"><br />
# create fake map for demo<br />
load $TUT/1hpv.pdb<br />
<br />
# set b and q for all atoms<br />
alter all, b=10<br />
alter all, q=1<br />
<br />
# make a new map<br />
map_new fake_map, gaussian, 0.5, all<br />
<br />
# carved brick<br />
isomesh carved, fake_map, 1.0, resi 200, carve=2.1<br />
<br />
color marine, carved<br />
<br />
# normal brick<br />
isomesh normal, fake_map, 1.0, resi 200, 2.1<br />
<br />
orient resi 200<br />
</source><br />
<br />
===NOTES===<br />
====USAGE====<br />
If the mesh object already exists, then the new mesh will be appended onto the object as a new state (unless you indicate a state).<br />
<br />
*state > 0: specific state<br />
*state = 0: all states<br />
*state = -1: current state<br />
<br />
*source_state > 0: specific state<br />
*source_state = 0: include all states starting with 0<br />
*source_state = -1: current state<br />
*source_state = -2: last state in map<br />
<br />
====MAP AROUND THE CENTER====<br />
<br />
You can create mesh around the center of the view by specifying "center" as the selection argument.<br />
<br />
<source lang="python"><br />
isomesh normal, fake_map, 1.0, center<br />
</source><br />
<br />
====MAP OUTSIDE THE CALCULATED AREA====<br />
<br />
When [[map_auto_expand_sym]] is ON, you can create mesh beyond the precalculated volume. In this<br />
case, symmetry information (lattice constants, space group) of the model specified in the selection <br />
argument, not the map object itself, is used.<br />
<br />
====MAP LEVELS====<br />
* Generally speaking there is some ambiguity with visualization tools as to how map data is to treated: Some map file formats are normalized by convention (in the file data itself) and others do not. Some visualization tools automatically normalize maps upon reading, others do not. PyMOL's default behavior is dependent upon map file type: CCP4 and O/BRIX/DSN6 maps are automatically normalized upon reading (disable via '''normalize_*''' settings), other maps types are not. PyMOL's normalization is a straight statistical average of all map points -- this may or may not be what you want. If migrating to PyMOL from another tool, then it is definitely worth comparing how the maps are being represented by creating an equivalent figure in both, making sure that they match, and if they do not, then figuring out why not. ''From the PyMOL list. Author: Warren DeLano.''<br />
<br />
===SEE ALSO===<br />
*[[isodot]]<br />
*[[load]]<br />
*[[fetch]]<br />
*[[dynamic_mesh]]<br />
<br />
[[Category:Commands|Isomesh]]<br />
[[Category:States|Isomesh]]<br />
[[Category:Electron_Density]]<br />
[[Category:Maps]]</div>TakanoriNakanehttps://pymolwiki.org/index.php?title=Map_auto_expand_sym&diff=10826Map auto expand sym2012-08-25T01:26:31Z<p>TakanoriNakane: Created page with "==OVERVIEW== When '''map_auto_expand_sym''' is ON, symmetry operations will be applied to expand it beyond the precalculated volume when necessary. ==USAGE== set map_auto_ex..."</p>
<hr />
<div>==OVERVIEW==<br />
<br />
When '''map_auto_expand_sym''' is ON, symmetry operations will be applied to expand it<br />
beyond the precalculated volume when necessary. <br />
<br />
==USAGE==<br />
<br />
set map_auto_expand_sym, on<br />
<br />
The default is ON.<br />
<br />
==Note==<br />
<br />
[[isomesh]], [[isosurface]], etc use symmetry information (lattice constants, space group) of the<br />
model specified by ''selection'' argument, not the map object itself.<br />
<br />
==See Also==<br />
<br />
*[[isomesh]]<br />
*[[isosurface]]<br />
<br />
[[Category:Settings]]</div>TakanoriNakanehttps://pymolwiki.org/index.php?title=Dynamic_mesh&diff=10824Dynamic mesh2012-08-24T00:25:36Z<p>TakanoriNakane: Wizard > Density</p>
<hr />
<div>'''dynamic_mesh''' displays [[isomesh]] around the center of the view. When the view is moved, the isomesh will be updated automatically.<br />
You can also change contour level by PageDown/PageUp keys. This script is intended to implement interface similar to Coot for examing electron density maps.<br />
<br />
Note: PyMOL's [[Density Wizard]] (Menu > Wizard > Density) provides similar functionality. It is implemented using [[wizard]] framework, while this uses [[CallBack]] object.<br />
<br />
== Usage ==<br />
<br />
dynamic_mesh mapname [, level [, radius]]<br />
<br />
where<br />
<br />
map_name = string: name of volumetric object(map) to display <br />
level = float: contour level of isomesh {default: 0.8}<br />
radius = float: radius of isomesh around the center of the view {default: 8}<br />
<br />
== Example ==<br />
<br />
<syntaxhighlight lang="python"><br />
fetch 1HWK, async=1<br />
fetch 1HWK, 1hwk_map, type=2fofc, async=1<br />
run dynamic_mesh.py<br />
dynamic_mesh 1hwk_map<br />
show sticks, resn 117<br />
show ribbon<br />
zoom chain A and resn 117<br />
</syntaxhighlight><br />
<br />
Note: On PyMOL <= 1.4, you have to download the electron density map from the Uppsala Electron Density Server manually.<br />
<br />
== Script ==<br />
<br />
<syntaxhighlight lang="python"><br />
# Dynamic Mesh by Takanori Nakane, License: BSD-2 Clause<br />
# version 0.11: 20120823<br />
<br />
'''<br />
This script was tested on PyMOL 1.2 and 1.5.<br />
<br />
Example:<br />
<br />
fetch 1HWK, async=1<br />
fetch 1HWK, 1hwk_map, type=2fofc, async=1<br />
run dynamic_mesh.py<br />
dynamic_mesh 1hwk_map<br />
show sticks, resn 117<br />
show ribbon<br />
zoom chain A and resn 117<br />
<br />
Note: On PyMOL <= 1.4, you have to download the electron density<br />
map from the Uppsala Electron Density Server manually.<br />
'''<br />
<br />
from pymol.callback import Callback<br />
from pymol import cmd<br />
<br />
class DynamicMesh(Callback):<br />
def __init__(self, meshname, level = 0.8, radius = 8):<br />
self.center = cmd.get_position()<br />
self.level = level<br />
self.radius = radius<br />
self.mesh = meshname<br />
cmd.set("auto_zoom", 0)<br />
cmd.pseudoatom("__center__", pos = self.center, quiet = 1)<br />
cmd.hide("everything", "__center__")<br />
cmd.set_key("pgup", self.contour_plus)<br />
cmd.set_key("pgdn", self.contour_minus)<br />
# TODO: Where should I unregister them?<br />
self.update()<br />
<br />
def contour_plus(self):<br />
self.level += 0.1<br />
print "Map level: " + str(self.level)<br />
self.update()<br />
<br />
def contour_minus(self):<br />
if (self.level < 0.15):<br />
return<br />
self.level -= 0.1<br />
print "Map level: " + str(self.level)<br />
self.update()<br />
<br />
def update(self):<br />
self.center = cmd.get_position()<br />
cmd.alter_state(0, "__center__", "(x, y, z) = p", space={'p': self.center})<br />
cmd.isomesh("dynamic_mesh", self.mesh, self.level, "__center__", carve = self.radius)<br />
<br />
def __call__(self):<br />
tmp = cmd.get_position()<br />
r = (self.center[0] - tmp[0]) * (self.center[0] - tmp[0]) + \<br />
(self.center[1] - tmp[1]) * (self.center[1] - tmp[1]) + \<br />
(self.center[2] - tmp[2]) * (self.center[2] - tmp[2])<br />
if (r > 0.3): # increase this number if it is too slow<br />
self.update()<br />
<br />
def get_extent(self):<br />
tmp = cmd.get_position()<br />
return [[tmp[0] - self.radius, tmp[1] - self.radius, tmp[2] - self.radius], \<br />
[tmp[0] + self.radius, tmp[1] + self.radius, tmp[2] + self.radius]]<br />
<br />
def dynamic_mesh(meshname, level = 0.8, radius = 8):<br />
'''<br />
DESCRIPTION<br />
<br />
Make 'dynamic' mesh from volumetric data such as electron density map.<br />
The mesh will dynamically follow the center of the view.<br />
Contour leveo of isomesh can be changed by PageDown and PageUp keys.<br />
<br />
NOTE: Crystallographic operations will not be applied to the map.<br />
Only pre-calculated volume can be displayed.<br />
<br />
USAGE<br />
<br />
dynamic_mesh mapname [, level [, radius]]<br />
<br />
ARGUMENTS<br />
<br />
map_name = string: name of volumetric object(map) to display<br />
<br />
level = float: contour level of isomesh {default: 0.8}<br />
<br />
radius = float: radius of isomesh around the center of the view {default: 8}<br />
<br />
SEE ALSO<br />
<br />
isomesh<br />
'''<br />
<br />
cmd.delete("dynamic_mesh") # TODO: support multiple meshs<br />
cmd.delete("dymesh_callback")<br />
cmd.load_callback(DynamicMesh(meshname, float(level), float(radius)),'dymesh_callback')<br />
<br />
cmd.extend('dynamic_mesh', dynamic_mesh)<br />
cmd.auto_arg[0]['dynamic_mesh'] = [ cmd.map_sc, 'map object', ', ']<br />
</syntaxhighlight><br />
<br />
== See Also ==<br />
<br />
* [[isomesh]]<br />
* [[get_position]]<br />
* [[Density Wizard]]<br />
* Coot http://lmb.bioch.ox.ac.uk/coot/<br />
<br />
[[Category:Script_Library]]<br />
[[Category:UI_Scripts]]</div>TakanoriNakanehttps://pymolwiki.org/index.php?title=Dynamic_mesh&diff=10823Dynamic mesh2012-08-23T02:19:01Z<p>TakanoriNakane: Created page with "'''dynamic_mesh''' displays isomesh around the center of the view. When the view is moved, the isomesh will be updated automatically. You can also change contour level by Pag..."</p>
<hr />
<div>'''dynamic_mesh''' displays [[isomesh]] around the center of the view. When the view is moved, the isomesh will be updated automatically.<br />
You can also change contour level by PageDown/PageUp keys. This script is intended to implement interface similar to Coot for examing electron density maps.<br />
<br />
== Usage ==<br />
<br />
dynamic_mesh mapname [, level [, radius]]<br />
<br />
where<br />
<br />
map_name = string: name of volumetric object(map) to display <br />
level = float: contour level of isomesh {default: 0.8}<br />
radius = float: radius of isomesh around the center of the view {default: 8}<br />
<br />
== Example ==<br />
<br />
<syntaxhighlight lang="python"><br />
fetch 1HWK, async=1<br />
fetch 1HWK, 1hwk_map, type=2fofc, async=1<br />
run dynamic_mesh.py<br />
dynamic_mesh 1hwk_map<br />
show sticks, resn 117<br />
show ribbon<br />
zoom chain A and resn 117<br />
</syntaxhighlight><br />
<br />
Note: On PyMOL <= 1.4, you have to download the electron density map from the Uppsala Electron Density Server manually.<br />
<br />
== Script ==<br />
<br />
<syntaxhighlight lang="python"><br />
# Dynamic Mesh by Takanori Nakane, License: BSD-2 Clause<br />
# version 0.11: 20120823<br />
<br />
'''<br />
This script was tested on PyMOL 1.2 and 1.5.<br />
<br />
Example:<br />
<br />
fetch 1HWK, async=1<br />
fetch 1HWK, 1hwk_map, type=2fofc, async=1<br />
run dynamic_mesh.py<br />
dynamic_mesh 1hwk_map<br />
show sticks, resn 117<br />
show ribbon<br />
zoom chain A and resn 117<br />
<br />
Note: On PyMOL <= 1.4, you have to download the electron density<br />
map from the Uppsala Electron Density Server manually.<br />
'''<br />
<br />
from pymol.callback import Callback<br />
from pymol import cmd<br />
<br />
class DynamicMesh(Callback):<br />
def __init__(self, meshname, level = 0.8, radius = 8):<br />
self.center = cmd.get_position()<br />
self.level = level<br />
self.radius = radius<br />
self.mesh = meshname<br />
cmd.set("auto_zoom", 0)<br />
cmd.pseudoatom("__center__", pos = self.center, quiet = 1)<br />
cmd.hide("everything", "__center__")<br />
cmd.set_key("pgup", self.contour_plus)<br />
cmd.set_key("pgdn", self.contour_minus)<br />
# TODO: Where should I unregister them?<br />
self.update()<br />
<br />
def contour_plus(self):<br />
self.level += 0.1<br />
print "Map level: " + str(self.level)<br />
self.update()<br />
<br />
def contour_minus(self):<br />
if (self.level < 0.15):<br />
return<br />
self.level -= 0.1<br />
print "Map level: " + str(self.level)<br />
self.update()<br />
<br />
def update(self):<br />
self.center = cmd.get_position()<br />
cmd.alter_state(0, "__center__", "(x, y, z) = p", space={'p': self.center})<br />
cmd.isomesh("dynamic_mesh", self.mesh, self.level, "__center__", carve = self.radius)<br />
<br />
def __call__(self):<br />
tmp = cmd.get_position()<br />
r = (self.center[0] - tmp[0]) * (self.center[0] - tmp[0]) + \<br />
(self.center[1] - tmp[1]) * (self.center[1] - tmp[1]) + \<br />
(self.center[2] - tmp[2]) * (self.center[2] - tmp[2])<br />
if (r > 0.3): # increase this number if it is too slow<br />
self.update()<br />
<br />
def get_extent(self):<br />
tmp = cmd.get_position()<br />
return [[tmp[0] - self.radius, tmp[1] - self.radius, tmp[2] - self.radius], \<br />
[tmp[0] + self.radius, tmp[1] + self.radius, tmp[2] + self.radius]]<br />
<br />
def dynamic_mesh(meshname, level = 0.8, radius = 8):<br />
'''<br />
DESCRIPTION<br />
<br />
Make 'dynamic' mesh from volumetric data such as electron density map.<br />
The mesh will dynamically follow the center of the view.<br />
Contour leveo of isomesh can be changed by PageDown and PageUp keys.<br />
<br />
NOTE: Crystallographic operations will not be applied to the map.<br />
Only pre-calculated volume can be displayed.<br />
<br />
USAGE<br />
<br />
dynamic_mesh mapname [, level [, radius]]<br />
<br />
ARGUMENTS<br />
<br />
map_name = string: name of volumetric object(map) to display<br />
<br />
level = float: contour level of isomesh {default: 0.8}<br />
<br />
radius = float: radius of isomesh around the center of the view {default: 8}<br />
<br />
SEE ALSO<br />
<br />
isomesh<br />
'''<br />
<br />
cmd.delete("dynamic_mesh") # TODO: support multiple meshs<br />
cmd.delete("dymesh_callback")<br />
cmd.load_callback(DynamicMesh(meshname, float(level), float(radius)),'dymesh_callback')<br />
<br />
cmd.extend('dynamic_mesh', dynamic_mesh)<br />
cmd.auto_arg[0]['dynamic_mesh'] = [ cmd.map_sc, 'map object', ', ']<br />
</syntaxhighlight><br />
<br />
== See Also ==<br />
<br />
* [[isomesh]]<br />
* [[get_position]]<br />
* Coot http://lmb.bioch.ox.ac.uk/coot/<br />
<br />
[[Category:Script_Library]]<br />
[[Category:UI_Scripts]]</div>TakanoriNakanehttps://pymolwiki.org/index.php?title=Auto_arg&diff=10820Auto arg2012-08-21T15:04:58Z<p>TakanoriNakane: Created page with "cmd.auto_arg controls auto-completion of command arguments in PyMOL's command line. It is an array of dictionaries.When Pymol's console attempts to auto-complete the ''n''-th..."</p>
<hr />
<div>cmd.[[auto_arg]] controls auto-completion of command arguments in PyMOL's command line. It is an array of dictionaries.When Pymol's console attempts to auto-complete the ''n''-th argument of command ''abc'', it will look at cmd.auto_arg[n]['abc'] (''n'' starts from 0). This is a list with three elements.<br />
<br />
# The first element is a lambda function which returns an Shortcut object. Shortcut object wraps the list of candidate strings, given to its constructor.<br />
# The second element is a string, which describs the argument.<br />
# The third element is a string, which will be added after autocompletion (postfix).<br />
<br />
===PYTHON EXAMPLE===<br />
<br />
<source lang="python"><br />
cmd.auto_arg[0]['test']=[lambda: cmd.Shortcut(['abc','bcd']), '1st argument', ', ']<br />
</source><br />
<br />
This code defines the auto-completion list for the first argument of command<br />
''test''. When you type 'test ' and press TAB, PyMOL will show you two candidates as:<br />
<br />
<nowiki>parser: matching 1st argument:<br />
abc bcd </nowiki><br />
<br />
If you type 'a' and press TAB again, PyMOL will complete it to "test abc, ". Note that ', ' is added.<br />
<br />
===Pre-defined lambdas===<br />
<br />
In most cases, you just want to complete from object names or setting lists. Then you don't have to write your own lambda function. Just use '''cmd.object_sc''' for choosing from objects.<br />
<br />
<source lang="python">cmd.auto_arg[0]['test'] = [ cmd.object_sc, 'object', '']</source><br />
<br />
Use '''cmd.selection_sc''' for setting names (like 'line_width'), '''cmd.map_sc''' for maps and '''cmd.repres_sc''' for representations ('sticks', 'lines', etc).<br />
<br />
===SEE ALSO===<br />
*[[extend]]<br />
*parser.py, cmd.py, shortcut.py<br />
<br />
[[Category:Scripting]]</div>TakanoriNakanehttps://pymolwiki.org/index.php?title=Extend&diff=10819Extend2012-08-21T14:45:17Z<p>TakanoriNakane: auto_arg</p>
<hr />
<div>[[Extend]] is an API-only function which binds a new external function as a command into the PyMOL scripting language. In other words, when you write a function and want PyMOL to recognize the new command, you '''extend''' the command into PyMOL. Once extended, the function name is recognized like other function names (example below). Typically, '''extend''' is the last line of a PyMOL script.<br />
<br />
===PYMOL API===<br />
<source lang="python"><br />
cmd.extend(string name,function function)<br />
</source><br />
<br />
===PYTHON EXAMPLE===<br />
<source lang="python"><br />
def foo(moo=2): print moo<br />
cmd.extend('foo',foo)<br />
</source><br />
<br />
The following would now work within PyMOL:<br />
<source lang="python"><br />
PyMOL>foo<br />
2<br />
PyMOL>foo 3<br />
3<br />
PyMOL>foo moo=5<br />
5<br />
PyMOL>foo ?<br />
<br />
Usage: foo [ moo ]<br />
</source><br />
<br />
===NOTES===<br />
For security reasons, new PyMOL commands created using "extend" are not saved or restored in sessions.<br />
<br />
You may want to set [[auto_arg]] to enable auto-completion for your command's arguments.<br />
<br />
===SEE ALSO===<br />
*[[Alias]]<br />
*[[Api]]<br />
*[[auto_arg]]<br />
<br />
[[Category:Scripting]]<br />
[[Category:Commands|Extend]]<br />
<br />
<br />
<hr><br />
=== "extend" used in selections ===<br />
"extend" can also be used in selection statements to grow a selection based on covalent bonds. This behavior is illustrated on residue 64 of PDB file 1KAO where we initially select one atom and then "extend" that selection by one and three covalent bonds.<br />
<br />
<table border="1"><br />
<tr><br />
<td>[[Image:Extend0.png|250px]]</td><br />
<td>[[Image:Extend1.png|250px]]</td><br />
<td>[[Image:Extend3.png|250px]]</td><br />
</tr><br />
<tr><br />
<td>select (resi 64 and n. cz)</td><br />
<td>select (resi 64 and n. cz) extend 1</td><br />
<td>select (resi 64 and n. cz) extend 3</td><br />
</tr><br />
</table><br />
<hr></div>TakanoriNakanehttps://pymolwiki.org/index.php?title=Fetch&diff=10818Fetch2012-08-18T06:58:17Z<p>TakanoriNakane: proxy setting</p>
<hr />
<div>'''Fetch''' retrieves a protein structure from the PDB and loads it into PyMOL. The PDB file is saved in the current working directory for PyMOL.<br />
<br />
You can now fetch electron density maps using ''type=fofc'' or ''type=2fofc''. The map will be loaded if the electron density map exists on the [http://eds.bmc.uu.se/eds/ EDS] server.<br />
You can also fetch the so-called [http://www.rcsb.org/pdb/101/static101.do?p=education_discussion/Looking-at-Structures/bioassembly_tutorial.html biological assembly or biological unit] files from PDB using ''type=pdb1'', ''type=pdb2'' and so on. <br />
<br />
=== Syntax ===<br />
<source lang="python"><br />
fetch PDB_ID [ ID2...IDN ] [, async = [0,1] , [ type=[fofc,2fofc] ]<br />
</source><br />
<br />
To specify more than one PDB, just add its ID to the command line (without adding spaces). <br />
<br />
=== Proxy Setting ===<br />
<br />
If your network requires a proxy server, you can specify it by 'http_proxy' and 'ftp_proxy' environmental variables. <br />
<br />
At least in Mac OS X, these values are setup automatically. Otherwise, add<br />
<br />
<nowiki>export http_proxy='http://proxy.server.name:port/'</nowiki><br />
<nowiki>export ftp_proxy='http://proxy.server.name:port/' # shouldn't start with ftp://...</nowiki><br />
<br />
to your start up shell script.<br />
<br />
=== Example ===<br />
<source lang="python"><br />
# fetch them singly<br />
fetch 1kao<br />
fetch 1ctq<br />
<br />
# fetch them at once<br />
fetch 1kao 1ctq<br />
<br />
# fetch them at once, load them into PyMOL all at once (synchronously)<br />
fetch 1kao 1ctq, async=0<br />
<br />
# Example loading a protein and its electron density map<br />
fetch 1cll<br />
fetch 1cll, type=2fofc<br />
# focus on residues 30-40<br />
map_trim *, i. 30-40, 4<br />
zoom i. 30-40<br />
</source><br />
<br />
=== Example 2 ===<br />
<source lang="python"><br />
# fetch PDB files and process each of them<br />
# using async=0, PyMOL will wait for fetch to finish before executing the next command<br />
fetch 1kao, async=0<br />
remove not (alt ''+A)<br />
alter all, alt=''<br />
save 1koa_clean.pdb,1koa<br />
delete 1koa<br />
fetch 1ctq, async=0<br />
remove not (alt ''+A)<br />
alter all, alt=''<br />
save 1ctq_clean.pdb,1ctq<br />
</source><br />
<br />
=== Example 3 ===<br />
<source lang="python"><br />
# fetch the biological assembly of 1avd<br />
# the assembly is composed of asymmetric units (ASUs) stored in different MODELs<br />
# split the biological assembly using split_state<br />
fetch 1avd, type=pdb1<br />
split_state 1avd<br />
</source><br />
<br />
= See Also =<br />
[[Fetch_Path]], [[Fetch_Host]]<br />
<br />
[[Category:Commands|Fetch]]</div>TakanoriNakanehttps://pymolwiki.org/index.php?title=Cylinder_shader_ff_workaround&diff=10817Cylinder shader ff workaround2012-08-18T06:41:48Z<p>TakanoriNakane: New page</p>
<hr />
<div>==OVERVIEW==<br />
<br />
When cylinders (as in stick representation) are drawn incorrectly, enabling this option might fix the problem. This<br />
option is often required in NVIDIA's video cards (GeForce and Quadro). <br />
<br />
<gallery widths="300px" heights="300px"><br />
Image:shader_bug.png| Incorrect rendering in GeForce GTX 580<br />
Image:shader_bug_fixed.png| Setting this option 'on' fixed the problem<br />
</gallery><br />
<br />
==USAGE==<br />
<br />
set cylinder_shader_ff_workaround, on<br />
<br />
The default is off.<br />
<br />
Once you found this option necessary, you can add this to [[Pymolrc|.pymolrc]].<br />
<br />
<br />
[[Category:Settings]]</div>TakanoriNakanehttps://pymolwiki.org/index.php?title=File:Shader_bug_fixed.png&diff=10816File:Shader bug fixed.png2012-08-18T06:32:33Z<p>TakanoriNakane: Corrected version of 'shader_bug.png'</p>
<hr />
<div>Corrected version of 'shader_bug.png'</div>TakanoriNakanehttps://pymolwiki.org/index.php?title=File:Shader_bug.png&diff=10815File:Shader bug.png2012-08-18T06:31:24Z<p>TakanoriNakane: Cylinder shader bug which can be fixed by 'set cylinder_shader_ff_workaround, on'</p>
<hr />
<div>Cylinder shader bug which can be fixed by 'set cylinder_shader_ff_workaround, on'</div>TakanoriNakanehttps://pymolwiki.org/index.php?title=Settings&diff=10814Settings2012-08-18T04:41:54Z<p>TakanoriNakane: Added cylinder_shader_ff_workaround</p>
<hr />
<div>PyMOL is incredibly useful because of its flexibility. Almost any setting can be tweaked to give you the ability to make your scenes appear just as you want. Each command usually comes with one or more settings. For example, the [[ray]] command comes with '''50''' settings!<br />
<br />
Below you will find the list of all known settings (as of this writing). Settings are added all the time, so this list should be updated somehow. Also, see all '''[[:Category:Settings|documented settings]]'''.<br />
<br />
If you feel like documenting them, and what they do, feel free.<br />
<br />
[[active_selections]]<br />
[[all_states]]<br />
[[ambient]]<br />
[[angle_color]]<br />
[[angle_label_position]]<br />
[[angle_size]]<br />
[[animation]]<br />
[[animation_duration]]<br />
[[antialias]]<br />
[[async_builds]]<br />
[[ati_bugs]]<br />
[[atom_name_wildcard]]<br />
[[auto_classify_atoms]]<br />
[[auto_color]]<br />
[[auto_copy_images]]<br />
[[auto_defer_builds]]<br />
[[auto_dss]]<br />
[[auto_hide_selections]]<br />
[[auto_indicate_flags]]<br />
[[auto_number_selections]]<br />
[[auto_remove_hydrogens]]<br />
[[auto_rename_duplicate_objects]]<br />
[[auto_sculpt]]<br />
[[auto_show_lines]]<br />
[[auto_show_nonbonded]]<br />
[[auto_show_selections]]<br />
[[auto_show_spheres]]<br />
[[auto_zoom]]<br />
[[backface_cull]]<br />
[[batch_prefix]]<br />
[[bg_rgb]]<br />
[[bonding_vdw_cutoff]]<br />
[[button_mode]]<br />
[[button_mode_name]]<br />
[[cache_display]]<br />
[[cache_frames]]<br />
[[cache_max]]<br />
[[cache_memory]]<br />
[[cache_mode]]<br />
[[cartoon_color]]<br />
[[cartoon_cylindrical_helices]]<br />
[[cartoon_debug]]<br />
[[cartoon_discrete_colors]]<br />
[[cartoon_dumbbell_length]]<br />
[[cartoon_dumbbell_radius]]<br />
[[cartoon_dumbbell_width]]<br />
[[cartoon_fancy_helices]]<br />
[[cartoon_fancy_sheets]]<br />
[[cartoon_flat_cycles]]<br />
[[cartoon_flat_sheets]]<br />
[[cartoon_helix_radius]]<br />
[[cartoon_highlight_color]]<br />
[[cartoon_ladder_color]]<br />
[[cartoon_ladder_mode]]<br />
[[cartoon_ladder_radius]]<br />
[[cartoon_loop_cap]]<br />
[[cartoon_loop_quality]]<br />
[[cartoon_loop_radius]]<br />
[[cartoon_nucleic_acid_color]]<br />
[[cartoon_nucleic_acid_mode]]<br />
[[cartoon_oval_length]]<br />
[[cartoon_oval_quality]]<br />
[[cartoon_oval_width]]<br />
[[cartoon_power]]<br />
[[cartoon_power_b]]<br />
[[cartoon_putty_quality]]<br />
[[cartoon_putty_radius]]<br />
[[cartoon_putty_range]]<br />
[[cartoon_putty_scale_max]]<br />
[[cartoon_putty_scale_min]]<br />
[[cartoon_putty_scale_power]]<br />
[[cartoon_putty_transform]]<br />
[[cartoon_rect_length]]<br />
[[cartoon_rect_width]]<br />
[[cartoon_refine]]<br />
[[cartoon_refine_normals]]<br />
[[cartoon_refine_tips]]<br />
[[cartoon_ring_color]]<br />
[[cartoon_ring_finder]]<br />
[[cartoon_ring_mode]]<br />
[[cartoon_ring_radius]]<br />
[[cartoon_ring_transparency]]<br />
[[cartoon_ring_width]]<br />
[[cartoon_round_helices]]<br />
[[cartoon_sampling]]<br />
[[cartoon_side_chain_helper]]<br />
[[cartoon_smooth_cycles]]<br />
[[cartoon_smooth_first]]<br />
[[cartoon_smooth_last]]<br />
[[cartoon_smooth_loops]]<br />
[[cartoon_throw]]<br />
[[cartoon_trace_atoms]]<br />
[[cartoon_transparency]]<br />
[[cartoon_tube_cap]]<br />
[[cartoon_tube_quality]]<br />
[[cartoon_tube_radius]]<br />
[[cavity_cull]]<br />
[[cgo_dot_radius]]<br />
[[cgo_dot_width]]<br />
[[cgo_ellipsoid_quality]]<br />
[[cgo_line_radius]]<br />
[[cgo_line_width]]<br />
[[cgo_ray_width_scale]]<br />
[[cgo_sphere_quality]]<br />
[[cgo_transparency]]<br />
[[clamp_colors]]<br />
[[cone_quality]]<br />
[[connect_bonded]]<br />
[[connect_cutoff]]<br />
[[connect_mode]]<br />
[[coulomb_cutoff]]<br />
[[coulomb_dielectric]]<br />
[[coulomb_units_factor]]<br />
[[cull_spheres]]<br />
[[cylinder_shader_ff_workaround]]<br />
[[dash_color]]<br />
[[dash_gap]]<br />
[[dash_length]]<br />
[[dash_radius]]<br />
[[dash_round_ends]]<br />
[[dash_width]]<br />
[[debug_pick]]<br />
[[defer_builds_mode]]<br />
[[defer_updates]]<br />
[[depth_cue]]<br />
[[dihedral_color]]<br />
[[dihedral_label_position]]<br />
[[dihedral_size]]<br />
[[direct]]<br />
[[dist_counter]]<br />
[[distance_exclusion]]<br />
[[dot_color]]<br />
[[dot_density]]<br />
[[dot_hydrogens]]<br />
[[dot_lighting]]<br />
[[dot_mode]]<br />
[[dot_normals]]<br />
[[dot_radius]]<br />
[[dot_solvent]]<br />
[[dot_width]]<br />
[[draw_frames]]<br />
[[editor_auto_dihedral]]<br />
[[editor_auto_origin]]<br />
[[editor_label_fragments]]<br />
[[ellipsoid_color]]<br />
[[ellipsoid_probability]]<br />
[[ellipsoid_quality]]<br />
[[ellipsoid_scale]]<br />
[[ellipsoid_transparency]]<br />
[[fast_idle]]<br />
[[fetch_path]]<br />
[[field_of_view]]<br />
[[fit_iterations]]<br />
[[fit_tolerance]]<br />
[[float_labels]]<br />
[[fog]]<br />
[[fog_start]]<br />
[[frame]]<br />
[[full_screen]]<br />
[[gamma]]<br />
[[gaussian_b_adjust]]<br />
[[gaussian_b_floor]]<br />
[[gaussian_resolution]]<br />
[[geometry_export_mode]]<br />
[[gl_ambient]]<br />
[[gradient_max_length]]<br />
[[gradient_min_length]]<br />
[[gradient_min_slope]]<br />
[[gradient_normal_min_dot]]<br />
[[gradient_spacing]]<br />
[[gradient_step_size]]<br />
[[gradient_symmetry]]<br />
[[grid_max]]<br />
[[grid_mode]]<br />
[[grid_slot]]<br />
[[group_arrow_prefix]]<br />
[[group_auto_mode]]<br />
[[group_full_member_names]]<br />
[[h_bond_cone]]<br />
[[h_bond_cutoff_center]]<br />
[[h_bond_cutoff_edge]]<br />
[[h_bond_exclusion]]<br />
[[h_bond_from_proton]]<br />
[[h_bond_max_angle]]<br />
[[h_bond_power_a]]<br />
[[h_bond_power_b]]<br />
[[half_bonds]]<br />
[[hash_max]]<br />
[[hide_long_bonds]]<br />
[[hide_underscore_names]]<br />
[[idle_delay]]<br />
[[ignore_case]]<br />
[[ignore_pdb_segi]]<br />
[[image_copy_always]]<br />
[[image_dots_per_inch]]<br />
[[internal_feedback]]<br />
[[internal_gui]]<br />
[[internal_gui_control_size]]<br />
[[internal_gui_mode]]<br />
[[internal_gui_width]]<br />
[[internal_prompt]]<br />
[[isomesh_auto_state]]<br />
[[label_angle_digits]]<br />
[[label_color]]<br />
[[label_digits]]<br />
[[label_dihedral_digits]]<br />
[[label_distance_digits]]<br />
[[label_font_id]]<br />
[[label_outline_color]]<br />
[[label_position]]<br />
[[label_shadow_mode]]<br />
[[label_size]]<br />
[[legacy_mouse_zoom]]<br />
[[legacy_vdw_radii]]<br />
[[light]]<br />
[[light2]]<br />
[[light3]]<br />
[[light4]]<br />
[[light5]]<br />
[[light6]]<br />
[[light7]]<br />
[[light8]]<br />
[[light9]]<br />
[[light_count]]<br />
[[line_color]]<br />
[[line_radius]]<br />
[[line_smooth]]<br />
[[line_stick_helper]]<br />
[[line_width]]<br />
[[log_box_selections]]<br />
[[log_conformations]]<br />
[[logging]]<br />
[[map_auto_expand_sym]]<br />
[[matrix_mode]]<br />
[[max_threads]]<br />
[[max_triangles]]<br />
[[mesh_carve_cutoff]]<br />
[[mesh_carve_selection]]<br />
[[mesh_carve_state]]<br />
[[mesh_clear_cutoff]]<br />
[[mesh_clear_selection]]<br />
[[mesh_clear_state]]<br />
[[mesh_color]]<br />
[[mesh_cutoff]]<br />
[[mesh_grid_max]]<br />
[[mesh_lighting]]<br />
[[mesh_mode]]<br />
[[mesh_negative_color]]<br />
[[mesh_negative_visible]]<br />
[[mesh_normals]]<br />
[[mesh_quality]]<br />
[[mesh_radius]]<br />
[[mesh_skip]]<br />
[[mesh_solvent]]<br />
[[mesh_type]]<br />
[[mesh_width]]<br />
[[min_mesh_spacing]]<br />
[[moe_separate_chains]]<br />
[[mouse_grid]]<br />
[[mouse_limit]]<br />
[[mouse_restart_movie_delay]]<br />
[[mouse_scale]]<br />
[[mouse_selection_mode]]<br />
[[mouse_wheel_scale]]<br />
[[movie_animate_by_frame]]<br />
[[movie_delay]]<br />
[[movie_fps]]<br />
[[movie_loop]]<br />
[[movie_rock]]<br />
[[multiplex]]<br />
[[no_idle]]<br />
[[nonbonded_size]]<br />
[[nonbonded_transparency]]<br />
[[normal_workaround]]<br />
[[normalize_ccp4_maps]]<br />
[[normalize_grd_maps]]<br />
[[normalize_o_maps]]<br />
[[nvidia_bugs]]<br />
[[opaque_background]]<br />
[[orthoscopic]]<br />
[[overlay]]<br />
[[overlay_lines]]<br />
[[pdb_conect_all]]<br />
[[pdb_discrete_chains]]<br />
[[pdb_echo_tags]]<br />
[[pdb_formal_charges]]<br />
[[pdb_hetatm_guess_valences]]<br />
[[pdb_hetatm_sort]]<br />
[[pdb_honor_model_number]]<br />
[[pdb_insertions_go_first]]<br />
[[pdb_insure_orthogonal]]<br />
[[pdb_literal_names]]<br />
[[pdb_no_end_record]]<br />
[[pdb_reformat_names_mode]]<br />
[[pdb_retain_ids]]<br />
[[pdb_standard_order]]<br />
[[pdb_truncate_residue_name]]<br />
[[pdb_unbond_cations]]<br />
[[pdb_use_ter_records]]<br />
[[pickable]]<br />
[[png_file_gamma]]<br />
[[png_screen_gamma]]<br />
[[power]]<br />
[[pqr_no_chain_id]]<br />
[[presentation]]<br />
[[presentation_auto_quit]]<br />
[[presentation_auto_start]]<br />
[[presentation_mode]]<br />
[[preserve_chempy_ids]]<br />
[[pymol_space_max_blue]]<br />
[[pymol_space_max_green]]<br />
[[pymol_space_max_red]]<br />
[[pymol_space_min_factor]]<br />
[[raise_exceptions]]<br />
[[ramp_blend_nearby_colors]]<br />
[[rank_assisted_sorts]]<br />
[[ray_blend_blue]]<br />
[[ray_blend_colors]]<br />
[[ray_blend_green]]<br />
[[ray_blend_red]]<br />
[[ray_clip_shadows]]<br />
[[ray_color_ramps]]<br />
[[ray_default_renderer]]<br />
[[ray_direct_shade]]<br />
[[ray_hint_camera]]<br />
[[ray_hint_shadow]]<br />
[[ray_improve_shadows]]<br />
[[ray_interior_color]]<br />
[[ray_interior_mode]]<br />
[[ray_interior_reflect]]<br />
[[ray_interior_shadows]]<br />
[[ray_interior_texture]]<br />
[[ray_label_specular]]<br />
[[ray_legacy_lighting]]<br />
[[ray_max_passes]]<br />
[[ray_opaque_background]]<br />
[[ray_orthoscopic]]<br />
[[ray_oversample_cutoff]]<br />
[[ray_pixel_scale]]<br />
[[ray_scatter]]<br />
[[ray_shadow]]<br />
[[ray_shadow_decay_factor]]<br />
[[ray_shadow_decay_range]]<br />
[[ray_shadow_fudge]]<br />
[[ray_shadows]]<br />
[[ray_spec_local]]<br />
[[ray_texture]]<br />
[[ray_texture_settings]]<br />
[[ray_trace_color]]<br />
[[ray_trace_depth_factor]]<br />
[[ray_trace_disco_factor]]<br />
[[ray_trace_fog]]<br />
[[ray_trace_fog_start]]<br />
[[ray_trace_frames]]<br />
[[ray_trace_gain]]<br />
[[ray_trace_mode]]<br />
[[ray_trace_persist_cutoff]]<br />
[[ray_trace_slope_factor]]<br />
[[ray_trace_trans_cutoff]]<br />
[[ray_transparency_contrast]]<br />
[[ray_transparency_oblique]]<br />
[[ray_transparency_oblique_power]]<br />
[[ray_transparency_shadows]]<br />
[[ray_transparency_spec_cut]]<br />
[[ray_transparency_specular]]<br />
[[ray_triangle_fudge]]<br />
[[reflect]]<br />
[[reflect_power]]<br />
[[retain_order]]<br />
[[ribbon_color]]<br />
[[ribbon_nucleic_acid_mode]]<br />
[[ribbon_power]]<br />
[[ribbon_power_b]]<br />
[[ribbon_radius]]<br />
[[ribbon_sampling]]<br />
[[ribbon_side_chain_helper]]<br />
[[ribbon_smooth]]<br />
[[ribbon_throw]]<br />
[[ribbon_trace_atoms]]<br />
[[ribbon_width]]<br />
[[robust_logs]]<br />
[[rock]]<br />
[[rock_delay]]<br />
[[roving_byres]]<br />
[[roving_cartoon]]<br />
[[roving_delay]]<br />
[[roving_detail]]<br />
[[roving_isomesh]]<br />
[[roving_isosurface]]<br />
[[roving_labels]]<br />
[[roving_lines]]<br />
[[roving_map1_level]]<br />
[[roving_map1_name]]<br />
[[roving_map2_level]]<br />
[[roving_map2_name]]<br />
[[roving_map3_level]]<br />
[[roving_map3_name]]<br />
[[roving_nb_spheres]]<br />
[[roving_nonbonded]]<br />
[[roving_origin]]<br />
[[roving_origin_z]]<br />
[[roving_origin_z_cushion]]<br />
[[roving_polar_contacts]]<br />
[[roving_polar_cutoff]]<br />
[[roving_ribbon]]<br />
[[roving_selection]]<br />
[[roving_spheres]]<br />
[[roving_sticks]]<br />
[[scene_animation]]<br />
[[scene_animation_duration]]<br />
[[scene_buttons]]<br />
[[scene_buttons_mode]]<br />
[[scene_current_name]]<br />
[[scene_loop]]<br />
[[scene_restart_movie_delay]]<br />
[[scenes_changed]]<br />
[[sculpt_angl_weight]]<br />
[[sculpt_auto_center]]<br />
[[sculpt_avd_excl]]<br />
[[sculpt_avd_gap]]<br />
[[sculpt_avd_range]]<br />
[[sculpt_avd_weight]]<br />
[[sculpt_bond_weight]]<br />
[[sculpt_field_mask]]<br />
[[sculpt_hb_overlap]]<br />
[[sculpt_hb_overlap_base]]<br />
[[sculpt_line_weight]]<br />
[[sculpt_max_max]]<br />
[[sculpt_max_min]]<br />
[[sculpt_max_scale]]<br />
[[sculpt_max_weight]]<br />
[[sculpt_memory]]<br />
[[sculpt_min_max]]<br />
[[sculpt_min_min]]<br />
[[sculpt_min_scale]]<br />
[[sculpt_min_weight]]<br />
[[sculpt_nb_interval]]<br />
[[sculpt_plan_weight]]<br />
[[sculpt_pyra_weight]]<br />
[[sculpt_tors_tolerance]]<br />
[[sculpt_tors_weight]]<br />
[[sculpt_tri_max]]<br />
[[sculpt_tri_min]]<br />
[[sculpt_tri_mode]]<br />
[[sculpt_tri_scale]]<br />
[[sculpt_tri_weight]]<br />
[[sculpt_vdw_scale]]<br />
[[sculpt_vdw_scale14]]<br />
[[sculpt_vdw_vis_max]]<br />
[[sculpt_vdw_vis_mid]]<br />
[[sculpt_vdw_vis_min]]<br />
[[sculpt_vdw_vis_mode]]<br />
[[sculpt_vdw_weight]]<br />
[[sculpt_vdw_weight14]]<br />
[[sculpting]]<br />
[[sculpting_cycles]]<br />
[[sdof_drag_scale]]<br />
[[secondary_structure]]<br />
[[security]]<br />
[[sel_counter]]<br />
[[selection_overlay]]<br />
[[selection_round_points]]<br />
[[selection_visible_only]]<br />
[[selection_width]]<br />
[[selection_width_max]]<br />
[[selection_width_scale]]<br />
[[seq_view]]<br />
[[seq_view_alignment]]<br />
[[seq_view_color]]<br />
[[seq_view_discrete_by_state]]<br />
[[seq_view_fill_char]]<br />
[[seq_view_fill_color]]<br />
[[seq_view_format]]<br />
[[seq_view_label_color]]<br />
[[seq_view_label_mode]]<br />
[[seq_view_label_spacing]]<br />
[[seq_view_label_start]]<br />
[[seq_view_location]]<br />
[[seq_view_overlay]]<br />
[[seq_view_unaligned_color]]<br />
[[seq_view_unaligned_mode]]<br />
[[session_cache_optimize]]<br />
[[session_changed]]<br />
[[session_compression]]<br />
[[session_file]]<br />
[[session_migration]]<br />
[[session_version_check]]<br />
[[shininess]]<br />
[[show_alpha_checker]]<br />
[[show_progress]]<br />
[[simplify_display_lists]]<br />
[[single_image]]<br />
[[slice_dynamic_grid]]<br />
[[slice_dynamic_grid_resolution]]<br />
[[slice_grid]]<br />
[[slice_height_map]]<br />
[[slice_height_scale]]<br />
[[slice_track_camera]]<br />
[[slow_idle]]<br />
[[smooth_color_triangle]]<br />
[[solvent_radius]]<br />
[[spec_count]]<br />
[[spec_direct]]<br />
[[spec_direct_power]]<br />
[[spec_power]]<br />
[[spec_reflect]]<br />
[[specular]]<br />
[[specular_intensity]]<br />
[[sphere_color]]<br />
[[sphere_mode]]<br />
[[sphere_point_max_size]]<br />
[[sphere_point_size]]<br />
[[sphere_quality]]<br />
[[sphere_scale]]<br />
[[sphere_solvent]]<br />
[[sphere_transparency]]<br />
[[spheroid_fill]]<br />
[[spheroid_scale]]<br />
[[spheroid_smooth]]<br />
[[ss_helix_phi_exclude]]<br />
[[ss_helix_phi_include]]<br />
[[ss_helix_phi_target]]<br />
[[ss_helix_psi_exclude]]<br />
[[ss_helix_psi_include]]<br />
[[ss_helix_psi_target]]<br />
[[ss_strand_phi_exclude]]<br />
[[ss_strand_phi_include]]<br />
[[ss_strand_phi_target]]<br />
[[ss_strand_psi_exclude]]<br />
[[ss_strand_psi_include]]<br />
[[ss_strand_psi_target]]<br />
[[state]]<br />
[[static_singletons]]<br />
[[stereo]]<br />
[[stereo_angle]]<br />
[[stereo_double_pump_mono]]<br />
[[stereo_mode]]<br />
[[stereo_shift]]<br />
[[stick_ball]]<br />
[[stick_ball_ratio]]<br />
[[stick_color]]<br />
[[stick_fixed_radius]]<br />
[[stick_nub]]<br />
[[stick_overlap]]<br />
[[stick_quality]]<br />
[[stick_radius]]<br />
[[stick_transparency]]<br />
[[stick_valence_scale]]<br />
[[stop_on_exceptions]]<br />
[[suppress_hidden]]<br />
[[surface_best]]<br />
[[surface_carve_cutoff]]<br />
[[surface_carve_normal_cutoff]]<br />
[[surface_carve_selection]]<br />
[[surface_carve_state]]<br />
[[surface_cavity_cutoff]]<br />
[[surface_cavity_mode]]<br />
[[surface_cavity_radius]]<br />
[[surface_circumscribe]]<br />
[[surface_clear_cutoff]]<br />
[[surface_clear_selection]]<br />
[[surface_clear_state]]<br />
[[surface_color]]<br />
[[surface_debug]]<br />
[[surface_miserable]]<br />
[[surface_mode]]<br />
[[surface_negative_color]]<br />
[[surface_negative_visible]]<br />
[[surface_normal]]<br />
[[surface_optimize_subsets]]<br />
[[surface_poor]]<br />
[[surface_proximity]]<br />
[[surface_quality]]<br />
[[surface_ramp_above_mode]]<br />
[[surface_solvent]]<br />
[[surface_trim_cutoff]]<br />
[[surface_trim_factor]]<br />
[[surface_type]]<br />
[[suspend_updates]]<br />
[[swap_dsn6_bytes]]<br />
[[sweep_angle]]<br />
[[sweep_mode]]<br />
[[sweep_phase]]<br />
[[sweep_speed]]<br />
[[test1]]<br />
[[test2]]<br />
[[text]]<br />
[[texture_fonts]]<br />
[[trace_atoms_mode]]<br />
[[transparency]]<br />
[[transparency_global_sort]]<br />
[[transparency_mode]]<br />
[[transparency_picking_mode]]<br />
[[triangle_max_passes]]<br />
[[trim_dots]]<br />
[[two_sided_lighting]]<br />
[[use_display_lists]]<br />
[[valence]]<br />
[[valence_default]]<br />
[[valence_size]]<br />
[[validate_object_names]]<br />
[[virtual_trackball]]<br />
[[wildcard]]<br />
[[wizard_prompt_mode]]<br />
[[wrap_output]]<br />
<br />
[[Category:Settings|All Settings]]</div>TakanoriNakanehttps://pymolwiki.org/index.php?title=Get_session&diff=10553Get session2012-02-22T14:49:55Z<p>TakanoriNakane: Description of top-level structure</p>
<hr />
<div>Returns a dictionary representation the currently loaded PyMOL session.The session file (.pse) is a compressed version of its output. <br />
<br />
By using this API, user scripts can access many interesting properties which are otherwise inaccessible. Examples include [[Pymol2glmol]] and [[get_raw_distances]] scripts.<br />
<br />
WARNING: This API is undocumented API, intended for internal use. Use it only when it is necessary.<br />
<br />
= Usage =<br />
<source lang="python"><br />
# get the session as a dictionary<br />
print cmd.get_session()<br />
</source><br />
<br />
= Return value =<br />
<br />
The returned dictionary has following key-value pairs.<br />
<br />
:main: An array encoding window size. For example, [640, 480]<br />
<br />
:color_ext:<br />
<br />
:settings: An array of PyMOL's global settings. They are dumped by SettingAsPyList in layer1/Setting.c. Further details will not be discussed because scripts can access these values from [[get|cmd.get]] API.<br />
<br />
:colors: If you have defined color names by [[Set Color]], they are described here. Default color names (red, blue, etc...) will not appear. This dict can also be obtained by [[Get Color Indices|cmd.get_color_indices()]]. To get RGB definition of a color, get its pallet ID by cmd.get_color_index and convert it to RGB tuple by cmd.get_color_tuple.<br />
<br />
:view: Same as [[Get View|cmd.get_view()]]<br />
<br />
:version: Version number of PyMOL<br />
<br />
:view_dict: <br />
<br />
:names: This is the most complex but interesting part. Produced by ExecutiveGetNamedEntries, this array describes internal C-objects of the current session. Each element is an array of five elements. <br />
<br />
<br />
(documentation in progress... Please feel free to expand)<br />
<br />
[[Category:Commands]]</div>TakanoriNakane