<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.pymol.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Sbliven</id>
	<title>PyMOL Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.pymol.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Sbliven"/>
	<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php/Special:Contributions/Sbliven"/>
	<updated>2026-05-05T02:22:43Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Get_Names&amp;diff=13470</id>
		<title>Get Names</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Get_Names&amp;diff=13470"/>
		<updated>2016-02-19T15:31:53Z</updated>

		<summary type="html">&lt;p&gt;Sbliven: Updating argument list&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''get_names''' returns a list of object and/or selection names.&lt;br /&gt;
&lt;br /&gt;
===PYMOL API===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
cmd.get_names(type,enabled_only,selection)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ARGUMENTS===&lt;br /&gt;
* '''type : string''' determines the type of objects to be returned. It can take any of the following values:&lt;br /&gt;
** '''objects''' Structure objects&lt;br /&gt;
** '''selections''' All selection&lt;br /&gt;
** '''all''' Objects and Selections&lt;br /&gt;
** '''public_objects''' (default)&lt;br /&gt;
** '''public_selections'''&lt;br /&gt;
** '''public_nongroup_objects'''&lt;br /&gt;
** '''public_group_objects'''&lt;br /&gt;
** '''nongroup_objects'''&lt;br /&gt;
** '''group_objects'''&lt;br /&gt;
* '''enabled_only : boolean''' If 1, only enabled objects are returned. Default 0 (all objects)&lt;br /&gt;
* '''selection'''&lt;br /&gt;
===NOTES===&lt;br /&gt;
The default behavior is to return only object names.&lt;br /&gt;
&lt;br /&gt;
=== EXAMPLES ===&lt;br /&gt;
Multiple alignments&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# structure align all proteins in PyMOL to the protein named &amp;quot;PROT&amp;quot;.  Effectively a &lt;br /&gt;
# poor multiple method for multiple structure alignment.&lt;br /&gt;
for x in cmd.get_names(&amp;quot;all&amp;quot;): cealign( &amp;quot;PROT&amp;quot;, x)&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
&lt;br /&gt;
Determine whether or not an object (objName) is enabled:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
if objName in cmd.get_names(enabled_only=1):&lt;br /&gt;
    print objName, &amp;quot;is enabled&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SEE ALSO===&lt;br /&gt;
[[get_type]], [[get_names_of_type]], [[count_atoms]], [[count_states]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Commands|Get Names]]&lt;/div&gt;</summary>
		<author><name>Sbliven</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Talk:SuperSym&amp;diff=13439</id>
		<title>Talk:SuperSym</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Talk:SuperSym&amp;diff=13439"/>
		<updated>2016-01-13T12:08:52Z</updated>

		<summary type="html">&lt;p&gt;Sbliven: /* this script does not work */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Wow, nice contribution.  If it's this large, can you package it up in a tar/zip file for easier download?&lt;br /&gt;
[[User:Inchoate|Tree]] 23:02, 1 September 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
FYI, PyMOLWiki pages see more action and downloads when they have images/screenshots of what is being offered.  Just a hint.&lt;br /&gt;
[[User:Inchoate|Tree]] 15:34, 18 September 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
== this script does not work ==&lt;br /&gt;
&lt;br /&gt;
I am running a six month old laptop with Windows 7. I have installed Python 3.1, cctbx and numpy 1.5 and this script still will not run at all. It keeps quitting saying &amp;quot;OOOPs&amp;quot; please install cctbx and numpy, which I can clearly see are installed. This script clearly needs more work.&lt;br /&gt;
&lt;br /&gt;
: I was also unable to get this plugin working with a resonable amount of effort. The cctbx python modules are available using the cctbx-python script, but I was unable to get PyMOL to launch from that python environment. --[[User:Sbliven|Sbliven]] ([[User talk:Sbliven|talk]]) 12:08, 13 January 2016 (UTC)&lt;/div&gt;</summary>
		<author><name>Sbliven</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Flatten_obj&amp;diff=13310</id>
		<title>Flatten obj</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Flatten_obj&amp;diff=13310"/>
		<updated>2015-11-03T13:29:20Z</updated>

		<summary type="html">&lt;p&gt;Sbliven: Removing incorrect API section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox script-repo&lt;br /&gt;
|type      = script&lt;br /&gt;
|filename  = flatten_obj.py&lt;br /&gt;
|author    = [[User:sbliven|Spencer Bliven]]&lt;br /&gt;
|license   = Public Domain&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;flatten_obj&amp;lt;/code&amp;gt; python script combines multiple objects or states into a single object,&lt;br /&gt;
renaming chains where required.&lt;br /&gt;
&lt;br /&gt;
This is particularly useful for dealing with biological assemblies, which are&lt;br /&gt;
loaded as multi-state objects when fetched using &amp;lt;code&amp;gt;[[fetch]] PDBID, type=pdb1&amp;lt;/code&amp;gt;. It&lt;br /&gt;
can also be used as a quick way to combine multiple objects without causing&lt;br /&gt;
collisions between chain identifiers.&lt;br /&gt;
&lt;br /&gt;
The command re-letters chains to avoid collisions. Older versions of PyMOL&lt;br /&gt;
restrict the chain id to a single character, so the script will fail for&lt;br /&gt;
assemblies with &amp;gt;62 chains. With more recent versions, this problem is solved&lt;br /&gt;
with multi-character chain IDs. Several options are available for how&lt;br /&gt;
re-lettering should occur.&lt;br /&gt;
&lt;br /&gt;
= Usage =&lt;br /&gt;
&lt;br /&gt;
    flatten_obj name, selection[, state[, rename[, quiet[, chain_map]]]]&lt;br /&gt;
&lt;br /&gt;
= Arguments =&lt;br /&gt;
&lt;br /&gt;
* name = a unique name for the flattened object {default: flat}&lt;br /&gt;
&lt;br /&gt;
* selection = the set of objects to include in the flattening. The selection will be expanded to include all atoms of objects. {default: all}&lt;br /&gt;
&lt;br /&gt;
* state = the source state to select. Use 0 or -1 to flatten all states {default: 0}&lt;br /&gt;
&lt;br /&gt;
* rename = The scheme to use for renaming chains: {default: 0}&lt;br /&gt;
** (0) preserve chains IDs where possible, rename other chains alphabetically&lt;br /&gt;
** (1) rename all chains alphabetically&lt;br /&gt;
** (2) rename chains using the original chain letter, object name, and state&lt;br /&gt;
&lt;br /&gt;
* quiet = If set to 0, print some additional information about progress and chain renaming {default: 1}&lt;br /&gt;
&lt;br /&gt;
* chain_map = An attribute name for the 'stored' scratch object. If specified, `stored.&amp;lt;chain_map&amp;gt;` will be populated with a dictionary mapping the new chain names to a tuple giving the originated object, state, and chainID. {default: &amp;quot;&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
= Notes = &lt;br /&gt;
&lt;br /&gt;
Like the select command, if name is omitted then the default object name&lt;br /&gt;
(&amp;quot;flat&amp;quot;) is used as the name argument.&lt;br /&gt;
&lt;br /&gt;
Chain renaming is tricky. PDB files originally limited chains to single&lt;br /&gt;
letter identifiers containing [A-Za-z0-9]. When this was found to be&lt;br /&gt;
limiting, multi-letter chains (ideally &amp;lt; 4 chars) were allowed. This is&lt;br /&gt;
supported as of PyMOL 1.7. Earlier versions do not accept rename=2, and&lt;br /&gt;
will raise an exception when flattening a structure with more than 62&lt;br /&gt;
chains.&lt;br /&gt;
&lt;br /&gt;
= Examples = &lt;br /&gt;
&lt;br /&gt;
    flatten_obj flat, nmrObj&lt;br /&gt;
    flatten_obj ( obj1 or obj2 )&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
&lt;br /&gt;
* [[split_states]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Script_Library]] [[Category:ObjSel_Scripts]]&lt;/div&gt;</summary>
		<author><name>Sbliven</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Flatten_obj&amp;diff=13309</id>
		<title>Flatten obj</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Flatten_obj&amp;diff=13309"/>
		<updated>2015-10-30T15:59:00Z</updated>

		<summary type="html">&lt;p&gt;Sbliven: Replacing code with github link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox script-repo&lt;br /&gt;
|type      = script&lt;br /&gt;
|filename  = flatten_obj.py&lt;br /&gt;
|author    = [[User:sbliven|Spencer Bliven]]&lt;br /&gt;
|license   = Public Domain&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;flatten_obj&amp;lt;/code&amp;gt; python script combines multiple objects or states into a single object,&lt;br /&gt;
renaming chains where required.&lt;br /&gt;
&lt;br /&gt;
This is particularly useful for dealing with biological assemblies, which are&lt;br /&gt;
loaded as multi-state objects when fetched using &amp;lt;code&amp;gt;[[fetch]] PDBID, type=pdb1&amp;lt;/code&amp;gt;. It&lt;br /&gt;
can also be used as a quick way to combine multiple objects without causing&lt;br /&gt;
collisions between chain identifiers.&lt;br /&gt;
&lt;br /&gt;
The command re-letters chains to avoid collisions. Older versions of PyMOL&lt;br /&gt;
restrict the chain id to a single character, so the script will fail for&lt;br /&gt;
assemblies with &amp;gt;62 chains. With more recent versions, this problem is solved&lt;br /&gt;
with multi-character chain IDs. Several options are available for how&lt;br /&gt;
re-lettering should occur.&lt;br /&gt;
&lt;br /&gt;
= Usage =&lt;br /&gt;
&lt;br /&gt;
    flatten_obj name, selection[, state[, rename[, quiet[, chain_map]]]]&lt;br /&gt;
&lt;br /&gt;
= Arguments =&lt;br /&gt;
&lt;br /&gt;
* name = a unique name for the flattened object {default: flat}&lt;br /&gt;
&lt;br /&gt;
* selection = the set of objects to include in the flattening. The selection will be expanded to include all atoms of objects. {default: all}&lt;br /&gt;
&lt;br /&gt;
* state = the source state to select. Use 0 or -1 to flatten all states {default: 0}&lt;br /&gt;
&lt;br /&gt;
* rename = The scheme to use for renaming chains: {default: 0}&lt;br /&gt;
** (0) preserve chains IDs where possible, rename other chains alphabetically&lt;br /&gt;
** (1) rename all chains alphabetically&lt;br /&gt;
** (2) rename chains using the original chain letter, object name, and state&lt;br /&gt;
&lt;br /&gt;
* quiet = If set to 0, print some additional information about progress and chain renaming {default: 1}&lt;br /&gt;
&lt;br /&gt;
* chain_map = An attribute name for the 'stored' scratch object. If specified, `stored.&amp;lt;chain_map&amp;gt;` will be populated with a dictionary mapping the new chain names to a tuple giving the originated object, state, and chainID. {default: &amp;quot;&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
= Notes = &lt;br /&gt;
&lt;br /&gt;
Like the select command, if name is omitted then the default object name&lt;br /&gt;
(&amp;quot;flat&amp;quot;) is used as the name argument.&lt;br /&gt;
&lt;br /&gt;
Chain renaming is tricky. PDB files originally limited chains to single&lt;br /&gt;
letter identifiers containing [A-Za-z0-9]. When this was found to be&lt;br /&gt;
limiting, multi-letter chains (ideally &amp;lt; 4 chars) were allowed. This is&lt;br /&gt;
supported as of PyMOL 1.7. Earlier versions do not accept rename=2, and&lt;br /&gt;
will raise an exception when flattening a structure with more than 62&lt;br /&gt;
chains.&lt;br /&gt;
&lt;br /&gt;
= Examples = &lt;br /&gt;
&lt;br /&gt;
    flatten_obj flat, nmrObj&lt;br /&gt;
    flatten_obj ( obj1 or obj2 )&lt;br /&gt;
&lt;br /&gt;
= PyMol API =&lt;br /&gt;
&lt;br /&gt;
    cmd.flatten_obj(string name, string selection)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
&lt;br /&gt;
* [[split_states]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Script_Library]] [[Category:ObjSel_Scripts]]&lt;/div&gt;</summary>
		<author><name>Sbliven</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Flatten_obj&amp;diff=13108</id>
		<title>Flatten obj</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Flatten_obj&amp;diff=13108"/>
		<updated>2015-10-30T14:15:33Z</updated>

		<summary type="html">&lt;p&gt;Sbliven: Creating page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox script-repo&lt;br /&gt;
|type      = script&lt;br /&gt;
|download  = Submitted to the [[Git_intro|Pymol-script-repo]] as flatten_obj.py&lt;br /&gt;
|author    = [[User:sbliven|Spencer Bliven]]&lt;br /&gt;
|license   = Public Domain&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
= Description =&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;flatten_obj&amp;lt;/code&amp;gt; python script combines multiple objects or states into a single object,&lt;br /&gt;
renaming chains where required.&lt;br /&gt;
&lt;br /&gt;
This is particularly useful for dealing with biological assemblies, which are&lt;br /&gt;
loaded as multi-state objects when fetched using &amp;lt;code&amp;gt;[[fetch]] PDBID, type=pdb1&amp;lt;/code&amp;gt;. It&lt;br /&gt;
can also be used as a quick way to combine multiple objects without causing&lt;br /&gt;
collisions between chain identifiers.&lt;br /&gt;
&lt;br /&gt;
The command re-letters chains to avoid collisions. Older versions of PyMOL&lt;br /&gt;
restrict the chain id to a single character, so the script will fail for&lt;br /&gt;
assemblies with &amp;gt;62 chains. With more recent versions, this problem is solved&lt;br /&gt;
with multi-character chain IDs. Several options are available for how&lt;br /&gt;
re-lettering should occur.&lt;br /&gt;
&lt;br /&gt;
= Usage =&lt;br /&gt;
&lt;br /&gt;
    flatten_obj name, selection[, state[, rename[, quiet[, chain_map]]]]&lt;br /&gt;
&lt;br /&gt;
= Arguments =&lt;br /&gt;
&lt;br /&gt;
* name = a unique name for the flattened object {default: flat}&lt;br /&gt;
&lt;br /&gt;
* selection = the set of objects to include in the flattening. The selection will be expanded to include all atoms of objects. {default: all}&lt;br /&gt;
&lt;br /&gt;
* state = the source state to select. Use 0 or -1 to flatten all states {default: 0}&lt;br /&gt;
&lt;br /&gt;
* rename = The scheme to use for renaming chains: {default: 0}&lt;br /&gt;
** (0) preserve chains IDs where possible, rename other chains alphabetically&lt;br /&gt;
** (1) rename all chains alphabetically&lt;br /&gt;
** (2) rename chains using the original chain letter, object name, and state&lt;br /&gt;
&lt;br /&gt;
* quiet = If set to 0, print some additional information about progress and chain renaming {default: 1}&lt;br /&gt;
&lt;br /&gt;
* chain_map = An attribute name for the 'stored' scratch object. If specified, `stored.&amp;lt;chain_map&amp;gt;` will be populated with a dictionary mapping the new chain names to a tuple giving the originated object, state, and chainID. {default: &amp;quot;&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
= Notes = &lt;br /&gt;
&lt;br /&gt;
Like the select command, if name is omitted then the default object name&lt;br /&gt;
(&amp;quot;flat&amp;quot;) is used as the name argument.&lt;br /&gt;
&lt;br /&gt;
Chain renaming is tricky. PDB files originally limited chains to single&lt;br /&gt;
letter identifiers containing [A-Za-z0-9]. When this was found to be&lt;br /&gt;
limiting, multi-letter chains (ideally &amp;lt; 4 chars) were allowed. This is&lt;br /&gt;
supported as of PyMOL 1.7. Earlier versions do not accept rename=2, and&lt;br /&gt;
will raise an exception when flattening a structure with more than 62&lt;br /&gt;
chains.&lt;br /&gt;
&lt;br /&gt;
= Examples = &lt;br /&gt;
&lt;br /&gt;
    flatten_obj flat, nmrObj&lt;br /&gt;
    flatten_obj ( obj1 or obj2 )&lt;br /&gt;
&lt;br /&gt;
= PyMol API =&lt;br /&gt;
&lt;br /&gt;
    cmd.flatten_obj(string name, string selection)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Code =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
flatten_obj.py - Flatten multi-state pymol objects into a single state.&lt;br /&gt;
&lt;br /&gt;
This is particularly useful for dealing with biological assemblies, which are&lt;br /&gt;
loaded as multi-state objects when fetched using `fetch PDBID, type=pdb1`. It&lt;br /&gt;
can also be used as a quick way to combine multiple objects without causing&lt;br /&gt;
collisions between chain identifiers.&lt;br /&gt;
&lt;br /&gt;
The command re-letters chains to avoid collisions. Older versions of PyMOL&lt;br /&gt;
restrict the chain id to a single character, so the script will fail for&lt;br /&gt;
assemblies with &amp;gt;62 chains. With more recent versions, this problem is solved&lt;br /&gt;
with multi-character chain IDs. Several options are available for how&lt;br /&gt;
re-lettering should occur.&lt;br /&gt;
&lt;br /&gt;
Author: Spencer Bliven &amp;lt;spencer.bliven@gmail.com&amp;gt;&lt;br /&gt;
Date: October 30, 2015&lt;br /&gt;
Version: 1.0&lt;br /&gt;
License: Public Domain&lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
from pymol import cmd, stored&lt;br /&gt;
import re&lt;br /&gt;
try:&lt;br /&gt;
    from collections import OrderedDict&lt;br /&gt;
    _orderedDict = True&lt;br /&gt;
except ImportError:&lt;br /&gt;
    _orderedDict = False&lt;br /&gt;
&lt;br /&gt;
# PyMOL 1.7.4 introduces support for multi-letter chains, so we can afford to&lt;br /&gt;
# use a smaller alphabet. In earlier versions, use lower-case letters if needed&lt;br /&gt;
# (requires running `set ignore_case, 0`)&lt;br /&gt;
_long_chains = cmd.get_version()[1] &amp;gt;= 1.74&lt;br /&gt;
_default_base = 36 if _long_chains else 62&lt;br /&gt;
&lt;br /&gt;
class OutOfChainsError(Exception):&lt;br /&gt;
    def __init__(self,msg):&lt;br /&gt;
        self.msg=msg&lt;br /&gt;
    def __str__(self):&lt;br /&gt;
        return str(self.msg)&lt;br /&gt;
&lt;br /&gt;
class ChainSet(object):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    Base class for various methods to rename chains&lt;br /&gt;
&lt;br /&gt;
    Contains _chains, which maps from the renamed chain to a tuple with the&lt;br /&gt;
    original (object,state,chain). All dict-like accessors work on ChainSets,&lt;br /&gt;
    e.g.&lt;br /&gt;
        chain_set[&amp;quot;A&amp;quot;] -&amp;gt; (&amp;quot;obj&amp;quot;,1,&amp;quot;A&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    def __init__(self):&lt;br /&gt;
        # Use an OrderedDict in Python &amp;gt;= 1.7 for better printing&lt;br /&gt;
        if _orderedDict:&lt;br /&gt;
            self._chains = OrderedDict()&lt;br /&gt;
        else:&lt;br /&gt;
            self._chains = dict()&lt;br /&gt;
&lt;br /&gt;
    def map_chain(self, obj, state, origChain ):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        map_chain(string obj,int state, string chain]]) -&amp;gt; string&lt;br /&gt;
&lt;br /&gt;
        Maps a chain letter to a unique chainID. Results are unique within each&lt;br /&gt;
        instance, and can be used as keys on this chain set.&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        raise NotImplementedError(&amp;quot;Base class&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    # delegate most methods to _chains&lt;br /&gt;
    def __getattr__(self,at):&lt;br /&gt;
        if at in &amp;quot;pop popitem update setdefault&amp;quot;.split():&lt;br /&gt;
            raise AttributeError(&amp;quot;type object '%s' has no attribute '%s'&amp;quot;%(type(self),at))&lt;br /&gt;
        return getattr(self._chains,at)&lt;br /&gt;
    def __cmp__(self,other):    return self._chains.__cmp__(other)&lt;br /&gt;
    def __eq__(self,other):     return self._chains.__eq__(other)&lt;br /&gt;
    def __ge__(self,other):     return self._chains.__ge__(other)&lt;br /&gt;
    def __gt__(self,other):     return self._chains.__gt__(other)&lt;br /&gt;
    def __le__(self,other):     return self._chains.__le__(other)&lt;br /&gt;
    def __lt__(self,other):     return self._chains.__lt__(other)&lt;br /&gt;
    def __ne__(self,other):     return self._chains.__ne__(other)&lt;br /&gt;
    def __len__(self):          return self._chains.__len__()&lt;br /&gt;
    def __contains__(self,key): return self._chains.__contains__(key)&lt;br /&gt;
    def __getitem__(self,key):  return self._chains.__getitem__(key)&lt;br /&gt;
    def __iter__(self):         return self._chains.__iter__()&lt;br /&gt;
    def __str__(self):          return str(self._chains)&lt;br /&gt;
&lt;br /&gt;
    @staticmethod&lt;br /&gt;
    def _int_to_chain(i,base=_default_base):&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        _int_to_chain(int,int) -&amp;gt; str&lt;br /&gt;
&lt;br /&gt;
        Converts a positive integer to a chain ID. Chain IDs include uppercase&lt;br /&gt;
        characters, numbers, and optionally lowercase letters.&lt;br /&gt;
&lt;br /&gt;
        i = a positive integer to convert&lt;br /&gt;
        base = the alphabet size to include. Typically 36 or 62.&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        if i &amp;lt; 0:&lt;br /&gt;
            raise ValueError(&amp;quot;positive integers only&amp;quot;)&lt;br /&gt;
        if base &amp;lt; 0 or 62 &amp;lt; base:&lt;br /&gt;
            raise ValueError(&amp;quot;Invalid base&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
        quot = int(i)/base&lt;br /&gt;
        rem = i%base&lt;br /&gt;
        if rem &amp;lt; 26:&lt;br /&gt;
            letter = chr( ord(&amp;quot;A&amp;quot;) + rem)&lt;br /&gt;
        elif rem &amp;lt; 36:&lt;br /&gt;
            letter = str( rem-26)&lt;br /&gt;
        else:&lt;br /&gt;
            letter = chr( ord(&amp;quot;a&amp;quot;) + rem - 36)&lt;br /&gt;
        if quot == 0:&lt;br /&gt;
            return letter&lt;br /&gt;
        else:&lt;br /&gt;
            return ChainSet._int_to_chain(quot-1,base) + letter&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
class DefaultChainSet(ChainSet):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    Avoids relettering chains if possible. If a chain has been used, uses the&lt;br /&gt;
    next available chain letter. Note that this can potentially lead to&lt;br /&gt;
    cascading renames, e.g. if chains are sorted alphabetically rather than by&lt;br /&gt;
    object.&lt;br /&gt;
&lt;br /&gt;
    Used for rename = 0.&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    def __init__(self):&lt;br /&gt;
        super(DefaultChainSet,self).__init__()&lt;br /&gt;
        self._next_chain = 0&lt;br /&gt;
    def map_chain(self, obj, state, origChain ):&lt;br /&gt;
        # Keep _next_chain up-to-date&lt;br /&gt;
        while ChainSet._int_to_chain(self._next_chain) in self:&lt;br /&gt;
            self._next_chain += 1&lt;br /&gt;
        # Map this chain&lt;br /&gt;
        if origChain in self:&lt;br /&gt;
            # Rename&lt;br /&gt;
            next_chain = ChainSet._int_to_chain(self._next_chain)&lt;br /&gt;
            self._next_chain += 1&lt;br /&gt;
        else:&lt;br /&gt;
            next_chain = origChain&lt;br /&gt;
        self._chains[next_chain] = (obj,state,origChain)&lt;br /&gt;
        return next_chain&lt;br /&gt;
&lt;br /&gt;
class SequentialChainSet(ChainSet):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    Renumbers all chains starting at A, continuing through the capital letters&lt;br /&gt;
    and numbers, and then adding additional letters through 9999 (the last&lt;br /&gt;
    valid chain for mmCIF) and beyond.&lt;br /&gt;
&lt;br /&gt;
    Used for rename=1&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    def __init__(self):&lt;br /&gt;
        super(SequentialChainSet,self).__init__()&lt;br /&gt;
        self._next_chain = 0&lt;br /&gt;
&lt;br /&gt;
    def map_chain(self, obj, state, origChain ):&lt;br /&gt;
        next_chain = ChainSet._int_to_chain(self._next_chain)&lt;br /&gt;
        self._chains[next_chain] = (obj,state,origChain)&lt;br /&gt;
        self._next_chain += 1&lt;br /&gt;
        return next_chain&lt;br /&gt;
&lt;br /&gt;
class LongChainSet(ChainSet):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    Uses long strings for the chain names. Chains are renamed like&lt;br /&gt;
    &amp;quot;%s_%s_%04d&amp;quot;%(original_chainid,objectname,state).&lt;br /&gt;
&lt;br /&gt;
    Used for rename=2&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    def map_chain(self, obj, state, origChain ):&lt;br /&gt;
        ch = &amp;quot;%s_%s_%04d&amp;quot;%(origChain,obj,state)&lt;br /&gt;
        if self.has_key(ch):&lt;br /&gt;
            raise ValueError(&amp;quot;Duplicate chain %s&amp;quot;%(ch))&lt;br /&gt;
        self._chains[ch] = (obj,state,origChain)&lt;br /&gt;
        return ch&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def flatten_obj(name=&amp;quot;&amp;quot;,selection=&amp;quot;&amp;quot;,state=0,rename=0,quiet=1,chain_map=&amp;quot;&amp;quot;):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
DESCRIPTION&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;flatten_obj&amp;quot; combines multiple objects or states into a single object,&lt;br /&gt;
    renaming chains where required&lt;br /&gt;
&lt;br /&gt;
USAGE&lt;br /&gt;
&lt;br /&gt;
    flatten_obj name, selection[, state[, rename[, quiet[, chain_map]]]]&lt;br /&gt;
&lt;br /&gt;
ARGUMENTS&lt;br /&gt;
&lt;br /&gt;
    name = a unique name for the flattened object {default: flat}&lt;br /&gt;
&lt;br /&gt;
    selection = the set of objects to include in the flattening. The selection&lt;br /&gt;
        will be expanded to include all atoms of objects. {default: all}&lt;br /&gt;
&lt;br /&gt;
    state = the source state to select. Use 0 or -1 to flatten all states {default: 0}&lt;br /&gt;
&lt;br /&gt;
    rename = The scheme to use for renaming chains: {default: 0}&lt;br /&gt;
        (0) preserve chains IDs where possible, rename other chains&lt;br /&gt;
            alphabetically&lt;br /&gt;
        (1) rename all chains alphabetically&lt;br /&gt;
        (2) rename chains using the original chain letter, object name, and state&lt;br /&gt;
&lt;br /&gt;
    quiet = If set to 0, print some additional information about progress and&lt;br /&gt;
        chain renaming {default: 1}&lt;br /&gt;
&lt;br /&gt;
    chain_map = An attribute name for the 'stored' scratch object. If&lt;br /&gt;
        specified, `stored.&amp;lt;chain_map&amp;gt;` will be populated with a dictionary&lt;br /&gt;
        mapping the new chain names to a tuple giving the originated object,&lt;br /&gt;
        state, and chainID. {default: &amp;quot;&amp;quot;}&lt;br /&gt;
&lt;br /&gt;
NOTES&lt;br /&gt;
&lt;br /&gt;
    Like the select command, if name is omitted then the default object name&lt;br /&gt;
    (&amp;quot;flat&amp;quot;) is used as the name argument.&lt;br /&gt;
&lt;br /&gt;
    Chain renaming is tricky. PDB files originally limited chains to single&lt;br /&gt;
    letter identifiers containing [A-Za-z0-9]. When this was found to be&lt;br /&gt;
    limiting, multi-letter chains (ideally &amp;lt; 4 chars) were allowed. This is&lt;br /&gt;
    supported as of PyMOL 1.7. Earlier versions do not accept rename=2, and&lt;br /&gt;
    will raise an exception when flattening a structure with more than 62&lt;br /&gt;
    chains.&lt;br /&gt;
&lt;br /&gt;
EXAMPLES&lt;br /&gt;
&lt;br /&gt;
    flatten_obj flat, nmrObj&lt;br /&gt;
    flatten_obj ( obj1 or obj2 )&lt;br /&gt;
&lt;br /&gt;
PYMOL API&lt;br /&gt;
&lt;br /&gt;
    cmd.flatten_obj(string name, string selection)&lt;br /&gt;
&lt;br /&gt;
SEE ALSO&lt;br /&gt;
&lt;br /&gt;
    split_states&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    # arguments&lt;br /&gt;
&lt;br /&gt;
    # Single argument; treat as selection&lt;br /&gt;
    if name and not selection:&lt;br /&gt;
        selection = name&lt;br /&gt;
        name = &amp;quot;&amp;quot;&lt;br /&gt;
    # default name and selection&lt;br /&gt;
    if not name:&lt;br /&gt;
        name = &amp;quot;flat&amp;quot;&lt;br /&gt;
    if not selection:&lt;br /&gt;
        selection = &amp;quot;(all)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    state = int(state)&lt;br /&gt;
    rename = int(rename)&lt;br /&gt;
    quiet = int(quiet)&lt;br /&gt;
&lt;br /&gt;
    # Wrap in extra parantheses for get_object_list&lt;br /&gt;
    selection = &amp;quot;( %s )&amp;quot; % selection&lt;br /&gt;
&lt;br /&gt;
    if rename == 0:&lt;br /&gt;
        chainSet = DefaultChainSet()&lt;br /&gt;
    elif rename == 1:&lt;br /&gt;
        chainSet = SequentialChainSet()&lt;br /&gt;
    elif rename == 2:&lt;br /&gt;
        chainSet = LongChainSet()&lt;br /&gt;
    else:&lt;br /&gt;
        raise ValueError(&amp;quot;Unrecognized rename option (Valid: 0,1,2)&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    metaprefix = &amp;quot;temp&amp;quot; #TODO unique prefix&lt;br /&gt;
&lt;br /&gt;
    # store original value of retain_order, which causes weird interleaving of&lt;br /&gt;
    # structures if enabled.&lt;br /&gt;
    retain_order = cmd.get(&amp;quot;retain_order&amp;quot;)&lt;br /&gt;
    try:&lt;br /&gt;
        cmd.set(&amp;quot;retain_order&amp;quot;,0)&lt;br /&gt;
&lt;br /&gt;
        # create new object for each state&lt;br /&gt;
        for obj in cmd.get_object_list(selection):&lt;br /&gt;
&lt;br /&gt;
            if state &amp;lt;= 0:&lt;br /&gt;
                # all states&lt;br /&gt;
                prefix = &amp;quot;%s_%s_&amp;quot;%(metaprefix,obj)&lt;br /&gt;
                cmd.split_states(obj,prefix=prefix)&lt;br /&gt;
            else:&lt;br /&gt;
                prefix = &amp;quot;%s_%s_%04d&amp;quot;%(metaprefix,obj,state)&lt;br /&gt;
                cmd.create(prefix, obj, state, 1)&lt;br /&gt;
&lt;br /&gt;
        # renumber all states&lt;br /&gt;
        statere = re.compile(&amp;quot;^%s_(.*)_(\d+)$&amp;quot; % metaprefix) # matches split object names&lt;br /&gt;
&lt;br /&gt;
        warn_lowercase = False&lt;br /&gt;
&lt;br /&gt;
        # Iterate over all objects with metaprefix&lt;br /&gt;
        try:&lt;br /&gt;
            for obj in cmd.get_object_list(&amp;quot;(%s_*)&amp;quot;%(metaprefix) ):&lt;br /&gt;
                m = statere.match(obj)&lt;br /&gt;
                if m is None:&lt;br /&gt;
                    print(&amp;quot;Failed to match object %s&amp;quot; %obj)&lt;br /&gt;
                    continue&lt;br /&gt;
                origobj = m.group(1)&lt;br /&gt;
                statenum = int(m.group(2))&lt;br /&gt;
&lt;br /&gt;
                chains = set([atom.chain for atom in cmd.get_model(obj).atom])&lt;br /&gt;
&lt;br /&gt;
                rev_chain_map = {} #old -&amp;gt; new, for this obj only&lt;br /&gt;
                for chain in sorted(chains):&lt;br /&gt;
                    new_chain = chainSet.map_chain(origobj,statenum,chain)&lt;br /&gt;
                    rev_chain_map[chain] = new_chain&lt;br /&gt;
                    if not quiet:&lt;br /&gt;
                        print(&amp;quot;  %s state %d chain %s -&amp;gt; %s&amp;quot;%(origobj,statenum,chain, new_chain) )&lt;br /&gt;
                    if not _long_chains:&lt;br /&gt;
                        if len(new_chain) &amp;gt; 1:&lt;br /&gt;
                            raise OutOfChainsError(&amp;quot;No additional chains available (max 62).&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
                try:&lt;br /&gt;
                    stored_name = stored.get_unused_name()&lt;br /&gt;
                except AttributeError:&lt;br /&gt;
                    # backup solution for PyMOL &amp;lt; 1.6&lt;br /&gt;
                    stored_name = &amp;quot;_flatten_obj_chainMapping&amp;quot;&lt;br /&gt;
&lt;br /&gt;
                setattr(stored,stored_name,rev_chain_map)&lt;br /&gt;
                cmd.alter(obj,&amp;quot;chain = stored.%s[chain]&amp;quot;%stored_name)&lt;br /&gt;
                delattr(stored,stored_name)&lt;br /&gt;
&lt;br /&gt;
            print(&amp;quot;Creating object from %s_*&amp;quot;%metaprefix)&lt;br /&gt;
            # Recombine into a single object&lt;br /&gt;
            cmd.create(name,&amp;quot;%s_*&amp;quot;%metaprefix)&lt;br /&gt;
&lt;br /&gt;
            # Set chain_map&lt;br /&gt;
            if chain_map:&lt;br /&gt;
                setattr(stored,chain_map,chainSet)&lt;br /&gt;
&lt;br /&gt;
            # Warn if lowercase chains were generated &lt;br /&gt;
            if cmd.get(&amp;quot;ignore_case&amp;quot;) == &amp;quot;on&amp;quot; and any([c.upper() != c for c in chainSet.keys()]):&lt;br /&gt;
                print(&amp;quot;Warning: using lower-case chain IDs. Consider running the &amp;quot;&lt;br /&gt;
                        &amp;quot;following command:\n  set ignore_case, 0&amp;quot; )&lt;br /&gt;
&lt;br /&gt;
        finally:&lt;br /&gt;
            # Clean up&lt;br /&gt;
            print(&amp;quot;Cleaning up intermediates&amp;quot;)&lt;br /&gt;
            cmd.delete(&amp;quot;%s_*&amp;quot;%metaprefix)&lt;br /&gt;
    finally:&lt;br /&gt;
        # restore original parameters&lt;br /&gt;
        print(&amp;quot;Resetting variables&amp;quot;)&lt;br /&gt;
        cmd.set(&amp;quot;retain_order&amp;quot;,retain_order)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
cmd.extend('flatten_obj', flatten_obj)&lt;br /&gt;
&lt;br /&gt;
# tab-completion of arguments&lt;br /&gt;
cmd.auto_arg[0]['flatten_obj'] = [ cmd.object_sc, 'name or selection', '']&lt;br /&gt;
cmd.auto_arg[1]['flatten_obj'] = [ cmd.object_sc, 'selection', '']&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
&lt;br /&gt;
* [[split_states]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Script_Library]] [[Category:ObjSel_Scripts]]&lt;/div&gt;</summary>
		<author><name>Sbliven</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Template_talk:PymolScriptRepoInclude&amp;diff=13118</id>
		<title>Template talk:PymolScriptRepoInclude</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Template_talk:PymolScriptRepoInclude&amp;diff=13118"/>
		<updated>2015-10-30T13:58:50Z</updated>

		<summary type="html">&lt;p&gt;Sbliven: Created page with &amp;quot;== Not working == This template doesn't seem to work? --~~~~&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Not working ==&lt;br /&gt;
This template doesn't seem to work? --[[User:Sbliven|Sbliven]] 13:58, 30 October 2015 (UTC)&lt;/div&gt;</summary>
		<author><name>Sbliven</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=User:Sbliven/Sandbox&amp;diff=13129</id>
		<title>User:Sbliven/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=User:Sbliven/Sandbox&amp;diff=13129"/>
		<updated>2015-10-30T13:57:26Z</updated>

		<summary type="html">&lt;p&gt;Sbliven: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Pymol Inclusion ==&lt;br /&gt;
Conclusion: the include plugin doesn't work as a template.&lt;br /&gt;
&lt;br /&gt;
Through Template:&lt;br /&gt;
{{Template:PymolScriptRepoInclude/Test|removealt.py}}&lt;br /&gt;
&lt;br /&gt;
Subst:&lt;br /&gt;
&amp;lt;nowiki&amp;gt;{{{lt|&amp;lt;}}}include src=&amp;quot;https://raw.github.com/Pymol-Scripts/Pymol-script-repo/master/{{{1}}}&amp;quot; highlight=&amp;quot;{{{2|python}}}&amp;quot; /{{{gt|&amp;gt;}}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code has been put under version control in the project [http://www.pymolwiki.org/index.php/Git_intro Pymol-script-repo].&lt;br /&gt;
&lt;br /&gt;
This code has been put under version control in the project [http://www.pymolwiki.org/index.php/Git_intro Pymol-script-repo].&lt;br /&gt;
&lt;br /&gt;
Direct:&lt;br /&gt;
&amp;lt;include src=&amp;quot;https://raw.github.com/Pymol-Scripts/Pymol-script-repo/master/removealt.py&amp;quot; highlight=&amp;quot;python&amp;quot; /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sbliven</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Template:PymolScriptRepoInclude/Test&amp;diff=13123</id>
		<title>Template:PymolScriptRepoInclude/Test</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Template:PymolScriptRepoInclude/Test&amp;diff=13123"/>
		<updated>2015-10-30T13:56:52Z</updated>

		<summary type="html">&lt;p&gt;Sbliven: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;&amp;lt;nowiki&amp;gt;{{{lt|&amp;lt;}}}include src=&amp;quot;https://raw.github.com/Pymol-Scripts/Pymol-script-repo/master/{{{1}}}&amp;quot; highlight=&amp;quot;{{{2|python}}}&amp;quot; /{{{gt|&amp;gt;}}}&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code has been put under version control in the project [http://www.pymolwiki.org/index.php/Git_intro Pymol-script-repo].&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
Automatically includes current script code from Pymol-script-repo on github.&lt;br /&gt;
&lt;br /&gt;
Usage: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{PymolScriptRepoInclude|filename|language}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;, where filename gives the path on github and language gives the programming language (default python).&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sbliven</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=User:Sbliven/Sandbox&amp;diff=13128</id>
		<title>User:Sbliven/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=User:Sbliven/Sandbox&amp;diff=13128"/>
		<updated>2015-10-30T13:48:32Z</updated>

		<summary type="html">&lt;p&gt;Sbliven: /* Pymol Inclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Pymol Inclusion ==&lt;br /&gt;
Conclusion: the include plugin doesn't work as a template.&lt;br /&gt;
&lt;br /&gt;
Through Template:&lt;br /&gt;
{{Template:PymolScriptRepoInclude/Test|removealt.py}}&lt;br /&gt;
&lt;br /&gt;
Subst:&lt;br /&gt;
&amp;lt;nowiki&amp;gt;&amp;lt;include src=&amp;quot;https://raw.github.com/Pymol-Scripts/Pymol-script-repo/master/{{{1}}}&amp;quot; highlight=&amp;quot;{{{2|python}}}&amp;quot; /&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code has been put under version control in the project [http://www.pymolwiki.org/index.php/Git_intro Pymol-script-repo].&lt;br /&gt;
&lt;br /&gt;
Direct:&lt;br /&gt;
&amp;lt;include src=&amp;quot;https://raw.github.com/Pymol-Scripts/Pymol-script-repo/master/removealt.py&amp;quot; highlight=&amp;quot;python&amp;quot; /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sbliven</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Template:PymolScriptRepoInclude/Test&amp;diff=13122</id>
		<title>Template:PymolScriptRepoInclude/Test</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Template:PymolScriptRepoInclude/Test&amp;diff=13122"/>
		<updated>2015-10-30T12:19:08Z</updated>

		<summary type="html">&lt;p&gt;Sbliven: testing ways to delay include parsing&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;include src=&amp;quot;https://raw.github.com/Pymol-Scripts/Pymol-script-repo/master/{{{1}}}&amp;quot; highlight=&amp;quot;{{{2|python}}}&amp;quot; /&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code has been put under version control in the project [http://www.pymolwiki.org/index.php/Git_intro Pymol-script-repo].&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
Automatically includes current script code from Pymol-script-repo on github.&lt;br /&gt;
&lt;br /&gt;
Usage: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{PymolScriptRepoInclude|filename|language}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;, where filename gives the path on github and language gives the programming language (default python).&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sbliven</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=User:Sbliven/Sandbox&amp;diff=13127</id>
		<title>User:Sbliven/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=User:Sbliven/Sandbox&amp;diff=13127"/>
		<updated>2015-10-30T12:11:50Z</updated>

		<summary type="html">&lt;p&gt;Sbliven: /* Pymol Inclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Pymol Inclusion ==&lt;br /&gt;
Through Template:&lt;br /&gt;
{{Template:PymolScriptRepoInclude|removealt.py}}&lt;br /&gt;
&lt;br /&gt;
Direct:&lt;br /&gt;
&amp;lt;include src=&amp;quot;https://raw.github.com/Pymol-Scripts/Pymol-script-repo/master/removealt.py&amp;quot; highlight=&amp;quot;python&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Subst:&lt;br /&gt;
&amp;lt;include src=&amp;quot;https://raw.github.com/Pymol-Scripts/Pymol-script-repo/master/{{{1}}}&amp;quot; highlight=&amp;quot;{{{2|python}}}&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code has been put under version control in the project [http://www.pymolwiki.org/index.php/Git_intro Pymol-script-repo].&lt;/div&gt;</summary>
		<author><name>Sbliven</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=User:Sbliven/Sandbox&amp;diff=13126</id>
		<title>User:Sbliven/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=User:Sbliven/Sandbox&amp;diff=13126"/>
		<updated>2015-10-30T12:10:47Z</updated>

		<summary type="html">&lt;p&gt;Sbliven: /* Pymol Inclusion */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Pymol Inclusion ==&lt;br /&gt;
Through Template:&lt;br /&gt;
{{Template:PymolScriptRepoInclude|removealt.py}}&lt;br /&gt;
&lt;br /&gt;
Direct:&lt;br /&gt;
&amp;lt;include src=&amp;quot;https://raw.github.com/Pymol-Scripts/Pymol-script-repo/master/removealt.py&amp;quot; highlight=&amp;quot;python&amp;quot; /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sbliven</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=User:Sbliven/Sandbox&amp;diff=13125</id>
		<title>User:Sbliven/Sandbox</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=User:Sbliven/Sandbox&amp;diff=13125"/>
		<updated>2015-10-30T12:09:31Z</updated>

		<summary type="html">&lt;p&gt;Sbliven: Pymol inclusion&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Pymol Inclusion ==&lt;br /&gt;
Direct:&lt;br /&gt;
&amp;lt;include src=&amp;quot;https://raw.github.com/Pymol-Scripts/Pymol-script-repo/master/findseq.py&amp;quot; highlight=&amp;quot;python&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Through Template:&lt;br /&gt;
{{Template:PymolScriptRepoInclude|findseq.py}}&lt;/div&gt;</summary>
		<author><name>Sbliven</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Template:PymolScriptRepoInclude&amp;diff=13120</id>
		<title>Template:PymolScriptRepoInclude</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Template:PymolScriptRepoInclude&amp;diff=13120"/>
		<updated>2015-10-30T12:04:52Z</updated>

		<summary type="html">&lt;p&gt;Sbliven: Adding documentation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;&amp;lt;include src=&amp;quot;https://raw.github.com/Pymol-Scripts/Pymol-script-repo/master/{{{1}}}&amp;quot; highlight=&amp;quot;{{{2|python}}}&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This code has been put under version control in the project [http://www.pymolwiki.org/index.php/Git_intro Pymol-script-repo].&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
Automatically includes current script code from Pymol-script-repo on github.&lt;br /&gt;
&lt;br /&gt;
Usage: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{PymolScriptRepoInclude|filename|language}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;, where filename gives the path on github and language gives the programming language (default python).&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sbliven</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Get_color_tuple&amp;diff=13063</id>
		<title>Get color tuple</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Get_color_tuple&amp;diff=13063"/>
		<updated>2015-09-08T09:48:00Z</updated>

		<summary type="html">&lt;p&gt;Sbliven: Documenting cmd.get_color_tuple&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Converts a pymol color name into a RGB tuple.&lt;br /&gt;
&lt;br /&gt;
= Example =&lt;br /&gt;
&lt;br /&gt;
 PyMOL&amp;gt;print cmd.get_color_tuple(&amp;quot;raspberry&amp;quot;)&lt;br /&gt;
 (0.699999988079071, 0.30000001192092896, 0.4000000059604645)&lt;/div&gt;</summary>
		<author><name>Sbliven</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Talk:Bounding_Box&amp;diff=13097</id>
		<title>Talk:Bounding Box</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Talk:Bounding_Box&amp;diff=13097"/>
		<updated>2015-08-26T12:41:07Z</updated>

		<summary type="html">&lt;p&gt;Sbliven: /* Port to Numpy */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Port to Numpy ==&lt;br /&gt;
The dependencies on numarray and scientific python are rather dated now. It would be great if someone could port this to numpy, which should be much more common. [[User:Sbliven|Sbliven]] 08:41, 26 August 2015 (EDT)&lt;/div&gt;</summary>
		<author><name>Sbliven</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Transform_selection&amp;diff=12748</id>
		<title>Transform selection</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Transform_selection&amp;diff=12748"/>
		<updated>2015-06-01T10:56:31Z</updated>

		<summary type="html">&lt;p&gt;Sbliven: Added description from 1.7.0 docstring&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Overview ==&lt;br /&gt;
'''transform_selection''' applies a transformation matrix to a selection.  The matrix should actually be passed in as a single list -- not a list of lists.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== PYMOL API ===&lt;br /&gt;
   &lt;br /&gt;
 cmd.transform_selection(string selection, list matrix, int state, int log, int homogenous, int transpose):&lt;br /&gt;
&lt;br /&gt;
=== Details ===&lt;br /&gt;
&lt;br /&gt;
Note that when homogenous is zero, the input matrix is NOT a&lt;br /&gt;
standard homogenous 4x4 transformation matrix.  Instead it is&lt;br /&gt;
something PyMOL-specific which consists of the following:&lt;br /&gt;
&lt;br /&gt;
# a 3x3 matrix containing the rotation in the upper-left quadrant&lt;br /&gt;
# a 1x3 translation to be applied '''before''' rotation in the bottom row (matrix[12],matrix[13],matrix[14]).&lt;br /&gt;
# a 3x1 translation to be applied '''after''' rotation in the right-hand column (matrix[3],matrix[7],matrix[11])&lt;br /&gt;
&lt;br /&gt;
So, you can translate+rotate+translate with this one matrix.&lt;br /&gt;
&lt;br /&gt;
In other words, if the matrix is:&lt;br /&gt;
 &lt;br /&gt;
 [  m0  m1  m2  m3 \&lt;br /&gt;
    m4  m5  m6  m7 \&lt;br /&gt;
    m8  m9 m10 m11 \&lt;br /&gt;
   m12 m13 m14 m15 ] &lt;br /&gt;
&lt;br /&gt;
Atoms will be transformed as follows&lt;br /&gt;
 &lt;br /&gt;
 Y = M X&lt;br /&gt;
 &lt;br /&gt;
 y0 = m0*(x0+m12) + m1*(x1+m13) +  m2*(x2+m14) + m3 \&lt;br /&gt;
 y1 = m4*(x0+m12) + m5*(x1+m13) +  m6*(x2+m14) + m7 \&lt;br /&gt;
 y2 = m8*(x0+m12) + m9*(x1+m13) + m10*(x2+m14) + m11 &lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
=== Real-World Example === &lt;br /&gt;
I wrote a structure alignment program that needs to update the coordinates of the 2nd protein by translating it, rotating it and then translating it on top of the other molecule.  It's done as follows:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
//&lt;br /&gt;
// C code&lt;br /&gt;
//&lt;br /&gt;
// ...after the magic is done, pack all the values into the TTT matrix.&lt;br /&gt;
PyObject* pyU = Py_BuildValue( &amp;quot;[f,f,f,f, f,f,f,f, f,f,f,f, f,f,f,f]&amp;quot;,&lt;br /&gt;
			   bestU[0][0], bestU[1][0], bestU[2][0], bestCOM1[0],&lt;br /&gt;
			   bestU[0][1], bestU[1][1], bestU[2][1], bestCOM1[1],&lt;br /&gt;
			   bestU[0][2], bestU[1][2], bestU[2][2], bestCOM1[2],&lt;br /&gt;
                          -bestCOM2[0], -bestCOM2[1], -bestCOM2[2], 1.);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
where bestU is the transpose of the best rotation matrix, bestCOM1 is the center of mass (COM) for molecule 1, and bestCOM2 is for molecule two.  '''pyU''' becomes '''rotMat'''.  The call in Python is then,&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# Python code.&lt;br /&gt;
#&lt;br /&gt;
cmd.transform_selection( mol2, rotMat, homogenous=0 );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Were I '''not''' to use bestCOM1 or bestCOM2, each of those entries would be 0.  The last element should always be 1.&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
[[transform_odb]]&lt;/div&gt;</summary>
		<author><name>Sbliven</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Get_Symmetry&amp;diff=12774</id>
		<title>Get Symmetry</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Get_Symmetry&amp;diff=12774"/>
		<updated>2015-06-01T09:55:08Z</updated>

		<summary type="html">&lt;p&gt;Sbliven: Adding description of return value&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''get_symmetry''' can be used to obtain the crystal and spacegroup parameters for a molecule&lt;br /&gt;
