[Script] Individually color each chain of a protein using the rainbow

This script provides a way to rainbow color a protein by chain. (i.e. each chain will be colored from red to purple)
 

PURPOSE: The following script works on an open Molecule Window containing a protein molecule. It colors each chain of the protein from red (N-terminus) to purple (C-terminus)
 

INSTALLATION: Save RainbowColorChain.pl to a local directory or location accessible from the Files Explorer.
 

USAGE: From the DS Client: From the Files Explorer, right-click on the RainbowColorChain.pl file and select Open With | Script Window then launch the script using the Run command from the Scripting toolbar.

Conversely, add this script as a button. To make a button from a script please follow the instructions from the tutorial “Working with scripts”. (Tutorials > Quick start tutorials > Working with scripts). In short: 

  1. Open Edit | preferences 

  2. In General | Script Commands click on Add Command 

  3. Navigate to where the script is downloaded and click Open 

  4. Fill the Tooltip title with RainbowColorPerChain 

  5. Fill Tooltip text with Color proteins by Rainbow Scheme 

  6. In the Requires field choose Molecule Window 

  7. Change to General | toolbar in the Preferences pop-up 

  8. Type “Display” In the New toolbar field and click Add Toolbar 

  9. In the Commands hierarchy, expand Scripts and double-click on RainbowColorPerChain to add the script