The DSSR --block-color option

Upon user requests, I’ve recently introduced the --block-color option to DSSR, available as of v1.5.2-2016apr02. As its name implies, the --block-color option facilitate user customization of PyMOL rendered colors of the base rectangular blocks or their edges (e.g., the minor-groove) directly from the command-line. A simple example goes like this: --block-color='A blue; T red', which makes A colored blue and T colored red. As detailed below, the new option is very flexible with regard to the specification of colors, bases, or some edges to highlight. Before that, a little background is in order.

Background info

The DSSR cartoon-block representation follows the color convention of the original 3DNA blocview script, where A is red; C is yellow; G is green; T is blue; and U is cyan. If I remember correctly, the blocview coloring was based on the scheme adopted by the Nucleic Acid Database (NDB). To allow for some flexibility, 3DNA includes a config file named $X3DNA/config/raster3d.par where users can change the RGB values of the corresponding bases. However, I do not know if any user has ever bothered to play around with the configuration file for customized base colors.

Over the years, blocview-generated images have become popular, due to its simplicity, and (maybe more importantly) its endorsement by the NDB and PDB for nucleic acid structures. Via NDB, the blocview-generated images have also been used in RNA FRABASE 2.0 and RNA Structure Atlas. Nevertheless, the blocview script has several dependencies: MolScript for protein or DNA/RNA backbone ribbons, render from Raster3D for rendering, and ImageMagick for image processing. Moreover, the blocview script used by NDB/PDB is (likely to be) based on 3DNA v1.5, the last version before I left Rutgers in 2002.

Over the years, 3DNA has been continuously refined, with significant changes introduced in v2.0 around 2008 to accompany the Nature Protocols paper. Currently at v2.3, the codebase for 3DNA version 2 is in maintenance mode: the software will still be supported with identified bugs fixed, but no more new feature is planned. 3DNA version 3, as represented by DSSR and SNAP, is the way to go.

DSSR has no third-party dependencies

While creating DSSR, I set it as one of the design goals to make the program fully self-contained, without any third-party dependencies. Connections to other tools are clearly delineated via text files. If anything goes wrong, one can easily identify where the problem is. Experience over the past few years has unambiguously proved the effectiveness of this zero-dependency approach. Other than being directly distributed with an operating system, DSSR is the easiest to get up and running. Moreover, DSSR can be easily integrated into other pipelines, including Jmol and PyMOL, among many other bioinformatics tools.

For the cartoon-block representation, DSSR produces .r3d files that can be loaded into PyMOL, mixed and matched with other visualization styles PyMOL has to offer. No more direct dependencies on MolScript, Raster3D, and ImageMagick as is the case for blocview. It is also worth mentioning that DSSR does not need PyMOL to run. DSSR and PyMOL are connected via .r3d files, a process which can be streamlined with the Dssr_block PyMOL plugin.

DSSR releases before v1.5.2-2016apr02 have the color coding of base blocks fixed within the source code, following the default style of blocview. Over the past few months, I’ve received at least two explicit requests on customizing the default colors of DSSR-generated base blocks. The --block-color option has been introduced for this purpose.

Details of the --block-color option

The general format of the option is as follows:

--block-color='id color [; id2 color2 ...]'
  • id can be A, C, G, T, U, or the degenerated IUPAC code, including R, Y, N etc. See UPAC nucleotide code for details.
  • id can also be minor, major, upper, bottom, wc-edge to specify one of the six faces of a 3D rectangular block. See Fig.1D of the DSSR paper for details.

Fig.1D (DSSR 2015 NAR paper)

  • id can further be GC, AT, GU, pair, and variants thereof, to specify the colors of the corresponding long base-pair rectangular blocks.
  • color can be a common name (144 total), as specified in the RGB Color website. For example, red, magenta, light gray etc.
  • color can also be a single number in the range [0, 1] or [0, 255] to specify a shade of gray. DSSR repeat the number twice to get the RGB triple consisting of the same number.
  • color can further be a set of three space-delimited numbers to specify the RGB triple. Again, the number can be in [0, 1] or [0, 255]. Moreover, the three numbers can be put in square brackets. For example --block-color='A 0 1 1' and --block-color='A [0 1 1]' specify adenine to be colored with RGB triple [0 1 1] (aqua/cyan, corresponding to --block-color='A cyan').
  • More than one identity (bases) can be specified, separated by ; (,, :, or | also works). Note: within the PyMOL dssr_block plugin, only | or : can be used as a separator: comma (,) or semicolon (;) cannot be used as a separator within a PyMOL command argument (thanks to Thomas Holder for drawing this point to my attention).
  • Case does not matter when specifying id or color. So either ‘A’ or ‘a’, and ‘blue’ or ‘Blue’ or ‘BLUE’ can be used to make adenine blue: --block-color='a blue'.

Some example usages

While the above description may appears to be quite complicated, the actual usage of the --block-color option is very straightforward. As always, the cases are best made with concrete examples, as shown below using the classic Dickerson B-DNA dodecamer 355d.

# all bases in blue
x3dna-dssr -i=355d.pdb --cartoon-block=orient --block-color='N blue' -o=355d-all-blue.pml
#
# all WC-pairs in red, with the minor-groove edge in 'dim gary'
x3dna-dssr -i=355d.pdb --cartoon-block=orient --block-color='wc-pair red; minor dim gray' -o=355d-pair-minor.pml
#
# thymine (T) in purple, and the upper (+z) face in white
# see Figure below, which shows the two bases in WC-pairs are anti-parallel
x3dna-dssr -i=355d.pdb --cartoon-block=orient --block-color='T purple; upper 1' -o=355d-T-upper.pml

T-colord purple, +z (upper) faces white

---

Comment

 
---

·

Thank you for printing this article from http://home.x3dna.org/. Please do not forget to visit back for more 3DNA-related information. — Xiang-Jun Lu