<?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=Desastre</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=Desastre"/>
	<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php/Special:Contributions/Desastre"/>
	<updated>2026-04-17T11:18:41Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=ToGroup&amp;diff=11730</id>
		<title>ToGroup</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=ToGroup&amp;diff=11730"/>
		<updated>2014-04-05T16:03:21Z</updated>

		<summary type="html">&lt;p&gt;Desastre: Add script repo entry&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox script-repo&lt;br /&gt;
|type      = script&lt;br /&gt;
|filename  = togroup.py&lt;br /&gt;
|author    = [[User:Inchoate|Jason Vertrees]]&lt;br /&gt;
|license   = -&lt;br /&gt;
}}&lt;br /&gt;
= Overview =&lt;br /&gt;
[[toGroup]] will convert a multistate object into a group of single-state objects.  ''Be warned, by default it deletes your original object (since it's extracting a copy).&lt;br /&gt;
&lt;br /&gt;
PyMOL does a great job at handling multistate objects and grouping them together.  One thing that I found myself doing over and over again was &lt;br /&gt;
* loading a multistate object (say a PDBQT file with 100 ligand poses)&lt;br /&gt;
* splitting that object into all 100 states, with some given prefix&lt;br /&gt;
* then grouping them into their own group&lt;br /&gt;
* and then finally removing the original.&lt;br /&gt;
&lt;br /&gt;
This became tedious, so I automated that with this script.&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# A multistate object (20 NMR states)&lt;br /&gt;
fetch 1nmr&lt;br /&gt;
&lt;br /&gt;
# Create the group called,  &amp;quot;nmrEnsemble&amp;quot;&lt;br /&gt;
# from '1nmr' and name all the new states state1,&lt;br /&gt;
# state2, state3, etc.&lt;br /&gt;
toGroup nmrEnsemble, 1nmr, prefix=state&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= The Code =&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import pymol&lt;br /&gt;
from pymol import cmd&lt;br /&gt;
&lt;br /&gt;
def toGroup(groupName,sel,prefix=&amp;quot;&amp;quot;,delOrig=True):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    DESCRIPTION&lt;br /&gt;
    toGroup will take a multistate object and extract it&lt;br /&gt;
    to a group with N objects all in state #1.  It essentially&lt;br /&gt;
    performs the following:&lt;br /&gt;
&lt;br /&gt;
    split_states myObj, prefix=somePrefix&lt;br /&gt;
    group newGroup, somePrefix*&lt;br /&gt;
    delete myObj&lt;br /&gt;
&lt;br /&gt;
    PARAMETERS:&lt;br /&gt;
    &lt;br /&gt;
    groupName (string)&lt;br /&gt;
        The name of the group to create&lt;br /&gt;
&lt;br /&gt;
    sel (string)&lt;br /&gt;
        The name of the selection/object from which&lt;br /&gt;
        to make the group&lt;br /&gt;
&lt;br /&gt;
    prefix (string)&lt;br /&gt;
        The prefix of the names of each of split states.&lt;br /&gt;
        For example, if your prefix is ''obj'' and is in&lt;br /&gt;
        states 1 through 100 then the states will be labeled&lt;br /&gt;
        obj1, obj2, obj3, ..., obj100.&lt;br /&gt;
&lt;br /&gt;
    delOrig (string/boolean)&lt;br /&gt;
        If true then delete the original selection, otherwise not.&lt;br /&gt;
&lt;br /&gt;
    RETURN&lt;br /&gt;
&lt;br /&gt;
    Nothing, it makes a new group.&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    if prefix==&amp;quot;&amp;quot;:&lt;br /&gt;
        prefix=&amp;quot;grouped&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    cmd.split_states(sel, prefix=prefix)&lt;br /&gt;
    cmd.group(groupName,prefix+&amp;quot;*&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
    if delOrig:&lt;br /&gt;
        cmd.delete(sel)&lt;br /&gt;
&lt;br /&gt;
cmd.extend(&amp;quot;toGroup&amp;quot;, toGroup)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
[[group]], [[saveGroup]], [[select]], [[Category:States]], [[split_states]], [[delete]], [[extend]].&lt;br /&gt;
&lt;br /&gt;
[[Category:Script_Library]]&lt;br /&gt;
[[Category:ObjSel_Scripts]]&lt;/div&gt;</summary>
		<author><name>Desastre</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Linux_Install&amp;diff=12442</id>
		<title>Linux Install</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Linux_Install&amp;diff=12442"/>
		<updated>2009-04-07T09:24:50Z</updated>

		<summary type="html">&lt;p&gt;Desastre: /* Gentoo Linux (x86) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Installing PyMol is quite straightforward.&lt;br /&gt;
&lt;br /&gt;
=PyMol=&lt;br /&gt;
Installing PyMol is very simple, even from source.  On Linux, you need the following requirements:&lt;br /&gt;
* [http://www.python.org/ Python] (with distutils)&lt;br /&gt;
* [http://pmw.sf.net Pmw] (Python Megawidgets)&lt;br /&gt;
* OpenGL driver (I use [http://www.nvidia.com/object/unix.html NVidia])&lt;br /&gt;
* libpng&lt;br /&gt;
&lt;br /&gt;
== Generic Linux ==&lt;br /&gt;
&lt;br /&gt;
=== From Source ===&lt;br /&gt;
Many people want the latest versions of PyMOL as they usually have valuable features, but don't want to build PyMOL.  Building PyMOL is generally '''very''' simple.  &lt;br /&gt;
&lt;br /&gt;
This quick install assumes you already have a [http://subversion.tigris.org/ Subversion] client installed, have internet access, and all the dependencies are satisfied. &lt;br /&gt;
&lt;br /&gt;
To obtain a copy of the current revision version issue the command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
svn co https://pymol.svn.sourceforge.net/svnroot/pymol/trunk/pymol pymol&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then go into the source directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cd pymol&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have root or superuser privileges you can continue with the installation. If not follow [http://pymolwiki.org/index.php/Linux_Install#Installing_without_root_Privileges this guide]&lt;br /&gt;
&lt;br /&gt;
Run the first stage of the installation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
python setup.py install&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Run the second stage of the installation:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
python setup2.py install&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A launch script '''pymol''' will have been created. You can copy this script in the /usr/local/bin directory, so that any user of the system can use PyMOL:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
cp ./pymol /usr/local/bin&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test your installation. If you get an error message &amp;quot;ImportError: No module named Pmw&amp;quot; and lack half of the user interface, then run the additional command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
python setup2.py install pmw&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want to update the source code to the latest svn revision, go into the pymol directory and issue the command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
svn up&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To uninstall the PyMOL:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
python setup2.py uninstall&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Installing without root Privileges ====&lt;br /&gt;
&lt;br /&gt;
Use the prefix command to specify where to install PyMOL:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
python setup.py install --prefix /dir_to/pymol/py_build&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, you'll need to modify your '''PYTHONPATH''' variable:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export PYTHONPATH=$PYTHONPATH:/dir_to/pymol/py_build/lib/python{version}/site-packages&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Install to prefix:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
python setup2.py install --prefix /dir_to/pymol/py_build&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you can run PyMOL:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
./pymol&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Compiling By Hand ===&lt;br /&gt;
Due to the large variance of Linux systems, some systems may work fine with PyMol, and some may have related install issues.  To overcome this, you can download the '''ext''' package and the PyMol source and compile/install by hand.  The '''ext''' package is available from the Source Forge download section and contains all the necessary software to make PyMol run.  In the most recent available version (0.99rc1) this includes&lt;br /&gt;
* tcl-8_4_11.tgz                        &lt;br /&gt;
* tk-8_4_11.tgz                         &lt;br /&gt;
* zlib-1_2_3.tgz                        &lt;br /&gt;
* libpng-1_2_8.tgz                      &lt;br /&gt;
* python-2_4_2.tgz                      &lt;br /&gt;
* numeric-24_2.tgz                      &lt;br /&gt;
* pmw-1_2.tgz                           &lt;br /&gt;
* freetype-2_1_10.tgz                   &lt;br /&gt;
--and--                                   &lt;br /&gt;
* (freeglut-2_4_0.tgz &lt;br /&gt;
--or-- &lt;br /&gt;
* glut-3_7_6.tgz) &lt;br /&gt;
&lt;br /&gt;
====Supported Packages====&lt;br /&gt;
The above packages don't need to be installed from their source-packages only.  That is, you can use your system's installer (eg. yum, YaST, apt-get, rpm, etc.) to install the packages.  '''Just be sure, if you install the above packages with your system's installer, that you also include the development packages.  PyMOL needs the source/header files to compile against.  For example, don't only install, ''freeglut-2.4.0'' but also look for, and install, ''freeglut-2.4.-devel'' '''.&lt;br /&gt;
&lt;br /&gt;
Once downloaded, see the file '''pymol/INSTALL''' and '''pymol/INSTALL.generic'''.&lt;br /&gt;
&lt;br /&gt;
Here's the basic steps to install by source:&lt;br /&gt;
# get the source [http://delsci.com/rel/0_98/#OtherUnix PyMol Source]&lt;br /&gt;
# extract both packages, rename ext-VERSION.tgz to ext and move it into the pymol directory&lt;br /&gt;
# cd pymol&lt;br /&gt;
# cd ext&lt;br /&gt;
# vi build.com  # edit the build file&lt;br /&gt;
# cd ..&lt;br /&gt;
# cp setup/Rules.make . # or correct Rules.make file for your machine&lt;br /&gt;
# vi Rules.make         # make appropriate changes&lt;br /&gt;
# vi setup.py           # make appropriate changes&lt;br /&gt;
# make&lt;br /&gt;
&lt;br /&gt;
Warnings:&lt;br /&gt;
* if you're using a 64-bit machine, lib becomes lib64 for almost everything&lt;br /&gt;
* ensure you have the correct Python path and version (is it 2.3?  2.4?)&lt;br /&gt;
* make sure you make the changes in '''Rules.make''', '''setup.py''', and '''Makefile''', for your platform. For x86_64, besides above files, change following line in contrib/modules/Makefile.pre.in.src pointing to lib64 ([[leafyoung at yahoo dot com]])&lt;br /&gt;
   LIBP = $(exec_installdir)/lib'''''64'''''/python$(VERSION)&lt;br /&gt;
&lt;br /&gt;
Copy the appropriate setup/Rules.XXX file to the base PyMol dir.  You'll have to edit the file for your system.  Then run 'make'.&lt;br /&gt;
&lt;br /&gt;
== External Links to Distribution-specific Packages ==&lt;br /&gt;
&lt;br /&gt;
Some of the detailed information in the subsequent sections may be obsolete, so here are links to package information pages:&lt;br /&gt;
&lt;br /&gt;
* Fedora: [https://admin.fedoraproject.org/pkgdb/packages/name/pymol]&lt;br /&gt;
&lt;br /&gt;
* RHEL: [https://fedoraproject.org/wiki/SIGs/SciTech/PackageList] &lt;br /&gt;
&lt;br /&gt;
* Ubuntu: [http://packages.ubuntu.com/jaunty/science/pymol]&lt;br /&gt;
&lt;br /&gt;
* Debian: [http://packages.debian.org/lenny/pymol]&lt;br /&gt;
&lt;br /&gt;
* OpenSUSE: [http://software.opensuse.org/search?p=1&amp;amp;q=pymol]&lt;br /&gt;
&lt;br /&gt;
* Gentoo-portage: [http://gentoo-portage.com/sci-chemistry/pymol]&lt;br /&gt;
&lt;br /&gt;
== Fedora ==&lt;br /&gt;
&lt;br /&gt;
Starting from Fedora 9, you can install PyMOL from yum repositories.&lt;br /&gt;
&lt;br /&gt;
As root:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install pymol&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will install the latest precompiled version of PyMol. If you want the bleeding edge version or you have an older version of the operating system, follow the instructions for [http://pymolwiki.org/index.php/Linux_Install#Generic_Linux Generic Linux]. In order to satisfy all dependencies necessary for compiling from source issue as root (or superuser) the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
yum install python-devel freeglut-devel freetype-devel tkinter python-pmw&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Gentoo Linux (x86 &amp;amp; amd64) ==&lt;br /&gt;
as root:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
emerge pymol&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
be sure to have the proper OpenGL configuration. For example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
eselect opengl ati&lt;br /&gt;
eselect opengl nvidia&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
list of available versions in portage [http://www.gentoo-portage.com/sci-chemistry/pymol pymol for gentoo]&lt;br /&gt;
&lt;br /&gt;
All beta releases are maintained in the science overlay, which can be used with&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
layman -a sci&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
There is ongoing development in providing plugins via ebuilds with an thread in [http://bugs.gentoo.org/show_bug.cgi?id=209970 gentoo bugzilla]. The ebuild can be checked out via svn&lt;br /&gt;
 svn co http://svn.olausson.de/molmod/trunk&lt;br /&gt;
There is also svn ebuild of pymol, which contains all bugfixes which are request in the gentoo bugzilla.&lt;br /&gt;
&lt;br /&gt;
All bugs and feature request should be either send to justin at j-schmitz dot net or spamsuxx at gmail dot com.&lt;br /&gt;
&lt;br /&gt;
== SuSe ==&lt;br /&gt;
=== 32-bit (x86) ===&lt;br /&gt;
See [[#Generic Linux]] above.&lt;br /&gt;
&lt;br /&gt;
=== 64-bit (x86_64) ===&lt;br /&gt;
See [[#Generic Linux]] above.  Some details for problem solving are here.  64-bit Python install is quite easy.  Make sure your nvidia driver is installed (or ATI, but I have no experience there).&lt;br /&gt;
&lt;br /&gt;
To install PyMol&lt;br /&gt;
*Ensure your system has it's distutils in place and ready to use.  Try the following check:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from distutils import *&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
*Download the [http://pymol.org/ source]&lt;br /&gt;
*Download [http://www.sf.net/projects/pmw Pmw] from [http://www.sf.net/ SourceForge].&lt;br /&gt;
** To install Pmw, just decompress it and then move the base director &amp;quot;Pwm&amp;quot; to /usr/lib64/python2.3/site-packages/.  You can test that it's there by testing the import, see below:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import * from Pmw&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
If errors erupt, investigate.&lt;br /&gt;
* decompress the source and cd into the PyMol directory that was just decompressed.&lt;br /&gt;
* If upgrading see [[:Category: Upgrading PyMol|below]].&lt;br /&gt;
* Now enter the following...&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
python setup.py build&amp;lt;br&amp;gt;&lt;br /&gt;
sudo python setup.py install&amp;lt;br&amp;gt;&lt;br /&gt;
sudo python setup2.py&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
* The sudo commands will need a root password or someone with sudo capabilities.&lt;br /&gt;
&lt;br /&gt;
I also copy the 'pymol.com' file to /usr/local/bin or /usr/bin -- somewhere in my path:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
sudo cp ./pymol.com /usr/local/bin&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Please note that newer versions of PyMol create the '''pymol''' executable, not '''pymol.com'''.  So, for later versions (~0.99+) use&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
sudo cp ./pymol /usr/local/bin&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You should now have a working PyMol install.  &lt;br /&gt;
&lt;br /&gt;
'''pymol.com''' should now run your new PyMol install.&lt;br /&gt;
&lt;br /&gt;
==Ubuntu Linux (x86 32,64; mac ppc)==&lt;br /&gt;
&lt;br /&gt;
http://xanana.ucsc.edu/~wgscott/xtal/ubuntu-small.png&lt;br /&gt;
&lt;br /&gt;
The [http://www.ubuntu.com/ Ubuntu] [http://packages.ubuntu.com/breezy/science/pymol pymol package] can be installed with minimal effort using the GUI package manager [http://en.wikipedia.org/wiki/Synaptic_Package_Manager synaptic], or on the command line, using the command&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo apt-get install pymol&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
once the [http://ubuntuguide.org/#extrarepositories universe repository] has been activated.  &lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Ubuntu_Linux Ubuntu] is a completely free and well-maintained Debian GNU/Linux distribution. Further details on using [http://xanana.ucsc.edu/linux/debian_linux.html Ubuntu for crystallography] and related applications are available are linked. PyMol also compiles from source on Ubuntu following the [[#Generic Linux]] instructions given above.&lt;br /&gt;
&lt;br /&gt;
'''NOTE : '''If you experience problems with PyMOL OpenGL window (i.e. flickering) try disabling compiz.&lt;br /&gt;
&lt;br /&gt;
=Preparing your System=&lt;br /&gt;
See [[Linux_XFree86_Configuration]].&lt;br /&gt;
&lt;br /&gt;
==Graphics==&lt;br /&gt;
===XFree86 Config===&lt;br /&gt;
Check out [[XFree86_Configuration|Configuring XFree86]] if you need information on editing the XFree86 configuration file.&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation|Linux Installation]]&lt;br /&gt;
&lt;br /&gt;
===Xorg===&lt;br /&gt;
Adding a &lt;br /&gt;
 Stereo 3&lt;br /&gt;
option in /etc/X11/xorg.conf suffices to run pymol in stereo mode on a 64bit system with the Nvidia Quadro FX1400 under Red Hat Enterprise 4 (RHEL4). Adding the following modeline (determined via /usr/bin/gtf): &lt;br /&gt;
&lt;br /&gt;
 ModeLine     &amp;quot;1280x1024_118.00&amp;quot; 229.7 1280 1384 1528 1776 1024 1025 1028 1096 -hsync +vsync&lt;br /&gt;
&lt;br /&gt;
appears to slightly improve the stereo quality, in particular when one&lt;br /&gt;
displays labels and/or dashes/dots.&lt;br /&gt;
&lt;br /&gt;
For those having possible driver issues, this link might help&lt;br /&gt;
[http://www.nvnews.net/vbulletin/showthread.php?t=69136 NVNews]&lt;br /&gt;
&lt;br /&gt;
===xorg.conf for stereo in Fedora Core 6===&lt;br /&gt;
It is assumed that you have installed the proprietary [http://www.nvidia.com/content/drivers/drivers.asp Nvidia graphics drivers], and that the &amp;quot;Device&amp;quot; section of xorg.conf has the following line in it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Driver &amp;quot;nvidia&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add the following section to the end of xorg.conf to disable &amp;quot;Composite&amp;quot;, which is incompatible with stereographics.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Section &amp;quot;Extensions&amp;quot;&lt;br /&gt;
     Option &amp;quot;Composite&amp;quot; &amp;quot;Disable&amp;quot;&lt;br /&gt;
EndSection&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Section &amp;quot;Screen&amp;quot; add the following line to enable quad-buffered stereo:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Option &amp;quot;Stereo&amp;quot; &amp;quot;3&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Problems=&lt;br /&gt;
&lt;br /&gt;
==Input==&lt;br /&gt;
If you notice that the keyboard input is ignored into the Pmw widgets, you may have an X-based input method editor installed and running.  Such examples could be SCIM, KINPUT/2 or the like.  Try turning off the IME and restarting PyMol to get the widgets to recognize your input.&lt;br /&gt;
&lt;br /&gt;
==libnvidia-tls.so.1: cannot handle TLS data==&lt;br /&gt;
&lt;br /&gt;
If you get an error, upon invoking pymol, of the form&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Traceback (most recent call last):&lt;br /&gt;
  File &amp;quot;/usr/lib/python2.4/site-packages/pymol/__init__.py&amp;quot;, line 109, in ?&lt;br /&gt;
    import pymol&lt;br /&gt;
  File &amp;quot;/usr/lib/python2.4/site-packages/pymol/__init__.py&amp;quot;, line 353, in ?&lt;br /&gt;
    import _cmd&lt;br /&gt;
ImportError: libnvidia-tls.so.1: cannot handle TLS data&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then try changing the permissons on   libnvidia-tls.so.1.  i.e,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; sudo chmod 777 /usr/lib/libnvidia-tls.so.1   &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Super-Large Files==&lt;br /&gt;
For loading files that require the majority of your system's memory, try tweaking your system's [http://certcities.com/editorial/columns/story.asp?EditorialsID=214 ulimit] before starting PyMOL.  ''' ''Be warned, when your system uses its full amount of memory and swap space, it comes to a halt very quickly.'' '''&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# shows current setup&lt;br /&gt;
ulimit -a&lt;br /&gt;
&lt;br /&gt;
# allows setting of a limit in current shell.&lt;br /&gt;
ulimit -v SizeInKB&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Desastre</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Command_Line_Options&amp;diff=5218</id>
		<title>Command Line Options</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Command_Line_Options&amp;diff=5218"/>
		<updated>2009-01-15T13:22:07Z</updated>

		<summary type="html">&lt;p&gt;Desastre: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;PyMOL has lots of options for controlling it immediately from startup.  Run ''''help launching'''' from the command line for detailed listings of options for your current version of PyMol.  Here is a sample output which should be pretty consistent for recent versions.&lt;br /&gt;
&lt;br /&gt;
= Command Line Options =&lt;br /&gt;
{| width=&amp;quot;45%&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;font-weight:bold; text-align:center; font-size:150%;&amp;quot; | PyMOL Command line Options&lt;br /&gt;
! Option !! What it Does&lt;br /&gt;
|-&lt;br /&gt;
||'''-c''' ||  Command line mode, no GUI.  For batch opeations.&lt;br /&gt;
|-&lt;br /&gt;
||'''-b''' ||  Runs benchmark.&lt;br /&gt;
|-&lt;br /&gt;
||'''-i''' ||  Disable the internal OpenGL GUI (object list, menus, etc.)&lt;br /&gt;
|-&lt;br /&gt;
||'''-k''' ||  Supress the use of the .pymolrc file.&lt;br /&gt;
|-&lt;br /&gt;
||'''-x''' ||  Disable the external GUI module.&lt;br /&gt;
|-&lt;br /&gt;
||'''-t''' ||  Use Tcl/Tk based external GUI module (pmg_tk).&lt;br /&gt;
|-&lt;br /&gt;
||'''-q''' ||  Quiet launch. Suppress splash screen &amp;amp; other chatter.&lt;br /&gt;
|-&lt;br /&gt;
||'''-p''' ||  Listen for commands on standard input.&lt;br /&gt;
|-&lt;br /&gt;
||'''-e''' ||  Start in full-screen mode.&lt;br /&gt;
|-&lt;br /&gt;
||'''-2''' ||  Start in two-button mouse mode.&lt;br /&gt;
|-&lt;br /&gt;
||'''-o''' ||  Disable security protections for session files.&lt;br /&gt;
|-&lt;br /&gt;
||'''-R''' ||  Launch Greg Landrum's XMLRPC listener.&lt;br /&gt;
|-&lt;br /&gt;
||'''-B''' ||  Enable blue-line stereo signal (for Mac stereo)&lt;br /&gt;
|-&lt;br /&gt;
||'''-G''' ||  Start in Game mode.&lt;br /&gt;
|-&lt;br /&gt;
||'''-S''' ||  Force and launch in stereo, if possible.&lt;br /&gt;
|-&lt;br /&gt;
||'''-M''' ||  Force mono even when hardware stereo is present.&lt;br /&gt;
|-&lt;br /&gt;
||'''-X &amp;lt;int&amp;gt; -Y &amp;lt;int&amp;gt; -W &amp;lt;int&amp;gt; -H &amp;lt;int&amp;gt; -V &amp;lt;int&amp;gt;''' || Adjust window geometry.&lt;br /&gt;
|-&lt;br /&gt;
||'''-f &amp;lt;# line&amp;gt;''' || Controls display of commands and feedback in OpenGL (0=off).&lt;br /&gt;
|-&lt;br /&gt;
||'''-r &amp;lt;file.py&amp;gt; ''' || Run a Python program (in __main__) on startup.&lt;br /&gt;
|-&lt;br /&gt;
||'''-l &amp;lt;file.py&amp;gt; ''' || Spawn a python program in new thread.&lt;br /&gt;
|-&lt;br /&gt;
||'''-d &amp;lt;string&amp;gt; ''' || Run pymol command string upon startup.&lt;br /&gt;
|-&lt;br /&gt;
||'''-u &amp;lt;script&amp;gt; ''' || Load and append to this PyMOL script or program file.&lt;br /&gt;
|-&lt;br /&gt;
||'''-s &amp;lt;script&amp;gt; ''' || Save commands to this PyMOL script or program file.&lt;br /&gt;
|-&lt;br /&gt;
||'''-g &amp;lt;file.png&amp;gt; ''' || Write a PNG file (after evaluating previous arguments)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Supported File Formats  =&lt;br /&gt;
&amp;lt;file&amp;gt; can have one of the following extensions, and all files provided will be loaded or run after PyMOL starts.&lt;br /&gt;
&lt;br /&gt;
{| width=&amp;quot;45%&amp;quot;&lt;br /&gt;
|+ style=&amp;quot;font-weight:bold; text-align:center; font-size:150%;&amp;quot; | PyMOL Supported File Formats&lt;br /&gt;
! Extension !! Format&lt;br /&gt;
|-&lt;br /&gt;
|| '''.pml''' || PyMOL command script to be run on startup&lt;br /&gt;
|-&lt;br /&gt;
||'''.py, .pym, .pyc''' ||  Python program to be run on startup&lt;br /&gt;
|-&lt;br /&gt;
||'''.pdb'''   ||           Protein Data Bank format file to be loaded on startup&lt;br /&gt;
|-&lt;br /&gt;
||'''.mmod'''  ||          Macromodel format to be loaded on startup&lt;br /&gt;
|-&lt;br /&gt;
||'''.mol'''   ||          MDL MOL file to be loaded on startup&lt;br /&gt;
|-&lt;br /&gt;
||'''.sdf'''   ||           MDL SD file to be parsed and loaded on startup&lt;br /&gt;
|-&lt;br /&gt;
||'''.xplor''' ||           X-PLOR Map file (ASCII) to be loaded on startup&lt;br /&gt;
|-&lt;br /&gt;
||'''.ccp4'''  ||           CCP4 map file (BINARY) to be loaded on startup&lt;br /&gt;
|-&lt;br /&gt;
||'''.cc1, .cc2''' ||       ChemDraw 3D cartesian coordinate file&lt;br /&gt;
|-&lt;br /&gt;
||'''.pkl'''   ||           Pickled ChemPy Model (class &amp;quot;chempy.model.Indexed&amp;quot;)&lt;br /&gt;
|-&lt;br /&gt;
||'''.r3d'''   ||           Raster3D file&lt;br /&gt;
|-&lt;br /&gt;
||'''.cex'''   ||           CEX file (Metaphorics)&lt;br /&gt;
|-&lt;br /&gt;
||'''.top'''   ||           AMBER topology file&lt;br /&gt;
|-&lt;br /&gt;
||'''.crd'''   ||           AMBER coordinate file&lt;br /&gt;
|-&lt;br /&gt;
||'''.rst'''   ||           AMBER restart file&lt;br /&gt;
|-&lt;br /&gt;
||'''.trj'''   ||           AMBER trajectory&lt;br /&gt;
|-&lt;br /&gt;
||'''.pse'''   ||           PyMOL session file&lt;br /&gt;
|-&lt;br /&gt;
||'''.phi'''   ||          Delphi/Grasp Electrostatic Potential Map&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
= Examples =&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# load the 3 pdb files and execte the following commands&lt;br /&gt;
pymol mol1.pdb mol2.pdb mol3.pdb -d 'as ribbon;spectrum count;set seq_view'&lt;br /&gt;
&lt;br /&gt;
# load the 3 pdbs and run the script&lt;br /&gt;
pymol mol1.pdb mol2.pdb mol3.pdb my_script.pml&lt;br /&gt;
&lt;br /&gt;
# Run my_program using PyMOL as the Python interpreter&lt;br /&gt;
# passing the 3 pdb files to my_program.py&lt;br /&gt;
pymol my_program.py -- mol1.pdb mol2.pdb mol3.pdb&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Desastre</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Linux_Install&amp;diff=12426</id>
		<title>Linux Install</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Linux_Install&amp;diff=12426"/>
		<updated>2008-05-08T12:58:37Z</updated>

		<summary type="html">&lt;p&gt;Desastre: /* Gentoo Linux (x86) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Installing PyMol is quite straightforward.&lt;br /&gt;
&lt;br /&gt;
=PyMol=&lt;br /&gt;
Installing PyMol is very simple, even from source.  On Linux, you need the following requirements:&lt;br /&gt;
* [http://www.python.org/ Python] (with distutils)&lt;br /&gt;
* [http://pmw.sf.net Pmw] (Python Megawidgets)&lt;br /&gt;
* OpenGL driver (I use [http://www.nvidia.com/object/unix.html NVidia])&lt;br /&gt;
* libpng&lt;br /&gt;
&lt;br /&gt;
== Generic Linux ==&lt;br /&gt;
&lt;br /&gt;
=== Quick Install for Latest Features ===&lt;br /&gt;
Many people want the latest versions of PyMOL as they usually have valuable features, but don't want to build PyMOL.  Building PyMOL is generally '''very''' simple.  &lt;br /&gt;
&lt;br /&gt;
This quick install assumes you already have a [http://subversion.tigris.org/ Subversion] client installed, have some sort of superuser (root) access, and have internet access.  It will download the most current version from [http://pymol.sf.net PyMOL's Projet Page] and install it.  This should install PyMOL onto your system so that any users on your system can use it.  To easily get the latest version, do the following:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
mkdir pymol_temp&lt;br /&gt;
cd pymol_temp&lt;br /&gt;
svn co https://pymol.svn.sourceforge.net/svnroot/pymol/trunk/pymol pymol&lt;br /&gt;
cd pymol&lt;br /&gt;
sudo python setup.py install&lt;br /&gt;
sudo python setup2.py install&lt;br /&gt;
sudo cp ./pymol /usr/local/bin/pymol&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Now, just remove the '''pymol_temp''' directory if you want and you're done.&lt;br /&gt;
&lt;br /&gt;
=== 0.99rc1 note! ===&lt;br /&gt;
For those keeping current via CVS, building from source, or installing precompiled unix binaries, here is a quick &amp;quot;heads up!&amp;quot; intended to save you some minor grief: For the last six years, the PyMOL launch script has been called '''pymol.com''' instead of simply &amp;quot;pymol&amp;quot;.  I can't remember why I did things that way, but PyMOL's &amp;quot;.com&amp;quot; convention is different from the most everything else and for no good reason.  The launch script should just be the name of the program.&lt;br /&gt;
&lt;br /&gt;
Therefore, as of 0.99rc1, the launch script will simply be &amp;quot;pymol&amp;quot;.  No big deal right?  Well, not so fast:  symbolic links, shell aliases, external scripts, package builders, and end-user habits may all need to be adjusted after installing this next version.  That is why I haven't changed this before now -- but we should clean this up before 1.0. So, remember: if you update to PyMOL 0.99rc1 (when it's released) and suddenly can't launch PyMOL, that is likely what is going on.  Either reset your pointers to '''./pymol''', or symlink '''./pymol''' to '''./pymol.com''' to preserve the status quo.&lt;br /&gt;
&lt;br /&gt;
=== From Source ===&lt;br /&gt;
* untar the compressed package;&lt;br /&gt;
* cd into the newly untarred directory (should be '''pymol''' or '''pymol-version''').&lt;br /&gt;
* execute &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;python setup.py install            # you may need to be root&amp;lt;/source&amp;gt;&lt;br /&gt;
* execute &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;python setup2.py install           # you may need to be root&amp;lt;/source&amp;gt;&lt;br /&gt;
* execute &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;cp ./pymol.com SOME_PATH           # where SOME_PATH is some directory in your $PATH&amp;lt;/source&amp;gt;&lt;br /&gt;
or for the latest version, &lt;br /&gt;
* execute &amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;cp ./pymol SOME_PATH           # where SOME_PATH is some directory in your $PATH&amp;lt;/source&amp;gt;&lt;br /&gt;
The executable name is &amp;quot;pymol.com&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== From Package ===&lt;br /&gt;
Download the appropriate RPM and use 'rpm' to install it.  Typically,&lt;br /&gt;
 rpm -Uvh rpmFileName.rpm&lt;br /&gt;
&lt;br /&gt;
===Compiling By Hand===&lt;br /&gt;
Due to the large variance of Linux systems, some systems may work fine with PyMol, and some may have related install issues.  To overcome this, you can download the '''ext''' package and the PyMol source and compile/install by hand.  The '''ext''' package is available from the Source Forge download section and contains all the necessary software to make PyMol run.  In the most recent available version (0.99rc1) this includes&lt;br /&gt;
* tcl-8_4_11.tgz                        &lt;br /&gt;
* tk-8_4_11.tgz                         &lt;br /&gt;
* zlib-1_2_3.tgz                        &lt;br /&gt;
* libpng-1_2_8.tgz                      &lt;br /&gt;
* python-2_4_2.tgz                      &lt;br /&gt;
* numeric-24_2.tgz                      &lt;br /&gt;
* pmw-1_2.tgz                           &lt;br /&gt;
* freetype-2_1_10.tgz                   &lt;br /&gt;
--and--                                   &lt;br /&gt;
* (freeglut-2_4_0.tgz &lt;br /&gt;
--or-- &lt;br /&gt;
* glut-3_7_6.tgz) &lt;br /&gt;
&lt;br /&gt;
     &lt;br /&gt;
&lt;br /&gt;
Once downloaded, see the file '''pymol/INSTALL''' and '''pymol/INSTALL.generic'''.&lt;br /&gt;
&lt;br /&gt;
Here's the basic steps to install by source:&lt;br /&gt;
# get the source [http://delsci.com/rel/0_98/#OtherUnix PyMol Source]&lt;br /&gt;
# extract both packages, rename ext-VERSION.tgz to ext and move it into the pymol directory&lt;br /&gt;
# cd pymol&lt;br /&gt;
# cd ext&lt;br /&gt;
# vi build.com  # edit the build file&lt;br /&gt;
# cd ..&lt;br /&gt;
# cp setup/Rules.make . # or correct Rules.make file for your machine&lt;br /&gt;
# vi Rules.make         # make appropriate changes&lt;br /&gt;
# vi setup.py           # make appropriate changes&lt;br /&gt;
# make&lt;br /&gt;
&lt;br /&gt;
Warnings:&lt;br /&gt;
* if you're using a 64-bit machine, lib becomes lib64 for almost everything&lt;br /&gt;
* ensure you have the correct Python path and version (is it 2.3?  2.4?)&lt;br /&gt;
* make sure you make the changes in '''Rules.make''', '''setup.py''', and '''Makefile''', for your platform. For x86_64, besides above files, change following line in contrib/modules/Makefile.pre.in.src pointing to lib64 ([[leafyoung at yahoo dot com]])&lt;br /&gt;
   LIBP=           $(exec_installdir)/lib'''''64'''''/python$(VERSION)&lt;br /&gt;
&lt;br /&gt;
Copy the appropriate setup/Rules.XXX file to the base PyMol dir.  You'll have to edit the file for your system.  Then run 'make'.&lt;br /&gt;
&lt;br /&gt;
==== Installing without Superuser (root) Privileges ====&lt;br /&gt;
Use the prefix command to specify where to install PyMOL.  Then, you'll need to modify your '''PYTHONPATH''' variable,&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot; line=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
# install to prefix&lt;br /&gt;
python setup.py install --prefix /dir_to/pymol/py_build&lt;br /&gt;
# update your PYTHONPATH variable&lt;br /&gt;
export PYTHONPATH=$PYTHONPATH:/dir_to/pymol/py_build/lib/python{version}/site-packages&lt;br /&gt;
# install to prefix (this step _is_ needed)&lt;br /&gt;
python setup2.py install --prefix /dir_to/pymol/py_build&lt;br /&gt;
# now you can run PyMOL&lt;br /&gt;
./pymol&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Installing a Script Without Superuser Access ====&lt;br /&gt;
Install the script following the instructions by the distributor.  Then, add the path where the module was built to the PYTHONPATH environment variable (if needed).&lt;br /&gt;
&lt;br /&gt;
== Fedora Core Linux (x86) ==&lt;br /&gt;
PyMOL RPMs are available for Fedora Core 1 &amp;amp; 2, provided by Morten Kjeldgaard. These can be manually downloaded by browsing from: [http://apt.bioxray.dk/]&lt;br /&gt;
&lt;br /&gt;
Alternatively, PyMOL can be installed using [http://linux.duke.edu/projects/yum/ Yum] (an automated package installer and updater, installed by default in Fedora). This can be done by adding the following lines to your /etc/yum.conf file:&lt;br /&gt;
&lt;br /&gt;
 [xray]&lt;br /&gt;
 name=MOKs RPM Repository fedora $releasever - $basearch - xray&lt;br /&gt;
 baseurl=http://apt.bioxray.dk/fedora/fc$releasever/$basearch/xray&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
you may also need to add the pgp key for the repository before yum will get packages from it by either saying:&lt;br /&gt;
&lt;br /&gt;
 rpm --import http://www.bioxray.dk/~mok/404825e7.asc&lt;br /&gt;
&lt;br /&gt;
or with older versions of rpm:&lt;br /&gt;
&lt;br /&gt;
 wget http://www.bioxray.dk/~mok/404825e7.asc&lt;br /&gt;
 rpm --import 404825e7.asc&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
And then issuing the following command as root:&lt;br /&gt;
&lt;br /&gt;
 yum install pymol&lt;br /&gt;
&lt;br /&gt;
== Gentoo Linux (x86) ==&lt;br /&gt;
as root:&lt;br /&gt;
 emerge pymol&lt;br /&gt;
be sure to have the proper OpenGL configuration. For example:&lt;br /&gt;
 opengl-update ati&lt;br /&gt;
 opengl-update nvidia&lt;br /&gt;
list of available versions in portage [http://www.gentoo-portage.com/sci-chemistry/pymol pymol for gentoo]&lt;br /&gt;
&lt;br /&gt;
A version of the latest svn build is avaible via the dberkholz overlay, which can be used with&lt;br /&gt;
 layman -a dberkholz &amp;amp;&amp;amp; emerge =sci-chemistry/pymol-9999&lt;br /&gt;
&lt;br /&gt;
There is ongoing development in providing plugins via ebuilds with an thread in [http://bugs.gentoo.org/show_bug.cgi?id=209970 gentoo bugzilla]. The ebuild can be checked out via svn&lt;br /&gt;
 svn co http://svn.olausson.de/molmod/trunk&lt;br /&gt;
There is also svn ebuild of pymol, which contains all bugfixes which are request in the gentoo bugzilla.&lt;br /&gt;
&lt;br /&gt;
All bugs and feature request should be either send to justin at j-schmitz dot net or spamsuxx at gmail dot com.&lt;br /&gt;
&lt;br /&gt;
== SuSe ==&lt;br /&gt;
=== 32-bit (x86) ===&lt;br /&gt;
See [[#Generic Linux]] above.&lt;br /&gt;
&lt;br /&gt;
=== 64-bit (x86_64) ===&lt;br /&gt;
See [[#Generic Linux]] above.  Some details for problem solving are here.  64-bit Python install is quite easy.  Make sure your nvidia driver is installed (or ATI, but I have no experience there).&lt;br /&gt;
&lt;br /&gt;
To install PyMol&lt;br /&gt;
*Ensure your system has it's distutils in place and ready to use.  Try the following check:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from distutils import *&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
*Download the [http://pymol.org/ source]&lt;br /&gt;
*Download [http://www.sf.net/projects/pmw Pmw] from [http://www.sf.net/ SourceForge].&lt;br /&gt;
** To install Pmw, just decompress it and then move the base director &amp;quot;Pwm&amp;quot; to /usr/lib64/python2.3/site-packages/.  You can test that it's there by testing the import, see below:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
import * from Pmw&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
If errors erupt, investigate.&lt;br /&gt;
* decompress the source and cd into the PyMol directory that was just decompressed.&lt;br /&gt;
* If upgrading see [[:Category: Upgrading PyMol|below]].&lt;br /&gt;
* Now enter the following...&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
python setup.py build&amp;lt;br&amp;gt;&lt;br /&gt;
sudo python setup.py install&amp;lt;br&amp;gt;&lt;br /&gt;
sudo python setup2.py&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
* The sudo commands will need a root password or someone with sudo capabilities.&lt;br /&gt;
&lt;br /&gt;
I also copy the 'pymol.com' file to /usr/local/bin or /usr/bin -- somewhere in my path:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
sudo cp ./pymol.com /usr/local/bin&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Please note that newer versions of PyMol create the '''pymol''' executable, not '''pymol.com'''.  So, for later versions (~0.99+) use&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
sudo cp ./pymol /usr/local/bin&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You should now have a working PyMol install.  &lt;br /&gt;
&lt;br /&gt;
'''pymol.com''' should now run your new PyMol install.&lt;br /&gt;
&lt;br /&gt;
==Ubuntu Linux (x86 32,64; mac ppc)==&lt;br /&gt;
&lt;br /&gt;
http://xanana.ucsc.edu/~wgscott/xtal/ubuntu-small.png&lt;br /&gt;
&lt;br /&gt;
The [http://www.ubuntu.com/ Ubuntu] [http://packages.ubuntu.com/breezy/science/pymol pymol package] can be installed with minimal effort using the GUI package manager [http://en.wikipedia.org/wiki/Synaptic_Package_Manager synaptic], or on the command line, using the command&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install pymol&lt;br /&gt;
&lt;br /&gt;
once the [http://ubuntuguide.org/#extrarepositories universe repository] has been activated.  &lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/Ubuntu_Linux Ubuntu] is a completely free and well-maintained Debian GNU/Linux distribution. Further details on using [http://xanana.ucsc.edu/linux/debian_linux.html Ubuntu for crystallography] and related applications are available are linked. PyMol also compiles from source on Ubuntu following the [[#Generic Linux]] instructions given above.&lt;br /&gt;
&lt;br /&gt;
'''NOTE : '''If you experience problems with PyMOL OpenGL window (i.e. flickering) try disabling compiz.&lt;br /&gt;
&lt;br /&gt;
=Preparing your System=&lt;br /&gt;
See [[Linux_XFree86_Configuration]].&lt;br /&gt;
&lt;br /&gt;
==Graphics==&lt;br /&gt;
===XFree86 Config===&lt;br /&gt;
Check out [[XFree86_Configuration|Configuring XFree86]] if you need information on editing the XFree86 configuration file.&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation|Linux Installation]]&lt;br /&gt;
&lt;br /&gt;
===Xorg===&lt;br /&gt;
Adding a &lt;br /&gt;
 Stereo 3&lt;br /&gt;
option in /etc/X11/xorg.conf suffices to run pymol in stereo mode on a 64bit system with the Nvidia Quadro FX1400 under Red Hat Enterprise 4 (RHEL4). Adding the following modeline (determined via /usr/bin/gtf): &lt;br /&gt;
&lt;br /&gt;
 ModeLine     &amp;quot;1280x1024_118.00&amp;quot; 229.7 1280 1384 1528 1776 1024 1025 1028 1096 -hsync +vsync&lt;br /&gt;
&lt;br /&gt;
appears to slightly improve the stereo quality, in particular when one&lt;br /&gt;
displays labels and/or dashes/dots.&lt;br /&gt;
&lt;br /&gt;
For those having possible driver issues, this link might help&lt;br /&gt;
[http://www.nvnews.net/vbulletin/showthread.php?t=69136 NVNews]&lt;br /&gt;
&lt;br /&gt;
===xorg.conf for stereo in Fedora Core 6===&lt;br /&gt;
It is assumed that you have installed the proprietary [http://www.nvidia.com/content/drivers/drivers.asp Nvidia graphics drivers], and that the &amp;quot;Device&amp;quot; section of xorg.conf has the following line in it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Driver &amp;quot;nvidia&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Add the following section to the end of xorg.conf to disable &amp;quot;Composite&amp;quot;, which is incompatible with stereographics.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Section &amp;quot;Extensions&amp;quot;&lt;br /&gt;
     Option &amp;quot;Composite&amp;quot; &amp;quot;Disable&amp;quot;&lt;br /&gt;
EndSection&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Section &amp;quot;Screen&amp;quot; add the following line to enable quad-buffered stereo:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Option &amp;quot;Stereo&amp;quot; &amp;quot;3&amp;quot;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Problems=&lt;br /&gt;
&lt;br /&gt;
==Input==&lt;br /&gt;
If you notice that the keyboard input is ignored into the Pmw widgets, you may have an X-based input method editor installed and running.  Such examples could be SCIM, KINPUT/2 or the like.  Try turning off the IME and restarting PyMol to get the widgets to recognize your input.&lt;br /&gt;
&lt;br /&gt;
==libnvidia-tls.so.1: cannot handle TLS data==&lt;br /&gt;
&lt;br /&gt;
If you get an error, upon invoking pymol, of the form&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Traceback (most recent call last):&lt;br /&gt;
  File &amp;quot;/usr/lib/python2.4/site-packages/pymol/__init__.py&amp;quot;, line 109, in ?&lt;br /&gt;
    import pymol&lt;br /&gt;
  File &amp;quot;/usr/lib/python2.4/site-packages/pymol/__init__.py&amp;quot;, line 353, in ?&lt;br /&gt;
    import _cmd&lt;br /&gt;
ImportError: libnvidia-tls.so.1: cannot handle TLS data&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
then try changing the permissons on   libnvidia-tls.so.1.  i.e,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; sudo chmod 777 /usr/lib/libnvidia-tls.so.1   &amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Desastre</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Talk:APBS&amp;diff=7</id>
		<title>Talk:APBS</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Talk:APBS&amp;diff=7"/>
		<updated>2008-04-27T06:55:07Z</updated>

		<summary type="html">&lt;p&gt;Desastre: /* Question/Crash */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I've added some details about where and how to download and install apbs and its dependencies.  I have cross-referenced a description of how this can be done on OS X.  &lt;br /&gt;
&lt;br /&gt;
I've put a few very tentative lines in about linux.&lt;br /&gt;
&lt;br /&gt;
== Well done! ==&lt;br /&gt;
&lt;br /&gt;
Hey, thanks for this plugin.  It worked on an SMP 64-bit Linux machine with little effort.  Still crashes a bit, but the effort is worth it.&lt;br /&gt;
[[User:Inchoate|Tree]] 18:21, 21 February 2008 (CST)&lt;br /&gt;
&lt;br /&gt;
== Question/Crash ==&lt;br /&gt;
&lt;br /&gt;
I ran APBS on 2ILK.  When I try to show the solv. acc. map, it computes something for a sec, then crashes taking PyMOL with it.  Is this common?  Any ideas on fixing it?  It's probably my lack of understanding on how APBS works.&lt;br /&gt;
[[User:Inchoate|Tree]] 07:40, 22 February 2008 (CST)&lt;br /&gt;
&lt;br /&gt;
For me it doesn't crash, but asks me to calculate the pqr file myself. Than it calculates the map fine.&lt;br /&gt;
[[User:Desastre|Desastre]] 27 April 2008&lt;/div&gt;</summary>
		<author><name>Desastre</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Talk:APBS&amp;diff=6</id>
		<title>Talk:APBS</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Talk:APBS&amp;diff=6"/>
		<updated>2008-04-27T06:54:54Z</updated>

		<summary type="html">&lt;p&gt;Desastre: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I've added some details about where and how to download and install apbs and its dependencies.  I have cross-referenced a description of how this can be done on OS X.  &lt;br /&gt;
&lt;br /&gt;
I've put a few very tentative lines in about linux.&lt;br /&gt;
&lt;br /&gt;
== Well done! ==&lt;br /&gt;
&lt;br /&gt;
Hey, thanks for this plugin.  It worked on an SMP 64-bit Linux machine with little effort.  Still crashes a bit, but the effort is worth it.&lt;br /&gt;
[[User:Inchoate|Tree]] 18:21, 21 February 2008 (CST)&lt;br /&gt;
&lt;br /&gt;
== Question/Crash ==&lt;br /&gt;
&lt;br /&gt;
I ran APBS on 2ILK.  When I try to show the solv. acc. map, it computes something for a sec, then crashes taking PyMOL with it.  Is this common?  Any ideas on fixing it?  It's probably my lack of understanding on how APBS works.&lt;br /&gt;
[[User:Inchoate|Tree]] 07:40, 22 February 2008 (CST)&lt;br /&gt;
&lt;br /&gt;
For me it doesn't crash, but asks me to calculate the pdr file myself. Than it calculates the map fine.&lt;br /&gt;
[[User:Desastre|Desastre]] 27 April 2008&lt;/div&gt;</summary>
		<author><name>Desastre</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Colorama&amp;diff=3456</id>
		<title>Colorama</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Colorama&amp;diff=3456"/>
		<updated>2008-03-30T18:00:26Z</updated>

		<summary type="html">&lt;p&gt;Desastre: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=COLORAMA=&lt;br /&gt;
&lt;br /&gt;
COLORAMA is a PyMOL plugin which allows to color objects using adjustable scale bars. &lt;br /&gt;
&lt;br /&gt;
==Program features==&lt;br /&gt;
In RGB mode, each color R, G, B is represented by one scale bar which can be manually adjusted while the selected object is colored in real time. For convenience, it is as well possible to switch to the HSV color system.&lt;br /&gt;
&lt;br /&gt;
Additionally, a color gradient with user-defined start- and end-colors can be created for the selected molecule.&lt;br /&gt;
&lt;br /&gt;
==Screenshot==&lt;br /&gt;
[[Image:COLORAMA-screenshot.jpg]]&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
&lt;br /&gt;
Install the program by copying the code below into an empty text file (e.g. &amp;quot;colorama.py&amp;quot;) located in the \Pymol\modules\pmg_tk\startup directory. After PyMOL has been started, the program can be launched from the PLUGINS menu. COLORAMA does not properly work with PyMOL versions older than 1.0.&lt;br /&gt;
&lt;br /&gt;
===Single color===&lt;br /&gt;
&lt;br /&gt;
#Type the name of a PyMOL object to be colored into the COLORAMA entry field.&lt;br /&gt;
#Push the &amp;quot;Set&amp;quot; button.&lt;br /&gt;
#The scales are adjusted to the current color which is additionally visualized in a field left to the scales.&lt;br /&gt;
#If one of the scales is moved, the color of the selected object will change in real-time.&lt;br /&gt;
#Pushing the RGB or HSV buttons on the left allows to switch between both color systems.&lt;br /&gt;
&lt;br /&gt;
===Color gradients===&lt;br /&gt;
&lt;br /&gt;
#After an object has been selected, push the &amp;quot;G&amp;quot; button (gradient).&lt;br /&gt;
#Select the start color by pushing &amp;quot;C1&amp;quot; and adjusting it using the scales.&lt;br /&gt;
#Select the end color &amp;quot;C2&amp;quot; in the same way.&lt;br /&gt;
#To create the gradient, push &amp;quot;Set gradient&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
A new object will be created which is called &amp;quot;dummy-OLD_OBJECT&amp;quot;. The B-factor column of this object is overwritten and now contains the number of each residue. The original object is left unchanged. The gradient mode can be left by pushing &amp;quot;M&amp;quot; (monochrome).&lt;br /&gt;
This part of the program uses a modified version of the [http://pldserver1.biochem.queensu.ca/~rlc/work/pymol/ color_b script] by Robert L. Campbell &amp;amp; James Stroud.&lt;br /&gt;
&lt;br /&gt;
==Contact==&lt;br /&gt;
Gregor Hagelueken,&lt;br /&gt;
gh50@st-andrews.ac.uk&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
--- COLORAMA: Coloring Widget for PyMOL --- &lt;br /&gt;
Author  : Gregor Hagelueken&lt;br /&gt;
Program : Color_select&lt;br /&gt;
Date    : Oct 2007&lt;br /&gt;
Version : 0.1.1&lt;br /&gt;
Mail    : gha@helmholtz-hzi.de&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
COLORAMA is a plugin for the PyMOL Molecular Graphics System. &lt;br /&gt;
It allows to color molecules using RGB or HSV colors which can be manually adjusted. &lt;br /&gt;
Alternatively, a user defined color gradient can be applied to the molecule.&lt;br /&gt;
The program works properly with PyMOL versions &amp;gt;=1.0.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The program uses a modified version of the color_b program by Robert L. Campbell &amp;amp; James Stroud&lt;br /&gt;
for the gradient calculation and the RGBToHTMLColor function by Paul Winkler.&lt;br /&gt;
&lt;br /&gt;
Literature:&lt;br /&gt;
 DeLano, W.L. The PyMOL Molecular Graphics System (2002) DeLano Scientific, San Carlos, CA, USA. http://www.pymol.org&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------&lt;br /&gt;
----------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
import colorsys,sys&lt;br /&gt;
from pymol import cmd,stored&lt;br /&gt;
from Tkinter import *&lt;br /&gt;
class Colorama:&lt;br /&gt;
    def __init__ (self,master):&lt;br /&gt;
        #create frames&lt;br /&gt;
        self.F1 = Frame(roota, padx=5, pady=5, bg='red')&lt;br /&gt;
        self.F2 = Frame(roota, padx=5, pady=5, bg='green')&lt;br /&gt;
        self.F3 = Frame(roota, padx=5, pady=5, bg='blue')&lt;br /&gt;
        self.F4 = Frame(self.F1, padx=5, pady=5, bg='yellow')&lt;br /&gt;
        self.F5 = Frame(self.F1, padx=5, pady=5, bg='white')&lt;br /&gt;
        self.F6 = Frame(self.F1, padx=5, pady=5, bg='pink')&lt;br /&gt;
        &lt;br /&gt;
        #color system radiobuttons&lt;br /&gt;
        self.Radiocolorsystem = IntVar()&lt;br /&gt;
        self.RGB = Radiobutton (self.F3, text='RGB', indicatoron=0, variable=self.Radiocolorsystem, value=1, command=self.Scalergb)&lt;br /&gt;
        self.HSV = Radiobutton (self.F3, text='HSV', indicatoron=0, variable=self.Radiocolorsystem, value=2, command=self.Scalehsv)&lt;br /&gt;
        &lt;br /&gt;
        #mono/gradient and Farbe1/Farbe2 radiobuttons&lt;br /&gt;
        self.RadioMonoGradient = IntVar()&lt;br /&gt;
        self.RadioFarbe12 = IntVar()&lt;br /&gt;
        self.Monobutton = Radiobutton (self.F3, text='M', indicatoron=0, variable=self.RadioMonoGradient, value=1, command=self.Mono)&lt;br /&gt;
        self.Gradbutton = Radiobutton (self.F3, text='G', indicatoron=0, variable=self.RadioMonoGradient, value=2, command=self.Grad)&lt;br /&gt;
        self.Farbe1button = Radiobutton (self.F3, text='C1', indicatoron=0, variable=self.RadioFarbe12, value=1, command=self.Farbe1) &lt;br /&gt;
        self.Farbe2button = Radiobutton (self.F3, text='C2', indicatoron=0, variable=self.RadioFarbe12, value=2, command=self.Farbe2) &lt;br /&gt;
        &lt;br /&gt;
        #preselect RGB and mono&lt;br /&gt;
        self.RGB.select()&lt;br /&gt;
        self.Monobutton.select()&lt;br /&gt;
        self.Farbe1button.select()&lt;br /&gt;
        self.monograd='mono'&lt;br /&gt;
        self.colorsystem='rgb'&lt;br /&gt;
        self.farbe12='farbe1'&lt;br /&gt;
        &lt;br /&gt;
        #initialize the scales&lt;br /&gt;
        self.Scales()&lt;br /&gt;
        &lt;br /&gt;
        #other GUI elements&lt;br /&gt;
        self.selectionentry = Entry(master=self.F5, font=('Arial', 10))&lt;br /&gt;
        self.selectionentry.insert(0,&amp;quot;&amp;quot;)&lt;br /&gt;
        self.selectionbutton = Button(master=self.F5, text='Set', command=self.setselection)&lt;br /&gt;
        self.setgradientbutton = Button(master=self.F5, text='Set Gradient', command=self.setgradient)&lt;br /&gt;
        self.label = Label(master=self.F4, text=&amp;quot;None&amp;quot;, font=('Arial', 10))&lt;br /&gt;
        self.selectionlabel = Label(master=self.F4, text=&amp;quot;Active:&amp;quot;, font=('Arial', 10))&lt;br /&gt;
        self.inputlabel = Label (master=self.F5, text=&amp;quot;Object:&amp;quot;, font=('Arial', 10))&lt;br /&gt;
        self.colorfield1 = Label(master=self.F3,width=3, height=10)&lt;br /&gt;
        self.colorfield2 = Label(master=self.F3,width=3, height=10)&lt;br /&gt;
        &lt;br /&gt;
        self.selection=&amp;quot;&amp;quot;&lt;br /&gt;
        self.setselection()&lt;br /&gt;
        &lt;br /&gt;
        #start layout procedure&lt;br /&gt;
        self.layout()&lt;br /&gt;
    &lt;br /&gt;
    def layout(self):&lt;br /&gt;
        self.F1.pack(side=TOP, anchor=NW)&lt;br /&gt;
        self.F4.pack(side=BOTTOM, fill=X, anchor=W)&lt;br /&gt;
        self.F5.pack(side=TOP)&lt;br /&gt;
        self.F2.pack(side=RIGHT, fill=Y)&lt;br /&gt;
        self.F3.pack(side=LEFT, fill=X)&lt;br /&gt;
        &lt;br /&gt;
        #entry and buttons&lt;br /&gt;
        self.setgradientbutton.pack(side=RIGHT,fill=X, anchor=NE)&lt;br /&gt;
        self.selectionbutton.pack(side=RIGHT, anchor=N)&lt;br /&gt;
        self.selectionentry.pack(side=RIGHT,fill=X, anchor=NE)&lt;br /&gt;
        &lt;br /&gt;
        #labels&lt;br /&gt;
        self.inputlabel.pack(side=TOP, anchor=NW)&lt;br /&gt;
        self.selectionlabel.pack(side=LEFT, anchor=W)&lt;br /&gt;
        self.label.pack(side=LEFT)&lt;br /&gt;
        &lt;br /&gt;
        #colorfields&lt;br /&gt;
        self.colorfield2.pack(side=RIGHT)&lt;br /&gt;
        self.colorfield1.pack(side=RIGHT)&lt;br /&gt;
        &lt;br /&gt;
        #scales&lt;br /&gt;
        self.ScaleRed.pack(side=RIGHT, fill=Y)&lt;br /&gt;
        self.ScaleGreen.pack(side=RIGHT, fill=Y)&lt;br /&gt;
        self.ScaleBlue.pack(side=RIGHT, fill=Y)&lt;br /&gt;
        &lt;br /&gt;
        #radiobuttons&lt;br /&gt;
        self.RGB.pack(side=TOP, fill=X)&lt;br /&gt;
        self.HSV.pack(side=TOP, fill=X)&lt;br /&gt;
        self.Monobutton.pack(side=TOP, fill=X)&lt;br /&gt;
        self.Gradbutton.pack(side=TOP, fill=X)&lt;br /&gt;
        self.Farbe1button.pack(side=TOP, fill=X)&lt;br /&gt;
        self.Farbe2button.pack(side=TOP, fill=X)&lt;br /&gt;
    &lt;br /&gt;
    def Scales(self):&lt;br /&gt;
            self.ScaleRed = Scale(master=self.F2, label='R', length='3c',&lt;br /&gt;
                              from_=0, to=255,&lt;br /&gt;
                              #set(startred),&lt;br /&gt;
                              command=self.setzeFarbe)&lt;br /&gt;
            self.ScaleGreen = Scale(master=self.F2, label='G', length='3c',&lt;br /&gt;
                              from_=0, to=255,&lt;br /&gt;
                              #set(startgreen),&lt;br /&gt;
                              command=self.setzeFarbe)&lt;br /&gt;
            self.ScaleBlue = Scale(master=self.F2, label='B', length='3c',&lt;br /&gt;
                              from_=0, to=255,&lt;br /&gt;
                              #set(startblue),&lt;br /&gt;
                              command=self.setzeFarbe)&lt;br /&gt;
                              &lt;br /&gt;
    def Scalergb(self):&lt;br /&gt;
        if (self.colorsystem=='hsv'):&lt;br /&gt;
            h=float(self.ScaleRed.get())&lt;br /&gt;
            s=float(self.ScaleGreen.get())&lt;br /&gt;
            v=float(self.ScaleBlue.get())&lt;br /&gt;
            rgbcolor = colorsys.hsv_to_rgb(h,s,v)&lt;br /&gt;
            r=255*rgbcolor[0]&lt;br /&gt;
            g=255*rgbcolor[1]&lt;br /&gt;
            b=255*rgbcolor[2]&lt;br /&gt;
            self.ScaleRed.config(label='R', from_=0, to=255, resolution=1)&lt;br /&gt;
            self.ScaleGreen.config(label='G', from_=0, to=255, resolution=1)&lt;br /&gt;
            self.ScaleBlue.config(label='B', from_=0, to=255, resolution=1)&lt;br /&gt;
            self.ScaleRed.set(r)&lt;br /&gt;
            self.ScaleGreen.set(g)&lt;br /&gt;
            self.ScaleBlue.set(b)&lt;br /&gt;
            self.colorsystem='rgb'&lt;br /&gt;
            &lt;br /&gt;
    def Scalehsv(self):&lt;br /&gt;
        if (self.colorsystem=='rgb'):&lt;br /&gt;
            r=float(self.ScaleRed.get())/255&lt;br /&gt;
            g=float(self.ScaleGreen.get())/255&lt;br /&gt;
            b=float(self.ScaleBlue.get())/255&lt;br /&gt;
            hsvcolor = colorsys.rgb_to_hsv(r,g,b)&lt;br /&gt;
            h=hsvcolor[0]&lt;br /&gt;
            s=hsvcolor[1]&lt;br /&gt;
            v=hsvcolor[2]&lt;br /&gt;
            self.ScaleRed.config(label='H', from_=0, to=1, resolution=0.01)&lt;br /&gt;
            self.ScaleGreen.config(label='S', from_=0, to=1, resolution=0.01)&lt;br /&gt;
            self.ScaleBlue.config(label='V', from_=0, to=1, resolution=0.01)&lt;br /&gt;
            self.ScaleRed.set(h)&lt;br /&gt;
            self.ScaleGreen.set(s)&lt;br /&gt;
            self.ScaleBlue.set(v)&lt;br /&gt;
            self.colorsystem='hsv'&lt;br /&gt;
    &lt;br /&gt;
    def Mono(self):&lt;br /&gt;
        self.monograd='mono'&lt;br /&gt;
    &lt;br /&gt;
    def Grad(self):&lt;br /&gt;
        self.monograd='grad'&lt;br /&gt;
        &lt;br /&gt;
    def Farbe1(self):&lt;br /&gt;
        #Let the scales know which color is to be changed&lt;br /&gt;
        self.farbe12='farbe1'&lt;br /&gt;
        #set scales to farbe1&lt;br /&gt;
        if (self.monograd=='grad'):&lt;br /&gt;
            if (self.colorsystem=='rgb'):&lt;br /&gt;
                startred=self.farbe1[0]&lt;br /&gt;
                startgreen=self.farbe1[1]&lt;br /&gt;
                startblue=self.farbe1[2]							  &lt;br /&gt;
                self.ScaleRed.set(startred)&lt;br /&gt;
                self.ScaleGreen.set(startgreen)&lt;br /&gt;
                self.ScaleBlue.set(startblue)&lt;br /&gt;
            elif (self.colorsystem=='hsv'):&lt;br /&gt;
                hsvcolor=colorsys.rgb_to_hsv(self.farbe1[0], self.farbe1[1], self.farbe1[2])&lt;br /&gt;
                h=hsvcolor[0]&lt;br /&gt;
                s=hsvcolor[1]&lt;br /&gt;
                v=hsvcolor[2]&lt;br /&gt;
                self.ScaleRed.set(h)&lt;br /&gt;
                self.ScaleGreen.set(s)&lt;br /&gt;
                self.ScaleBlue.set(v)&lt;br /&gt;
    &lt;br /&gt;
    def Farbe2(self):&lt;br /&gt;
        #Let the scales know which color is to be changed&lt;br /&gt;
        self.farbe12='farbe2'&lt;br /&gt;
        #set scales to farbe1&lt;br /&gt;
        if (self.monograd=='grad'):&lt;br /&gt;
            if (self.colorsystem=='rgb'):&lt;br /&gt;
                startred=self.farbe2[0]&lt;br /&gt;
                startgreen=self.farbe2[1]&lt;br /&gt;
                startblue=self.farbe2[2]							  &lt;br /&gt;
                self.ScaleRed.set(startred)&lt;br /&gt;
                self.ScaleGreen.set(startgreen)&lt;br /&gt;
                self.ScaleBlue.set(startblue)&lt;br /&gt;
            elif (self.colorsystem=='hsv'):&lt;br /&gt;
                hsvcolor=colorsys.rgb_to_hsv(self.farbe2[0], self.farbe2[1], self.farbe2[2])&lt;br /&gt;
                h=hsvcolor[0]&lt;br /&gt;
                s=hsvcolor[1]&lt;br /&gt;
                v=hsvcolor[2]&lt;br /&gt;
                self.ScaleRed.set(h)&lt;br /&gt;
                self.ScaleGreen.set(s)&lt;br /&gt;
                self.ScaleBlue.set(v)&lt;br /&gt;
        &lt;br /&gt;
    def setselection(self):&lt;br /&gt;
        if (self.selectionentry.get() != &amp;quot;&amp;quot;):&lt;br /&gt;
            self.selection=self.selectionentry.get()&lt;br /&gt;
            &lt;br /&gt;
            #Color of each residue is stored in  stored.colorlist to check if the molecule has a colorgradient&lt;br /&gt;
            stored.colorlist = []&lt;br /&gt;
            cmd.iterate (self.selection+&amp;quot; &amp;amp; name CA&amp;quot;, &amp;quot;stored.colorlist.append(int(color))&amp;quot;)&lt;br /&gt;
            &lt;br /&gt;
            if (len(stored.colorlist)==0):&lt;br /&gt;
                #for other objects (e.g. density...)&lt;br /&gt;
                stored.colorlist.append(cmd.get_object_color_index(self.selection))&lt;br /&gt;
                stored.colorlist.append(cmd.get_object_color_index(self.selection))&lt;br /&gt;
            &lt;br /&gt;
            &lt;br /&gt;
            initialcolornterm=cmd.get_color_tuple(stored.colorlist[0])&lt;br /&gt;
            initialcolorcterm=cmd.get_color_tuple(stored.colorlist[len(stored.colorlist)-1])&lt;br /&gt;
            self.farbe1=initialcolornterm[0]*255, initialcolornterm[1]*255, initialcolornterm[2]*255&lt;br /&gt;
            self.farbe2=initialcolorcterm[0]*255, initialcolorcterm[1]*255, initialcolorcterm[2]*255&lt;br /&gt;
            &lt;br /&gt;
            #Set active object to label&lt;br /&gt;
            self.label.config(text=self.selection)&lt;br /&gt;
            &lt;br /&gt;
            #check if there is a gradient and adjust Mono/Gradbutton&lt;br /&gt;
            if (initialcolornterm==initialcolorcterm):&lt;br /&gt;
                self.Monobutton.select()&lt;br /&gt;
                self.Mono()&lt;br /&gt;
                &lt;br /&gt;
            elif (initialcolornterm!=initialcolorcterm):&lt;br /&gt;
                self.Gradbutton.select()&lt;br /&gt;
                self.Grad()&lt;br /&gt;
            &lt;br /&gt;
            #adjust colorfields&lt;br /&gt;
            self.colorfield1.config(bg=self.RGBToHTMLColor(self.farbe1))&lt;br /&gt;
            self.colorfield2.config(bg=self.RGBToHTMLColor(self.farbe2))&lt;br /&gt;
            self.Farbe1button.select()&lt;br /&gt;
            self.Farbe1()&lt;br /&gt;
            &lt;br /&gt;
            #Set scales to initialcolor of the new object    &lt;br /&gt;
            if (self.colorsystem=='rgb'):&lt;br /&gt;
                startred=255*initialcolornterm[0]&lt;br /&gt;
                startgreen=255*initialcolornterm[1]&lt;br /&gt;
                startblue=255*initialcolornterm[2]							  &lt;br /&gt;
                self.ScaleRed.set(startred)&lt;br /&gt;
                self.ScaleGreen.set(startgreen)&lt;br /&gt;
                self.ScaleBlue.set(startblue)&lt;br /&gt;
            elif (self.colorsystem=='hsv'):&lt;br /&gt;
                hsvcolor=colorsys.rgb_to_hsv(initialcolornterm[0], initialcolornterm[1], initialcolornterm[2])&lt;br /&gt;
                h=hsvcolor[0]&lt;br /&gt;
                s=hsvcolor[1]&lt;br /&gt;
                v=hsvcolor[2]&lt;br /&gt;
                self.ScaleRed.set(h)&lt;br /&gt;
                self.ScaleGreen.set(s)&lt;br /&gt;
                self.ScaleBlue.set(v)&lt;br /&gt;
             &lt;br /&gt;
    def setzeFarbe(self, event):&lt;br /&gt;
        if ((self.selection != &amp;quot;&amp;quot;) &amp;amp; (self.monograd == 'mono')):&lt;br /&gt;
            if (self.colorsystem=='rgb'):&lt;br /&gt;
                col=[]&lt;br /&gt;
                #read RGB values from scales&lt;br /&gt;
                r=int(self.ScaleRed.get())&lt;br /&gt;
                g=int(self.ScaleGreen.get())&lt;br /&gt;
                b=int(self.ScaleBlue.get())&lt;br /&gt;
                rgbcolor=r,g,b&lt;br /&gt;
                #Prepare a rgb tupel&lt;br /&gt;
                col.append(rgbcolor)&lt;br /&gt;
                #hexcolor for colorfields&lt;br /&gt;
                hexcolor=self.RGBToHTMLColor(rgbcolor)&lt;br /&gt;
                self.colorfield1.config(bg=hexcolor)&lt;br /&gt;
                self.colorfield2.config(bg=hexcolor)&lt;br /&gt;
                cmd.delete(self.selection+&amp;quot;_color&amp;quot;)&lt;br /&gt;
                cmd.set_color(self.selection+&amp;quot;_color&amp;quot;, col[0])&lt;br /&gt;
                cmd.color(self.selection+&amp;quot;_color&amp;quot;, self.selection)&lt;br /&gt;
                del col[0]&lt;br /&gt;
            elif (self.colorsystem=='hsv'):&lt;br /&gt;
                col=[]&lt;br /&gt;
                #read HSV values from scales&lt;br /&gt;
                h=float(self.ScaleRed.get())&lt;br /&gt;
                s=float(self.ScaleGreen.get())&lt;br /&gt;
                v=float(self.ScaleBlue.get())&lt;br /&gt;
                &lt;br /&gt;
                #HSV to RGB and change from 1.0, 1.0, 1.0 format to 255,255,255 format&lt;br /&gt;
                rgbcolor = colorsys.hsv_to_rgb(h,s,v)&lt;br /&gt;
                r = 255*rgbcolor[0]&lt;br /&gt;
                g = 255*rgbcolor[1]&lt;br /&gt;
                b = 255*rgbcolor[2]&lt;br /&gt;
                #as above&lt;br /&gt;
                rgbcolor = r,g,b&lt;br /&gt;
                col.append(rgbcolor)&lt;br /&gt;
                #hexcolor for colorfields&lt;br /&gt;
                hexcolor=self.RGBToHTMLColor(rgbcolor)&lt;br /&gt;
                self.colorfield1.config(bg=hexcolor)&lt;br /&gt;
                self.colorfield2.config(bg=hexcolor)&lt;br /&gt;
                cmd.delete(self.selection+&amp;quot;_color&amp;quot;)&lt;br /&gt;
                cmd.set_color(self.selection+&amp;quot;_color&amp;quot;, col[0])&lt;br /&gt;
                cmd.color(self.selection+&amp;quot;_color&amp;quot;, self.selection)&lt;br /&gt;
                del col[0]&lt;br /&gt;
        elif ((self.selection !=&amp;quot;&amp;quot;) &amp;amp; (self.monograd == 'grad')):&lt;br /&gt;
            &lt;br /&gt;
            if (self.colorsystem=='rgb'):&lt;br /&gt;
                col=[]&lt;br /&gt;
                #read RGB values from scales&lt;br /&gt;
                r=int(self.ScaleRed.get())&lt;br /&gt;
                g=int(self.ScaleGreen.get())&lt;br /&gt;
                b=int(self.ScaleBlue.get())&lt;br /&gt;
                rgbcolor=r,g,b&lt;br /&gt;
                #Prepare a rgb tupel&lt;br /&gt;
                col.append(rgbcolor)&lt;br /&gt;
                #hexcolor for colorfields&lt;br /&gt;
                hexcolor=self.RGBToHTMLColor(rgbcolor)&lt;br /&gt;
                if (self.farbe12=='farbe1'):&lt;br /&gt;
                    self.colorfield1.config(bg=hexcolor)&lt;br /&gt;
                    self.farbe1=rgbcolor&lt;br /&gt;
                elif (self.farbe12=='farbe2'):&lt;br /&gt;
                    self.colorfield2.config(bg=hexcolor)&lt;br /&gt;
                    self.farbe2=rgbcolor&lt;br /&gt;
&lt;br /&gt;
            elif (self.colorsystem=='hsv'):&lt;br /&gt;
                col=[]&lt;br /&gt;
                #read HSV values from scales&lt;br /&gt;
                h=float(self.ScaleRed.get())&lt;br /&gt;
                s=float(self.ScaleGreen.get())&lt;br /&gt;
                v=float(self.ScaleBlue.get())&lt;br /&gt;
                &lt;br /&gt;
                #HSV to RGB and change from 1.0, 1.0, 1.0 format to 255,255,255 format&lt;br /&gt;
                rgbcolor = colorsys.hsv_to_rgb(h,s,v)&lt;br /&gt;
                r = 255*rgbcolor[0]&lt;br /&gt;
                g = 255*rgbcolor[1]&lt;br /&gt;
                b = 255*rgbcolor[2]&lt;br /&gt;
                #as above&lt;br /&gt;
                rgbcolor = r,g,b&lt;br /&gt;
                col.append(rgbcolor)&lt;br /&gt;
                #hexcolor for colorfields&lt;br /&gt;
                hexcolor=self.RGBToHTMLColor(rgbcolor)&lt;br /&gt;
                &lt;br /&gt;
                if (self.farbe12=='farbe1'):&lt;br /&gt;
                    self.colorfield1.config(bg=hexcolor)&lt;br /&gt;
                    self.farbe1=rgbcolor&lt;br /&gt;
                elif (self.farbe12=='farbe2'):&lt;br /&gt;
                    self.colorfield2.config(bg=hexcolor)&lt;br /&gt;
                    self.farbe2=rgbcolor&lt;br /&gt;
    &lt;br /&gt;
    def setgradient(self):&lt;br /&gt;
        &lt;br /&gt;
        stored.residuelist = []&lt;br /&gt;
        cmd.iterate (self.selection, &amp;quot;stored.residuelist.append(int(resi))&amp;quot;)&lt;br /&gt;
        firstresidue=min(stored.residuelist)&lt;br /&gt;
        lastresidue=max(stored.residuelist)&lt;br /&gt;
        rs=float(self.farbe1[0])/float(255)&lt;br /&gt;
        gs=float(self.farbe1[1])/float(255)&lt;br /&gt;
        bs=float(self.farbe1[2])/float(255)&lt;br /&gt;
        re=float(self.farbe2[0])/float(255)&lt;br /&gt;
        ge=float(self.farbe2[1])/float(255)&lt;br /&gt;
        be=float(self.farbe2[2])/float(255)&lt;br /&gt;
        hsvcolorstart = colorsys.rgb_to_hsv(rs, gs, bs)&lt;br /&gt;
        hs=hsvcolorstart[0]&lt;br /&gt;
        ss=hsvcolorstart[1]&lt;br /&gt;
        vs=hsvcolorstart[2]&lt;br /&gt;
        hsvcolorend = colorsys.rgb_to_hsv(re, ge, be)&lt;br /&gt;
        he=hsvcolorend[0]&lt;br /&gt;
        se=hsvcolorend[1]&lt;br /&gt;
        ve=hsvcolorend[2]&lt;br /&gt;
        color_grad(selection=self.selection, minimum=firstresidue, maximum=lastresidue, hs=hs, he=he,ss=ss,se=se,vs=vs,ve=ve)&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
    def RGBToHTMLColor(self, rgb_tuple):&lt;br /&gt;
	    #by Paul Winkler&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot; convert an (R, G, B) tuple to #RRGGBB &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        hexcolor = '#%02x%02x%02x' % rgb_tuple&lt;br /&gt;
        # that's it! '%02x' means zero-padded, 2-digit hex values&lt;br /&gt;
        return hexcolor&lt;br /&gt;
&lt;br /&gt;
def __init__(self):&lt;br /&gt;
    self.menuBar.addmenuitem('Plugin', 'command',&lt;br /&gt;
                             'Colorama',&lt;br /&gt;
                             label = 'Colorama',&lt;br /&gt;
                             command = lambda s=self : open_Colorama())&lt;br /&gt;
	&lt;br /&gt;
def open_Colorama():&lt;br /&gt;
    #initialize window (roota)&lt;br /&gt;
    global roota&lt;br /&gt;
    roota = Tk()&lt;br /&gt;
    roota.title(' COLORAMA by gha')&lt;br /&gt;
    global colorama&lt;br /&gt;
    colorama = Colorama(roota)&lt;br /&gt;
&lt;br /&gt;
def color_grad(selection='',item='b',mode='hist',gradient='bgr',nbins=11,sat=1,value=1,minimum='1',maximum='1',dummy='dummy_all', hs=1, he=1, ss=1,se=1,vs=1,ve=1, colorname='init'):&lt;br /&gt;
  &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    --- color_grad: color gradient tool for PyMOL --- &lt;br /&gt;
    Author  : Gregor Hagelueken&lt;br /&gt;
    Program : Color_grad&lt;br /&gt;
    Date    : Oct 2007&lt;br /&gt;
    Version : 0.1.0&lt;br /&gt;
    Mail    : gha@helmholtz-hzi.de&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    This is a modified version of the color_b program by Robert L. Campbell &amp;amp; James Stroud&lt;br /&gt;
&lt;br /&gt;
    Literature:&lt;br /&gt;
    DeLano, W.L. The PyMOL Molecular Graphics System (2002) DeLano Scientific, San Carlos, CA, USA. http://www.pymol.org&lt;br /&gt;
&lt;br /&gt;
    ----------------------------------------------------------------------&lt;br /&gt;
    ----------------------------------------------------------------------&lt;br /&gt;
  &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  nbins=int(nbins)&lt;br /&gt;
  sat=float(sat)&lt;br /&gt;
  value=float(value)&lt;br /&gt;
  hs=float(hs)&lt;br /&gt;
  he=float(he)&lt;br /&gt;
  ss=float(ss)&lt;br /&gt;
  se=float(se)&lt;br /&gt;
  vs=float(vs)&lt;br /&gt;
  ve=float(ve)&lt;br /&gt;
  colorname='color_'+selection&lt;br /&gt;
  &lt;br /&gt;
  nbins=int(maximum)-int(minimum)+2&lt;br /&gt;
  dummy=&amp;quot;dummy-&amp;quot;+selection&lt;br /&gt;
  colname=&amp;quot;col&amp;quot;+selection&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
# make sure sat and value are in the range 0-1.0&lt;br /&gt;
  sat = min(sat, 1.0)&lt;br /&gt;
  sat = max(sat, 0.0)&lt;br /&gt;
  value = min(value, 1.0)&lt;br /&gt;
  value = max(value, 0.0)&lt;br /&gt;
&lt;br /&gt;
# make sure lowercase&lt;br /&gt;
  gradient.lower()&lt;br /&gt;
  mode.lower()&lt;br /&gt;
&lt;br /&gt;
# Sanity checking&lt;br /&gt;
  if nbins == 1:&lt;br /&gt;
    print &amp;quot;\n     WARNING: You specified nbins=1, which doesn't make sense...resetting nbins=11\n&amp;quot;&lt;br /&gt;
    nbins=11&lt;br /&gt;
&lt;br /&gt;
  if mode not in ('hist','ramp'):&lt;br /&gt;
    print &amp;quot;\n     WARNING: Unknown mode &amp;quot;,mode, &amp;quot;    -----&amp;gt;   Nothing done.\n&amp;quot;&lt;br /&gt;
    return&lt;br /&gt;
  if selection == '':&lt;br /&gt;
	print &amp;quot;\n USAGE: color_grad dimB, minimum=380, maximum=531, hs=0.3, he=0.25,ss=0.7,se=0.2,vs=1,ve=0.5\n&amp;quot;&lt;br /&gt;
	return&lt;br /&gt;
  elif gradient not in ('bgr','rgb','rainbow','reverserainbow','bwr','rwb',&lt;br /&gt;
                        'bmr','rmb','rw','wr','gw','wg','bw','wb','gy','yg','gray','grey','reversegray','reversegrey'):&lt;br /&gt;
    print &amp;quot;\n     WARNING: Unknown gradient: &amp;quot;,gradient, &amp;quot;    -----&amp;gt;   Nothing done.\n&amp;quot;&lt;br /&gt;
    return&lt;br /&gt;
&lt;br /&gt;
  print &amp;quot;MODE, GRADIENT, NBINS:&amp;quot;, mode,gradient, nbins&lt;br /&gt;
&lt;br /&gt;
# get list of B-factors from selection&lt;br /&gt;
  m = cmd.get_model(selection)&lt;br /&gt;
  sel = []&lt;br /&gt;
  b_list = []&lt;br /&gt;
&lt;br /&gt;
  if len(m.atom) == 0:&lt;br /&gt;
    print &amp;quot;Sorry, no atoms selected&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  else:&lt;br /&gt;
    if item == 'b':&lt;br /&gt;
      for i in range(len(m.atom)):&lt;br /&gt;
        m.atom[i].b=m.atom[i].resi&lt;br /&gt;
        b_list.append(m.atom[i].b) &lt;br /&gt;
        &lt;br /&gt;
    elif item == 'q':&lt;br /&gt;
      for i in range(len(m.atom)):&lt;br /&gt;
        b_list.append(m.atom[i].q)&lt;br /&gt;
&lt;br /&gt;
    else:&lt;br /&gt;
      print &amp;quot;Not configured to work on item %s&amp;quot; % item&lt;br /&gt;
      return&lt;br /&gt;
    &lt;br /&gt;
    cmd.load_model(m, dummy)&lt;br /&gt;
    &lt;br /&gt;
    print selection&lt;br /&gt;
    max_b = maximum&lt;br /&gt;
    min_b = minimum&lt;br /&gt;
    print &amp;quot;Minimum and Maximum B-values: &amp;quot;, min_b, max_b&lt;br /&gt;
    #nbins = (max_b - min_b)&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    if mode == 'hist':&lt;br /&gt;
&lt;br /&gt;
# check if minimum or maximum was specified and use the entered values&lt;br /&gt;
      if minimum != '':&lt;br /&gt;
        min_b = int(minimum)-1&lt;br /&gt;
      if maximum != '':&lt;br /&gt;
        max_b = int(maximum)+1&lt;br /&gt;
      # histogram:&lt;br /&gt;
      # color in bins of equal B-value ranges&lt;br /&gt;
      # subtract 0.1 from the lowest B in order to ensure that the single&lt;br /&gt;
      # atom with the lowest B value doesn't get omitted&lt;br /&gt;
      bin_width = (max_b - min_b)/nbins&lt;br /&gt;
      sel.append(selection + &amp;quot; and (%s = %4.4g&amp;quot; % (item,min_b + bin_width) + &amp;quot;)&amp;quot;)&lt;br /&gt;
      for j in range(1,nbins):&lt;br /&gt;
        #sel.append(selection + &amp;quot; and %s &amp;gt; %4.4g&amp;quot; % (item,min_b + j*bin_width))&lt;br /&gt;
        sel.append(dummy + &amp;quot; and %s = %4.4g&amp;quot; % (item,min_b + j*bin_width))&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
# call the function to create the gradient which returns a list of colours&lt;br /&gt;
    colours = make_gradient(sel,gradient,nbins,sat,value,hs,he,ss,se,vs,ve,colorname)&lt;br /&gt;
&lt;br /&gt;
# do the colouring now&lt;br /&gt;
    for j in range(nbins):&lt;br /&gt;
      print &amp;quot;Color select: &amp;quot;,sel[j]&lt;br /&gt;
      cmd.color(colours[j],sel[j])&lt;br /&gt;
  sel = []&lt;br /&gt;
  colours = []&lt;br /&gt;
# function for creating the gradient&lt;br /&gt;
def make_gradient(sel,gradient,nbins,sat,value,hs,he,ss,se,vs,ve,colorname):&lt;br /&gt;
  if gradient == 'bgr' or gradient == 'rainbow':&lt;br /&gt;
    col=[]&lt;br /&gt;
    coldesc=[]&lt;br /&gt;
    for j in range(nbins):&lt;br /&gt;
      # must append the str(sel[j]) to the color name so that it is unique &lt;br /&gt;
      # for the selection&lt;br /&gt;
      coldesc.append(colorname + str(j))&lt;br /&gt;
      # coldesc.append('col' + str(sel[j]) + str(j))&lt;br /&gt;
&lt;br /&gt;
      # create colors using hsv scale (fractional) starting at blue(.6666667) &lt;br /&gt;
      # through red(0.00000) in intervals of .6666667/(nbins -1) (the &amp;quot;nbins-1&amp;quot; &lt;br /&gt;
      # ensures that the last color is, in fact, red (0)&lt;br /&gt;
      # rewrote this to use the colorsys module to convert hsv to rgb&lt;br /&gt;
      hsv = (hs - (hs-he) * float(j) / (nbins-1), ss-(ss-se)*float(j)/(nbins-1), vs-(vs-ve)*float(j)/(nbins-1) )&lt;br /&gt;
      #convert to rgb and append to color list&lt;br /&gt;
      rgb = colorsys.hsv_to_rgb(hsv[0],hsv[1],hsv[2])&lt;br /&gt;
&lt;br /&gt;
      col.append(rgb)&lt;br /&gt;
      # cmd.set_color(&amp;quot;col&amp;quot; + str(sel[j]) + str(j),col[j])&lt;br /&gt;
      cmd.set_color(colorname + str(j),col[j])&lt;br /&gt;
      &lt;br /&gt;
      #cmd.color(,resi[j])&lt;br /&gt;
&lt;br /&gt;
  # return the gradient as a list of colors named by their index (i.e. col0,col1,col2,col3,...)&lt;br /&gt;
  return coldesc&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Download==&lt;br /&gt;
[[Media:colorama-0.1.1.tar.bz2|colorama-0.1.1.tar.bz2]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;br /&gt;
[[Category:Script_Library|Helicity Check]]&lt;/div&gt;</summary>
		<author><name>Desastre</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=File:Colorama-0.1.1.tar.bz2&amp;diff=1477</id>
		<title>File:Colorama-0.1.1.tar.bz2</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=File:Colorama-0.1.1.tar.bz2&amp;diff=1477"/>
		<updated>2008-03-30T17:59:44Z</updated>

		<summary type="html">&lt;p&gt;Desastre: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Desastre</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=File:Colorama.tar.bz2&amp;diff=1725</id>
		<title>File:Colorama.tar.bz2</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=File:Colorama.tar.bz2&amp;diff=1725"/>
		<updated>2008-03-30T17:58:15Z</updated>

		<summary type="html">&lt;p&gt;Desastre: uploaded a new version of &amp;quot;Image:Colorama.tar.bz2&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Desastre</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=File:Colorama.tar.bz2&amp;diff=1724</id>
		<title>File:Colorama.tar.bz2</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=File:Colorama.tar.bz2&amp;diff=1724"/>
		<updated>2008-03-30T17:58:15Z</updated>

		<summary type="html">&lt;p&gt;Desastre: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Desastre</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Talk:Grid_mode&amp;diff=66</id>
		<title>Talk:Grid mode</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Talk:Grid_mode&amp;diff=66"/>
		<updated>2008-02-18T16:53:22Z</updated>

		<summary type="html">&lt;p&gt;Desastre: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Since which version is this function is applied?&lt;/div&gt;</summary>
		<author><name>Desastre</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Talk:Grid_mode&amp;diff=65</id>
		<title>Talk:Grid mode</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Talk:Grid_mode&amp;diff=65"/>
		<updated>2008-02-18T11:38:44Z</updated>

		<summary type="html">&lt;p&gt;Desastre: New page: Since which version does this function is applied?&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Since which version does this function is applied?&lt;/div&gt;</summary>
		<author><name>Desastre</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Resicolor&amp;diff=9464</id>
		<title>Resicolor</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Resicolor&amp;diff=9464"/>
		<updated>2008-01-12T17:47:41Z</updated>

		<summary type="html">&lt;p&gt;Desastre: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Description==&lt;br /&gt;
&lt;br /&gt;
Here is a small script to color proteins according to residue type. Call it from your .pymolrc or from within pymol: &amp;quot;run resicolor.py&amp;quot;. Then, issuing &amp;quot;resicolor&amp;quot; will apply the scheme. Selections are supported: &amp;quot;resicolor chain A&amp;quot; will apply the scheme only to chain A.&lt;br /&gt;
This functionality is also available as a plugin ([[Resicolor_plugin]]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
#script contributed by Philippe Garteiser; garteiserp@omrf.ouhsc.edu&lt;br /&gt;
from pymol import cmd&lt;br /&gt;
&lt;br /&gt;
def resicolor(selection='all'):&lt;br /&gt;
    &lt;br /&gt;
    '''USAGE: resicolor &amp;lt;selection&amp;gt;&lt;br /&gt;
    colors all or the given selection with arbitrary&lt;br /&gt;
    coloring scheme.&lt;br /&gt;
    '''&lt;br /&gt;
    cmd.select ('calcium','resn ca or resn cal')&lt;br /&gt;
    cmd.select ('acid','resn asp or resn glu or resn cgu')&lt;br /&gt;
    cmd.select ('basic','resn arg or resn lys or resn his')&lt;br /&gt;
    cmd.select ('nonpolar','resn met or resn phe or resn pro or resn trp or resn val or resn leu or resn ile or resn ala')&lt;br /&gt;
    cmd.select ('polar','resn ser or resn thr or resn asn or resn gln or resn tyr')&lt;br /&gt;
    cmd.select ('cys','resn cys or resn cyx')&lt;br /&gt;
    cmd.select ('backbone','name ca or name n or name c or name o')&lt;br /&gt;
    cmd.select ('none')&lt;br /&gt;
&lt;br /&gt;
    print selection&lt;br /&gt;
    code={'acid'    :  'red'    ,&lt;br /&gt;
          'basic'   :  'blue'   ,&lt;br /&gt;
          'nonpolar':  'orange' ,&lt;br /&gt;
          'polar'   :  'green'  ,&lt;br /&gt;
          'cys'     :  'yellow'}&lt;br /&gt;
    cmd.select ('none')&lt;br /&gt;
    for elem in code:&lt;br /&gt;
        line='color '+code[elem]+','+elem+'&amp;amp;'+selection&lt;br /&gt;
        print line&lt;br /&gt;
        cmd.do (line)&lt;br /&gt;
    word='color white,backbone &amp;amp;'+selection&lt;br /&gt;
    print word&lt;br /&gt;
    cmd.do (word)                  #Used to be in code, but looks like&lt;br /&gt;
                                   #dictionnaries are accessed at random&lt;br /&gt;
    cmd.hide ('everything','resn HOH')&lt;br /&gt;
&lt;br /&gt;
cmd.extend ('resicolor',resicolor)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Download==&lt;br /&gt;
[[Media:Resicolor-0.1.tar.bz2‎|Resicolor-0.1.tar.bz2‎]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Script_Library]]&lt;br /&gt;
[[Category:Coloring|Resicolor Script]]&lt;/div&gt;</summary>
		<author><name>Desastre</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=File:Resicolor-0.1.tar.bz2&amp;diff=2010</id>
		<title>File:Resicolor-0.1.tar.bz2</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=File:Resicolor-0.1.tar.bz2&amp;diff=2010"/>
		<updated>2008-01-12T17:47:07Z</updated>

		<summary type="html">&lt;p&gt;Desastre: Resicolor-0.1 script as tarball&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Resicolor-0.1 script as tarball&lt;/div&gt;</summary>
		<author><name>Desastre</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Helicity_check&amp;diff=8316</id>
		<title>Helicity check</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Helicity_check&amp;diff=8316"/>
		<updated>2008-01-12T17:44:24Z</updated>

		<summary type="html">&lt;p&gt;Desastre: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''helicity_check''' shows the evolution of O -- N distances over an amino acid sequence&lt;br /&gt;
&lt;br /&gt;
See for further info:&lt;br /&gt;
&lt;br /&gt;
''Protein Sci'' ROHL and DOIG 5 (8) 1687&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Models for the 3(10)-helix/coil, pi-helix/coil, and alpha-helix/3(10)-helix/coil transitions in isolated peptides.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
uses:&lt;br /&gt;
*in the pymol console:&lt;br /&gt;
  &amp;gt;run pymol_helicity_check.py&lt;br /&gt;
    ----&amp;gt; select some consecutive amino acids&lt;br /&gt;
           - this is nicely done with the Display-&amp;gt;Sequence tool&lt;br /&gt;
  &amp;gt;helicity_check()&lt;br /&gt;
*installing helicity_check&lt;br /&gt;
  copy pymol_helicity_check.py in $PYMOL_INSTALL_DIR/modules/pmg_tk/startup&lt;br /&gt;
  launch Pymol: you now have a new option in the Plugin menu&lt;br /&gt;
 &lt;br /&gt;
helicity_check uses gnuplot (http://www.gnuplot.info) to display its results.&lt;br /&gt;
As a consequence gnuplot needs to be installed.&lt;br /&gt;
 &lt;br /&gt;
This plugin was tested on linux only, it might need some modifications to run on&lt;br /&gt;
other OSes. (hints: launching gnuplot and path to dumpfile)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# pymol_helicity_check.py&lt;br /&gt;
# Copyright (c) 2006-2007 Julien Lefeuvre &amp;lt;lefeuvrejulien@yahoo.fr&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
Pymol plugin for checking helicity type&lt;br /&gt;
&lt;br /&gt;
helicity_check() takes as input a selection ('sele' by default)&lt;br /&gt;
of at least 5 amino acids and computes the distances between&lt;br /&gt;
O(i) - N(i+3)&lt;br /&gt;
O(i) - N(i+4)&lt;br /&gt;
O(i) - N(i+5)&lt;br /&gt;
See for further info:&lt;br /&gt;
Protein Sci ROHL and DOIG 5 (8) 1687&lt;br /&gt;
'Models for the 3(10)-helix/coil, pi-helix/coil,&lt;br /&gt;
and alpha-helix/3(10)-helix/coil transitions in isolated peptides.'&lt;br /&gt;
&lt;br /&gt;
uses:&lt;br /&gt;
*in the pymol console:&lt;br /&gt;
  &amp;gt;run pymol_helicity_check.py&lt;br /&gt;
    ----&amp;gt; select some consecutive amino acids&lt;br /&gt;
           - this is nicely done with the Display-&amp;gt;Sequence tool&lt;br /&gt;
  &amp;gt;helicity_check()&lt;br /&gt;
*installing helicity_check&lt;br /&gt;
  copy pymol_helicity_check.py in $PYMOL_INSTALL_DIR/modules/pmg_tk/startup&lt;br /&gt;
  launch Pymol: you now have a new option in the Plugin menu&lt;br /&gt;
&lt;br /&gt;
helicity_check uses gnuplot (http://www.gnuplot.info) to display its results&lt;br /&gt;
As a consequence gnuplot needs to be installed.&lt;br /&gt;
&lt;br /&gt;
This plugin was tested on linux only, it my need some modifications to run on&lt;br /&gt;
other OSes (hints: launching gnuplot and path to dumpfile)&lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
__author__ =    &amp;quot;Julien Lefeuvre &amp;lt;lefeuvrejulien@yahoo.fr&amp;gt;&amp;quot;&lt;br /&gt;
__version__ =   &amp;quot;1.0&amp;quot;&lt;br /&gt;
__date__ =      &amp;quot;2007-04-02&amp;quot;&lt;br /&gt;
__copyright__ = &amp;quot;Copyright (c) 2007 %s. All rights reserved.&amp;quot; % __author__&lt;br /&gt;
__licence__ =   &amp;quot;BSD&amp;quot;&lt;br /&gt;
&lt;br /&gt;
from pymol import cmd&lt;br /&gt;
from math import sqrt&lt;br /&gt;
import sys&lt;br /&gt;
import os&lt;br /&gt;
import subprocess&lt;br /&gt;
import time&lt;br /&gt;
&lt;br /&gt;
def __init__(self):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;init function in order to have a nice menu option in Pymol&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    self.menuBar.addmenuitem('Plugin', 'command', 'Helicity Check',&lt;br /&gt;
             label='Helicity Check', command = lambda: helicity_check())&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
class Residue(object):&lt;br /&gt;
&lt;br /&gt;
    def __init__(self):&lt;br /&gt;
        self.name=None&lt;br /&gt;
        self.index=None&lt;br /&gt;
        self.Ocoord=None&lt;br /&gt;
        self.Ncoord=None&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def calc_distON(Ocoord,Ncoord):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;return the distance between 2 atoms given their coordinates&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    sum = 0&lt;br /&gt;
    for o, n in zip(Ocoord, Ncoord):&lt;br /&gt;
        sum += (o - n)**2&lt;br /&gt;
    return sqrt(sum)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
def helicity_check(selection='sele'):&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;calcultate distance O[res i]-N[res i+3]&lt;br /&gt;
                           O[res i]-N[res i+4]&lt;br /&gt;
                           O[res i]-N[res i+5]&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    seq_model = cmd.get_model(selection) #get info from selection&lt;br /&gt;
    res_lim = seq_model.get_residues()&lt;br /&gt;
&lt;br /&gt;
    if len(res_lim)&amp;lt;5:&lt;br /&gt;
        sys.stderr.write(&amp;quot;\nPlease select at least 5 residues\n&amp;quot;)&lt;br /&gt;
        return&lt;br /&gt;
&lt;br /&gt;
    atom_list = seq_model.atom&lt;br /&gt;
    res_data=[]&lt;br /&gt;
&lt;br /&gt;
    for start,end in res_lim:   #extract the data we are interested in&lt;br /&gt;
        res=Residue()&lt;br /&gt;
        for atom in atom_list[start:end]:&lt;br /&gt;
            if atom.name == 'N':&lt;br /&gt;
                res.name = atom.resn&lt;br /&gt;
                res.index = atom.resi&lt;br /&gt;
                res.Ncoord = atom.coord&lt;br /&gt;
            elif atom.name == 'O':&lt;br /&gt;
                res.Ocoord = atom.coord&lt;br /&gt;
        if res.Ocoord and res.Ncoord and res.name and res.index:&lt;br /&gt;
            res_data.append(res)&lt;br /&gt;
        else:&lt;br /&gt;
            sys.stderr.write(&amp;quot;\nPlease select complete protein residues\n&amp;quot;)&lt;br /&gt;
            return&lt;br /&gt;
&lt;br /&gt;
    res_list = [int(res.index) for res in res_data]&lt;br /&gt;
&lt;br /&gt;
    if res_list != range(res_list[0], res_list[-1]+1):&lt;br /&gt;
        sys.stderr.write(&amp;quot;\nPlease select a unbrocken residue sequence\n&amp;quot;)&lt;br /&gt;
        return&lt;br /&gt;
&lt;br /&gt;
    distON3 = []&lt;br /&gt;
    distON4 = []&lt;br /&gt;
    distON5 = []&lt;br /&gt;
    distONs = [distON3, distON4, distON5]&lt;br /&gt;
&lt;br /&gt;
    for i,res in enumerate(res_data[:-5]): #distances calculations&lt;br /&gt;
        resis = res_data[i+3:i+6]&lt;br /&gt;
        for resi, distONi in zip(resis, distONs):&lt;br /&gt;
            distONi.append(calc_distON(res.Ocoord, resi.Ncoord))&lt;br /&gt;
&lt;br /&gt;
    dump = os.tmpnam()+'.dat'&lt;br /&gt;
    dumpfile = file(dump, 'w')&lt;br /&gt;
&lt;br /&gt;
    sys.stdout.write('\n#Distances O(i)---N(i+n)\n'&lt;br /&gt;
           '#ResNum , d(O(i)-N(i+3)) , d(O(i)-N(i+4)) , d(O(i)-N(i+4))\n')&lt;br /&gt;
    for i, d3, d4, d5 in zip(res_list, distON3, distON4, distON5):&lt;br /&gt;
        #writing console output&lt;br /&gt;
        sys.stdout.write(&lt;br /&gt;
              '  %i ,      %f ,       %f ,       %f \n'%(i, d3, d4, d5))&lt;br /&gt;
        #writing data to a dump file for use by gnuplot&lt;br /&gt;
        dumpfile.write(&lt;br /&gt;
              '  %i       %f        %f        %f \n'%(i, d3, d4, d5))&lt;br /&gt;
    dumpfile.flush()&lt;br /&gt;
&lt;br /&gt;
    #launch a gnuplot window to show the distances&lt;br /&gt;
    gnuplotcmd = subprocess.Popen(['/usr/bin/gnuplot'], shell=True,&lt;br /&gt;
                               stdin=subprocess.PIPE)&lt;br /&gt;
    gnuplotcmd.stdin.write('set autoscale\n')&lt;br /&gt;
    gnuplotcmd.stdin.write(&amp;quot;plot &amp;quot;&lt;br /&gt;
         &amp;quot;'%s' using 1:2 title 'd(O(i)-N(i+3))' with lines, &amp;quot;&lt;br /&gt;
         &amp;quot;'%s' using 1:3 title 'd(O(i)-N(i+4))' with lines, &amp;quot;&lt;br /&gt;
         &amp;quot;'%s' using 1:4 title 'd(O(i)-N(i+5))' with lines\n'&amp;quot;&lt;br /&gt;
                          % (dump, dump, dump))&lt;br /&gt;
    time.sleep(3)&lt;br /&gt;
    dumpfile.close()&lt;br /&gt;
    os.remove(dump)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Download==&lt;br /&gt;
[[Media:Helicity_check-1.0.tar.bz2|Helicity_check-1.0.tar.bz2]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;br /&gt;
[[Category:Script_Library|Helicity Check]]&lt;/div&gt;</summary>
		<author><name>Desastre</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=File:Helicity_check-1.0.tar.bz2&amp;diff=2093</id>
		<title>File:Helicity check-1.0.tar.bz2</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=File:Helicity_check-1.0.tar.bz2&amp;diff=2093"/>
		<updated>2008-01-12T17:42:09Z</updated>

		<summary type="html">&lt;p&gt;Desastre: Helicity_check-1.0 script as tarball&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Helicity_check-1.0 script as tarball&lt;/div&gt;</summary>
		<author><name>Desastre</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Colorama&amp;diff=3451</id>
		<title>Colorama</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Colorama&amp;diff=3451"/>
		<updated>2008-01-12T17:23:12Z</updated>

		<summary type="html">&lt;p&gt;Desastre: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=COLORAMA=&lt;br /&gt;
&lt;br /&gt;
COLORAMA is a PyMOL plugin which allows to color objects using adjustable scale bars. &lt;br /&gt;
&lt;br /&gt;
==Program features==&lt;br /&gt;
In RGB mode, each color R, G, B is represented by one scale bar which can be manually adjusted while the selected object is colored in real time. For convenience, it is as well possible to switch to the HSV color system.&lt;br /&gt;
&lt;br /&gt;
Additionally, a color gradient with user-defined start- and end-colors can be created for the selected molecule.&lt;br /&gt;
&lt;br /&gt;
==Screenshot==&lt;br /&gt;
[[Image:COLORAMA-screenshot.jpg]]&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
&lt;br /&gt;
Install the program by copying the code below into an empty text file (e.g. &amp;quot;colorama.py&amp;quot;) located in the \Pymol\modules\pmg_tk\startup directory. The program will launch automatically after PyMOL is started. COLORAMA does not properly work with PyMOL versions older than 1.0.&lt;br /&gt;
&lt;br /&gt;
===Single color===&lt;br /&gt;
&lt;br /&gt;
#Type the name of a PyMOL object to be colored into the COLORAMA entry field.&lt;br /&gt;
#Push the &amp;quot;Set&amp;quot; button.&lt;br /&gt;
#The scales are adjusted to the current color which is additionally visualized in a field left to the scales.&lt;br /&gt;
#If one of the scales is moved, the color of the selected object will change in real-time.&lt;br /&gt;
#Pushing the RGB or HSV buttons on the left allows to switch between both color systems.&lt;br /&gt;
&lt;br /&gt;
===Color gradients===&lt;br /&gt;
&lt;br /&gt;
#After an object has been selected, push the &amp;quot;G&amp;quot; button (gradient).&lt;br /&gt;
#Select the start color by pushing &amp;quot;C1&amp;quot; and adjusting it using the scales.&lt;br /&gt;
#Select the end color &amp;quot;C2&amp;quot; in the same way.&lt;br /&gt;
#To create the gradient, push &amp;quot;Set gradient&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
A new object will be created which is called &amp;quot;dummy-OLD_OBJECT&amp;quot;. The B-factor column of this object is overwritten and now contains the number of each residue. The original object is left unchanged. The gradient mode can be left by pushing &amp;quot;M&amp;quot; (monochrome).&lt;br /&gt;
This part of the program uses a modified version of the [http://pldserver1.biochem.queensu.ca/~rlc/work/pymol/ color_b script] by Robert L. Campbell &amp;amp; James Stroud.&lt;br /&gt;
&lt;br /&gt;
==Contact==&lt;br /&gt;
Gregor.Hagelueken@helmholtz-hzi.de&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
--- COLORAMA: Coloring Widget for PyMOL --- &lt;br /&gt;
Author  : Gregor Hagelueken&lt;br /&gt;
Program : Color_select&lt;br /&gt;
Date    : Oct 2007&lt;br /&gt;
Version : 0.1.0&lt;br /&gt;
Mail    : gha@helmholtz-hzi.de&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
COLORAMA is a plugin for the PyMOL Molecular Graphics System. &lt;br /&gt;
It allows to color molecules using RGB or HSV colors which can be manually adjusted. &lt;br /&gt;
Alternatively, a user defined color gradient can be applied to the molecule.&lt;br /&gt;
The program works properly with PyMOL versions &amp;gt;=1.0.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The program uses a modified version of the color_b program by Robert L. Campbell &amp;amp; James Stroud&lt;br /&gt;
for the gradient calculation and the RGBToHTMLColor function by Paul Winkler.&lt;br /&gt;
&lt;br /&gt;
Literature:&lt;br /&gt;
 DeLano, W.L. The PyMOL Molecular Graphics System (2002) DeLano Scientific, San Carlos, CA, USA. http://www.pymol.org&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------&lt;br /&gt;
----------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
import colorsys,sys&lt;br /&gt;
from pymol import cmd,stored&lt;br /&gt;
from Tkinter import *&lt;br /&gt;
class Colorama:&lt;br /&gt;
    def __init__ (self,master):&lt;br /&gt;
        #create frames&lt;br /&gt;
        self.F1 = Frame(roota, padx=5, pady=5, bg='red')&lt;br /&gt;
        self.F2 = Frame(roota, padx=5, pady=5, bg='green')&lt;br /&gt;
        self.F3 = Frame(roota, padx=5, pady=5, bg='blue')&lt;br /&gt;
        self.F4 = Frame(self.F1, padx=5, pady=5, bg='yellow')&lt;br /&gt;
        self.F5 = Frame(self.F1, padx=5, pady=5, bg='white')&lt;br /&gt;
        self.F6 = Frame(self.F1, padx=5, pady=5, bg='pink')&lt;br /&gt;
        &lt;br /&gt;
        #color system radiobuttons&lt;br /&gt;
        self.Radiocolorsystem = IntVar()&lt;br /&gt;
        self.RGB = Radiobutton (self.F3, text='RGB', indicatoron=0, variable=self.Radiocolorsystem, value=1, command=self.Scalergb)&lt;br /&gt;
        self.HSV = Radiobutton (self.F3, text='HSV', indicatoron=0, variable=self.Radiocolorsystem, value=2, command=self.Scalehsv)&lt;br /&gt;
        &lt;br /&gt;
        #mono/gradient and Farbe1/Farbe2 radiobuttons&lt;br /&gt;
        self.RadioMonoGradient = IntVar()&lt;br /&gt;
        self.RadioFarbe12 = IntVar()&lt;br /&gt;
        self.Monobutton = Radiobutton (self.F3, text='M', indicatoron=0, variable=self.RadioMonoGradient, value=1, command=self.Mono)&lt;br /&gt;
        self.Gradbutton = Radiobutton (self.F3, text='G', indicatoron=0, variable=self.RadioMonoGradient, value=2, command=self.Grad)&lt;br /&gt;
        self.Farbe1button = Radiobutton (self.F3, text='C1', indicatoron=0, variable=self.RadioFarbe12, value=1, command=self.Farbe1) &lt;br /&gt;
        self.Farbe2button = Radiobutton (self.F3, text='C2', indicatoron=0, variable=self.RadioFarbe12, value=2, command=self.Farbe2) &lt;br /&gt;
        &lt;br /&gt;
        #preselect RGB and mono&lt;br /&gt;
        self.RGB.select()&lt;br /&gt;
        self.Monobutton.select()&lt;br /&gt;
        self.Farbe1button.select()&lt;br /&gt;
        self.monograd='mono'&lt;br /&gt;
        self.colorsystem='rgb'&lt;br /&gt;
        self.farbe12='farbe1'&lt;br /&gt;
        &lt;br /&gt;
        #initialize the scales&lt;br /&gt;
        self.Scales()&lt;br /&gt;
        &lt;br /&gt;
        #other GUI elements&lt;br /&gt;
        self.selectionentry = Entry(master=self.F5, font=('Arial', 10))&lt;br /&gt;
        self.selectionentry.insert(0,&amp;quot;&amp;quot;)&lt;br /&gt;
        self.selectionbutton = Button(master=self.F5, text='Set', command=self.setselection)&lt;br /&gt;
        self.setgradientbutton = Button(master=self.F5, text='Set Gradient', command=self.setgradient)&lt;br /&gt;
        self.label = Label(master=self.F4, text=&amp;quot;None&amp;quot;, font=('Arial', 10))&lt;br /&gt;
        self.selectionlabel = Label(master=self.F4, text=&amp;quot;Active:&amp;quot;, font=('Arial', 10))&lt;br /&gt;
        self.inputlabel = Label (master=self.F5, text=&amp;quot;Object:&amp;quot;, font=('Arial', 10))&lt;br /&gt;
        self.colorfield1 = Label(master=self.F3,width=3, height=10)&lt;br /&gt;
        self.colorfield2 = Label(master=self.F3,width=3, height=10)&lt;br /&gt;
        &lt;br /&gt;
        self.selection=&amp;quot;&amp;quot;&lt;br /&gt;
        self.setselection()&lt;br /&gt;
        &lt;br /&gt;
        #start layout procedure&lt;br /&gt;
        self.layout()&lt;br /&gt;
    &lt;br /&gt;
    def layout(self):&lt;br /&gt;
        self.F1.pack(side=TOP, anchor=NW)&lt;br /&gt;
        self.F4.pack(side=BOTTOM, fill=X, anchor=W)&lt;br /&gt;
        self.F5.pack(side=TOP)&lt;br /&gt;
        self.F2.pack(side=RIGHT, fill=Y)&lt;br /&gt;
        self.F3.pack(side=LEFT, fill=X)&lt;br /&gt;
        &lt;br /&gt;
        #entry and buttons&lt;br /&gt;
        self.setgradientbutton.pack(side=RIGHT,fill=X, anchor=NE)&lt;br /&gt;
        self.selectionbutton.pack(side=RIGHT, anchor=N)&lt;br /&gt;
        self.selectionentry.pack(side=RIGHT,fill=X, anchor=NE)&lt;br /&gt;
        &lt;br /&gt;
        #labels&lt;br /&gt;
        self.inputlabel.pack(side=TOP, anchor=NW)&lt;br /&gt;
        self.selectionlabel.pack(side=LEFT, anchor=W)&lt;br /&gt;
        self.label.pack(side=LEFT)&lt;br /&gt;
        &lt;br /&gt;
        #colorfields&lt;br /&gt;
        self.colorfield2.pack(side=RIGHT)&lt;br /&gt;
        self.colorfield1.pack(side=RIGHT)&lt;br /&gt;
        &lt;br /&gt;
        #scales&lt;br /&gt;
        self.ScaleRed.pack(side=RIGHT, fill=Y)&lt;br /&gt;
        self.ScaleGreen.pack(side=RIGHT, fill=Y)&lt;br /&gt;
        self.ScaleBlue.pack(side=RIGHT, fill=Y)&lt;br /&gt;
        &lt;br /&gt;
        #radiobuttons&lt;br /&gt;
        self.RGB.pack(side=TOP, fill=X)&lt;br /&gt;
        self.HSV.pack(side=TOP, fill=X)&lt;br /&gt;
        self.Monobutton.pack(side=TOP, fill=X)&lt;br /&gt;
        self.Gradbutton.pack(side=TOP, fill=X)&lt;br /&gt;
        self.Farbe1button.pack(side=TOP, fill=X)&lt;br /&gt;
        self.Farbe2button.pack(side=TOP, fill=X)&lt;br /&gt;
    &lt;br /&gt;
    def Scales(self):&lt;br /&gt;
            self.ScaleRed = Scale(master=self.F2, label='R', length='3c',&lt;br /&gt;
                              from_=0, to=255,&lt;br /&gt;
                              #set(startred),&lt;br /&gt;
                              command=self.setzeFarbe)&lt;br /&gt;
            self.ScaleGreen = Scale(master=self.F2, label='G', length='3c',&lt;br /&gt;
                              from_=0, to=255,&lt;br /&gt;
                              #set(startgreen),&lt;br /&gt;
                              command=self.setzeFarbe)&lt;br /&gt;
            self.ScaleBlue = Scale(master=self.F2, label='B', length='3c',&lt;br /&gt;
                              from_=0, to=255,&lt;br /&gt;
                              #set(startblue),&lt;br /&gt;
                              command=self.setzeFarbe)&lt;br /&gt;
                              &lt;br /&gt;
    def Scalergb(self):&lt;br /&gt;
        if (self.colorsystem=='hsv'):&lt;br /&gt;
            h=float(self.ScaleRed.get())&lt;br /&gt;
            s=float(self.ScaleGreen.get())&lt;br /&gt;
            v=float(self.ScaleBlue.get())&lt;br /&gt;
            rgbcolor = colorsys.hsv_to_rgb(h,s,v)&lt;br /&gt;
            r=255*rgbcolor[0]&lt;br /&gt;
            g=255*rgbcolor[1]&lt;br /&gt;
            b=255*rgbcolor[2]&lt;br /&gt;
            self.ScaleRed.config(label='R', from_=0, to=255, resolution=1)&lt;br /&gt;
            self.ScaleGreen.config(label='G', from_=0, to=255, resolution=1)&lt;br /&gt;
            self.ScaleBlue.config(label='B', from_=0, to=255, resolution=1)&lt;br /&gt;
            self.ScaleRed.set(r)&lt;br /&gt;
            self.ScaleGreen.set(g)&lt;br /&gt;
            self.ScaleBlue.set(b)&lt;br /&gt;
            self.colorsystem='rgb'&lt;br /&gt;
            &lt;br /&gt;
    def Scalehsv(self):&lt;br /&gt;
        if (self.colorsystem=='rgb'):&lt;br /&gt;
            r=float(self.ScaleRed.get())/255&lt;br /&gt;
            g=float(self.ScaleGreen.get())/255&lt;br /&gt;
            b=float(self.ScaleBlue.get())/255&lt;br /&gt;
            hsvcolor = colorsys.rgb_to_hsv(r,g,b)&lt;br /&gt;
            h=hsvcolor[0]&lt;br /&gt;
            s=hsvcolor[1]&lt;br /&gt;
            v=hsvcolor[2]&lt;br /&gt;
            self.ScaleRed.config(label='H', from_=0, to=1, resolution=0.01)&lt;br /&gt;
            self.ScaleGreen.config(label='S', from_=0, to=1, resolution=0.01)&lt;br /&gt;
            self.ScaleBlue.config(label='V', from_=0, to=1, resolution=0.01)&lt;br /&gt;
            self.ScaleRed.set(h)&lt;br /&gt;
            self.ScaleGreen.set(s)&lt;br /&gt;
            self.ScaleBlue.set(v)&lt;br /&gt;
            self.colorsystem='hsv'&lt;br /&gt;
    &lt;br /&gt;
    def Mono(self):&lt;br /&gt;
        self.monograd='mono'&lt;br /&gt;
    &lt;br /&gt;
    def Grad(self):&lt;br /&gt;
        self.monograd='grad'&lt;br /&gt;
        &lt;br /&gt;
    def Farbe1(self):&lt;br /&gt;
        #Let the scales know which color is to be changed&lt;br /&gt;
        self.farbe12='farbe1'&lt;br /&gt;
        #set scales to farbe1&lt;br /&gt;
        if (self.monograd=='grad'):&lt;br /&gt;
            if (self.colorsystem=='rgb'):&lt;br /&gt;
                startred=self.farbe1[0]&lt;br /&gt;
                startgreen=self.farbe1[1]&lt;br /&gt;
                startblue=self.farbe1[2]							  &lt;br /&gt;
                self.ScaleRed.set(startred)&lt;br /&gt;
                self.ScaleGreen.set(startgreen)&lt;br /&gt;
                self.ScaleBlue.set(startblue)&lt;br /&gt;
            elif (self.colorsystem=='hsv'):&lt;br /&gt;
                hsvcolor=colorsys.rgb_to_hsv(self.farbe1[0], self.farbe1[1], self.farbe1[2])&lt;br /&gt;
                h=hsvcolor[0]&lt;br /&gt;
                s=hsvcolor[1]&lt;br /&gt;
                v=hsvcolor[2]&lt;br /&gt;
                self.ScaleRed.set(h)&lt;br /&gt;
                self.ScaleGreen.set(s)&lt;br /&gt;
                self.ScaleBlue.set(v)&lt;br /&gt;
    &lt;br /&gt;
    def Farbe2(self):&lt;br /&gt;
        #Let the scales know which color is to be changed&lt;br /&gt;
        self.farbe12='farbe2'&lt;br /&gt;
        #set scales to farbe1&lt;br /&gt;
        if (self.monograd=='grad'):&lt;br /&gt;
            if (self.colorsystem=='rgb'):&lt;br /&gt;
                startred=self.farbe2[0]&lt;br /&gt;
                startgreen=self.farbe2[1]&lt;br /&gt;
                startblue=self.farbe2[2]							  &lt;br /&gt;
                self.ScaleRed.set(startred)&lt;br /&gt;
                self.ScaleGreen.set(startgreen)&lt;br /&gt;
                self.ScaleBlue.set(startblue)&lt;br /&gt;
            elif (self.colorsystem=='hsv'):&lt;br /&gt;
                hsvcolor=colorsys.rgb_to_hsv(self.farbe2[0], self.farbe2[1], self.farbe2[2])&lt;br /&gt;
                h=hsvcolor[0]&lt;br /&gt;
                s=hsvcolor[1]&lt;br /&gt;
                v=hsvcolor[2]&lt;br /&gt;
                self.ScaleRed.set(h)&lt;br /&gt;
                self.ScaleGreen.set(s)&lt;br /&gt;
                self.ScaleBlue.set(v)&lt;br /&gt;
        &lt;br /&gt;
    def setselection(self):&lt;br /&gt;
        if (self.selectionentry.get() != &amp;quot;&amp;quot;):&lt;br /&gt;
            self.selection=self.selectionentry.get()&lt;br /&gt;
            &lt;br /&gt;
            #Color of each residue is stored in  stored.colorlist to check if the molecule has a colorgradient&lt;br /&gt;
            stored.colorlist = []&lt;br /&gt;
            cmd.iterate (self.selection+&amp;quot; &amp;amp; name CA&amp;quot;, &amp;quot;stored.colorlist.append(int(color))&amp;quot;)&lt;br /&gt;
            &lt;br /&gt;
            if (len(stored.colorlist)==0):&lt;br /&gt;
                #for other objects (e.g. density...)&lt;br /&gt;
                stored.colorlist.append(cmd.get_object_color_index(self.selection))&lt;br /&gt;
                stored.colorlist.append(cmd.get_object_color_index(self.selection))&lt;br /&gt;
            &lt;br /&gt;
            &lt;br /&gt;
            initialcolornterm=cmd.get_color_tuple(stored.colorlist[0])&lt;br /&gt;
            initialcolorcterm=cmd.get_color_tuple(stored.colorlist[len(stored.colorlist)-1])&lt;br /&gt;
            self.farbe1=initialcolornterm[0]*255, initialcolornterm[1]*255, initialcolornterm[2]*255&lt;br /&gt;
            self.farbe2=initialcolorcterm[0]*255, initialcolorcterm[1]*255, initialcolorcterm[2]*255&lt;br /&gt;
            &lt;br /&gt;
            #Set active object to label&lt;br /&gt;
            self.label.config(text=self.selection)&lt;br /&gt;
            &lt;br /&gt;
            #check if there is a gradient and adjust Mono/Gradbutton&lt;br /&gt;
            if (initialcolornterm==initialcolorcterm):&lt;br /&gt;
                self.Monobutton.select()&lt;br /&gt;
                self.Mono()&lt;br /&gt;
                &lt;br /&gt;
            elif (initialcolornterm!=initialcolorcterm):&lt;br /&gt;
                self.Gradbutton.select()&lt;br /&gt;
                self.Grad()&lt;br /&gt;
            &lt;br /&gt;
            #adjust colorfields&lt;br /&gt;
            self.colorfield1.config(bg=self.RGBToHTMLColor(self.farbe1))&lt;br /&gt;
            self.colorfield2.config(bg=self.RGBToHTMLColor(self.farbe2))&lt;br /&gt;
            self.Farbe1button.select()&lt;br /&gt;
            self.Farbe1()&lt;br /&gt;
            &lt;br /&gt;
            #Set scales to initialcolor of the new object    &lt;br /&gt;
            if (self.colorsystem=='rgb'):&lt;br /&gt;
                startred=255*initialcolornterm[0]&lt;br /&gt;
                startgreen=255*initialcolornterm[1]&lt;br /&gt;
                startblue=255*initialcolornterm[2]							  &lt;br /&gt;
                self.ScaleRed.set(startred)&lt;br /&gt;
                self.ScaleGreen.set(startgreen)&lt;br /&gt;
                self.ScaleBlue.set(startblue)&lt;br /&gt;
            elif (self.colorsystem=='hsv'):&lt;br /&gt;
                hsvcolor=colorsys.rgb_to_hsv(initialcolornterm[0], initialcolornterm[1], initialcolornterm[2])&lt;br /&gt;
                h=hsvcolor[0]&lt;br /&gt;
                s=hsvcolor[1]&lt;br /&gt;
                v=hsvcolor[2]&lt;br /&gt;
                self.ScaleRed.set(h)&lt;br /&gt;
                self.ScaleGreen.set(s)&lt;br /&gt;
                self.ScaleBlue.set(v)&lt;br /&gt;
             &lt;br /&gt;
    def setzeFarbe(self, event):&lt;br /&gt;
        if ((self.selection != &amp;quot;&amp;quot;) &amp;amp; (self.monograd == 'mono')):&lt;br /&gt;
            if (self.colorsystem=='rgb'):&lt;br /&gt;
                col=[]&lt;br /&gt;
                #read RGB values from scales&lt;br /&gt;
                r=int(self.ScaleRed.get())&lt;br /&gt;
                g=int(self.ScaleGreen.get())&lt;br /&gt;
                b=int(self.ScaleBlue.get())&lt;br /&gt;
                rgbcolor=r,g,b&lt;br /&gt;
                #Prepare a rgb tupel&lt;br /&gt;
                col.append(rgbcolor)&lt;br /&gt;
                #hexcolor for colorfields&lt;br /&gt;
                hexcolor=self.RGBToHTMLColor(rgbcolor)&lt;br /&gt;
                self.colorfield1.config(bg=hexcolor)&lt;br /&gt;
                self.colorfield2.config(bg=hexcolor)&lt;br /&gt;
                cmd.delete(self.selection+&amp;quot;_color&amp;quot;)&lt;br /&gt;
                cmd.set_color(self.selection+&amp;quot;_color&amp;quot;, col[0])&lt;br /&gt;
                cmd.color(self.selection+&amp;quot;_color&amp;quot;, self.selection)&lt;br /&gt;
                del col[0]&lt;br /&gt;
            elif (self.colorsystem=='hsv'):&lt;br /&gt;
                col=[]&lt;br /&gt;
                #read HSV values from scales&lt;br /&gt;
                h=float(self.ScaleRed.get())&lt;br /&gt;
                s=float(self.ScaleGreen.get())&lt;br /&gt;
                v=float(self.ScaleBlue.get())&lt;br /&gt;
                &lt;br /&gt;
                #HSV to RGB and change from 1.0, 1.0, 1.0 format to 255,255,255 format&lt;br /&gt;
                rgbcolor = colorsys.hsv_to_rgb(h,s,v)&lt;br /&gt;
                r = 255*rgbcolor[0]&lt;br /&gt;
                g = 255*rgbcolor[1]&lt;br /&gt;
                b = 255*rgbcolor[2]&lt;br /&gt;
                #as above&lt;br /&gt;
                rgbcolor = r,g,b&lt;br /&gt;
                col.append(rgbcolor)&lt;br /&gt;
                #hexcolor for colorfields&lt;br /&gt;
                hexcolor=self.RGBToHTMLColor(rgbcolor)&lt;br /&gt;
                self.colorfield1.config(bg=hexcolor)&lt;br /&gt;
                self.colorfield2.config(bg=hexcolor)&lt;br /&gt;
                cmd.delete(self.selection+&amp;quot;_color&amp;quot;)&lt;br /&gt;
                cmd.set_color(self.selection+&amp;quot;_color&amp;quot;, col[0])&lt;br /&gt;
                cmd.color(self.selection+&amp;quot;_color&amp;quot;, self.selection)&lt;br /&gt;
                del col[0]&lt;br /&gt;
        elif ((self.selection !=&amp;quot;&amp;quot;) &amp;amp; (self.monograd == 'grad')):&lt;br /&gt;
            &lt;br /&gt;
            if (self.colorsystem=='rgb'):&lt;br /&gt;
                col=[]&lt;br /&gt;
                #read RGB values from scales&lt;br /&gt;
                r=int(self.ScaleRed.get())&lt;br /&gt;
                g=int(self.ScaleGreen.get())&lt;br /&gt;
                b=int(self.ScaleBlue.get())&lt;br /&gt;
                rgbcolor=r,g,b&lt;br /&gt;
                #Prepare a rgb tupel&lt;br /&gt;
                col.append(rgbcolor)&lt;br /&gt;
                #hexcolor for colorfields&lt;br /&gt;
                hexcolor=self.RGBToHTMLColor(rgbcolor)&lt;br /&gt;
                if (self.farbe12=='farbe1'):&lt;br /&gt;
                    self.colorfield1.config(bg=hexcolor)&lt;br /&gt;
                    self.farbe1=rgbcolor&lt;br /&gt;
                elif (self.farbe12=='farbe2'):&lt;br /&gt;
                    self.colorfield2.config(bg=hexcolor)&lt;br /&gt;
                    self.farbe2=rgbcolor&lt;br /&gt;
&lt;br /&gt;
            elif (self.colorsystem=='hsv'):&lt;br /&gt;
                col=[]&lt;br /&gt;
                #read HSV values from scales&lt;br /&gt;
                h=float(self.ScaleRed.get())&lt;br /&gt;
                s=float(self.ScaleGreen.get())&lt;br /&gt;
                v=float(self.ScaleBlue.get())&lt;br /&gt;
                &lt;br /&gt;
                #HSV to RGB and change from 1.0, 1.0, 1.0 format to 255,255,255 format&lt;br /&gt;
                rgbcolor = colorsys.hsv_to_rgb(h,s,v)&lt;br /&gt;
                r = 255*rgbcolor[0]&lt;br /&gt;
                g = 255*rgbcolor[1]&lt;br /&gt;
                b = 255*rgbcolor[2]&lt;br /&gt;
                #as above&lt;br /&gt;
                rgbcolor = r,g,b&lt;br /&gt;
                col.append(rgbcolor)&lt;br /&gt;
                #hexcolor for colorfields&lt;br /&gt;
                hexcolor=self.RGBToHTMLColor(rgbcolor)&lt;br /&gt;
                &lt;br /&gt;
                if (self.farbe12=='farbe1'):&lt;br /&gt;
                    self.colorfield1.config(bg=hexcolor)&lt;br /&gt;
                    self.farbe1=rgbcolor&lt;br /&gt;
                elif (self.farbe12=='farbe2'):&lt;br /&gt;
                    self.colorfield2.config(bg=hexcolor)&lt;br /&gt;
                    self.farbe2=rgbcolor&lt;br /&gt;
    &lt;br /&gt;
    def setgradient(self):&lt;br /&gt;
        &lt;br /&gt;
        stored.residuelist = []&lt;br /&gt;
        cmd.iterate (self.selection, &amp;quot;stored.residuelist.append(int(resi))&amp;quot;)&lt;br /&gt;
        firstresidue=min(stored.residuelist)&lt;br /&gt;
        lastresidue=max(stored.residuelist)&lt;br /&gt;
        rs=float(self.farbe1[0])/float(255)&lt;br /&gt;
        gs=float(self.farbe1[1])/float(255)&lt;br /&gt;
        bs=float(self.farbe1[2])/float(255)&lt;br /&gt;
        re=float(self.farbe2[0])/float(255)&lt;br /&gt;
        ge=float(self.farbe2[1])/float(255)&lt;br /&gt;
        be=float(self.farbe2[2])/float(255)&lt;br /&gt;
        hsvcolorstart = colorsys.rgb_to_hsv(rs, gs, bs)&lt;br /&gt;
        hs=hsvcolorstart[0]&lt;br /&gt;
        ss=hsvcolorstart[1]&lt;br /&gt;
        vs=hsvcolorstart[2]&lt;br /&gt;
        hsvcolorend = colorsys.rgb_to_hsv(re, ge, be)&lt;br /&gt;
        he=hsvcolorend[0]&lt;br /&gt;
        se=hsvcolorend[1]&lt;br /&gt;
        ve=hsvcolorend[2]&lt;br /&gt;
        color_grad(selection=self.selection, minimum=firstresidue, maximum=lastresidue, hs=hs, he=he,ss=ss,se=se,vs=vs,ve=ve)&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
    def RGBToHTMLColor(self, rgb_tuple):&lt;br /&gt;
	    #by Paul Winkler&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot; convert an (R, G, B) tuple to #RRGGBB &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        hexcolor = '#%02x%02x%02x' % rgb_tuple&lt;br /&gt;
        # that's it! '%02x' means zero-padded, 2-digit hex values&lt;br /&gt;
        return hexcolor&lt;br /&gt;
&lt;br /&gt;
def __init__(self):&lt;br /&gt;
&lt;br /&gt;
    open_Colorama()&lt;br /&gt;
	&lt;br /&gt;
def open_Colorama():&lt;br /&gt;
    #initialize window (roota)&lt;br /&gt;
    global roota&lt;br /&gt;
    roota = Tk()&lt;br /&gt;
    roota.title(' COLORAMA by gha')&lt;br /&gt;
    global colorama&lt;br /&gt;
    colorama = Colorama(roota)&lt;br /&gt;
&lt;br /&gt;
def color_grad(selection='',item='b',mode='hist',gradient='bgr',nbins=11,sat=1,value=1,minimum='1',maximum='1',dummy='dummy_all', hs=1, he=1, ss=1,se=1,vs=1,ve=1, colorname='init'):&lt;br /&gt;
  &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    --- color_grad: color gradient tool for PyMOL --- &lt;br /&gt;
    Author  : Gregor Hagelueken&lt;br /&gt;
    Program : Color_grad&lt;br /&gt;
    Date    : Oct 2007&lt;br /&gt;
    Version : 0.1.0&lt;br /&gt;
    Mail    : gha@helmholtz-hzi.de&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    This is a modified version of the color_b program by Robert L. Campbell &amp;amp; James Stroud&lt;br /&gt;
&lt;br /&gt;
    Literature:&lt;br /&gt;
    DeLano, W.L. The PyMOL Molecular Graphics System (2002) DeLano Scientific, San Carlos, CA, USA. http://www.pymol.org&lt;br /&gt;
&lt;br /&gt;
    ----------------------------------------------------------------------&lt;br /&gt;
    ----------------------------------------------------------------------&lt;br /&gt;
  &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  nbins=int(nbins)&lt;br /&gt;
  sat=float(sat)&lt;br /&gt;
  value=float(value)&lt;br /&gt;
  hs=float(hs)&lt;br /&gt;
  he=float(he)&lt;br /&gt;
  ss=float(ss)&lt;br /&gt;
  se=float(se)&lt;br /&gt;
  vs=float(vs)&lt;br /&gt;
  ve=float(ve)&lt;br /&gt;
  colorname='color_'+selection&lt;br /&gt;
  &lt;br /&gt;
  nbins=int(maximum)-int(minimum)+2&lt;br /&gt;
  dummy=&amp;quot;dummy-&amp;quot;+selection&lt;br /&gt;
  colname=&amp;quot;col&amp;quot;+selection&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
# make sure sat and value are in the range 0-1.0&lt;br /&gt;
  sat = min(sat, 1.0)&lt;br /&gt;
  sat = max(sat, 0.0)&lt;br /&gt;
  value = min(value, 1.0)&lt;br /&gt;
  value = max(value, 0.0)&lt;br /&gt;
&lt;br /&gt;
# make sure lowercase&lt;br /&gt;
  gradient.lower()&lt;br /&gt;
  mode.lower()&lt;br /&gt;
&lt;br /&gt;
# Sanity checking&lt;br /&gt;
  if nbins == 1:&lt;br /&gt;
    print &amp;quot;\n     WARNING: You specified nbins=1, which doesn't make sense...resetting nbins=11\n&amp;quot;&lt;br /&gt;
    nbins=11&lt;br /&gt;
&lt;br /&gt;
  if mode not in ('hist','ramp'):&lt;br /&gt;
    print &amp;quot;\n     WARNING: Unknown mode &amp;quot;,mode, &amp;quot;    -----&amp;gt;   Nothing done.\n&amp;quot;&lt;br /&gt;
    return&lt;br /&gt;
  if selection == '':&lt;br /&gt;
	print &amp;quot;\n USAGE: color_grad dimB, minimum=380, maximum=531, hs=0.3, he=0.25,ss=0.7,se=0.2,vs=1,ve=0.5\n&amp;quot;&lt;br /&gt;
	return&lt;br /&gt;
  elif gradient not in ('bgr','rgb','rainbow','reverserainbow','bwr','rwb',&lt;br /&gt;
                        'bmr','rmb','rw','wr','gw','wg','bw','wb','gy','yg','gray','grey','reversegray','reversegrey'):&lt;br /&gt;
    print &amp;quot;\n     WARNING: Unknown gradient: &amp;quot;,gradient, &amp;quot;    -----&amp;gt;   Nothing done.\n&amp;quot;&lt;br /&gt;
    return&lt;br /&gt;
&lt;br /&gt;
  print &amp;quot;MODE, GRADIENT, NBINS:&amp;quot;, mode,gradient, nbins&lt;br /&gt;
&lt;br /&gt;
# get list of B-factors from selection&lt;br /&gt;
  m = cmd.get_model(selection)&lt;br /&gt;
  sel = []&lt;br /&gt;
  b_list = []&lt;br /&gt;
&lt;br /&gt;
  if len(m.atom) == 0:&lt;br /&gt;
    print &amp;quot;Sorry, no atoms selected&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  else:&lt;br /&gt;
    if item == 'b':&lt;br /&gt;
      for i in range(len(m.atom)):&lt;br /&gt;
        m.atom[i].b=m.atom[i].resi&lt;br /&gt;
        b_list.append(m.atom[i].b) &lt;br /&gt;
        &lt;br /&gt;
    elif item == 'q':&lt;br /&gt;
      for i in range(len(m.atom)):&lt;br /&gt;
        b_list.append(m.atom[i].q)&lt;br /&gt;
&lt;br /&gt;
    else:&lt;br /&gt;
      print &amp;quot;Not configured to work on item %s&amp;quot; % item&lt;br /&gt;
      return&lt;br /&gt;
    &lt;br /&gt;
    cmd.load_model(m, dummy)&lt;br /&gt;
    &lt;br /&gt;
    print selection&lt;br /&gt;
    max_b = maximum&lt;br /&gt;
    min_b = minimum&lt;br /&gt;
    print &amp;quot;Minimum and Maximum B-values: &amp;quot;, min_b, max_b&lt;br /&gt;
    #nbins = (max_b - min_b)&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    if mode == 'hist':&lt;br /&gt;
&lt;br /&gt;
# check if minimum or maximum was specified and use the entered values&lt;br /&gt;
      if minimum != '':&lt;br /&gt;
        min_b = int(minimum)-1&lt;br /&gt;
      if maximum != '':&lt;br /&gt;
        max_b = int(maximum)+1&lt;br /&gt;
      # histogram:&lt;br /&gt;
      # color in bins of equal B-value ranges&lt;br /&gt;
      # subtract 0.1 from the lowest B in order to ensure that the single&lt;br /&gt;
      # atom with the lowest B value doesn't get omitted&lt;br /&gt;
      bin_width = (max_b - min_b)/nbins&lt;br /&gt;
      sel.append(selection + &amp;quot; and (%s = %4.4g&amp;quot; % (item,min_b + bin_width) + &amp;quot;)&amp;quot;)&lt;br /&gt;
      for j in range(1,nbins):&lt;br /&gt;
        #sel.append(selection + &amp;quot; and %s &amp;gt; %4.4g&amp;quot; % (item,min_b + j*bin_width))&lt;br /&gt;
        sel.append(dummy + &amp;quot; and %s = %4.4g&amp;quot; % (item,min_b + j*bin_width))&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
# call the function to create the gradient which returns a list of colours&lt;br /&gt;
    colours = make_gradient(sel,gradient,nbins,sat,value,hs,he,ss,se,vs,ve,colorname)&lt;br /&gt;
&lt;br /&gt;
# do the colouring now&lt;br /&gt;
    for j in range(nbins):&lt;br /&gt;
      print &amp;quot;Color select: &amp;quot;,sel[j]&lt;br /&gt;
      cmd.color(colours[j],sel[j])&lt;br /&gt;
  sel = []&lt;br /&gt;
  colours = []&lt;br /&gt;
# function for creating the gradient&lt;br /&gt;
def make_gradient(sel,gradient,nbins,sat,value,hs,he,ss,se,vs,ve,colorname):&lt;br /&gt;
  if gradient == 'bgr' or gradient == 'rainbow':&lt;br /&gt;
    col=[]&lt;br /&gt;
    coldesc=[]&lt;br /&gt;
    for j in range(nbins):&lt;br /&gt;
      # must append the str(sel[j]) to the color name so that it is unique &lt;br /&gt;
      # for the selection&lt;br /&gt;
      coldesc.append(colorname + str(j))&lt;br /&gt;
      # coldesc.append('col' + str(sel[j]) + str(j))&lt;br /&gt;
&lt;br /&gt;
      # create colors using hsv scale (fractional) starting at blue(.6666667) &lt;br /&gt;
      # through red(0.00000) in intervals of .6666667/(nbins -1) (the &amp;quot;nbins-1&amp;quot; &lt;br /&gt;
      # ensures that the last color is, in fact, red (0)&lt;br /&gt;
      # rewrote this to use the colorsys module to convert hsv to rgb&lt;br /&gt;
      hsv = (hs - (hs-he) * float(j) / (nbins-1), ss-(ss-se)*float(j)/(nbins-1), vs-(vs-ve)*float(j)/(nbins-1) )&lt;br /&gt;
      #convert to rgb and append to color list&lt;br /&gt;
      rgb = colorsys.hsv_to_rgb(hsv[0],hsv[1],hsv[2])&lt;br /&gt;
&lt;br /&gt;
      col.append(rgb)&lt;br /&gt;
      # cmd.set_color(&amp;quot;col&amp;quot; + str(sel[j]) + str(j),col[j])&lt;br /&gt;
      cmd.set_color(colorname + str(j),col[j])&lt;br /&gt;
      &lt;br /&gt;
      #cmd.color(,resi[j])&lt;br /&gt;
&lt;br /&gt;
  # return the gradient as a list of colors named by their index (i.e. col0,col1,col2,col3,...)&lt;br /&gt;
  return coldesc&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Download==&lt;br /&gt;
[[Media:colorama-0.1.0.tar.bz2|colorama-0.1.0.tar.bz2]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;br /&gt;
[[Category:Script_Library|Helicity Check]]&lt;/div&gt;</summary>
		<author><name>Desastre</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Colorama&amp;diff=3450</id>
		<title>Colorama</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Colorama&amp;diff=3450"/>
		<updated>2008-01-12T17:10:24Z</updated>

		<summary type="html">&lt;p&gt;Desastre: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=COLORAMA=&lt;br /&gt;
&lt;br /&gt;
COLORAMA is a PyMOL plugin which allows to color objects using adjustable scale bars. &lt;br /&gt;
&lt;br /&gt;
==Program features==&lt;br /&gt;
In RGB mode, each color R, G, B is represented by one scale bar which can be manually adjusted while the selected object is colored in real time. For convenience, it is as well possible to switch to the HSV color system.&lt;br /&gt;
&lt;br /&gt;
Additionally, a color gradient with user-defined start- and end-colors can be created for the selected molecule.&lt;br /&gt;
&lt;br /&gt;
==Screenshot==&lt;br /&gt;
[[Image:COLORAMA-screenshot.jpg]]&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
&lt;br /&gt;
Install the program by copying the code below into an empty text file (e.g. &amp;quot;colorama.py&amp;quot;) located in the \Pymol\modules\pmg_tk\startup directory. The program will launch automatically after PyMOL is started. COLORAMA does not properly work with PyMOL versions older than 1.0.&lt;br /&gt;
&lt;br /&gt;
===Single color===&lt;br /&gt;
&lt;br /&gt;
#Type the name of a PyMOL object to be colored into the COLORAMA entry field.&lt;br /&gt;
#Push the &amp;quot;Set&amp;quot; button.&lt;br /&gt;
#The scales are adjusted to the current color which is additionally visualized in a field left to the scales.&lt;br /&gt;
#If one of the scales is moved, the color of the selected object will change in real-time.&lt;br /&gt;
#Pushing the RGB or HSV buttons on the left allows to switch between both color systems.&lt;br /&gt;
&lt;br /&gt;
===Color gradients===&lt;br /&gt;
&lt;br /&gt;
#After an object has been selected, push the &amp;quot;G&amp;quot; button (gradient).&lt;br /&gt;
#Select the start color by pushing &amp;quot;C1&amp;quot; and adjusting it using the scales.&lt;br /&gt;
#Select the end color &amp;quot;C2&amp;quot; in the same way.&lt;br /&gt;
#To create the gradient, push &amp;quot;Set gradient&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
A new object will be created which is called &amp;quot;dummy-OLD_OBJECT&amp;quot;. The B-factor column of this object is overwritten and now contains the number of each residue. The original object is left unchanged. The gradient mode can be left by pushing &amp;quot;M&amp;quot; (monochrome).&lt;br /&gt;
This part of the program uses a modified version of the [http://pldserver1.biochem.queensu.ca/~rlc/work/pymol/ color_b script] by Robert L. Campbell &amp;amp; James Stroud.&lt;br /&gt;
&lt;br /&gt;
==Contact==&lt;br /&gt;
Gregor.Hagelueken@helmholtz-hzi.de&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
--- COLORAMA: Coloring Widget for PyMOL --- &lt;br /&gt;
Author  : Gregor Hagelueken&lt;br /&gt;
Program : Color_select&lt;br /&gt;
Date    : Oct 2007&lt;br /&gt;
Version : 0.1.0&lt;br /&gt;
Mail    : gha@helmholtz-hzi.de&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
COLORAMA is a plugin for the PyMOL Molecular Graphics System. &lt;br /&gt;
It allows to color molecules using RGB or HSV colors which can be manually adjusted. &lt;br /&gt;
Alternatively, a user defined color gradient can be applied to the molecule.&lt;br /&gt;
The program works properly with PyMOL versions &amp;gt;=1.0.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The program uses a modified version of the color_b program by Robert L. Campbell &amp;amp; James Stroud&lt;br /&gt;
for the gradient calculation and the RGBToHTMLColor function by Paul Winkler.&lt;br /&gt;
&lt;br /&gt;
Literature:&lt;br /&gt;
 DeLano, W.L. The PyMOL Molecular Graphics System (2002) DeLano Scientific, San Carlos, CA, USA. http://www.pymol.org&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------&lt;br /&gt;
----------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
import colorsys,sys&lt;br /&gt;
from pymol import cmd,stored&lt;br /&gt;
from Tkinter import *&lt;br /&gt;
class Colorama:&lt;br /&gt;
    def __init__ (self,master):&lt;br /&gt;
        #create frames&lt;br /&gt;
        self.F1 = Frame(roota, padx=5, pady=5, bg='red')&lt;br /&gt;
        self.F2 = Frame(roota, padx=5, pady=5, bg='green')&lt;br /&gt;
        self.F3 = Frame(roota, padx=5, pady=5, bg='blue')&lt;br /&gt;
        self.F4 = Frame(self.F1, padx=5, pady=5, bg='yellow')&lt;br /&gt;
        self.F5 = Frame(self.F1, padx=5, pady=5, bg='white')&lt;br /&gt;
        self.F6 = Frame(self.F1, padx=5, pady=5, bg='pink')&lt;br /&gt;
        &lt;br /&gt;
        #color system radiobuttons&lt;br /&gt;
        self.Radiocolorsystem = IntVar()&lt;br /&gt;
        self.RGB = Radiobutton (self.F3, text='RGB', indicatoron=0, variable=self.Radiocolorsystem, value=1, command=self.Scalergb)&lt;br /&gt;
        self.HSV = Radiobutton (self.F3, text='HSV', indicatoron=0, variable=self.Radiocolorsystem, value=2, command=self.Scalehsv)&lt;br /&gt;
        &lt;br /&gt;
        #mono/gradient and Farbe1/Farbe2 radiobuttons&lt;br /&gt;
        self.RadioMonoGradient = IntVar()&lt;br /&gt;
        self.RadioFarbe12 = IntVar()&lt;br /&gt;
        self.Monobutton = Radiobutton (self.F3, text='M', indicatoron=0, variable=self.RadioMonoGradient, value=1, command=self.Mono)&lt;br /&gt;
        self.Gradbutton = Radiobutton (self.F3, text='G', indicatoron=0, variable=self.RadioMonoGradient, value=2, command=self.Grad)&lt;br /&gt;
        self.Farbe1button = Radiobutton (self.F3, text='C1', indicatoron=0, variable=self.RadioFarbe12, value=1, command=self.Farbe1) &lt;br /&gt;
        self.Farbe2button = Radiobutton (self.F3, text='C2', indicatoron=0, variable=self.RadioFarbe12, value=2, command=self.Farbe2) &lt;br /&gt;
        &lt;br /&gt;
        #preselect RGB and mono&lt;br /&gt;
        self.RGB.select()&lt;br /&gt;
        self.Monobutton.select()&lt;br /&gt;
        self.Farbe1button.select()&lt;br /&gt;
        self.monograd='mono'&lt;br /&gt;
        self.colorsystem='rgb'&lt;br /&gt;
        self.farbe12='farbe1'&lt;br /&gt;
        &lt;br /&gt;
        #initialize the scales&lt;br /&gt;
        self.Scales()&lt;br /&gt;
        &lt;br /&gt;
        #other GUI elements&lt;br /&gt;
        self.selectionentry = Entry(master=self.F5, font=('Arial', 10))&lt;br /&gt;
        self.selectionentry.insert(0,&amp;quot;&amp;quot;)&lt;br /&gt;
        self.selectionbutton = Button(master=self.F5, text='Set', command=self.setselection)&lt;br /&gt;
        self.setgradientbutton = Button(master=self.F5, text='Set Gradient', command=self.setgradient)&lt;br /&gt;
        self.label = Label(master=self.F4, text=&amp;quot;None&amp;quot;, font=('Arial', 10))&lt;br /&gt;
        self.selectionlabel = Label(master=self.F4, text=&amp;quot;Active:&amp;quot;, font=('Arial', 10))&lt;br /&gt;
        self.inputlabel = Label (master=self.F5, text=&amp;quot;Object:&amp;quot;, font=('Arial', 10))&lt;br /&gt;
        self.colorfield1 = Label(master=self.F3,width=3, height=10)&lt;br /&gt;
        self.colorfield2 = Label(master=self.F3,width=3, height=10)&lt;br /&gt;
        &lt;br /&gt;
        self.selection=&amp;quot;&amp;quot;&lt;br /&gt;
        self.setselection()&lt;br /&gt;
        &lt;br /&gt;
        #start layout procedure&lt;br /&gt;
        self.layout()&lt;br /&gt;
    &lt;br /&gt;
    def layout(self):&lt;br /&gt;
        self.F1.pack(side=TOP, anchor=NW)&lt;br /&gt;
        self.F4.pack(side=BOTTOM, fill=X, anchor=W)&lt;br /&gt;
        self.F5.pack(side=TOP)&lt;br /&gt;
        self.F2.pack(side=RIGHT, fill=Y)&lt;br /&gt;
        self.F3.pack(side=LEFT, fill=X)&lt;br /&gt;
        &lt;br /&gt;
        #entry and buttons&lt;br /&gt;
        self.setgradientbutton.pack(side=RIGHT,fill=X, anchor=NE)&lt;br /&gt;
        self.selectionbutton.pack(side=RIGHT, anchor=N)&lt;br /&gt;
        self.selectionentry.pack(side=RIGHT,fill=X, anchor=NE)&lt;br /&gt;
        &lt;br /&gt;
        #labels&lt;br /&gt;
        self.inputlabel.pack(side=TOP, anchor=NW)&lt;br /&gt;
        self.selectionlabel.pack(side=LEFT, anchor=W)&lt;br /&gt;
        self.label.pack(side=LEFT)&lt;br /&gt;
        &lt;br /&gt;
        #colorfields&lt;br /&gt;
        self.colorfield2.pack(side=RIGHT)&lt;br /&gt;
        self.colorfield1.pack(side=RIGHT)&lt;br /&gt;
        &lt;br /&gt;
        #scales&lt;br /&gt;
        self.ScaleRed.pack(side=RIGHT, fill=Y)&lt;br /&gt;
        self.ScaleGreen.pack(side=RIGHT, fill=Y)&lt;br /&gt;
        self.ScaleBlue.pack(side=RIGHT, fill=Y)&lt;br /&gt;
        &lt;br /&gt;
        #radiobuttons&lt;br /&gt;
        self.RGB.pack(side=TOP, fill=X)&lt;br /&gt;
        self.HSV.pack(side=TOP, fill=X)&lt;br /&gt;
        self.Monobutton.pack(side=TOP, fill=X)&lt;br /&gt;
        self.Gradbutton.pack(side=TOP, fill=X)&lt;br /&gt;
        self.Farbe1button.pack(side=TOP, fill=X)&lt;br /&gt;
        self.Farbe2button.pack(side=TOP, fill=X)&lt;br /&gt;
    &lt;br /&gt;
    def Scales(self):&lt;br /&gt;
            self.ScaleRed = Scale(master=self.F2, label='R', length='3c',&lt;br /&gt;
                              from_=0, to=255,&lt;br /&gt;
                              #set(startred),&lt;br /&gt;
                              command=self.setzeFarbe)&lt;br /&gt;
            self.ScaleGreen = Scale(master=self.F2, label='G', length='3c',&lt;br /&gt;
                              from_=0, to=255,&lt;br /&gt;
                              #set(startgreen),&lt;br /&gt;
                              command=self.setzeFarbe)&lt;br /&gt;
            self.ScaleBlue = Scale(master=self.F2, label='B', length='3c',&lt;br /&gt;
                              from_=0, to=255,&lt;br /&gt;
                              #set(startblue),&lt;br /&gt;
                              command=self.setzeFarbe)&lt;br /&gt;
                              &lt;br /&gt;
    def Scalergb(self):&lt;br /&gt;
        if (self.colorsystem=='hsv'):&lt;br /&gt;
            h=float(self.ScaleRed.get())&lt;br /&gt;
            s=float(self.ScaleGreen.get())&lt;br /&gt;
            v=float(self.ScaleBlue.get())&lt;br /&gt;
            rgbcolor = colorsys.hsv_to_rgb(h,s,v)&lt;br /&gt;
            r=255*rgbcolor[0]&lt;br /&gt;
            g=255*rgbcolor[1]&lt;br /&gt;
            b=255*rgbcolor[2]&lt;br /&gt;
            self.ScaleRed.config(label='R', from_=0, to=255, resolution=1)&lt;br /&gt;
            self.ScaleGreen.config(label='G', from_=0, to=255, resolution=1)&lt;br /&gt;
            self.ScaleBlue.config(label='B', from_=0, to=255, resolution=1)&lt;br /&gt;
            self.ScaleRed.set(r)&lt;br /&gt;
            self.ScaleGreen.set(g)&lt;br /&gt;
            self.ScaleBlue.set(b)&lt;br /&gt;
            self.colorsystem='rgb'&lt;br /&gt;
            &lt;br /&gt;
    def Scalehsv(self):&lt;br /&gt;
        if (self.colorsystem=='rgb'):&lt;br /&gt;
            r=float(self.ScaleRed.get())/255&lt;br /&gt;
            g=float(self.ScaleGreen.get())/255&lt;br /&gt;
            b=float(self.ScaleBlue.get())/255&lt;br /&gt;
            hsvcolor = colorsys.rgb_to_hsv(r,g,b)&lt;br /&gt;
            h=hsvcolor[0]&lt;br /&gt;
            s=hsvcolor[1]&lt;br /&gt;
            v=hsvcolor[2]&lt;br /&gt;
            self.ScaleRed.config(label='H', from_=0, to=1, resolution=0.01)&lt;br /&gt;
            self.ScaleGreen.config(label='S', from_=0, to=1, resolution=0.01)&lt;br /&gt;
            self.ScaleBlue.config(label='V', from_=0, to=1, resolution=0.01)&lt;br /&gt;
            self.ScaleRed.set(h)&lt;br /&gt;
            self.ScaleGreen.set(s)&lt;br /&gt;
            self.ScaleBlue.set(v)&lt;br /&gt;
            self.colorsystem='hsv'&lt;br /&gt;
    &lt;br /&gt;
    def Mono(self):&lt;br /&gt;
        self.monograd='mono'&lt;br /&gt;
    &lt;br /&gt;
    def Grad(self):&lt;br /&gt;
        self.monograd='grad'&lt;br /&gt;
        &lt;br /&gt;
    def Farbe1(self):&lt;br /&gt;
        #Let the scales know which color is to be changed&lt;br /&gt;
        self.farbe12='farbe1'&lt;br /&gt;
        #set scales to farbe1&lt;br /&gt;
        if (self.monograd=='grad'):&lt;br /&gt;
            if (self.colorsystem=='rgb'):&lt;br /&gt;
                startred=self.farbe1[0]&lt;br /&gt;
                startgreen=self.farbe1[1]&lt;br /&gt;
                startblue=self.farbe1[2]							  &lt;br /&gt;
                self.ScaleRed.set(startred)&lt;br /&gt;
                self.ScaleGreen.set(startgreen)&lt;br /&gt;
                self.ScaleBlue.set(startblue)&lt;br /&gt;
            elif (self.colorsystem=='hsv'):&lt;br /&gt;
                hsvcolor=colorsys.rgb_to_hsv(self.farbe1[0], self.farbe1[1], self.farbe1[2])&lt;br /&gt;
                h=hsvcolor[0]&lt;br /&gt;
                s=hsvcolor[1]&lt;br /&gt;
                v=hsvcolor[2]&lt;br /&gt;
                self.ScaleRed.set(h)&lt;br /&gt;
                self.ScaleGreen.set(s)&lt;br /&gt;
                self.ScaleBlue.set(v)&lt;br /&gt;
    &lt;br /&gt;
    def Farbe2(self):&lt;br /&gt;
        #Let the scales know which color is to be changed&lt;br /&gt;
        self.farbe12='farbe2'&lt;br /&gt;
        #set scales to farbe1&lt;br /&gt;
        if (self.monograd=='grad'):&lt;br /&gt;
            if (self.colorsystem=='rgb'):&lt;br /&gt;
                startred=self.farbe2[0]&lt;br /&gt;
                startgreen=self.farbe2[1]&lt;br /&gt;
                startblue=self.farbe2[2]							  &lt;br /&gt;
                self.ScaleRed.set(startred)&lt;br /&gt;
                self.ScaleGreen.set(startgreen)&lt;br /&gt;
                self.ScaleBlue.set(startblue)&lt;br /&gt;
            elif (self.colorsystem=='hsv'):&lt;br /&gt;
                hsvcolor=colorsys.rgb_to_hsv(self.farbe2[0], self.farbe2[1], self.farbe2[2])&lt;br /&gt;
                h=hsvcolor[0]&lt;br /&gt;
                s=hsvcolor[1]&lt;br /&gt;
                v=hsvcolor[2]&lt;br /&gt;
                self.ScaleRed.set(h)&lt;br /&gt;
                self.ScaleGreen.set(s)&lt;br /&gt;
                self.ScaleBlue.set(v)&lt;br /&gt;
        &lt;br /&gt;
    def setselection(self):&lt;br /&gt;
        if (self.selectionentry.get() != &amp;quot;&amp;quot;):&lt;br /&gt;
            self.selection=self.selectionentry.get()&lt;br /&gt;
            &lt;br /&gt;
            #Color of each residue is stored in  stored.colorlist to check if the molecule has a colorgradient&lt;br /&gt;
            stored.colorlist = []&lt;br /&gt;
            cmd.iterate (self.selection+&amp;quot; &amp;amp; name CA&amp;quot;, &amp;quot;stored.colorlist.append(int(color))&amp;quot;)&lt;br /&gt;
            &lt;br /&gt;
            if (len(stored.colorlist)==0):&lt;br /&gt;
                #for other objects (e.g. density...)&lt;br /&gt;
                stored.colorlist.append(cmd.get_object_color_index(self.selection))&lt;br /&gt;
                stored.colorlist.append(cmd.get_object_color_index(self.selection))&lt;br /&gt;
            &lt;br /&gt;
            &lt;br /&gt;
            initialcolornterm=cmd.get_color_tuple(stored.colorlist[0])&lt;br /&gt;
            initialcolorcterm=cmd.get_color_tuple(stored.colorlist[len(stored.colorlist)-1])&lt;br /&gt;
            self.farbe1=initialcolornterm[0]*255, initialcolornterm[1]*255, initialcolornterm[2]*255&lt;br /&gt;
            self.farbe2=initialcolorcterm[0]*255, initialcolorcterm[1]*255, initialcolorcterm[2]*255&lt;br /&gt;
            &lt;br /&gt;
            #Set active object to label&lt;br /&gt;
            self.label.config(text=self.selection)&lt;br /&gt;
            &lt;br /&gt;
            #check if there is a gradient and adjust Mono/Gradbutton&lt;br /&gt;
            if (initialcolornterm==initialcolorcterm):&lt;br /&gt;
                self.Monobutton.select()&lt;br /&gt;
                self.Mono()&lt;br /&gt;
                &lt;br /&gt;
            elif (initialcolornterm!=initialcolorcterm):&lt;br /&gt;
                self.Gradbutton.select()&lt;br /&gt;
                self.Grad()&lt;br /&gt;
            &lt;br /&gt;
            #adjust colorfields&lt;br /&gt;
            self.colorfield1.config(bg=self.RGBToHTMLColor(self.farbe1))&lt;br /&gt;
            self.colorfield2.config(bg=self.RGBToHTMLColor(self.farbe2))&lt;br /&gt;
            self.Farbe1button.select()&lt;br /&gt;
            self.Farbe1()&lt;br /&gt;
            &lt;br /&gt;
            #Set scales to initialcolor of the new object    &lt;br /&gt;
            if (self.colorsystem=='rgb'):&lt;br /&gt;
                startred=255*initialcolornterm[0]&lt;br /&gt;
                startgreen=255*initialcolornterm[1]&lt;br /&gt;
                startblue=255*initialcolornterm[2]							  &lt;br /&gt;
                self.ScaleRed.set(startred)&lt;br /&gt;
                self.ScaleGreen.set(startgreen)&lt;br /&gt;
                self.ScaleBlue.set(startblue)&lt;br /&gt;
            elif (self.colorsystem=='hsv'):&lt;br /&gt;
                hsvcolor=colorsys.rgb_to_hsv(initialcolornterm[0], initialcolornterm[1], initialcolornterm[2])&lt;br /&gt;
                h=hsvcolor[0]&lt;br /&gt;
                s=hsvcolor[1]&lt;br /&gt;
                v=hsvcolor[2]&lt;br /&gt;
                self.ScaleRed.set(h)&lt;br /&gt;
                self.ScaleGreen.set(s)&lt;br /&gt;
                self.ScaleBlue.set(v)&lt;br /&gt;
             &lt;br /&gt;
    def setzeFarbe(self, event):&lt;br /&gt;
        if ((self.selection != &amp;quot;&amp;quot;) &amp;amp; (self.monograd == 'mono')):&lt;br /&gt;
            if (self.colorsystem=='rgb'):&lt;br /&gt;
                col=[]&lt;br /&gt;
                #read RGB values from scales&lt;br /&gt;
                r=int(self.ScaleRed.get())&lt;br /&gt;
                g=int(self.ScaleGreen.get())&lt;br /&gt;
                b=int(self.ScaleBlue.get())&lt;br /&gt;
                rgbcolor=r,g,b&lt;br /&gt;
                #Prepare a rgb tupel&lt;br /&gt;
                col.append(rgbcolor)&lt;br /&gt;
                #hexcolor for colorfields&lt;br /&gt;
                hexcolor=self.RGBToHTMLColor(rgbcolor)&lt;br /&gt;
                self.colorfield1.config(bg=hexcolor)&lt;br /&gt;
                self.colorfield2.config(bg=hexcolor)&lt;br /&gt;
                cmd.delete(self.selection+&amp;quot;_color&amp;quot;)&lt;br /&gt;
                cmd.set_color(self.selection+&amp;quot;_color&amp;quot;, col[0])&lt;br /&gt;
                cmd.color(self.selection+&amp;quot;_color&amp;quot;, self.selection)&lt;br /&gt;
                del col[0]&lt;br /&gt;
            elif (self.colorsystem=='hsv'):&lt;br /&gt;
                col=[]&lt;br /&gt;
                #read HSV values from scales&lt;br /&gt;
                h=float(self.ScaleRed.get())&lt;br /&gt;
                s=float(self.ScaleGreen.get())&lt;br /&gt;
                v=float(self.ScaleBlue.get())&lt;br /&gt;
                &lt;br /&gt;
                #HSV to RGB and change from 1.0, 1.0, 1.0 format to 255,255,255 format&lt;br /&gt;
                rgbcolor = colorsys.hsv_to_rgb(h,s,v)&lt;br /&gt;
                r = 255*rgbcolor[0]&lt;br /&gt;
                g = 255*rgbcolor[1]&lt;br /&gt;
                b = 255*rgbcolor[2]&lt;br /&gt;
                #as above&lt;br /&gt;
                rgbcolor = r,g,b&lt;br /&gt;
                col.append(rgbcolor)&lt;br /&gt;
                #hexcolor for colorfields&lt;br /&gt;
                hexcolor=self.RGBToHTMLColor(rgbcolor)&lt;br /&gt;
                self.colorfield1.config(bg=hexcolor)&lt;br /&gt;
                self.colorfield2.config(bg=hexcolor)&lt;br /&gt;
                cmd.delete(self.selection+&amp;quot;_color&amp;quot;)&lt;br /&gt;
                cmd.set_color(self.selection+&amp;quot;_color&amp;quot;, col[0])&lt;br /&gt;
                cmd.color(self.selection+&amp;quot;_color&amp;quot;, self.selection)&lt;br /&gt;
                del col[0]&lt;br /&gt;
        elif ((self.selection !=&amp;quot;&amp;quot;) &amp;amp; (self.monograd == 'grad')):&lt;br /&gt;
            &lt;br /&gt;
            if (self.colorsystem=='rgb'):&lt;br /&gt;
                col=[]&lt;br /&gt;
                #read RGB values from scales&lt;br /&gt;
                r=int(self.ScaleRed.get())&lt;br /&gt;
                g=int(self.ScaleGreen.get())&lt;br /&gt;
                b=int(self.ScaleBlue.get())&lt;br /&gt;
                rgbcolor=r,g,b&lt;br /&gt;
                #Prepare a rgb tupel&lt;br /&gt;
                col.append(rgbcolor)&lt;br /&gt;
                #hexcolor for colorfields&lt;br /&gt;
                hexcolor=self.RGBToHTMLColor(rgbcolor)&lt;br /&gt;
                if (self.farbe12=='farbe1'):&lt;br /&gt;
                    self.colorfield1.config(bg=hexcolor)&lt;br /&gt;
                    self.farbe1=rgbcolor&lt;br /&gt;
                elif (self.farbe12=='farbe2'):&lt;br /&gt;
                    self.colorfield2.config(bg=hexcolor)&lt;br /&gt;
                    self.farbe2=rgbcolor&lt;br /&gt;
&lt;br /&gt;
            elif (self.colorsystem=='hsv'):&lt;br /&gt;
                col=[]&lt;br /&gt;
                #read HSV values from scales&lt;br /&gt;
                h=float(self.ScaleRed.get())&lt;br /&gt;
                s=float(self.ScaleGreen.get())&lt;br /&gt;
                v=float(self.ScaleBlue.get())&lt;br /&gt;
                &lt;br /&gt;
                #HSV to RGB and change from 1.0, 1.0, 1.0 format to 255,255,255 format&lt;br /&gt;
                rgbcolor = colorsys.hsv_to_rgb(h,s,v)&lt;br /&gt;
                r = 255*rgbcolor[0]&lt;br /&gt;
                g = 255*rgbcolor[1]&lt;br /&gt;
                b = 255*rgbcolor[2]&lt;br /&gt;
                #as above&lt;br /&gt;
                rgbcolor = r,g,b&lt;br /&gt;
                col.append(rgbcolor)&lt;br /&gt;
                #hexcolor for colorfields&lt;br /&gt;
                hexcolor=self.RGBToHTMLColor(rgbcolor)&lt;br /&gt;
                &lt;br /&gt;
                if (self.farbe12=='farbe1'):&lt;br /&gt;
                    self.colorfield1.config(bg=hexcolor)&lt;br /&gt;
                    self.farbe1=rgbcolor&lt;br /&gt;
                elif (self.farbe12=='farbe2'):&lt;br /&gt;
                    self.colorfield2.config(bg=hexcolor)&lt;br /&gt;
                    self.farbe2=rgbcolor&lt;br /&gt;
    &lt;br /&gt;
    def setgradient(self):&lt;br /&gt;
        &lt;br /&gt;
        stored.residuelist = []&lt;br /&gt;
        cmd.iterate (self.selection, &amp;quot;stored.residuelist.append(int(resi))&amp;quot;)&lt;br /&gt;
        firstresidue=min(stored.residuelist)&lt;br /&gt;
        lastresidue=max(stored.residuelist)&lt;br /&gt;
        rs=float(self.farbe1[0])/float(255)&lt;br /&gt;
        gs=float(self.farbe1[1])/float(255)&lt;br /&gt;
        bs=float(self.farbe1[2])/float(255)&lt;br /&gt;
        re=float(self.farbe2[0])/float(255)&lt;br /&gt;
        ge=float(self.farbe2[1])/float(255)&lt;br /&gt;
        be=float(self.farbe2[2])/float(255)&lt;br /&gt;
        hsvcolorstart = colorsys.rgb_to_hsv(rs, gs, bs)&lt;br /&gt;
        hs=hsvcolorstart[0]&lt;br /&gt;
        ss=hsvcolorstart[1]&lt;br /&gt;
        vs=hsvcolorstart[2]&lt;br /&gt;
        hsvcolorend = colorsys.rgb_to_hsv(re, ge, be)&lt;br /&gt;
        he=hsvcolorend[0]&lt;br /&gt;
        se=hsvcolorend[1]&lt;br /&gt;
        ve=hsvcolorend[2]&lt;br /&gt;
        color_grad(selection=self.selection, minimum=firstresidue, maximum=lastresidue, hs=hs, he=he,ss=ss,se=se,vs=vs,ve=ve)&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
    def RGBToHTMLColor(self, rgb_tuple):&lt;br /&gt;
	    #by Paul Winkler&lt;br /&gt;
        &amp;quot;&amp;quot;&amp;quot; convert an (R, G, B) tuple to #RRGGBB &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
        hexcolor = '#%02x%02x%02x' % rgb_tuple&lt;br /&gt;
        # that's it! '%02x' means zero-padded, 2-digit hex values&lt;br /&gt;
        return hexcolor&lt;br /&gt;
&lt;br /&gt;
def __init__(self):&lt;br /&gt;
&lt;br /&gt;
    open_Colorama()&lt;br /&gt;
	&lt;br /&gt;
def open_Colorama():&lt;br /&gt;
    #initialize window (roota)&lt;br /&gt;
    global roota&lt;br /&gt;
    roota = Tk()&lt;br /&gt;
    roota.title(' COLORAMA by gha')&lt;br /&gt;
    global colorama&lt;br /&gt;
    colorama = Colorama(roota)&lt;br /&gt;
&lt;br /&gt;
def color_grad(selection='',item='b',mode='hist',gradient='bgr',nbins=11,sat=1,value=1,minimum='1',maximum='1',dummy='dummy_all', hs=1, he=1, ss=1,se=1,vs=1,ve=1, colorname='init'):&lt;br /&gt;
  &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    --- color_grad: color gradient tool for PyMOL --- &lt;br /&gt;
    Author  : Gregor Hagelueken&lt;br /&gt;
    Program : Color_grad&lt;br /&gt;
    Date    : Oct 2007&lt;br /&gt;
    Version : 0.1.0&lt;br /&gt;
    Mail    : gha@helmholtz-hzi.de&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    This is a modified version of the color_b program by Robert L. Campbell &amp;amp; James Stroud&lt;br /&gt;
&lt;br /&gt;
    Literature:&lt;br /&gt;
    DeLano, W.L. The PyMOL Molecular Graphics System (2002) DeLano Scientific, San Carlos, CA, USA. http://www.pymol.org&lt;br /&gt;
&lt;br /&gt;
    ----------------------------------------------------------------------&lt;br /&gt;
    ----------------------------------------------------------------------&lt;br /&gt;
  &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  nbins=int(nbins)&lt;br /&gt;
  sat=float(sat)&lt;br /&gt;
  value=float(value)&lt;br /&gt;
  hs=float(hs)&lt;br /&gt;
  he=float(he)&lt;br /&gt;
  ss=float(ss)&lt;br /&gt;
  se=float(se)&lt;br /&gt;
  vs=float(vs)&lt;br /&gt;
  ve=float(ve)&lt;br /&gt;
  colorname='color_'+selection&lt;br /&gt;
  &lt;br /&gt;
  nbins=int(maximum)-int(minimum)+2&lt;br /&gt;
  dummy=&amp;quot;dummy-&amp;quot;+selection&lt;br /&gt;
  colname=&amp;quot;col&amp;quot;+selection&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
# make sure sat and value are in the range 0-1.0&lt;br /&gt;
  sat = min(sat, 1.0)&lt;br /&gt;
  sat = max(sat, 0.0)&lt;br /&gt;
  value = min(value, 1.0)&lt;br /&gt;
  value = max(value, 0.0)&lt;br /&gt;
&lt;br /&gt;
# make sure lowercase&lt;br /&gt;
  gradient.lower()&lt;br /&gt;
  mode.lower()&lt;br /&gt;
&lt;br /&gt;
# Sanity checking&lt;br /&gt;
  if nbins == 1:&lt;br /&gt;
    print &amp;quot;\n     WARNING: You specified nbins=1, which doesn't make sense...resetting nbins=11\n&amp;quot;&lt;br /&gt;
    nbins=11&lt;br /&gt;
&lt;br /&gt;
  if mode not in ('hist','ramp'):&lt;br /&gt;
    print &amp;quot;\n     WARNING: Unknown mode &amp;quot;,mode, &amp;quot;    -----&amp;gt;   Nothing done.\n&amp;quot;&lt;br /&gt;
    return&lt;br /&gt;
  if selection == '':&lt;br /&gt;
	print &amp;quot;\n USAGE: color_grad dimB, minimum=380, maximum=531, hs=0.3, he=0.25,ss=0.7,se=0.2,vs=1,ve=0.5\n&amp;quot;&lt;br /&gt;
	return&lt;br /&gt;
  elif gradient not in ('bgr','rgb','rainbow','reverserainbow','bwr','rwb',&lt;br /&gt;
                        'bmr','rmb','rw','wr','gw','wg','bw','wb','gy','yg','gray','grey','reversegray','reversegrey'):&lt;br /&gt;
    print &amp;quot;\n     WARNING: Unknown gradient: &amp;quot;,gradient, &amp;quot;    -----&amp;gt;   Nothing done.\n&amp;quot;&lt;br /&gt;
    return&lt;br /&gt;
&lt;br /&gt;
  print &amp;quot;MODE, GRADIENT, NBINS:&amp;quot;, mode,gradient, nbins&lt;br /&gt;
&lt;br /&gt;
# get list of B-factors from selection&lt;br /&gt;
  m = cmd.get_model(selection)&lt;br /&gt;
  sel = []&lt;br /&gt;
  b_list = []&lt;br /&gt;
&lt;br /&gt;
  if len(m.atom) == 0:&lt;br /&gt;
    print &amp;quot;Sorry, no atoms selected&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  else:&lt;br /&gt;
    if item == 'b':&lt;br /&gt;
      for i in range(len(m.atom)):&lt;br /&gt;
        m.atom[i].b=m.atom[i].resi&lt;br /&gt;
        b_list.append(m.atom[i].b) &lt;br /&gt;
        &lt;br /&gt;
    elif item == 'q':&lt;br /&gt;
      for i in range(len(m.atom)):&lt;br /&gt;
        b_list.append(m.atom[i].q)&lt;br /&gt;
&lt;br /&gt;
    else:&lt;br /&gt;
      print &amp;quot;Not configured to work on item %s&amp;quot; % item&lt;br /&gt;
      return&lt;br /&gt;
    &lt;br /&gt;
    cmd.load_model(m, dummy)&lt;br /&gt;
    &lt;br /&gt;
    print selection&lt;br /&gt;
    max_b = maximum&lt;br /&gt;
    min_b = minimum&lt;br /&gt;
    print &amp;quot;Minimum and Maximum B-values: &amp;quot;, min_b, max_b&lt;br /&gt;
    #nbins = (max_b - min_b)&lt;br /&gt;
    &lt;br /&gt;
&lt;br /&gt;
    if mode == 'hist':&lt;br /&gt;
&lt;br /&gt;
# check if minimum or maximum was specified and use the entered values&lt;br /&gt;
      if minimum != '':&lt;br /&gt;
        min_b = int(minimum)-1&lt;br /&gt;
      if maximum != '':&lt;br /&gt;
        max_b = int(maximum)+1&lt;br /&gt;
      # histogram:&lt;br /&gt;
      # color in bins of equal B-value ranges&lt;br /&gt;
      # subtract 0.1 from the lowest B in order to ensure that the single&lt;br /&gt;
      # atom with the lowest B value doesn't get omitted&lt;br /&gt;
      bin_width = (max_b - min_b)/nbins&lt;br /&gt;
      sel.append(selection + &amp;quot; and (%s = %4.4g&amp;quot; % (item,min_b + bin_width) + &amp;quot;)&amp;quot;)&lt;br /&gt;
      for j in range(1,nbins):&lt;br /&gt;
        #sel.append(selection + &amp;quot; and %s &amp;gt; %4.4g&amp;quot; % (item,min_b + j*bin_width))&lt;br /&gt;
        sel.append(dummy + &amp;quot; and %s = %4.4g&amp;quot; % (item,min_b + j*bin_width))&lt;br /&gt;
        &lt;br /&gt;
&lt;br /&gt;
# call the function to create the gradient which returns a list of colours&lt;br /&gt;
    colours = make_gradient(sel,gradient,nbins,sat,value,hs,he,ss,se,vs,ve,colorname)&lt;br /&gt;
&lt;br /&gt;
# do the colouring now&lt;br /&gt;
    for j in range(nbins):&lt;br /&gt;
      print &amp;quot;Color select: &amp;quot;,sel[j]&lt;br /&gt;
      cmd.color(colours[j],sel[j])&lt;br /&gt;
  sel = []&lt;br /&gt;
  colours = []&lt;br /&gt;
# function for creating the gradient&lt;br /&gt;
def make_gradient(sel,gradient,nbins,sat,value,hs,he,ss,se,vs,ve,colorname):&lt;br /&gt;
  if gradient == 'bgr' or gradient == 'rainbow':&lt;br /&gt;
    col=[]&lt;br /&gt;
    coldesc=[]&lt;br /&gt;
    for j in range(nbins):&lt;br /&gt;
      # must append the str(sel[j]) to the color name so that it is unique &lt;br /&gt;
      # for the selection&lt;br /&gt;
      coldesc.append(colorname + str(j))&lt;br /&gt;
      # coldesc.append('col' + str(sel[j]) + str(j))&lt;br /&gt;
&lt;br /&gt;
      # create colors using hsv scale (fractional) starting at blue(.6666667) &lt;br /&gt;
      # through red(0.00000) in intervals of .6666667/(nbins -1) (the &amp;quot;nbins-1&amp;quot; &lt;br /&gt;
      # ensures that the last color is, in fact, red (0)&lt;br /&gt;
      # rewrote this to use the colorsys module to convert hsv to rgb&lt;br /&gt;
      hsv = (hs - (hs-he) * float(j) / (nbins-1), ss-(ss-se)*float(j)/(nbins-1), vs-(vs-ve)*float(j)/(nbins-1) )&lt;br /&gt;
      #convert to rgb and append to color list&lt;br /&gt;
      rgb = colorsys.hsv_to_rgb(hsv[0],hsv[1],hsv[2])&lt;br /&gt;
&lt;br /&gt;
      col.append(rgb)&lt;br /&gt;
      # cmd.set_color(&amp;quot;col&amp;quot; + str(sel[j]) + str(j),col[j])&lt;br /&gt;
      cmd.set_color(colorname + str(j),col[j])&lt;br /&gt;
      &lt;br /&gt;
      #cmd.color(,resi[j])&lt;br /&gt;
&lt;br /&gt;
  # return the gradient as a list of colors named by their index (i.e. col0,col1,col2,col3,...)&lt;br /&gt;
  return coldesc&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Download==&lt;br /&gt;
[[Media:colorama-0.1.0.tar.bz2|colorama-0.1.0.tar.bz2]]&lt;/div&gt;</summary>
		<author><name>Desastre</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=File:Colorama-0.1.0.tar.bz2&amp;diff=1234</id>
		<title>File:Colorama-0.1.0.tar.bz2</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=File:Colorama-0.1.0.tar.bz2&amp;diff=1234"/>
		<updated>2008-01-12T17:08:53Z</updated>

		<summary type="html">&lt;p&gt;Desastre: colorama-0.1.0 script as tarball&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;colorama-0.1.0 script as tarball&lt;/div&gt;</summary>
		<author><name>Desastre</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Talk:Cealign&amp;diff=170</id>
		<title>Talk:Cealign</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Talk:Cealign&amp;diff=170"/>
		<updated>2007-07-24T10:15:20Z</updated>

		<summary type="html">&lt;p&gt;Desastre: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I tried to reproduce the example of 1COM and 1BCO with version 0.8-RBS (cealign 1com and chain b, 1bco), but the RMSD I got was around 5.97 A. Does the capability get worse or did I do something wrong?&lt;/div&gt;</summary>
		<author><name>Desastre</name></author>
	</entry>
	<entry>
		<id>https://wiki.pymol.org/index.php?title=Talk:Cealign&amp;diff=169</id>
		<title>Talk:Cealign</title>
		<link rel="alternate" type="text/html" href="https://wiki.pymol.org/index.php?title=Talk:Cealign&amp;diff=169"/>
		<updated>2007-07-24T09:52:20Z</updated>

		<summary type="html">&lt;p&gt;Desastre: New page: I tried to reproduce the example of 1COM and 1BCO with version 0.86 (cealign 1com and chain b, 1bco), but the RMSD I got was around 5.97 A. Does the capability get worse or did I do someth...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I tried to reproduce the example of 1COM and 1BCO with version 0.86 (cealign 1com and chain b, 1bco), but the RMSD I got was around 5.97 A. Does the capability get worse or did I do something wrong?&lt;/div&gt;</summary>
		<author><name>Desastre</name></author>
	</entry>
</feed>