(FUTURE - map object - FUTURE)&lt;br /&gt;
&lt;br /&gt;
===USAGE===&lt;br /&gt;
 get_symmetry object-name-or-selection&lt;br /&gt;
&lt;br /&gt;
===DESCRIPTION===&lt;br /&gt;
&lt;br /&gt;
Returns a tuple containing the following 7 values:&lt;br /&gt;
&lt;br /&gt;
* The unit cell lengths (a,b,c)&lt;br /&gt;
* The unit cell angles (alpha, beta, gamma)&lt;br /&gt;
* The space group name (e.g. &amp;quot;P 21 21 21&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
===PYMOL API===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
cmd.get_symmetry(string selection) &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===See Also===&lt;br /&gt;
&lt;br /&gt;
* [[Supercell]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Commands|Get Symmetry]]&lt;/div&gt;</summary>
		<author><name>Sbliven</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Get_symmetry&amp;diff=12777</id>
		<title>Get symmetry</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Get_symmetry&amp;diff=12777"/>
		<updated>2015-06-01T09:50:32Z</updated>

		<summary type="html">&lt;p&gt;Sbliven: oops, wrong case&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Get Symmetry]]&lt;/div&gt;</summary>
		<author><name>Sbliven</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Get_symmetry&amp;diff=12776</id>
		<title>Get symmetry</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Get_symmetry&amp;diff=12776"/>
		<updated>2015-06-01T09:49:54Z</updated>

		<summary type="html">&lt;p&gt;Sbliven: Redirected page to Get symmetry&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Get symmetry]]&lt;/div&gt;</summary>
		<author><name>Sbliven</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Talk:Transform_odb&amp;diff=12805</id>
		<title>Talk:Transform odb</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Talk:Transform_odb&amp;diff=12805"/>
		<updated>2015-06-01T09:36:52Z</updated>

		<summary type="html">&lt;p&gt;Sbliven: question about format&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==ODB==&lt;br /&gt;
