Jmol/Interactivity: Difference between revisions

From Proteopedia
Jump to navigationJump to search
Karsten Theis (talk | contribs)
No edit summary
Karsten Theis (talk | contribs)
No edit summary
Line 27: Line 27:
You can associate a couple of commands with a green link (instead of the usual behavior of a green link to load a new scene). For example, the link below make parts of the structure "blink":  
You can associate a couple of commands with a green link (instead of the usual behavior of a green link to load a new scene). For example, the link below make parts of the structure "blink":  


To show ligand(s), click on the sun symbolin 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; selectionHalos ON; delay 0.5;selectionHalos OFF;</script>
Line 35: Line 35:


  <nowiki>
  <nowiki>
(carb<jmol>
(<jmol>
   <jmolLink>
   <jmolLink>
     <script> select ligand; selectionHalos ON;  
     <script> select ligand; selectionHalos ON;  
Line 50: Line 50:
<jmol>
<jmol>
   <jmolCheckbox>
   <jmolCheckbox>
     <scriptWhenChecked>hide ligand or hidden</scriptWhenChecked>
     <scriptWhenUnChecked>hide ligand or hidden</scriptWhenChecked>
     <scriptWhenUnchecked>hide hidden and not ligand</scriptWhenUnchecked>
     <scriptWhenchecked>hide hidden and not ligand</scriptWhenUnchecked>
     <checked>true</checked>  
     <checked>true</checked>  
     <text>ligand</text>
     <text>ligand</text>
Line 65: Line 65:
     <text>ligand</text>
     <text>ligand</text>
   </jmolCheckbox>
   </jmolCheckbox>
</jmol>
</nowiki>
===Radio button===
This set of buttons selects one side chain to be shown (or none).
<jmol>
  <jmolRadioGroup>
    <item>
      <script>select sidechain; spacefill off; select sidechain and 35 ; spacefill on</script>
      <text>Residue 35</text>
      <checked>false</checked>
    </item>
    <item>
      <script>select sidechain; spacefill off; select sidechain and 52 ; spacefill on</script>
      <text>Residue 52</text>
      <checked>false</checked>
    </item>
    <item>
      <script>select sidechain; spacefill off</script>
      <text>No side chains</text>
      <checked>true</checked>
    </item>
  </jmolRadioGroup>
</jmol>
<nowiki>
<jmol>
  <jmolRadioGroup>
    <item>
      <script>select sidechain; spacefill off; select sidechain and 35 ; spacefill on</script>
      <text>Residue 35</text>
      <checked>false</checked>
    </item>
    <item>
      <script>select sidechain; spacefill off; select sidechain and 52 ; spacefill on</script>
      <text>Residue 52</text>
      <checked>false</checked>
    </item>
    <item>
      <script>select sidechain; spacefill off</script>
      <text>No side chains</text>
      <checked>true</checked>
    </item>
  </jmolRadioGroup>
</jmol>
</jmol>
</nowiki>
</nowiki>

Revision as of 12:22, 19 June 2020

<StructureSection load='1d9z' size='340' side='right' caption='Structure of UvrB in complex with ATP' scene=>

Interactive Jmol elements

Some pages contain buttons, radio buttons and other elements that allow the reader to manipulate the 3D Jmol scene by clicking on them.

Button

This button loads a different molecule and scene, and makes sure waters and hidden and zshade is turned off:

The following code was used to build the button and make it work:

<jmol>
  <jmolButton>
    <script>script /scripts/37/376372/Overall/3.spt; 
            hide water; set zshade off</script>
    <text>Lysozyme</text>
  </jmolButton>
</jmol>

Link

You can associate a couple of commands with a green link (instead of the usual behavior of a green link to load a new scene). For example, the link below make parts of the structure "blink":

To show ligand(s), click on the sun symbol in the parentheses ()

(<jmol>
  <jmolLink>
    <script> select ligand; selectionHalos ON; 
             delay 0.5; selectionHalos OFF;</script>
    <text>☼</text>
  </jmolLink>
</jmol>)

Check box

This checkbox shows the ligand only when checked.

XML error: Mismatched tag at line 3

<jmol>
  <jmolCheckbox>
    <scriptWhenChecked>hide ligand or hidden</scriptWhenChecked>
    <scriptWhenUnchecked>hide hidden and not ligand</scriptWhenUnchecked>
    <checked>true</checked> 
    <text>ligand</text>
  </jmolCheckbox>
</jmol>

Radio button

This set of buttons selects one side chain to be shown (or none).

<jmol>
  <jmolRadioGroup>
    <item>
      <script>select sidechain; spacefill off; select sidechain and 35 ; spacefill on</script>
      <text>Residue 35</text>
      <checked>false</checked>
    </item>
    <item>
      <script>select sidechain; spacefill off; select sidechain and 52 ; spacefill on</script>
      <text>Residue 52</text>
      <checked>false</checked>
    </item>
    <item>
      <script>select sidechain; spacefill off</script>
      <text>No side chains</text>
      <checked>true</checked>
    </item>
   </jmolRadioGroup>
</jmol>

Proteopedia Page Contributors and Editors (what is this?)

Karsten Theis