| | 1 | = Color a Sliced Surface by B-factor = |
| | 2 | |
| | 3 | Here is how to color a molecular surface by atomic B-factor, |
| | 4 | including the planar cap where the surface is sliced by a clipping plane. |
| | 5 | |
| | 6 | The following script clips everything, then turns off clipping |
| | 7 | for the atoms so that they can protrude from the sliced surface. |
| | 8 | The atoms of the protein are then colored by B-factor with |
| | 9 | [http://rbvi.ucsf.edu/chimerax/docs/user/commands/color.html#byattribute |
| | 10 | color byattribute]. This automatically colors their patches on the outer |
| | 11 | surface of the protein, but not the sliced surface. |
| | 12 | The atoms themselves are also colored even though they are not displayed, |
| | 13 | and their coloring is then used by |
| | 14 | [http://rbvi.ucsf.edu/chimerax/docs/user/commands/color.html#zone |
| | 15 | color zone] to color patches in the sliced surface face by the nearest atom. |
| | 16 | |
| | 17 | {{{ |
| | 18 | open 2gbp |
| | 19 | surface |
| | 20 | turn y 70 |
| | 21 | clip front 0 position :bgc |
| | 22 | clip model #!1 false |
| | 23 | hide ~ligand target ar |
| | 24 | view ligand :<8 clip false |
| | 25 | style ligand ball |
| | 26 | color C white targ a |
| | 27 | graphics bgColor white |
| | 28 | graphics silhouette true |
| | 29 | color byattribute bfactor protein palette blue:red:yellow:white |
| | 30 | wait 1 |
| | 31 | color zone #1.2.1 near protein distance 3 sharp t update t |
| | 32 | }}} |
| | 33 | |
| | 34 | The [http://rbvi.ucsf.edu/chimerax/docs/user/commands/wait.html |
| | 35 | wait 1] is needed only in the context of a command file, |
| | 36 | to force drawing the graphics to create the surface cap before it is colored. |
| | 37 | |
| | 38 | The 'update' option of |
| | 39 | [http://rbvi.ucsf.edu/chimerax/docs/user/commands/color.html#zone |
| | 40 | color zone] allows subsequently adjusting the clipping plane position |
| | 41 | without having to redo the coloring. |
| | 42 | |
| | 43 | [[Image(bfactorclip.png)]] |
| | 44 | |
| | 45 | Elaine Meng, September 9, 2020 |
| | 46 | } |
| | 47 | } |