Can anyone post an example ODB file? From the code, it seems like it should be a tab-delimited file containing the first three rows of the transformation matrix, but in column-first order? That seems weird since it would suggest the transpose of the matrix. --[[User:Sbliven|Sbliven]] 05:36, 1 June 2015 (EDT)&lt;/div&gt;</summary>
		<author><name>Sbliven</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Load&amp;diff=12609</id>
		<title>Load</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Load&amp;diff=12609"/>
		<updated>2015-03-18T14:00:30Z</updated>

		<summary type="html">&lt;p&gt;Sbliven: Adding argument explainations&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''load''' reads several file formats.  The file extension is used to determine the format.  PDB files must end in &amp;quot;.pdb&amp;quot;, MOL files must end in &amp;quot;.mol&amp;quot;, Macromodel files must end in &amp;quot;.mmod&amp;quot;, XPLOR maps must end in &amp;quot;.xplor&amp;quot;, CCP4 maps must end in &amp;quot;.ccp4&amp;quot;, Raster3D input (Molscript output) must end in  &amp;quot;.r3d&amp;quot;, PyMOL session files must end in &amp;quot;.pse&amp;quot;, and pickled ChemPy models with a &amp;quot;.pkl&amp;quot; can also be directly read.&lt;br /&gt;
&lt;br /&gt;
If an object is specified, then the file is loaded into that object. Otherwise, an object is created with the same name as the file prefix.&lt;br /&gt;
&lt;br /&gt;
===USAGE===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
load filename [,object [,state [,format [,finish [,discrete [,multiplex ]]]]]]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===PYMOL API===&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
cmd.load( filename [,object [,state [,format [,finish [,discrete [,multiplex ]]]]]] )&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===ARGUMENTS===&lt;br /&gt;
&lt;br /&gt;
* '''filename : string''' Path to the file to load.&lt;br /&gt;
* '''object : string''' Name of Pymol object to store the structure in. Defaults to the filename prefix.&lt;br /&gt;
* '''state : integer''' State number to store the object in, or 0 to append (default:0)&lt;br /&gt;
* '''format : string''' Format for the file (see notes). Defaults to the filename extension.&lt;br /&gt;
* '''finish : integer'''&lt;br /&gt;
* '''discrete : integer''' For multi-model structures, a value of 0 indicates that models have the same set of atoms (e.g. trajectory files or NMR structures), allowing memory savings, while a value of 1 forces the creation of independent atom sets for each model&lt;br /&gt;
* '''quiet : integer''' (default 1)&lt;br /&gt;
* '''multiplex : integer'''&lt;br /&gt;
* '''zoom : integer'''&lt;br /&gt;
* '''partial : integer''' (default 0)&lt;br /&gt;
* '''mimic : integer''' (default 1)&lt;br /&gt;
&lt;br /&gt;
===NOTES===&lt;br /&gt;
*You can override the file extension by giving a format string:&lt;br /&gt;
 &lt;br /&gt;
 'pdb' : PDB,  'mmod' : Macromodel, 'xyz' : Tinker, 'cc1' : ChemDraw3D  &lt;br /&gt;
 'mol' : MDL MOL-file, 'sdf' : MDL SD-file&lt;br /&gt;
 'xplor' : X-PLOR/CNS map, 'ccp4' : CCP4 map,&lt;br /&gt;
 'callback' : PyMOL Callback object (PyOpenGL)&lt;br /&gt;
 'cgo' : compressed graphics object (list of floats)&lt;br /&gt;
 'trj' : AMBER trajectory (use load_traj command for more control)&lt;br /&gt;
 'top' : AMBER topology file 'rst' : AMBER restart file&lt;br /&gt;
 'cex' : Metaphorics CEX format&lt;br /&gt;
 'pse' : PyMOL Session file&lt;br /&gt;
 'pqr' : PQR (a modified PDB file with charges and radii)&lt;br /&gt;
 'mol2' : MOL2&lt;br /&gt;
&lt;br /&gt;
* A new feature has been added to load.  You can specify an URL to a PDB and PyMOL will download it.  This is a very handy feature for loading experimental/theoretical data from servers across the web.  Just copy the link they give you and do,&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
load http://www.theurl.com/path/toYourData&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
or you can open a remote file just from the command line&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# load a PDB file; I placed one example file on the PyMOL Wiki&lt;br /&gt;
pymol http://www.pymolwiki.org/1rsy.pdb&lt;br /&gt;
&lt;br /&gt;
# PyMOL can also handle the gzipped files on the PDB.  :-)&lt;br /&gt;
pymol ftp://ftp.wwpdb.org/pub/pdb/data/structures/divided/pdb/00/pdb100d.ent.gz&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===User Comments/Examples===&lt;br /&gt;
*Load xyz.pdb using the PyMOL API:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
cmd.load(&amp;quot;xyz.pdb&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Loading multiple PDBs into one object with many states:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
load trj0001.pdb, mov&lt;br /&gt;
load trj0002.pdb, mov&lt;br /&gt;
load trj0003.pdb, mov&lt;br /&gt;
etc.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
or, if you have too many states to do that by hand,&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
for idx in range(1,1001):cmd.load(&amp;quot;trj%04d.pdb&amp;quot;%idx,&amp;quot;mov&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
or, you can use &amp;quot;glob&amp;quot; from Python,&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from glob import glob&lt;br /&gt;
lst = glob(&amp;quot;trj*.pdb&amp;quot;)&lt;br /&gt;
lst.sort()&lt;br /&gt;
for fil in lst: cmd.load(fil,&amp;quot;mov&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*Load a NAMD multi-PDB file.  These are just concatenated PDB files.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
load NAMDtrajFile.pdb, multiplex=0&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Hint: You can save some time &amp;amp; a lot of memory by loading the file and removing the atoms in a single-line compound statement (with a semicolon&lt;br /&gt;
after the load statement).&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
load 1E3M.pdb; remove not A-C+F//&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Decorating the load command to include technical info about the loaded object&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
def load_with_props(fileName, objName):&lt;br /&gt;
  # store whatever info you want, like the filename&lt;br /&gt;
  obj_info[objName] = fileName&lt;br /&gt;
  # ... do more recording of properties you choose&lt;br /&gt;
  # ask PyMOL to now load the file&lt;br /&gt;
  cmd.load(fileName,objName)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Then on can query obj_info based on the object name:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
for obj in cmd.get_names():&lt;br /&gt;
  print obj_info[obj]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SEE ALSO===&lt;br /&gt;
[[Fetch]] [[Save]] [[Load Traj]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Commands|Load]]&lt;br /&gt;
[[Category:States|Load]]&lt;br /&gt;
[[Category:Input Output Module|Load]]&lt;/div&gt;</summary>
		<author><name>Sbliven</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=User:Sbliven&amp;diff=12530</id>
		<title>User:Sbliven</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=User:Sbliven&amp;diff=12530"/>
		<updated>2014-12-10T10:15:22Z</updated>

		<summary type="html">&lt;p&gt;Sbliven: Created page with &amp;quot;Spencer Bliven, Structural Bioinformatician&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Spencer Bliven, Structural Bioinformatician&lt;/div&gt;</summary>
		<author><name>Sbliven</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Talk:Select&amp;diff=12525</id>
		<title>Talk:Select</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Talk:Select&amp;diff=12525"/>
		<updated>2014-12-10T10:10:42Z</updated>

		<summary type="html">&lt;p&gt;Sbliven: Additional parameters&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Additional parameters ==&lt;br /&gt;
&lt;br /&gt;
The help string lists a number of additional parameters to select, but I haven't been able to find any further discussion of them:&lt;br /&gt;
&lt;br /&gt;
  select name, selection [, enable [, quiet [, merge [, state [, domain ]]]]]&lt;br /&gt;
&lt;br /&gt;
The ''state'' parameter doesn't seem to have any effect (at least it definitely doesn't limit selection to one state), and I'm not sure what the others are intended to do. Can anyone add descriptions of those parameters?&lt;br /&gt;
&lt;br /&gt;
--[[User:Sbliven|Sbliven]] 05:10, 10 December 2014 (EST)&lt;/div&gt;</summary>
		<author><name>Sbliven</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Talk:Plugin_Manager&amp;diff=12363</id>
		<title>Talk:Plugin Manager</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Talk:Plugin_Manager&amp;diff=12363"/>
		<updated>2014-11-26T12:08:29Z</updated>

		<summary type="html">&lt;p&gt;Sbliven: /* Startup path */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Version introduced ==&lt;br /&gt;
&lt;br /&gt;
Does anyone know when the Plugin Manager was introduced? I've verified it wasn't present in 1.3 and is present in 1.5, but I don't have access to 1.4 to test it. --[[User:Sbliven|Sbliven]] 07:00, 26 November 2014 (EST)&lt;br /&gt;
&lt;br /&gt;
== Startup path ==&lt;br /&gt;
&lt;br /&gt;
I'm a bit skeptical about this line in the script:&lt;br /&gt;
&lt;br /&gt;
 os.path.join(sys.prefix, 'Lib', 'site-packages', 'pmg_tk', 'startup')&lt;br /&gt;
&lt;br /&gt;
On my system, &amp;lt;tt&amp;gt;sys.prefix&amp;lt;/tt&amp;gt; resolves to &amp;lt;tt&amp;gt;PYTHON_HOME/ext&amp;lt;/tt&amp;gt;. I do have a &amp;lt;tt&amp;gt;/ext/lib&amp;lt;/tt&amp;gt; (lower case), but my site-packages is at &amp;lt;tt&amp;gt;/ext/lib/python1.7/site-packages&amp;lt;/tt&amp;gt;, and it doesn't contain a pmg_tk module. Perhaps what was really intended was to add &amp;lt;tt&amp;gt;PYTHON_HOME/modules/pmg_tk/startup&amp;lt;/tt&amp;gt;, which is the only entry in my startup path by default (and therefore doesn't need to be included with the set_startup_path command).&lt;br /&gt;
&lt;br /&gt;
Is the Lib path needed for Windows or some other OS?&lt;br /&gt;
--[[User:Sbliven|Sbliven]] 07:08, 26 November 2014 (EST)&lt;/div&gt;</summary>
		<author><name>Sbliven</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Talk:Plugin_Manager&amp;diff=12362</id>
		<title>Talk:Plugin Manager</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Talk:Plugin_Manager&amp;diff=12362"/>
		<updated>2014-11-26T12:00:47Z</updated>

		<summary type="html">&lt;p&gt;Sbliven: /* Version introduced */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Version introduced ==&lt;br /&gt;
&lt;br /&gt;
Does anyone know when the Plugin Manager was introduced? I've verified it wasn't present in 1.3 and is present in 1.5, but I don't have access to 1.4 to test it. --[[User:Sbliven|Sbliven]] 07:00, 26 November 2014 (EST)&lt;/div&gt;</summary>
		<author><name>Sbliven</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Cgo_grid&amp;diff=12202</id>
		<title>Cgo grid</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Cgo_grid&amp;diff=12202"/>
		<updated>2014-11-24T09:24:34Z</updated>

		<summary type="html">&lt;p&gt;Sbliven: Fixing capitalization&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox script-repo&lt;br /&gt;
|type      = Python Module&lt;br /&gt;
|filename  = cgo_grid.py&lt;br /&gt;
|author    = [[User:Andwar|Andreas Warnecke]]&lt;br /&gt;
|license   = BSD-2-Clause&lt;br /&gt;
}}&lt;br /&gt;
[[Image:cgo_grid.gif|right|cgo_grid creates flowing mesh objects]]&lt;br /&gt;
&lt;br /&gt;
==About cgo_grid==&lt;br /&gt;
'''cgo_grid''' will generate a flowing mesh object using the points provided or the current view. By default is will generate a flowing membrane. The shape is affected substantially by the arguments!&amp;lt;br&amp;gt;&lt;br /&gt;
* For instruction on setting up plugin import see [[Git intro]] or [[Plugin Manager]]&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
'''cgo_grid''' has many arguments, but not all need to be set necessarily (see arguments or examples).&lt;br /&gt;
{|&lt;br /&gt;
|&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
cgo_grid [ pos1 [, pos2 [, pos3 [, length_x [, length_z [, npoints_x [, npoints_z&lt;br /&gt;
[, nwaves_x [, nwaves_z [, offset_x [, offset_z [, gain_x [, gain_z&lt;br /&gt;
[, thickness [, color [, nstates [, startframe [, endframe&lt;br /&gt;
[, mode [, view [, name [, quiet ]]]]]]]]]]]]]]]]]]]]]]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Arguments==&lt;br /&gt;
{|&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    pos1 = single atom selection (='pk1') or list of 3 floats {default: [0,0,0]}&lt;br /&gt;
&lt;br /&gt;
    pos2 = single atom selection (='pk2') or list of 3 floats {default: [1,0,0]}&lt;br /&gt;
&lt;br /&gt;
    pos3 = single atom selection (='pk3') or list of 3 floats {default: [0,0,1]}&lt;br /&gt;
&lt;br /&gt;
    --&amp;gt; the plane is defined by pos1 (origin) and vectors to pos2 and pos3, respectively&lt;br /&gt;
&lt;br /&gt;
    length_x = &amp;lt;float&amp;gt;: length of membrane {default: 30}&lt;br /&gt;
    length_z = &amp;lt;float&amp;gt;: length of membrane {default: ''} # same as length_x&lt;br /&gt;
&lt;br /&gt;
    npoints_x = &amp;lt;int&amp;gt;: number of points(lines) along x-direction&lt;br /&gt;
                {default: ''} #will be set to give a ~1 unit grid&lt;br /&gt;
    npoints_z = &amp;lt;int&amp;gt;: number of points(lines) along z-direction&lt;br /&gt;
                {default: ''} #will be set to give a ~1 unit grid&lt;br /&gt;
                {minimum: 1 # automatic}&lt;br /&gt;
&lt;br /&gt;
    nwaves_x =   &amp;lt;float&amp;gt;: number of complete sin waves along object x-axis&lt;br /&gt;
                 {default: 2}&lt;br /&gt;
    nwaves_z =  &amp;lt;float&amp;gt;: number of complete sin waves along object z-axis&lt;br /&gt;
                {default: ''} # same as nwaves_x&lt;br /&gt;
                define separately to adjust number of waves in each direction&lt;br /&gt;
&lt;br /&gt;
    offset_x = &amp;lt;float&amp;gt; phase delay (in degrees) of sin wave in x-axis&lt;br /&gt;
             can be set to affect shape and starting amplitude {default: 0}&lt;br /&gt;
    offset_z = &amp;lt;float&amp;gt; phase delay (in degrees) of sin wave in z-axis&lt;br /&gt;
             can be set to affect shape and starting amplitude&lt;br /&gt;
             {default: ''} # same as  offset_x&lt;br /&gt;
    offset_x and offset_z can be used together to phase&lt;br /&gt;
    otherwise identical objects&lt;br /&gt;
&lt;br /&gt;
    gain_x = &amp;lt;float&amp;gt;: multiplication factor for y-amplitude for x-direction&lt;br /&gt;
             {default: 1}&lt;br /&gt;
    gain_z = &amp;lt;float&amp;gt;: multiplication factor for y-amplitude for z-direction&lt;br /&gt;
             {default: ''} #=gain_x&lt;br /&gt;
&lt;br /&gt;
    thickness = &amp;lt;float&amp;gt;: line thickness {default: 2}&lt;br /&gt;
&lt;br /&gt;
    color = color name &amp;lt;string&amp;gt; (e.g. 'skyblue') OR&lt;br /&gt;
            rgb-value list of 3 floats (e.g. [1.0,1.0,1.0]) OR&lt;br /&gt;
            {default: ''} // opposite of background&lt;br /&gt;
            input illegal values for random coloring&lt;br /&gt;
&lt;br /&gt;
    nstates =  &amp;lt;int&amp;gt;: number of states; {default: 60}&lt;br /&gt;
               this setting will define how many states&lt;br /&gt;
               the object will have (per wave) and how fluent and fast the&lt;br /&gt;
               animation will be.&lt;br /&gt;
               Higher values will promote 'fluent' transitions,&lt;br /&gt;
               but decrease flow speed.&lt;br /&gt;
                   Note: Frame animation cycles thought the states one at a time&lt;br /&gt;
                   and needs to be set accordingly. Can also be used to phase&lt;br /&gt;
                   otherwise identical objects.&lt;br /&gt;
               Set to 1 for static object {automatic minimum}&lt;br /&gt;
&lt;br /&gt;
    startframe: specify starting frame &amp;lt;int&amp;gt; or set (='') to use current frame&lt;br /&gt;
                set to 'append' to extend movie from the last frame {default: 1}&lt;br /&gt;
      endframe: specify end frame &amp;lt;int&amp;gt; or set (='') to use last frame&lt;br /&gt;
                if 'append' is used for startframe,&lt;br /&gt;
                endframe becomes the number of frames to be appended instead&lt;br /&gt;
                {default: 1}&lt;br /&gt;
                Note: if start- and endframe are the same, movie animation will&lt;br /&gt;
                be skipped, the object will be loaded and can be used afterwards&lt;br /&gt;
&lt;br /&gt;
    mode: defines positioning {default: 0}:&lt;br /&gt;
    0: pos1 is center&lt;br /&gt;
    1: pos1 is corner&lt;br /&gt;
&lt;br /&gt;
    view {default: 0}:&lt;br /&gt;
    '0': off/ uses provided points to create CGO&lt;br /&gt;
    '1': overrides atom selections and uses current orienatation for positioning&lt;br /&gt;
         - pos1 = origin/center&lt;br /&gt;
         - pos2 = origin +1 in camera y&lt;br /&gt;
         - pos3 = origin +1 in camera z&lt;br /&gt;
&lt;br /&gt;
    name: &amp;lt;string&amp;gt; name of cgo object {default: ''} / automatic&lt;br /&gt;
&lt;br /&gt;
    quiet: &amp;lt;boolean&amp;gt; toggles output&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
| text-align:center;&amp;quot; | Concept sketch:&amp;lt;br&amp;gt;[[Image:cgo_grid.png|500px|cgo_grid concept sketch]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
The behaviour or shape of the cgo_grid object are substantially influenced by the arguments&lt;br /&gt;
{|&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
delete all&lt;br /&gt;
set_view (\&lt;br /&gt;
     0.263772517,   -0.113038681,    0.957937598,\&lt;br /&gt;
    -0.040853567,    0.990910411,    0.128179103,\&lt;br /&gt;
    -0.963716805,   -0.072944686,    0.256756991,\&lt;br /&gt;
     0.000000000,    0.000000000, -131.816467285,\&lt;br /&gt;
     0.000000000,    0.000000000,    0.000000000,\&lt;br /&gt;
   -50.008331299,  353.641235352,  -20.000000000 )&lt;br /&gt;
&lt;br /&gt;
#membrane&lt;br /&gt;
cgo_grid color=blue&lt;br /&gt;
&lt;br /&gt;
#swimming worm, random color&lt;br /&gt;
cgo_grid \&lt;br /&gt;
pos1=[0,-5,0], pos2=[1,-5,1], pos3=[0,-5,1],\&lt;br /&gt;
length_x=15,\&lt;br /&gt;
npoints_z=1,\&lt;br /&gt;
gain_x=2,\&lt;br /&gt;
gain_z=0,\&lt;br /&gt;
thickness=20,\&lt;br /&gt;
color=3,\&lt;br /&gt;
mode=1,\&lt;br /&gt;
name=&amp;quot;worm&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#Moving Ladder&lt;br /&gt;
cgo_grid \&lt;br /&gt;
length_x=15,\&lt;br /&gt;
pos1=[0,10,0], pos2=[0,10,1], pos3=[0,9,0],\&lt;br /&gt;
npoints_x=2, npoints_z=30,\&lt;br /&gt;
name=&amp;quot;ladder&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#Roof&lt;br /&gt;
cgo_grid \&lt;br /&gt;
nstates=1,\&lt;br /&gt;
npoints_x=15,\&lt;br /&gt;
npoints_z=15,\&lt;br /&gt;
gain_x=20,\&lt;br /&gt;
gain_z=20,\&lt;br /&gt;
nwaves_x=0.5,\&lt;br /&gt;
thickness=5,\&lt;br /&gt;
color=cyan,\&lt;br /&gt;
name=&amp;quot;roof&amp;quot;&lt;br /&gt;
&lt;br /&gt;
#Boxes&lt;br /&gt;
cgo_grid \&lt;br /&gt;
pos1=[0,-10,0], pos2=[1,-10,0], pos3=[0,-10,1],\&lt;br /&gt;
nstates=1,\&lt;br /&gt;
npoints_x=50,\&lt;br /&gt;
npoints_z=50,\&lt;br /&gt;
nwaves_x=0,\&lt;br /&gt;
color=[0.00 , 0.53 , 0.22],\&lt;br /&gt;
thickness=5,\&lt;br /&gt;
name=&amp;quot;bottom&amp;quot;&lt;br /&gt;
&lt;br /&gt;
cgo_grid \&lt;br /&gt;
nstates=1,\&lt;br /&gt;
npoints_x=2,\&lt;br /&gt;
npoints_z=2,\&lt;br /&gt;
nwaves_x=0,\&lt;br /&gt;
color=gray60,\&lt;br /&gt;
thickness=10,\&lt;br /&gt;
name=&amp;quot;top&amp;quot;&lt;br /&gt;
&lt;br /&gt;
cgo_grid \&lt;br /&gt;
pos1=[-15,-10,15], pos2=[-14,-10,15], pos3=[-15,-9,15],\&lt;br /&gt;
nstates=1,\&lt;br /&gt;
npoints_x=5,\&lt;br /&gt;
npoints_z=5,\&lt;br /&gt;
gain_x=0,\&lt;br /&gt;
gain_z=-2,\&lt;br /&gt;
length_z=10,\&lt;br /&gt;
nwaves_x=0.5,\&lt;br /&gt;
color=gray60,\&lt;br /&gt;
thickness=5,\&lt;br /&gt;
mode=1,\&lt;br /&gt;
name=&amp;quot;front&amp;quot;&lt;br /&gt;
&lt;br /&gt;
cgo_grid \&lt;br /&gt;
pos1=[-15,-10,-15], pos2=[-14,-10,-15], pos3=[-15,-9,-15],\&lt;br /&gt;
nstates=1,\&lt;br /&gt;
npoints_x=5,\&lt;br /&gt;
npoints_z=5,\&lt;br /&gt;
gain_x=0,\&lt;br /&gt;
gain_z=2,\&lt;br /&gt;
length_z=10,\&lt;br /&gt;
nwaves_x=0.5,\&lt;br /&gt;
color=gray60,\&lt;br /&gt;
thickness=5,\&lt;br /&gt;
mode=1,\&lt;br /&gt;
name=&amp;quot;back&amp;quot;&lt;br /&gt;
&lt;br /&gt;
set ray_trace_frames, 0&lt;br /&gt;
set movie_loop,1&lt;br /&gt;
mplay&lt;br /&gt;
&lt;br /&gt;
# play around with the ARGUMENTS! :-)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==SEE ALSO==&lt;br /&gt;
* [[CgoCircle]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Script_Library]]&lt;br /&gt;
[[Category:Math_Scripts]]&lt;br /&gt;
[[Category:CGO]]&lt;/div&gt;</summary>
		<author><name>Sbliven</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Distancetoatom&amp;diff=12206</id>
		<title>Distancetoatom</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Distancetoatom&amp;diff=12206"/>
		<updated>2014-11-24T09:24:14Z</updated>

		<summary type="html">&lt;p&gt;Sbliven: Fixing capitalization&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox script-repo&lt;br /&gt;
|type      = Python Module&lt;br /&gt;
|filename  = distancetoatom.py&lt;br /&gt;
|author    = [[User:Andwar|Andreas Warnecke]] and [[User:Jaredsampson|Jared Sampson]]&lt;br /&gt;
|license   = BSD-2-Clause&lt;br /&gt;
}}&lt;br /&gt;
[[Image:distancetoatom_0.png|right|300px|get distance to atoms within cutoff]]&lt;br /&gt;
&lt;br /&gt;
==About distancetoatom==&lt;br /&gt;
'''distancetoatom''' prints all distances between a specified atom, coordinate or group selection center and all atoms within cutoff distance that are part of the selection.&amp;lt;br&amp;gt;&lt;br /&gt;
All coordinates and distances can be saved in a csv-style text file report and/or can be stored in a (custom) atom property, if defined.&lt;br /&gt;
* For instruction on setting up plugin import see [[Git intro]] or [[Plugin Manager]]&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
{|-&lt;br /&gt;
||&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
    distancetoatom [ origin [, cutoff [, filename [, selection [, state [, property_name [, coordinates [, decimals [, sort [, quiet ]]]]]]]]]]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Arguments===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;3;&amp;quot;|Arguments for distancetoatom&lt;br /&gt;
|- style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Keyword&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Default&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| What it does&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| origin &lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot;| pk1  &lt;br /&gt;
| &amp;quot;origin&amp;quot; defines the coordinates for the origin and can be:&lt;br /&gt;
1. a list with coordinates [x,y,z]&amp;lt;br&amp;gt;&lt;br /&gt;
2. a single atom selection string&amp;lt;br&amp;gt;&lt;br /&gt;
3. a multi-atom selection string (center will be used)&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| cutoff&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot;| 10  &lt;br /&gt;
| &amp;quot;cutoff&amp;quot; defines the maximum distance, atoms further away are not considered&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| filename &lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot;| None&lt;br /&gt;
| &amp;quot;filename&amp;quot; is the name of a report file that will be created (optional). &lt;br /&gt;
set to e.g. 'report.txt' to create a report. This file is CSV style and can be imported into EXCEL.&amp;lt;br&amp;gt;&lt;br /&gt;
(omit or set to &amp;quot;&amp;quot;, None, 0 or False to disable)&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| selection&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot;| all&lt;br /&gt;
| only atoms within &amp;quot;selection&amp;quot; (and cutoff distance) will be used for calculation&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| state &lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot;| 0&lt;br /&gt;
| &amp;quot;state&amp;quot; is the state that will be used for calculations&lt;br /&gt;
use 0 (omit), to automatically use the current state&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| property_name&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot;| p.dist&lt;br /&gt;
| &amp;quot;property_name&amp;quot; defines a (custom) property in which the calculated distance will be stored.&lt;br /&gt;
This can be used e.g. for labeling or spectrum coloring etc. (cf. examples)&amp;lt;br&amp;gt;&lt;br /&gt;
NB! older PyMOL versions only support b or q and the distance will overwrite this property if set.&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| coordinates&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot;| 0&lt;br /&gt;
| &amp;quot;coordinates&amp;quot; toggles whether, besides distance, the atom coordinates will be included in the report.&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| decimals&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot;| 3&lt;br /&gt;
| &amp;quot;decimals&amp;quot; is the number of decimal places calculated.&lt;br /&gt;
Note that PDB files do not support a higher resolution than 3.&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| sort&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot;| 1&lt;br /&gt;
| &amp;quot;sort&amp;quot; defines how the output will be sorted:&lt;br /&gt;
1: ascending (default)&amp;lt;br&amp;gt;&lt;br /&gt;
0: no sorting (by selection)&amp;lt;br&amp;gt;&lt;br /&gt;
-1: descending&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| quiet&lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot;| 1&lt;br /&gt;
| toggle verbosity&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
{|-&lt;br /&gt;
||&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# make function available to PyMOL&lt;br /&gt;
import distancetoatom&lt;br /&gt;
&lt;br /&gt;
##############################&lt;br /&gt;
# Example 1: print all distances&lt;br /&gt;
frag LYS&lt;br /&gt;
edit name CA&lt;br /&gt;
distancetoatom&lt;br /&gt;
&lt;br /&gt;
##############################&lt;br /&gt;
# Example 2: print all distances to file&lt;br /&gt;
fetch 1cll, async=0&lt;br /&gt;
distancetoatom origin=/1cll//A/CA`150/CA, filename=distances.txt, selection=elem O, property_name=b&lt;br /&gt;
# the file is CSV-format and can be imported, e.g. to EXCEL&lt;br /&gt;
&lt;br /&gt;
# format&lt;br /&gt;
hide everything&lt;br /&gt;
select byres (resi 150 expand 5 and not resn hoh) &lt;br /&gt;
show_as sticks, sele&lt;br /&gt;
util.cbaw sele&lt;br /&gt;
show_as spheres, resi 150&lt;br /&gt;
zoom sele&lt;br /&gt;
&lt;br /&gt;
##########&lt;br /&gt;
# Label by stored distance (property_name)&lt;br /&gt;
label sele and elem O, &amp;quot;%.2f&amp;quot;%b&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
##############################&lt;br /&gt;
# Example 3: color an object by distance to a coordinate&lt;br /&gt;
&lt;br /&gt;
fetch 1cll, async=0&lt;br /&gt;
distancetoatom [0,0,0], cutoff=1000, property_name=b&lt;br /&gt;
# the distance is stored in the b-factor in this case&lt;br /&gt;
# newer PyMOL versions support custom properties, e.g. &amp;quot;p.dist&amp;quot;&lt;br /&gt;
spectrum b, rainbow_rev &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
||&lt;br /&gt;
[[Image:distancetoatom_2.png|300px|Example 2]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:distancetoatom_1.png|300px|Example 3]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==SEE ALSO==&lt;br /&gt;
* [[Distance]]&lt;br /&gt;
* [[Get Distance]]&lt;br /&gt;
* [[Get raw distances]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Script_Library]]&lt;br /&gt;
[[Category:UI_Scripts]]&lt;br /&gt;
[[Category:Math_Scripts]]&lt;br /&gt;
[[Category:Biochemical_Properties]]&lt;br /&gt;
[[Category:Biochemical_Scripts]]&lt;/div&gt;</summary>
		<author><name>Sbliven</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Movie_color_fade&amp;diff=12216</id>
		<title>Movie color fade</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Movie_color_fade&amp;diff=12216"/>
		<updated>2014-11-24T09:23:59Z</updated>

		<summary type="html">&lt;p&gt;Sbliven: Fixing capitalization&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox script-repo&lt;br /&gt;
|type      = Python Module&lt;br /&gt;
|filename  = movie_color_fade.py&lt;br /&gt;
|author    = [[User:Andwar|Andreas Warnecke]]&lt;br /&gt;
|license   = BSD-2-Clause&lt;br /&gt;
}}&lt;br /&gt;
[[Image:movie_color_fade_example_1.gif|right|movie_color_fade example]]&lt;br /&gt;
&lt;br /&gt;
'''movie_color_fade''' is like [[Movie_fade|movie_fade]], but will fade colors in a movie. Simply specify the arguments (see below).&lt;br /&gt;
* For instruction on setting up plugin import see [[Git intro]] or [[Plugin Manager]]&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
{|-&lt;br /&gt;
||&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
 movie_color_fade [ startframe [, startcolor [, endframe [, endcolor [, selection ]]]]]&lt;br /&gt;
 help movie_color_fade&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Arguments===&lt;br /&gt;
* startframe, endframe = beginning and end movie frame for fading&lt;br /&gt;
** if omitted, the current or last frame will be respectively set automatically&lt;br /&gt;
* startcolor, endcolor = coloring at start and end&lt;br /&gt;
* selection: target selection&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
This example yields the movie to the top right&lt;br /&gt;
{|-&lt;br /&gt;
||&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# make function available to PyMOL&lt;br /&gt;
import movie_color_fade&lt;br /&gt;
&lt;br /&gt;
# object prep&lt;br /&gt;
bg black&lt;br /&gt;
delete all&lt;br /&gt;
fetch 1hpv, async=0&lt;br /&gt;
as cartoon&lt;br /&gt;
orient&lt;br /&gt;
color yellow, chain A&lt;br /&gt;
color skyblue, chain B&lt;br /&gt;
# movie prep&lt;br /&gt;
mset 1x120&lt;br /&gt;
&lt;br /&gt;
# color fading&lt;br /&gt;
movie_color_fade 1, yellow, 60, skyblue, chain A&lt;br /&gt;
movie_color_fade 60, skyblue, 120, yellow, chain A&lt;br /&gt;
movie_color_fade 1, skyblue, 60, yellow, chain B&lt;br /&gt;
movie_color_fade 60, yellow, 120, skyblue, chain B&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==SEE ALSO==&lt;br /&gt;
* [[Movie_fade]]&lt;br /&gt;
* [[mappend]]&lt;br /&gt;
* [[Color]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Script_Library]]&lt;br /&gt;
[[Category:UI_Scripts]]&lt;/div&gt;</summary>
		<author><name>Sbliven</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Get_colors&amp;diff=12210</id>
		<title>Get colors</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Get_colors&amp;diff=12210"/>
		<updated>2014-11-24T09:23:33Z</updated>

		<summary type="html">&lt;p&gt;Sbliven: Fixing capitalization&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox script-repo&lt;br /&gt;
|type      = Python Module&lt;br /&gt;
|filename  = get_colors.py&lt;br /&gt;
|author    = [[User:Andwar|Andreas Warnecke]]&lt;br /&gt;
|license   = BSD-2-Clause&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
* '''get_colors''' contains two functions that can be useful when working with colors&lt;br /&gt;
** ''get_colors'' : returns all available PyMOL colors&lt;br /&gt;
** ''get_random_color'' : returns a random available PyMOL color&lt;br /&gt;
&lt;br /&gt;
* Note that basic colors can be accessed manually without this script from the PyMOL menu under '''Setting''' --&amp;gt; '''Colors...'''&lt;br /&gt;
* For instruction on setting up plugin import see [[Git intro]] or [[Plugin Manager]]&lt;br /&gt;
&lt;br /&gt;
[[Image:1LSD_random_colors.png|right|300px|1LSD colored randomly by residue]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
 get_colors [ selection [, quiet ]]&lt;br /&gt;
 get_random_color [ selection [, quiet ]]&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
{|-&lt;br /&gt;
||&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# basic example&lt;br /&gt;
get_colors # basic colors&lt;br /&gt;
get colors all # larger range with intermediates&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#get disco funky&lt;br /&gt;
import get_colors&lt;br /&gt;
from get_colors import get_colors&lt;br /&gt;
from get_colors import get_random_color&lt;br /&gt;
&lt;br /&gt;
cmd.delete('all')&lt;br /&gt;
cmd.fetch('1LSD', async=0) # :P&lt;br /&gt;
cmd.hide('everything')&lt;br /&gt;
cmd.show_as('sticks','not hetatm')&lt;br /&gt;
cmd.orient()&lt;br /&gt;
&lt;br /&gt;
python # start a python block&lt;br /&gt;
from pymol import stored&lt;br /&gt;
stored.atom_list=[]&lt;br /&gt;
cmd.iterate('name CA','stored.atom_list.append([model, resi])')&lt;br /&gt;
resi_list=[&amp;quot;model %s and resi %s&amp;quot;%(value[0],value[1]) for value in stored.atom_list]&lt;br /&gt;
for resi in resi_list: cmd.color(get_random_color(),resi)&lt;br /&gt;
python end # end python block&lt;br /&gt;
cmd.ray()&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==SEE ALSO==&lt;br /&gt;
* [[Color]]&lt;br /&gt;
* [[Get Color Indices]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Script_Library]]&lt;br /&gt;
[[Category:UI_Scripts]]&lt;/div&gt;</summary>
		<author><name>Sbliven</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Quickdisplays&amp;diff=12358</id>
		<title>Quickdisplays</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Quickdisplays&amp;diff=12358"/>
		<updated>2014-11-24T09:23:18Z</updated>

		<summary type="html">&lt;p&gt;Sbliven: Fixing capitalization&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox script-repo&lt;br /&gt;
|type      = Python Module&lt;br /&gt;
|filename  = quickdisplays.py&lt;br /&gt;
|author    = [[User:Andwar|Andreas Warnecke]]&lt;br /&gt;
|license   = BSD-2-Clause&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The module '''quickdisplays''' is a package containing several functions for quick standard displays:&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;3;&amp;quot;|List of functions&lt;br /&gt;
|- style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Function&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| What it does&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Usage&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| disp_list &lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot;| prints a list of functions &lt;br /&gt;
| disp_list&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| disp_ss &lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot;| secondary structure &lt;br /&gt;
| disp_ss [ selection [, colors [, only ]]]&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| disp_ball_stick &lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot;| balls and sticks  &lt;br /&gt;
|disp_ball_stick [ selection [, hydrogens [, only ]]]&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| disp_mesh &lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot;| surface mesh &lt;br /&gt;
| disp_mesh [ selection [, color_m [, hydrogens [, only [, limits ]]]]]&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| disp_surf &lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot;| surface &lt;br /&gt;
| disp_surf [ selection [, color_s [, transparency [, hydrogens [, solvent [, ramp_above [, only [, limits ]]]]]]]]&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;row&amp;quot;| disp_putty &lt;br /&gt;
| style=&amp;quot;text-align:center;&amp;quot;| putty b-factor sausage &lt;br /&gt;
| disp_putty [ selection [, limits [, only ]]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* Note that each function has an '''individual help destription''', callable by entering, e.g.:&lt;br /&gt;
 help disp_surf&lt;br /&gt;
* For instruction on setting up plugin import see [[Git intro]] or [[Plugin Manager]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
!colspan=&amp;quot;5;&amp;quot;|Examples&lt;br /&gt;
|- style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
| [[Image:Quickdisplays_disp_surf.png|center|300px]]'''disp_surf'''&amp;lt;br&amp;gt;''surface''&lt;br /&gt;
| [[Image:Quickdisplays_disp_ss.png|center|300px]]'''disp_ss'''&amp;lt;br&amp;gt;''secondary structure''&lt;br /&gt;
| [[Image:Quickdisplays_disp_putty.png|center|300px]]'''disp_putty'''&amp;lt;br&amp;gt;''putty b-factor sausage''&lt;br /&gt;
| colspan=&amp;quot;2;&amp;quot; rowspan=&amp;quot;2;&amp;quot; style=&amp;quot;text-align:left;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
The ''combined displays'' example was produced like this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import quickdisplays&lt;br /&gt;
fetch 1hpv, async=0&lt;br /&gt;
&lt;br /&gt;
disp_putty all, limits=10&lt;br /&gt;
disp_surf color_s=lightblue, transparency=0.8&lt;br /&gt;
disp_ss chain B&lt;br /&gt;
disp_ball_stick hetatm&lt;br /&gt;
util.cbao hetatm&lt;br /&gt;
set mesh_mode, 1 # make sure hetams are meshed&lt;br /&gt;
set mesh_cutoff, 4.5&lt;br /&gt;
disp_mesh resn 478, color_m=green&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
|- style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
| [[Image:Quickdisplays_disp_mesh.png|center|300px]]'''disp_mesh'''&amp;lt;br&amp;gt;''mesh''&lt;br /&gt;
| [[Image:Quickdisplays_disp_ball_stick.png|center|300px]]'''disp_ball_stick'''&amp;lt;br&amp;gt;''balls and sticks''&lt;br /&gt;
| [[Image:Quickdisplays_combo.png|center|300px]]''combined displays''&amp;lt;br&amp;gt;see example&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Some notes on the arguments==&lt;br /&gt;
* '''selection''' can be used to restrict the display to certain objects or selections, the default is 'all'&lt;br /&gt;
* '''only''' can be ''True'' or ''False'' and will toggle whether the display will be added (''show'') or replace others (''show_as'')&lt;br /&gt;
* '''disp_mesh''' and '''disp_surf''' support the color '''putty''', which will color the object/selection by b-factor&lt;br /&gt;
* '''limits''' defines the b-factor color range: &lt;br /&gt;
** a list entry will define absolute values '''[min;max]'''&lt;br /&gt;
** a float value will calculate the corresponding percentiles '''&amp;amp;plusmn;value%''', ''default=5''&lt;br /&gt;
* setting '''hydrogens''' will add hydrogen to the model; if set to ''=False'', hydrogens are removed, if omitted the state of hydogens will be 'as is'&lt;br /&gt;
* '''colors''' in '''disp_ss''' is flexible:&lt;br /&gt;
** set e.g. three colors, e.g. 'red green blue' for sheets, helices and loops, respectively (cf. example) &lt;br /&gt;
** alternatively certain 'util.' functions can be used (cf. example)&lt;br /&gt;
** setting ''False'' once or for individual colors will suppress coloring&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Applied example ==&lt;br /&gt;
Enter the following lines one-by-one and observe how the display will be affected&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# import function to PyMOL&lt;br /&gt;
import quickdisplays&lt;br /&gt;
&lt;br /&gt;
# prep&lt;br /&gt;
fetch 1hpv, async=0&lt;br /&gt;
bg black&lt;br /&gt;
orient&lt;br /&gt;
disp_list # list of functions&lt;br /&gt;
&lt;br /&gt;
help disp_ss # check out help&lt;br /&gt;
disp_ss&lt;br /&gt;
disp_ss only=T&lt;br /&gt;
disp_ss colors=smudge orange grey&lt;br /&gt;
disp_ss colors=chartreuse False False # False suppresses coloring&lt;br /&gt;
disp_ss colors=util.chainbow # You can use util.cbc, util.rainbow, ...&lt;br /&gt;
&lt;br /&gt;
help disp_ball_stick # check out help&lt;br /&gt;
disp_ball_stick hetatm&lt;br /&gt;
disp_ball_stick all, only=T&lt;br /&gt;
util.cbaw&lt;br /&gt;
disp_ball_stick hydrogens=1&lt;br /&gt;
disp_ball_stick hydrogens=-1&lt;br /&gt;
disp_stick_ball # will this work?&lt;br /&gt;
&lt;br /&gt;
help disp_mesh # check out help&lt;br /&gt;
disp_mesh&lt;br /&gt;
disp_mesh color_m=green, only=False&lt;br /&gt;
disp_mesh color_m=green, only=T&lt;br /&gt;
disp_ball_stick hetatm&lt;br /&gt;
set mesh_skip, 2 # omits lines in mesh&lt;br /&gt;
disp_mesh color_m=default, hydrogens=1, only=T&lt;br /&gt;
disp_mesh color_m=putty, hydrogens=0, limits=20&lt;br /&gt;
disp_mesh color_m=putty, limits=30&lt;br /&gt;
disp_mesh color_m=putty, limits=[15,50]&lt;br /&gt;
&lt;br /&gt;
help disp_putty # check out help&lt;br /&gt;
disp_putty chain A, only=False, limits=[15,50] #only default is True&lt;br /&gt;
disp_putty all, limits=0&lt;br /&gt;
disp_putty all, limits=10&lt;br /&gt;
&lt;br /&gt;
help disp_surf # check out help&lt;br /&gt;
disp_surf color_s=white, solvent=1&lt;br /&gt;
disp_surf color_s=white# solvent=0&lt;br /&gt;
disp_surf color_s=lightblue, transparency=0.8&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==SEE ALSO==&lt;br /&gt;
[[Git intro]], [[Displaying Biochemical Properties]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Script_Library]]&lt;br /&gt;
[[Category:Biochemical_Properties]]&lt;br /&gt;
[[Category:UI_Scripts]]&lt;br /&gt;
[[Category:Biochemical_Scripts]]&lt;/div&gt;</summary>
		<author><name>Sbliven</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Git_install_scripts&amp;diff=12212</id>
		<title>Git install scripts</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Git_install_scripts&amp;diff=12212"/>
		<updated>2014-11-24T09:22:49Z</updated>

		<summary type="html">&lt;p&gt;Sbliven: Fixing capitalization&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Manual download of scripts ==&lt;br /&gt;
If you don't have the option or don't feel like installing git on your system, then go to:&lt;br /&gt;
 https://github.com/Pymol-Scripts/Pymol-script-repo&lt;br /&gt;
Click the &amp;quot;ZIP&amp;quot; button, near the top left corner.&lt;br /&gt;
Now unpack the files to a directory. For example:&lt;br /&gt;
 C:/Users/YOURNAME/Pymol-script-repo&lt;br /&gt;
 /home/YOURNAME/Pymol-script-repo&lt;br /&gt;
&lt;br /&gt;
Now go to: '''Adding Pymol-script-repo to PyMOL search path''' [http://www.pymolwiki.org/index.php/Git_install#Adding_Pymol-script-repo_to_PyMOL_search_path]&lt;br /&gt;
&lt;br /&gt;
== Git install instructions ==&lt;br /&gt;
=== For Windows users ===&lt;br /&gt;
# Install [http://code.google.com/p/msysgit/downloads/list?can=3&amp;amp;q=official+Git Git for Windows].&lt;br /&gt;
Use following settings in options, [http://www.geekgumbo.com/2010/04/09/installing-git-on-windows/ (You can read more here)].&lt;br /&gt;
* Windows Explorer Integration -&amp;gt; Context Menu Entries -&amp;gt; Git Bash Here + Git GUI here&lt;br /&gt;
* Run Git and included Unix tools from Windows Command prompts&lt;br /&gt;
* Checkout Windows style, commit Unix-style endings&lt;br /&gt;
&lt;br /&gt;
# Navigate to: '''C:\Users\YOURNAME'''&lt;br /&gt;
# Right click in folder -&amp;gt; Select: Git Gui -&amp;gt; Clone Existing Repository&lt;br /&gt;
# Source Location: git://github.com/Pymol-Scripts/Pymol-script-repo.git&lt;br /&gt;
# Target Directory: C:\\Users\\YOURNAME\\Pymol-script-repo&lt;br /&gt;
#: A backslash &amp;quot;\&amp;quot; in a string is [http://effbot.org/pyref/string-literals.htm is used for escape sequences]. To get a real backslash in a string, use double backslash &amp;quot;\\&amp;quot;   &lt;br /&gt;
You now have all the scripts available in your directory.&lt;br /&gt;
&lt;br /&gt;
=== For Linux users ===&lt;br /&gt;
# Install git&lt;br /&gt;
 # Debian/Ubuntu/Mint&lt;br /&gt;
 sudo apt-get install git&lt;br /&gt;
 # Fedora&lt;br /&gt;
 su -c 'yum install git'&lt;br /&gt;
 # openSUSE&lt;br /&gt;
 sudo zypper in git&lt;br /&gt;
&lt;br /&gt;
# Navigate to desired folder: &lt;br /&gt;
 cd /home/YOURNAME/&lt;br /&gt;
 git clone git://github.com/Pymol-Scripts/Pymol-script-repo.git&lt;br /&gt;
You now have all the scripts available in: /home/YOURNAME/Pymol-script-repo&lt;br /&gt;
&lt;br /&gt;
== Adding Pymol-script-repo to PyMOL search path ==&lt;br /&gt;
You now have to add the &amp;quot;Pymol-script-repo&amp;quot; directory to the PyMOL search path. &lt;br /&gt;
&lt;br /&gt;
PyMOL has since revision 3997 (30 April 2012) an improved plugin/script manager.&lt;br /&gt;
You have to remove old installations of plugins first, to get the automatic plugin installation to work.&lt;br /&gt;
=== Making a personal &amp;quot;pymolrc&amp;quot; file - for personal use ===&lt;br /&gt;
# Open notepad/gedit and save under:&lt;br /&gt;
## Win: '''C:\Users\YOURNAME\pymolrc.pym''' (Set: &amp;quot;Save as type&amp;quot; to &amp;quot;All files&amp;quot;)&lt;br /&gt;
## Linux: '''~/.pymolrc'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Add paths to sys.path so PyMOL can find modules and scripts&lt;br /&gt;
import sys, os&lt;br /&gt;
pymol_git = os.path.abspath(os.path.join(os.path.expanduser('~'), 'Pymol-script-repo'))&lt;br /&gt;
os.environ['PYMOL_GIT_MOD'] = os.path.join(pymol_git,'modules')&lt;br /&gt;
sys.path.append(pymol_git)&lt;br /&gt;
sys.path.append(os.environ['PYMOL_GIT_MOD'])&lt;br /&gt;
&lt;br /&gt;
# Make starting directory and change to it.&lt;br /&gt;
home_dir = os.path.abspath(os.path.join(os.path.expanduser('~'), 'pymol'))&lt;br /&gt;
if not os.path.exists(home_dir): os.makedirs(home_dir)&lt;br /&gt;
os.chdir(home_dir)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then open PyMOL. Go to top menu: Plugin-&amp;gt;Plugin Manager&lt;br /&gt;
# Installed plugins: Unclick &amp;quot;apbs_tools&amp;quot; as &amp;quot;load on startup&amp;quot;. (The Pymol-script-repo has a fine-tuned version, &amp;quot;apbsplugin&amp;quot;)&lt;br /&gt;
# Settings-&amp;gt;Add new directory: Point to: /custom/path/Pymol-script-repo/plugins&lt;br /&gt;
# Restart PyMOL&lt;br /&gt;
&lt;br /&gt;
=== Making a general &amp;quot;run_on_startup.py&amp;quot; - for all users ===&lt;br /&gt;
This section describes automatic loading of plugins using PyMOL's [[Plugin Manager]], which is available in newer PyMOL versions (e.g. 1.7, or higher).&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have a shared PyMOL installation for several linux computers, you can make general wide changes for the startup of PyMOL.&amp;lt;br&amp;gt;&lt;br /&gt;
First locate your PYMOL_PATH. Start PyMOL, and write:&lt;br /&gt;
 import os&lt;br /&gt;
 print os.environ['PYMOL_PATH']&lt;br /&gt;
