Jmol/Interactivity

From Proteopedia

(Difference between revisions)
Jump to: navigation, search
Current revision (21:42, 15 April 2021) (edit) (undo)
 
(29 intermediate revisions not shown.)
Line 4: Line 4:
===Button===
===Button===
-
This button loads a different molecule and scene, and makes sure waters and hidden and zshade is turned off:
+
This button loads a different molecule and scene, and makes sure waters are hidden and zshade is turned off:
<jmol>
<jmol>
Line 24: Line 24:
</jmol>
</jmol>
</nowiki>
</nowiki>
 +
 +
As a shortcut, you can use a template that inserts the code for you by entering:
 +
<nowiki>
 +
{{subst:Scene button|Lysozyme|37/376372/Overall/3|hide water; set zshade off}}</nowiki>
 +
 +
The string behind the first vertical line (the first parameter) is the button label, the string behind the second vertical line (the second parameter) is the scene like given by the SAT, and the string behind the third vertical line (the third parameter is the list of commands called right after the scene is loaded. Once you type this (or paste it) into the editor and save it, the code above will be inserted. You can learn more about templates at [https://www.mediawiki.org/wiki/Help:Templates].
===Link===
===Link===
Line 30: Line 36:
To show ligand(s), click on the sun symbol in the parentheses (<jmol>
To show ligand(s), click on the sun symbol in the parentheses (<jmol>
<jmolLink>
<jmolLink>
-
<script> select ligand; selectionHalos ON; delay 0.5;selectionHalos OFF;</script>
+
<script> select ligand or ATP; selectionHalos ON; delay 0.5;selectionHalos OFF;</script>
<text>☼</text>
<text>☼</text>
</jmolLink>
</jmolLink>
Line 44: Line 50:
</jmol>)
</jmol>)
</nowiki>
</nowiki>
 +
 +
As a shortcut for making a part of the structure "blink", you can use a template that inserts the code for you by entering:
 +
<nowiki>
 +
{{subst:blink|ligand or ATP}}</nowiki>
===Check box===
===Check box===
Line 51: Line 61:
<jmol>
<jmol>
<jmolCheckbox>
<jmolCheckbox>
-
<scriptWhenUnChecked>hide ligand or hidden</scriptWhenUnChecked>
+
<scriptWhenUnChecked>hide ligand or ATP or hidden</scriptWhenUnChecked>
-
<scriptWhenchecked>hide hidden and not ligand</scriptWhenchecked>
+
<scriptWhenchecked>hide hidden and not (ligand or ATP)</scriptWhenchecked>
<checked>true</checked>
<checked>true</checked>
-
<text>ligand</text>
+
<text>ATP and metals</text>
</jmolCheckbox>
</jmolCheckbox>
</jmol>
</jmol>
Line 61: Line 71:
<jmol>
<jmol>
<jmolCheckbox>
<jmolCheckbox>
-
<scriptWhenUnChecked>hide ligand or hidden
+
<scriptWhenUnChecked>hide ligand or ATP or hidden
</scriptWhenUnChecked>
</scriptWhenUnChecked>
-
<scriptWhenchecked>hide hidden and not ligand
+
<scriptWhenchecked>hide hidden and not (ligand or ATP)
</scriptWhenchecked>
</scriptWhenchecked>
<checked>true</checked>
<checked>true</checked>
Line 71: Line 81:
</nowiki>
</nowiki>
 +
Again, you can use a template to type less:
 +
<nowiki>
 +
{{subst:Hide button|ligand or ATP|(ligand or ATP)}}</nowiki>
 +
 +
 +
<jmol>
 +
<jmolCheckbox>
 +
<scriptWhenChecked>display displayed or ATP</scriptWhenChecked>
 +
<scriptWhenUnchecked>hide ATP or hidden</scriptWhenUnchecked>
 +
<checked>true</checked>
 +
<text> ATP molecule </text>
 +
</jmolCheckbox>
 +
</jmol>
===Radio button===
===Radio button===
 +
Please load <scene name='37/376372/Product_complex/6'>this scene</scene> before trying out the radiobuttons.
This set of buttons selects one side chain to be shown (or none).
This set of buttons selects one side chain to be shown (or none).
<jmol>
<jmol>
<jmolRadioGroup>
<jmolRadioGroup>
<item>
<item>
-
<script>select sidechain; spacefill off; select sidechain and 35; spacefill on</script>
+
<script>select sidechain; spacefill off; select sidechain and 35; color cpk; spacefill on</script>
<text>Residue 35</text>
<text>Residue 35</text>
<checked>false</checked>
<checked>false</checked>
</item>
</item>
<item>
<item>
-
<script>select sidechain; spacefill off; select sidechain and 52; spacefill on</script>
+
<script>select sidechain; spacefill off; select sidechain and 52; color cpk; spacefill on</script>
<text>Residue 52</text>
<text>Residue 52</text>
<checked>false</checked>
<checked>false</checked>
Line 101: Line 125:
<item>
<item>
<script>select sidechain; spacefill off;
<script>select sidechain; spacefill off;
-
select sidechain and 35 ; spacefill on</script>
+
select sidechain and 35; spacefill on</script>
<text>Residue 35</text>
<text>Residue 35</text>
<checked>false</checked>
<checked>false</checked>
Line 107: Line 131:
<item>
<item>
<script>select sidechain; spacefill off;
<script>select sidechain; spacefill off;
-
select sidechain and 52 ; spacefill on</script>
+
select sidechain and 52; spacefill on</script>
<text>Residue 52</text>
<text>Residue 52</text>
<checked>false</checked>
<checked>false</checked>
Line 119: Line 143:
</jmol>
</jmol>
</nowiki>
</nowiki>
 +
 +
Again, you can use a template to type less:
 +
<nowiki>
 +
{{subst:Triple radiobutton
 +
|Residue 35|select sidechain; spacefill off; select sidechain and 35; spacefill on
 +
|Residue 52|select sidechain; spacefill off; select sidechain and 52; spacefill on
 +
|No side chains|select sidechain; spacefill off}}</nowiki>
 +
 +
Before you use the template above, please remove the line breaks so that the entire command is on a single line, otherwise it does not work.
 +
 +
===Buttons to store and retrieve orientation===
 +
 +
This pair of buttons allows to save an orientation by pressing the first button, and return to the same orienation by pressing the second. Multiple pairs of these buttons allow to choreograph an animation and play it by pushing the buttons. The orientations are not saved beyond a session, though.
 +
 +
<jmol><jmolButton><script>view1 = script("show moveto")[11][0]</script><text>store view 1</text></jmolButton> </jmol> <jmol><jmolButton><script>script inline @{"moveto 1.0" + view1}</script><text>retrieve view 1</text></jmolButton></jmol>
 +
 +
<nowiki>
 +
<jmol>
 +
<jmolButton>
 +
<script>view1 = script("show moveto")[11][0]</script>
 +
<text>store view 1</text>
 +
</jmolButton>
 +
</jmol> <jmol>
 +
<jmolButton>
 +
<script>script inline @{"moveto 1.0" + view1}</script>
 +
<text>retrieve view 1</text>
 +
</jmolButton>
 +
</jmol></nowiki>
 +
 +
Again, you can use a template to type less:
 +
<nowiki>
 +
{{subst:Store view buttons}}</nowiki>
 +
 +
For more than one view, just add another pair of buttons and change view1 to view2. For a more elaborate example how to use buttons to dock a ligand, see [[User:Karsten Theis/Animation course]].
 +
 +
==Button to choose a fixed orientation and view==
 +
 +
Here is the <scene name='84/849728/Uvrb/1'>structure of UvrB</scene>. To zoom into different areas, use the two buttons below. The orientation and view are set manually and retrieved with the command "show moveto".
 +
 +
<jmol>
 +
<jmolButton>
 +
<script>moveto 1.0 { -905 -235 355 100.12} 535.03 0.0 0.0 {42.099225806451614 43.53887096774192 61.17029032258063} 68.42333343999844 {0 0 0} 0 0 0 3.0 0.0 0.0;</script>
 +
<text>🔎ATP binding</text>
 +
</jmolButton>
 +
</jmol>
 +
 +
<jmol>
 +
<jmolButton>
 +
<script>moveto 1.0 { -953 -276 126 132.73} 305.9 0.0 0.0 {61.51899999999999 9.498000000000001 60.450250000000004} 66.2379949723743 {0 0 0} 0 0 0 3.0 0.0 0.0;</script>
 +
<text>🔎DNA padlock</text>
 +
</jmolButton>
 +
</jmol>
 +
 +
<nowiki>
 +
<jmol>
 +
<jmolButton>
 +
<script>moveto 1.0 { -953 -276 126 132.73} 305.9 0.0 0.0
 +
{61.51899999999999 9.498000000000001 60.450250000000004}
 +
66.2379949723743 {0 0 0} 0 0 0 3.0 0.0 0.0;</script>
 +
<text>🔎DNA padlock</text>
 +
</jmolButton>
 +
</jmol></nowiki>
 +
 +
Again, you can use a template to type less:
 +
 +
<nowiki>
 +
{{subst:Lookat button|ATP binding|1.0 { -905 -235 355 100.12}
 +
535.03 0.0 0.0 {42.099225806451614 43.53887096774192 61.17029032258063}
 +
68.42333343999844 {0 0 0} 0 0 0 3.0 0.0 0.0;}}</nowiki>
</StructureSection>
</StructureSection>

Current revision

Structure of UvrB in complex with ATP

Drag the structure with the mouse to rotate

Advantages

The commands issued by these interactive elements are in effect immediately, i.e. without delay. You could accomplish the same effect by saving a separate 3D scene, but this will always have a loading delay. The effect is that "playing" with interactive elements is much more immediate than switching between green links.

Caveats

The commands will be issued to the Jmol window irrespective of what is shown there. If you click on a green link elsewhere and then try the buttons etc, the effect is unpredictable. You can try this here by using the interactive elements before clicking on the button that loads the lysozyme structure. If you do that, the commands associated with the interactive elements will act on the UvrB structure instead.

Proteopedia Page Contributors and Editors (what is this?)

Karsten Theis

Personal tools