ncbi / icn3d

web-based protein structure viewer and analysis tool interactively or in batch mode
https://www.ncbi.nlm.nih.gov/Structure/icn3d
Other
154 stars 42 forks source link

The Rainbow coloring in iCn3D isn't behaving correctly #41

Closed digitalbio closed 3 years ago

digitalbio commented 3 years ago

The Rainbow coloring style should work in the following way - the amino terminus of each protein chain (or the 5' end of each nucleic acid chain) should be red and the carboxyl terminus (or 3' end) should be violet.

When colored correctly, a structure like 1IGY will show the amino ends of all four chains in red.

Each chain needs to be colored independently because each chain is a separate molecule.

Instead it looks like the coloring is treating the four chains as part of a single concatenated molecule.

digitalbio commented 3 years ago

This image shows how the ends of each chain in the structure should be colored and how the amino ends of each residue in the sequence should be colored.

IMG_67A5469A4445-1

jiywang3 commented 3 years ago

The rainbow coloring is for any selection. What you can do is to select each chain and apply the rainbow coloring. Here is the share link of my example: https://structure.ncbi.nlm.nih.gov/icn3d/share.html?uqzXVbUSoxbLJocW8 image

digitalbio commented 3 years ago

No, that doesn't make sense. If I use other coloring styles, I see the coloring applied to the entire protein. For example, I can color a protein by charge without selecting each chain.

In a protein, each chain is independent, so each chain must be colored from the amino end to the carboxyl end.

PDB does this correctly with jsmol. Cn3D does this correctly also.

jiywang3 commented 3 years ago

The fundamental design of iCn3D is to apply features only to the selection. Different users have different preferences. This way you can apply Rainbow coloring to any of your selection and make it more flexible.

digitaltodd commented 3 years ago

The fundamental design is fine and makes sense. The issue is related to global selections.

There are two ways to apply a style to an entire structure: have nothing selected or select all atoms. This works for all of the styles.

In the case of rainbow and spectrum the issue is that the global style is being applied incorrectly, and the resulting display conveys information that is misleading.

Let's use 1NAJ, a DNA structure as an example. When either spectrum or rainbow are applied they are applied to the both stands as if the strands were a single molecule.

As spectrum and rainbow are intended to show the order of residues, the global coloring needs to be set on each chain independently - like chain coloring.

To my knowledge every viewer (including Cn3D) that displays spectrum / rainbow for an entire structure does so on a chain by chain basis so that the relationship of the individual molecules (parallel / anti-parallel) can be observed. LIgands are typically not colored (white)

I've added some examples

Default view - color by chain applied globally Screen Shot 2021-09-03 at 10 38 22 AM

Rainbow applied global (entire structure) - colors goes from one chain to the next implying a head to toe relationship between the structures Screen Shot 2021-09-03 at 10 39 11 AM

The rainbow applied correctly - done in iCn3D with five interactions - open the sequence view, select one chain, apply rainbow, select the other chain apply rainbow again to get the correct anti-parallel relationship between the strands. Imagine if you had to apply each chain color independently in any larger structure. Some have 10's and 100's of chains. Should be done in one click. Screen Shot 2021-09-03 at 10 40 12 AM

jiywang3 commented 3 years ago

I could add two options for Rainbow: per Selection, and per Chain in the next release.

jiywang3 commented 3 years ago

The feature is available now.