In this folder, you place &amp;quot;run_on_startup.py&amp;quot; and the Pymol-script-repo directory.&amp;lt;br&amp;gt;&lt;br /&gt;
Write in &amp;quot;run_on_startup.py&amp;quot; : &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# Add paths to sys.path so PyMOL can find modules and scripts&lt;br /&gt;
import sys, os&lt;br /&gt;
pymol_git = os.path.abspath(os.path.join(os.environ['PYMOL_PATH'], 'Pymol-script-repo'))&lt;br /&gt;
os.environ['PYMOL_GIT_MOD'] = os.path.join(pymol_git,'modules')&lt;br /&gt;
sys.path.append(pymol_git)&lt;br /&gt;
sys.path.append(os.environ['PYMOL_GIT_MOD'])&lt;br /&gt;
&lt;br /&gt;
# Make starting directory and change to it.&lt;br /&gt;
home_dir = os.path.abspath(os.path.join(os.path.expanduser('~'), 'pymol'))&lt;br /&gt;
if not os.path.exists(home_dir): os.makedirs(home_dir)&lt;br /&gt;
os.chdir(home_dir)&lt;br /&gt;
&lt;br /&gt;
# Make setting changes to Plugin Manager&lt;br /&gt;
import pymol.plugins&lt;br /&gt;
pymol.plugins.preferences = {'instantsave': False, 'verbose': False}&lt;br /&gt;
pymol.plugins.autoload = {'apbs_tools': False}&lt;br /&gt;
pymol.plugins.set_startup_path([os.path.join(pymol_git, 'plugins'), os.path.join(sys.prefix, 'Lib', 'site-packages', 'pmg_tk', 'startup')])&lt;br /&gt;
pymol.plugins.preferences = {'instantsave': True, 'verbose': False}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test the Scripts ==&lt;br /&gt;
Now start PyMOL, and test in PyMOL.&lt;br /&gt;
 print sys.path&lt;br /&gt;
 import colorbydisplacement&lt;br /&gt;
 help(colorbydisplacement)&lt;br /&gt;
&lt;br /&gt;
== Get latest changes to scripts ==&lt;br /&gt;
If new scripts are available or changes have been made, then:&lt;br /&gt;
=== For windows users ===&lt;br /&gt;
# Navigate to '''C:\Users\YOURNAME\Pymol-script-repo'''&lt;br /&gt;
# Right click in folder -&amp;gt; Select: Git Bash&lt;br /&gt;
# Write in terminal&lt;br /&gt;
 git pull origin master&lt;br /&gt;
&lt;br /&gt;
=== For Ubuntu/Mint users ===&lt;br /&gt;
# Navigate to '''/home/YOURNAME/Pymol-script-repo'''&lt;br /&gt;
# Write in terminal.&lt;br /&gt;
 git pull origin master&lt;br /&gt;
&lt;br /&gt;
= Do you want to contribute with a script? =&lt;br /&gt;
Information how to contribute scripts to the repository. It's easy! &amp;lt;br&amp;gt;&lt;br /&gt;
http://www.pymolwiki.org/index.php/git_authors&lt;/div&gt;</summary>
		<author><name>Sbliven</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Plugin_Manager&amp;diff=12650</id>
		<title>Plugin Manager</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Plugin_Manager&amp;diff=12650"/>
		<updated>2014-11-24T09:21:25Z</updated>

		<summary type="html">&lt;p&gt;Sbliven: moved Plugin manager to Plugin Manager: Fixing capitalization&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Newer versions of PyMOL come with a '''Plugin Manager''', which can be used to load plugins such as those in the [https://github.com/Pymol-Scripts/Pymol-script-repo# PyMOL Script Repo].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Manual Setup=&lt;br /&gt;
In the PyMOL menu naviagte to '''Plugins''' &amp;gt; '''Plugin Manager''' &amp;lt;br&amp;gt;&lt;br /&gt;
Here you can manually add directories or scripts that will be loaded upon startup.&amp;lt;br&amp;gt;&lt;br /&gt;
Older versions have a basic version of this manager: '''Plugin''' &amp;gt; '''Manage Plugins''', however, here the scripts need to be added individually.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Scripted setup during PyMOL launching=&lt;br /&gt;
===Creating run_on_startup.py===&lt;br /&gt;
'''run_on_startup.py''' can easily be created using a text editor such as notepad. The '''run_on_startup.py''' is handled similar to [[Pymolrc|pymolrc]] files and is executed every time PyMOL launches. An important distinction is that '''run_on_startup.py''' is executed before the [[Pymolrc|pymolrc]] files and is purely written in python.&lt;br /&gt;
&lt;br /&gt;
The recommended location of '''run_on_startup.py''' is the [[PYMOL_PATH|PyMOL home directory]]. An advantage is that should PyMOL be installed on a computer with several users, this will be run for all users, while the pymolrc files can be individual (e.g. in the USER directory).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#this can be copy-pasted to create run_on_startup.py in the home directory&lt;br /&gt;
 &lt;br /&gt;
# Add paths to sys.path so PyMOL can find modules and scripts&lt;br /&gt;
import sys&lt;br /&gt;
import os&lt;br /&gt;
 &lt;br /&gt;
pymol_git = os.path.realpath(os.path.join(os.environ['PYMOL_PATH'], 'Pymol-script-repo'))&lt;br /&gt;
 &lt;br /&gt;
os.environ['PYMOL_GIT_MOD'] = os.path.join(pymol_git,'modules')&lt;br /&gt;
sys.path.append(pymol_git)&lt;br /&gt;
sys.path.append(os.environ['PYMOL_GIT_MOD'])&lt;br /&gt;
 &lt;br /&gt;
# Make setting changes to Plugin Manager&lt;br /&gt;
try: # in case the PyMOL is older and doe not have the module pymol.plugins&lt;br /&gt;
    import pymol.plugins&lt;br /&gt;
 &lt;br /&gt;
    #THIS IS WHERE THE PATH IS ADDED TO INITIALIZE PLUGINS USING THE PLUGIN MANAGER&lt;br /&gt;
    pymol.plugins.set_startup_path([os.path.join(pymol_git, 'plugins'), os.path.join(sys.prefix, 'Lib', 'site-packages', 'pmg_tk', 'startup')])&lt;br /&gt;
 &lt;br /&gt;
    pymol.plugins.preferences = {'instantsave': False, 'verbose': False}&lt;br /&gt;
    pymol.plugins.autoload = {'apbs_tools': False}&lt;br /&gt;
    pymol.plugins.preferences = {'instantsave': True, 'verbose': False}&lt;br /&gt;
    # This can be used to trace if PyMOL executed the file correctly&lt;br /&gt;
    print 'Loaded run_on_stratup.py'&lt;br /&gt;
except:&lt;br /&gt;
    print 'NB! Plugin Manager not present!'&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that this block will also add the '''Pymol-script-repo''' and the subfolder '''Pymol-script-repo/modules''' to PyMOL's search path. This is something that is required in earlier PyMOL version to allow import of scripts. Thus this version of '''run_on_startup.py''' can be used for older versions, too.&lt;br /&gt;
&lt;br /&gt;
Note that the settings specific for the ''new'' version of the '''Plugin Manager''' will not have an effect.&lt;br /&gt;
&lt;br /&gt;
===What if the 'Pymol-script-repo' is not in the PyMOL directory?===&lt;br /&gt;
If the '''Pymol-script-repo''' is located somewhere else the first section of the '''run_on_startup.py''' file will be different.&amp;lt;br&amp;gt;&lt;br /&gt;
E.g. in the USER directory:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# This would replace the first section in '''run_on_startup.py'''.&lt;br /&gt;
import sys&lt;br /&gt;
import os&lt;br /&gt;
&lt;br /&gt;
pymol_git = os.path.abspath(os.path.join(os.path.expanduser('~'), 'Pymol-script-repo'))&lt;br /&gt;
&lt;br /&gt;
os.environ['PYMOL_GIT_MOD'] = os.path.join(pymol_git,'modules')&lt;br /&gt;
sys.path.append(pymol_git)&lt;br /&gt;
sys.path.append(os.environ['PYMOL_GIT_MOD'])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
E.g. in any other path:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# This would replace the first section in '''run_on_startup.py'''.&lt;br /&gt;
import sys&lt;br /&gt;
import os&lt;br /&gt;
&lt;br /&gt;
pymol_git = os.path.realpath('D:/MY/RANDOM/PATH/TO/Pymol-script-repo') # Adjust this line&lt;br /&gt;
# Note the slash ('/') instead of backslash ('\'), beware Windows users!&lt;br /&gt;
&lt;br /&gt;
os.environ['PYMOL_GIT_MOD'] = os.path.join(pymol_git,'modules')&lt;br /&gt;
sys.path.append(pymol_git)&lt;br /&gt;
sys.path.append(os.environ['PYMOL_GIT_MOD'])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Appending additional paths to the Plugin Manager===&lt;br /&gt;
Should your scripts be located in several alternative locations, it is possible to append additional directories to the '''Plugin Manager'''.&amp;lt;br&amp;gt;&lt;br /&gt;
In the example below, a directory called 'plugins_private', which is located in the PyMOL directory, is added to the Plugin Manger.&amp;lt;br&amp;gt;&lt;br /&gt;
Should the folder be somewhere else the example below can be adjusted as outlined above.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#copy paste into PyMOL's command line or into the pymolrc&lt;br /&gt;
&lt;br /&gt;
python&lt;br /&gt;
import os&lt;br /&gt;
import sys&lt;br /&gt;
import pymol.plugins # Note that this requires the 'new' Plugin Manager&lt;br /&gt;
&lt;br /&gt;
PRIVATE_PATH=os.path.realpath(os.path.join(os.environ['PYMOL_PATH'], 'plugins_private'))&lt;br /&gt;
startupdirectories=list(pymol.plugins.get_startup_path(True))&lt;br /&gt;
if PRIVATE_PATH not in startupdirectories:&lt;br /&gt;
    startupdirectories.append(PRIVATE_PATH)&lt;br /&gt;
if PRIVATE_PATH not in sys.path:&lt;br /&gt;
    sys.path.append(PRIVATE_PATH)&lt;br /&gt;
pymol.plugins.set_startup_path(startupdirectories)&lt;br /&gt;
python end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the '''Plugin Manager''' supports loading entire folders with scripts ('modules').&amp;lt;br&amp;gt;&lt;br /&gt;
If you have such a folder, make sure it contains a file called '__init__.py', which can be empty.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=If you don't have a Plugin Manager=&lt;br /&gt;
If you are running an older PyMOL without '''Plugin Manager''' you can either upgrade to the newest version or load plugins the traditional way. &amp;lt;br&amp;gt;&lt;br /&gt;
For detailed instructions see: [[Git install scripts]]&amp;lt;br&amp;gt;&lt;br /&gt;
Essentially, make sure that the folder is added to PyMOL's search paths.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import os&lt;br /&gt;
pymol_git = os.path.realpath(os.path.join(os.environ['PYMOL_PATH'], 'Pymol-script-repo'))&lt;br /&gt;
sys.path.append(pymol_git)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Import a plugin manually:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# EXAMPLE&lt;br /&gt;
delete all&lt;br /&gt;
frag LYS&lt;br /&gt;
cgo_arrow name N, name O # will not work if 'cgo_arrow' is not loaded&lt;br /&gt;
&lt;br /&gt;
import cgo_arrow # PyMOL will look for this file and load it&lt;br /&gt;
cgo_arrow name N, name O # should work if it is loaded&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=SEE ALSO=&lt;br /&gt;
[[Git install scripts]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Launching]]&lt;/div&gt;</summary>
		<author><name>Sbliven</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Plugin_manager&amp;diff=12356</id>
		<title>Plugin manager</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Plugin_manager&amp;diff=12356"/>
		<updated>2014-11-24T09:21:25Z</updated>

		<summary type="html">&lt;p&gt;Sbliven: moved Plugin manager to Plugin Manager: Fixing capitalization&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Plugin Manager]]&lt;/div&gt;</summary>
		<author><name>Sbliven</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Plugin_Manager&amp;diff=12649</id>
		<title>Plugin Manager</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Plugin_Manager&amp;diff=12649"/>
		<updated>2014-11-24T09:19:37Z</updated>

		<summary type="html">&lt;p&gt;Sbliven: /* Creating run_on_startup.py */ Adding link to PYMOL_PATH + some minor formatting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Newer versions of PyMOL come with a '''Plugin Manager''', which can be used to load plugins such as those in the [https://github.com/Pymol-Scripts/Pymol-script-repo# PyMOL Script Repo].&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Manual Setup=&lt;br /&gt;
In the PyMOL menu naviagte to '''Plugins''' &amp;gt; '''Plugin Manager''' &amp;lt;br&amp;gt;&lt;br /&gt;
Here you can manually add directories or scripts that will be loaded upon startup.&amp;lt;br&amp;gt;&lt;br /&gt;
Older versions have a basic version of this manager: '''Plugin''' &amp;gt; '''Manage Plugins''', however, here the scripts need to be added individually.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Scripted setup during PyMOL launching=&lt;br /&gt;
===Creating run_on_startup.py===&lt;br /&gt;
'''run_on_startup.py''' can easily be created using a text editor such as notepad. The '''run_on_startup.py''' is handled similar to [[Pymolrc|pymolrc]] files and is executed every time PyMOL launches. An important distinction is that '''run_on_startup.py''' is executed before the [[Pymolrc|pymolrc]] files and is purely written in python.&lt;br /&gt;
&lt;br /&gt;
The recommended location of '''run_on_startup.py''' is the [[PYMOL_PATH|PyMOL home directory]]. An advantage is that should PyMOL be installed on a computer with several users, this will be run for all users, while the pymolrc files can be individual (e.g. in the USER directory).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#this can be copy-pasted to create run_on_startup.py in the home directory&lt;br /&gt;
 &lt;br /&gt;
# Add paths to sys.path so PyMOL can find modules and scripts&lt;br /&gt;
import sys&lt;br /&gt;
import os&lt;br /&gt;
 &lt;br /&gt;
pymol_git = os.path.realpath(os.path.join(os.environ['PYMOL_PATH'], 'Pymol-script-repo'))&lt;br /&gt;
 &lt;br /&gt;
os.environ['PYMOL_GIT_MOD'] = os.path.join(pymol_git,'modules')&lt;br /&gt;
sys.path.append(pymol_git)&lt;br /&gt;
sys.path.append(os.environ['PYMOL_GIT_MOD'])&lt;br /&gt;
 &lt;br /&gt;
# Make setting changes to Plugin Manager&lt;br /&gt;
try: # in case the PyMOL is older and doe not have the module pymol.plugins&lt;br /&gt;
    import pymol.plugins&lt;br /&gt;
 &lt;br /&gt;
    #THIS IS WHERE THE PATH IS ADDED TO INITIALIZE PLUGINS USING THE PLUGIN MANAGER&lt;br /&gt;
    pymol.plugins.set_startup_path([os.path.join(pymol_git, 'plugins'), os.path.join(sys.prefix, 'Lib', 'site-packages', 'pmg_tk', 'startup')])&lt;br /&gt;
 &lt;br /&gt;
    pymol.plugins.preferences = {'instantsave': False, 'verbose': False}&lt;br /&gt;
    pymol.plugins.autoload = {'apbs_tools': False}&lt;br /&gt;
    pymol.plugins.preferences = {'instantsave': True, 'verbose': False}&lt;br /&gt;
    # This can be used to trace if PyMOL executed the file correctly&lt;br /&gt;
    print 'Loaded run_on_stratup.py'&lt;br /&gt;
except:&lt;br /&gt;
    print 'NB! Plugin Manager not present!'&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that this block will also add the '''Pymol-script-repo''' and the subfolder '''Pymol-script-repo/modules''' to PyMOL's search path. This is something that is required in earlier PyMOL version to allow import of scripts. Thus this version of '''run_on_startup.py''' can be used for older versions, too.&lt;br /&gt;
&lt;br /&gt;
Note that the settings specific for the ''new'' version of the '''Plugin Manager''' will not have an effect.&lt;br /&gt;
&lt;br /&gt;
===What if the 'Pymol-script-repo' is not in the PyMOL directory?===&lt;br /&gt;
If the '''Pymol-script-repo''' is located somewhere else the first section of the '''run_on_startup.py''' file will be different.&amp;lt;br&amp;gt;&lt;br /&gt;
E.g. in the USER directory:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# This would replace the first section in '''run_on_startup.py'''.&lt;br /&gt;
import sys&lt;br /&gt;
import os&lt;br /&gt;
&lt;br /&gt;
pymol_git = os.path.abspath(os.path.join(os.path.expanduser('~'), 'Pymol-script-repo'))&lt;br /&gt;
&lt;br /&gt;
os.environ['PYMOL_GIT_MOD'] = os.path.join(pymol_git,'modules')&lt;br /&gt;
sys.path.append(pymol_git)&lt;br /&gt;
sys.path.append(os.environ['PYMOL_GIT_MOD'])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
E.g. in any other path:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# This would replace the first section in '''run_on_startup.py'''.&lt;br /&gt;
import sys&lt;br /&gt;
import os&lt;br /&gt;
&lt;br /&gt;
pymol_git = os.path.realpath('D:/MY/RANDOM/PATH/TO/Pymol-script-repo') # Adjust this line&lt;br /&gt;
# Note the slash ('/') instead of backslash ('\'), beware Windows users!&lt;br /&gt;
&lt;br /&gt;
os.environ['PYMOL_GIT_MOD'] = os.path.join(pymol_git,'modules')&lt;br /&gt;
sys.path.append(pymol_git)&lt;br /&gt;
sys.path.append(os.environ['PYMOL_GIT_MOD'])&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Appending additional paths to the Plugin Manager===&lt;br /&gt;
Should your scripts be located in several alternative locations, it is possible to append additional directories to the '''Plugin Manager'''.&amp;lt;br&amp;gt;&lt;br /&gt;
In the example below, a directory called 'plugins_private', which is located in the PyMOL directory, is added to the Plugin Manger.&amp;lt;br&amp;gt;&lt;br /&gt;
Should the folder be somewhere else the example below can be adjusted as outlined above.&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#copy paste into PyMOL's command line or into the pymolrc&lt;br /&gt;
&lt;br /&gt;
python&lt;br /&gt;
import os&lt;br /&gt;
import sys&lt;br /&gt;
import pymol.plugins # Note that this requires the 'new' Plugin Manager&lt;br /&gt;
&lt;br /&gt;
PRIVATE_PATH=os.path.realpath(os.path.join(os.environ['PYMOL_PATH'], 'plugins_private'))&lt;br /&gt;
startupdirectories=list(pymol.plugins.get_startup_path(True))&lt;br /&gt;
if PRIVATE_PATH not in startupdirectories:&lt;br /&gt;
    startupdirectories.append(PRIVATE_PATH)&lt;br /&gt;
if PRIVATE_PATH not in sys.path:&lt;br /&gt;
    sys.path.append(PRIVATE_PATH)&lt;br /&gt;
pymol.plugins.set_startup_path(startupdirectories)&lt;br /&gt;
python end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the '''Plugin Manager''' supports loading entire folders with scripts ('modules').&amp;lt;br&amp;gt;&lt;br /&gt;
If you have such a folder, make sure it contains a file called '__init__.py', which can be empty.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=If you don't have a Plugin Manager=&lt;br /&gt;
If you are running an older PyMOL without '''Plugin Manager''' you can either upgrade to the newest version or load plugins the traditional way. &amp;lt;br&amp;gt;&lt;br /&gt;
For detailed instructions see: [[Git install scripts]]&amp;lt;br&amp;gt;&lt;br /&gt;
Essentially, make sure that the folder is added to PyMOL's search paths.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import sys&lt;br /&gt;
import os&lt;br /&gt;
pymol_git = os.path.realpath(os.path.join(os.environ['PYMOL_PATH'], 'Pymol-script-repo'))&lt;br /&gt;
sys.path.append(pymol_git)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Import a plugin manually:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# EXAMPLE&lt;br /&gt;
delete all&lt;br /&gt;
frag LYS&lt;br /&gt;
cgo_arrow name N, name O # will not work if 'cgo_arrow' is not loaded&lt;br /&gt;
&lt;br /&gt;
import cgo_arrow # PyMOL will look for this file and load it&lt;br /&gt;
cgo_arrow name N, name O # should work if it is loaded&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=SEE ALSO=&lt;br /&gt;
[[Git install scripts]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Launching]]&lt;/div&gt;</summary>
		<author><name>Sbliven</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=PYMOL_PATH&amp;diff=12354</id>
		<title>PYMOL PATH</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=PYMOL_PATH&amp;diff=12354"/>
		<updated>2014-11-24T09:14:57Z</updated>

		<summary type="html">&lt;p&gt;Sbliven: Creating PYMOL_PATH page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The '''PYMOL_PATH''' environmental variable points to the root PyMOL directory. It contains internal PyMol code and core modules. It is also the location for plugins installed via the [[Plugin Manager]]. The variable should be set automatically by PyMOL, and should not normally need to be changed by the user.&lt;br /&gt;
&lt;br /&gt;
= Standard Locations =&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Windows:''' &amp;lt;tt&amp;gt;C:\Program Files\PyMOL\&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Mac:''' &amp;lt;tt&amp;gt;/Applications/MacPyMOL.app/pymol&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Ubuntu''' (Open-source PyMOL): &amp;lt;tt&amp;gt;/usr/lib/python2.7/dist-packages/pymol&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Determining the location =&lt;br /&gt;
&lt;br /&gt;
For other operating systems or non-standard installation locations, the PYMOL_PATH can be determined by running the following command from within PyMOL:&lt;br /&gt;
&lt;br /&gt;
 print os.environ['PYMOL_PATH']&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Contents =&lt;br /&gt;
&lt;br /&gt;
The contents of PYTHON_PATH should generally not be modified, but a few locations can be useful to know:&lt;br /&gt;
&lt;br /&gt;
* '''&amp;lt;tt&amp;gt;PYMOL_PATH/examples/&amp;lt;/tt&amp;gt;''' Example PyMOL and Python scripts&lt;br /&gt;
* '''&amp;lt;tt&amp;gt;PYMOL_PATH/modules/pmg_tk/startup/&lt;br /&gt;
* '''&amp;lt;tt&amp;gt;PYMOL_PATH/run_on_startup.py&amp;lt;/tt&amp;gt;''' A python script run at startup, before &amp;lt;tt&amp;gt;.pymolrc&amp;lt;/tt&amp;gt;. See [[Plugin Manager]] for details.&lt;/div&gt;</summary>
		<author><name>Sbliven</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Selector&amp;diff=11876</id>
		<title>Selector</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Selector&amp;diff=11876"/>
		<updated>2014-05-19T07:58:23Z</updated>

		<summary type="html">&lt;p&gt;Sbliven: Redirect to Property Selectors, which is more appropriate.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Property Selectors]]&lt;/div&gt;</summary>
		<author><name>Sbliven</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Selectors&amp;diff=11878</id>
		<title>Selectors</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Selectors&amp;diff=11878"/>
		<updated>2014-05-19T07:57:51Z</updated>

		<summary type="html">&lt;p&gt;Sbliven: Redirect to Property Selectors&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Property Selectors]]&lt;/div&gt;</summary>
		<author><name>Sbliven</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Selector&amp;diff=11875</id>
		<title>Selector</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Selector&amp;diff=11875"/>
		<updated>2014-05-19T07:56:04Z</updated>

		<summary type="html">&lt;p&gt;Sbliven: Redirect to Selection Algebra&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Selection Algebra]]&lt;/div&gt;</summary>
		<author><name>Sbliven</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Selection&amp;diff=11880</id>
		<title>Selection</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Selection&amp;diff=11880"/>
		<updated>2014-05-19T07:55:41Z</updated>

		<summary type="html">&lt;p&gt;Sbliven: Redirect to Selection Algebra&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Selection Algebra]]&lt;/div&gt;</summary>
		<author><name>Sbliven</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Talk:H_Add&amp;diff=330</id>
		<title>Talk:H Add</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Talk:H_Add&amp;diff=330"/>
		<updated>2013-08-06T23:25:39Z</updated>

		<summary type="html">&lt;p&gt;Sbliven: /* Atom names */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Atom names==&lt;br /&gt;
&lt;br /&gt;
The names assigned to hydrogens take the form H01, H02, ..., and they seem to be assigned consistently to each amino acid. Is there a way to get h_add to use the standard PDB atom names instead? Or is this a deliberate attempt to break compatibility with other software packages, since the protonation states are assigned arbitrarily by h_add?&lt;br /&gt;
&lt;br /&gt;
--[[User:Sbliven|Sbliven]] 18:25, 6 August 2013 (CDT)&lt;/div&gt;</summary>
		<author><name>Sbliven</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Editing_atoms&amp;diff=7936</id>
		<title>Editing atoms</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Editing_atoms&amp;diff=7936"/>
		<updated>2012-07-23T20:49:54Z</updated>

		<summary type="html">&lt;p&gt;Sbliven: /* Get coordinates from Python */ Fixed list numbering&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Altering atom types/elements==&lt;br /&gt;
Example:&lt;br /&gt;
&lt;br /&gt;
To transform a carbon into an oxygen,&lt;br /&gt;
pick an atom by a ''select'' command or CTRL+middle.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
alter pk1,elem='O'&lt;br /&gt;
alter pk1,name='O2'&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Note that the ''name'' field should contain something more descriptive than just the element symbol.&lt;br /&gt;
For reasons unknown (?), util.cbag() and similar methods will not recognize the new element.&lt;br /&gt;
&lt;br /&gt;
==Altering atom coordinates==&lt;br /&gt;
Example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
alter_state 1,(pdb1cse),x=x-10.0 &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The latter section can contain formulae involving at least the xyz coordinates, lots of constants and the (+-*/) operators.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
==Translate or rotate individual objects==&lt;br /&gt;
There is a &amp;quot;translate&amp;quot; function similar to &amp;quot;rotate&amp;quot;, the docs for these don't exist yet, because the implementation isn't finished. However, feel free to use them in the following forms:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
translate vector,object-name,state&lt;br /&gt;
   vector needs to be something like [x,y,z]&lt;br /&gt;
&lt;br /&gt;
   translate [1,0,0],pept&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
rotate axis,angle,object-name,state&lt;br /&gt;
   axis can be either the letter x,y,z or a 3D vector [x,y,z]&lt;br /&gt;
&lt;br /&gt;
   rotate x,90,pept&lt;br /&gt;
   rotate [1,1,1],10,pept&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Get coordinates from Python==&lt;br /&gt;
&lt;br /&gt;
# The actual C-langauge arrays aren't exposed, but there are at least three different ways you can modify coordinates from within Python: You can get a python object which contains the molecular information, modify the coordinates in that object, load the modified molecule into PyMOL, update the modified coordinates to the original model, and then delete the modified object. (link to example)&lt;br /&gt;
# Another approach is the &amp;quot;alter_state&amp;quot; function, which can perform the same transformation in a single PyMOL command statement:&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
alter_state 1,pept,(x,y)=(-y,x)&lt;br /&gt;
&amp;lt;/source&amp;gt;Likewise sub-selections can be transformed as well:&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
alter_state 1,(pept and name ca),(x,y,z)=(x+5,y,z)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
# A third approach is to use alter_state with the global &amp;quot;stored&amp;quot; object: Example in a Python script)&lt;br /&gt;
Approaches 2 gives the best [[:Category:Performance|performance]], approach 3 gives more flexibility, and approach 1 gives you a reusable and fully modifiable Python object.&lt;br /&gt;
&lt;br /&gt;
[[Category:Modeling_and_Editing_Structures|Editing Atoms]]&lt;br /&gt;
[[Category:Performance]]&lt;br /&gt;
[[Category:States]]&lt;/div&gt;</summary>
		<author><name>Sbliven</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Talk:Color_Objects&amp;diff=303</id>
		<title>Talk:Color Objects</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Talk:Color_Objects&amp;diff=303"/>
		<updated>2010-05-17T00:46:02Z</updated>

		<summary type="html">&lt;p&gt;Sbliven: Pointed out bug with get_names('models')&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Bugs ==&lt;br /&gt;
&lt;br /&gt;
Using MacPyMol 1.2edu, I get an error from the line &amp;quot;obj_list = cmd.get_names('models')&amp;quot; stating that 'models' can't be found. This can be fixed by changing 'models' to 'objects'. If someone confirms that this is still a problem in the current build of pymol we should change it in the script. [[User:Sbliven|Sbliven]] 00:46, 17 May 2010 (UTC)&lt;/div&gt;</summary>
		<author><name>Sbliven</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Advanced_Coloring&amp;diff=695</id>
		<title>Advanced Coloring</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Advanced_Coloring&amp;diff=695"/>
		<updated>2010-05-17T00:31:24Z</updated>

		<summary type="html">&lt;p&gt;Sbliven: Changed a  broken external link for color_obj.py to point to the proper page on this wiki&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Coloring Molecules=&lt;br /&gt;
&lt;br /&gt;
==Basic Coloring==&lt;br /&gt;
Any molecule in PyMOL can be assigned a color using the small rightmost buttons in the object list (in the upper right part of the main GUI window. The [[Color]] command will do the same.&lt;br /&gt;
&lt;br /&gt;
PyMOL has a predefined set of colors that can be edited in the ''Settings-&amp;gt;Colors'' menu. &lt;br /&gt;
Alternatively, you can use the [[Set_Color]] command. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Coloring secondary structures==&lt;br /&gt;
To assign helices, sheets and loops individual colors, do:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
color red, ss h&lt;br /&gt;
color yellow, ss s&lt;br /&gt;
color green, ss l+''&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the colour bleeds from the ends of helices and sheets into loops, do:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
set cartoon_discrete_colors, 1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Or activate ''Cartoon -&amp;gt; Discrete Colors'' in the GUI menu.&lt;br /&gt;
&lt;br /&gt;
==Coloring by atom type==&lt;br /&gt;
The util.cba* (&amp;quot;Color By Atom&amp;quot;) commands color atoms according to type: oxygen in red, nitrogen in blue, hydrogen in white. Carbon will get a different colors, depending on the command:&lt;br /&gt;
{|&lt;br /&gt;
! command&lt;br /&gt;
! carbon color&lt;br /&gt;
|-&lt;br /&gt;
| util.cba'''g'''&lt;br /&gt;
| green&lt;br /&gt;
|-&lt;br /&gt;
| util.cba'''c'''&lt;br /&gt;
| cyan&lt;br /&gt;
|-&lt;br /&gt;
| util.cba?&lt;br /&gt;
| magenta&lt;br /&gt;
|-&lt;br /&gt;
| util.cba'''y'''&lt;br /&gt;
| yellow&lt;br /&gt;
|-&lt;br /&gt;
| util.cba'''s'''&lt;br /&gt;
| salmon&lt;br /&gt;
|-&lt;br /&gt;
| util.cba'''w'''&lt;br /&gt;
| white/grey&lt;br /&gt;
|-&lt;br /&gt;
| util.cba'''b'''&lt;br /&gt;
| slate&lt;br /&gt;
|-&lt;br /&gt;
| util.cba?&lt;br /&gt;
| orange&lt;br /&gt;
|-&lt;br /&gt;
| util.cba'''o'''&lt;br /&gt;
| light orange&lt;br /&gt;
|-&lt;br /&gt;
| util.cba'''p'''&lt;br /&gt;
| purple&lt;br /&gt;
|-&lt;br /&gt;
| util.cba'''k'''&lt;br /&gt;
| pink&lt;br /&gt;
|}&lt;br /&gt;
For instance:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
  util.cbay three&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
will color the object ''three'' by atom type, with the carbon atoms in yellow.&lt;br /&gt;
&lt;br /&gt;
==CMYK-safe Colors==&lt;br /&gt;
There are two distinct color spaces on computers: RGB (red-green-blue), which is for screens, and CMYK (cyan-magenta-yellow-black), which is for printing.&lt;br /&gt;
Some RGB triplets do not have equivalents in CMYK space. As a result, a figure that looks great on a screen can come out with unpredictable colors when printed.&lt;br /&gt;
&lt;br /&gt;
Most applications do a good job with RGB-to-CMYK conversions for photos, but do not do such a good job with graphics that use pure primary colors. For example, reds are generally OK, but pure blues and greens do not translate very well.&lt;br /&gt;
&lt;br /&gt;
Here are some RGB values that are within the CMYK gamut (i.e. are &amp;quot;CMYK-safe&amp;quot;):&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#optimized rgb values for cmyk output:&lt;br /&gt;
set_color dblue= [0.05 , 0.19 , 0.57]&lt;br /&gt;
set_color blue=  [0.02 , 0.50 , 0.72]&lt;br /&gt;
set_color mblue= [0.5  , 0.7  , 0.9 ]&lt;br /&gt;
set_color lblue= [0.86 , 1.00 , 1.00]&lt;br /&gt;
&lt;br /&gt;
set_color green= [0.00 , 0.53 , 0.22]&lt;br /&gt;
set_color lgreen=[0.50 , 0.78 , 0.50]&lt;br /&gt;
set_color yellow=[0.95 , 0.78 , 0.00]&lt;br /&gt;
set_color orange=[1.00 , 0.40 , 0.0 ]&lt;br /&gt;
&lt;br /&gt;
# these are trivial&lt;br /&gt;
set_color red=   [1.00 , 0.00 , 0.00]&lt;br /&gt;
set_color mred=  [1.00 , 0.40 , 0.40]&lt;br /&gt;
set_color lred=  [1.00 , 0.80 , 0.80]&lt;br /&gt;
set_color vlred= [1.00 , 0.90 , 0.90]&lt;br /&gt;
set_color white= [1.00 , 1.00 , 1.00]&lt;br /&gt;
set_color vlgray=[0.95 , 0.95 , 0.95]&lt;br /&gt;
set_color lgray= [0.90 , 0.90 , 0.90]&lt;br /&gt;
set_color gray=  [0.70 , 0.70 , 0.70]&lt;br /&gt;
set_color dgray= [0.50 , 0.50 , 0.50]&lt;br /&gt;
set_color vdgray=[0.30 , 0.30 , 0.30]&lt;br /&gt;
set_color black= [0.00 , 0.00 , 0.00]&lt;br /&gt;
##&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that there are default atom colors such as &amp;quot;carbon&amp;quot;, &amp;quot;nitrogen&amp;quot;, &amp;quot;oxygen&amp;quot;, &amp;quot;hydrogen&amp;quot;, &amp;quot;sulfur&amp;quot;, etc. which should also be redefined:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
set_color carbon= [0.00 , 0.53 , 0.22]&lt;br /&gt;
etc.&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Coloring with 'chainbows' from a script==&lt;br /&gt;
The chainbow function can be invoked by:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
util.chainbow(&amp;quot;object-name&amp;quot;)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Assign color by B-factor==&lt;br /&gt;
Robert Campbell has a color_b.py python script on his PyMOL web page that you can use.&lt;br /&gt;
it has a number of options including the selection, minimum and maximum values to consider and several types of colouring schemes (a selection of gradients plus the ability to set the saturation and brightness levels) and two types of binning of the colours (equal number of atoms in each colour or equal spacing of colours along the B-factor range).&lt;br /&gt;
&lt;br /&gt;
See http://pldserver1.biochem.queensu.ca/~rlc/work/pymol to download.&lt;br /&gt;
&lt;br /&gt;
====PyMol B-factor Coloring====&lt;br /&gt;
This concept is also discussed in [[Color#Color_by_Spectrum_Example|Coloring by BFactors and Spectrum]] and has a '''great list of the colors in the spectrum'''.&lt;br /&gt;
This just shows a quick standard PyMol way to color your protein by b-factor.  It also sets the range of color for coloring:&lt;br /&gt;
 spectrum b, minimum=20, maximum=50&lt;br /&gt;
&lt;br /&gt;
Or to color on a per-object basis:&lt;br /&gt;
 load myprotein.pdb&lt;br /&gt;
 spectrum b, selection=myprotein, minimum=20, maximum=50&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
[[Color]], [[Color#Color_by_Spectrum_Example|Coloring with Spectrum]]&lt;br /&gt;
&lt;br /&gt;
==Creating a Color bar==&lt;br /&gt;
To show a vertical/horizontal color bar indiacting the b-factor variation, use the script pseudobar.pml on the structure pseudobar.pdb, or do the following:&lt;br /&gt;
# Create a pdb-file which contains CA positions only, whereas the numbers correspond to your wanted increments of colors. Be sure that CA's are separated by a contant value, say 5 Angstroem.&lt;br /&gt;
# Load this new pseudobar-pdb file into PyMOL, make bonds between increment 1 and increment 2 [increment 2 and increment 3 and so on...], define/assign a smooth color for each increment (copy colors definition from automatically created colors made by b-factor script) and show the b-factor bar as lines (or sticks).&lt;br /&gt;
&lt;br /&gt;
Also, see the newly created [[spectrumbar]] script!&lt;br /&gt;
&lt;br /&gt;
==Coloring insides and outsides of helices differently==&lt;br /&gt;
The inside of helices can be adressed with:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
set cartoon_highlight_color, red&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
==Coloring all objects differently==&lt;br /&gt;
Is there a simple way to colour each object currently loaded, with a different colour?&lt;br /&gt;
There is a script [[Color_Objects |color_obj.py]] that does the job.&lt;br /&gt;
&lt;br /&gt;
USAGE&lt;br /&gt;
&lt;br /&gt;
        color_obj(rainbow=0)&lt;br /&gt;
&lt;br /&gt;
	This function colours each object currently in the PyMOL heirarchy&lt;br /&gt;
	with a different colour.  Colours used are either the 22 named&lt;br /&gt;
	colours used by PyMOL (in which case the 23rd object, if it exists,&lt;br /&gt;
	gets the same colour as the first), or are the colours of the rainbow&lt;br /&gt;
&lt;br /&gt;
==List the color of atoms==&lt;br /&gt;
To retrieve the color for all residues in a selection, you can iterate over it from the PyMOL command line&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
iterate all, print color&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
In Python, it looks like this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import pymol&lt;br /&gt;
pymol.color_list = []&lt;br /&gt;
cmd.iterate('all', 'pymol.color_list.append(color)')&lt;br /&gt;
print pymol.color_list&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Publication_Quality|Advanced Coloring]]&lt;br /&gt;
[[Category:Coloring|Advanced Coloring]]&lt;/div&gt;</summary>
		<author><name>Sbliven</name></author>
	</entry>
</feed>