Jmol/Useful one-liners: Difference between revisions
No edit summary |
|||
(15 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
This is a collection of [[Jmol/Useful one-liners|useful one-liners]] in Jmol. While the [[Scene authoring tools]] give you access to a lot of Jmol's functionality, they don't cover the entire scripting language. However, the SAT contains an input box for entering Jmol commands directly. This page collects commands that might be entered into that textbox to achieve effects not otherwise possible. Viewers of Proteopedia pages might find occasional use of these one-liners as well. To enter them, you first have to right-click on the Jmol window and open a console. For more complex Jmol commands, see [[Jmol/Using the console]]. | This is a collection of [[Jmol/Useful one-liners|useful one-liners]] in Jmol. While the [[Scene authoring tools]] give you access to a lot of Jmol's functionality, they don't cover the entire scripting language. However, the SAT contains an input box for entering Jmol commands directly. This page collects commands that might be entered into that textbox to achieve effects not otherwise possible. [[Viewing guide|Viewers of Proteopedia pages]] might find occasional use of these one-liners as well. To enter them, you first have to right-click on the Jmol window and open a console. For more complex Jmol commands, see [[Jmol/Using the console]]. | ||
==Examples== | ==Examples== | ||
Line 6: | Line 5: | ||
===Enhancing visibility=== | ===Enhancing visibility=== | ||
hover "%n%R %a"; font hover 30 | hover "%n%R %a"; font hover 30 | ||
Line 22: | Line 16: | ||
select selected and not *%B | select selected and not *%B | ||
Deselects alternate conformations. Some models contain two conformations (labeled A and B in column 17 of a PDB file, with fractional occupancies adding up to 1, see e.g. [https://pdb101.rcsb.org/learn/guide-to-understanding-pdb-data/dealing-with-coordinates]. The example | Deselects alternate conformations. Some models contain two conformations (labeled A and B in column 17 of a PDB file, with fractional occupancies adding up to 1, see e.g. [https://pdb101.rcsb.org/learn/guide-to-understanding-pdb-data/dealing-with-coordinates]. The example buttons hide or show all representations of alternate conformations. | ||
<jmol><jmolButton><text>hide %B</text><script>hide hidden or *%B</script></jmolButton></jmol> | <jmol><jmolButton><text>hide %B</text><script>hide hidden or *%B</script></jmolButton></jmol> | ||
<jmol><jmolButton><text>display %B</text><script>hide hidden and not *%B</script></jmolButton></jmol> | <jmol><jmolButton><text>display %B</text><script>hide hidden and not *%B</script></jmolButton></jmol> | ||
set zshade on | |||
<jmol><jmolButton><text>zshade</text><script>set zshade on</script></jmolButton></jmol> | |||
This fades the scene (to white if the background is white, to black if the background is black) for atoms further away from the viewer, giving a better 3D feel even when the model is not moving. This command is now available via a control in the SAT. | |||
set zshadepower 1 | |||
<jmol><jmolButton><text>1</text><script>set zshadepower 1</script></jmolButton></jmol> | |||
<jmol><jmolButton><text>2</text><script>set zshadepower 2</script></jmolButton></jmol> | |||
<jmol><jmolButton><text>3</text><script>set zshadepower 3</script></jmolButton></jmol> | |||
<jmol><jmolButton><text>4</text><script>set zshadepower 4</script></jmolButton></jmol> | |||
This controls how strongly the scene fades with distance. | |||
===Color bonds independently from atoms=== | ===Color bonds independently from atoms=== | ||
Line 40: | Line 44: | ||
Defines the currently selected atoms as "aoi". You can use this later in commands such as "select aoi" to select the atoms again. | Defines the currently selected atoms as "aoi". You can use this later in commands such as "select aoi" to select the atoms again. | ||
view1 | save orientation view1 | ||
restore orientation view1 | |||
<jmol><jmolButton><text>save orientation view1</text><script>save orientation view1</script></jmolButton></jmol> | |||
<jmol><jmolButton><text>restore orientation view1</text><script>restore orientation view1</script></jmolButton></jmol> | |||
===Contacts=== | |||
contact (selected)(not selected) | |||
This shows all contacts between the selected atoms and the remainder of the structure, using colored disks to show the contacts and their distances. If you want to exclude covalent bonds, do this | |||
contact (selected)(not selected and not within(1.8, selected)) | |||
Here is an example of the <scene name='82/824000/Contacts/4'>contacts of one glucose unit</scene> in a cellulose model. This used the additional parameter "full" to show pillows (of intersection vanderWaals spheres) instead of disks. | |||
===Expanding selection to whole residue/groups=== | |||
select within(group, selected) | |||
This expands the selection to include all atoms belonging to the same residues or groups than the currently selected atoms. [This command is available in the SAT in a perhaps unexpected spot: in the selections tab, in the select within distance box, the second button]. | |||
===Showing backbone torsion angles phi and psi=== | |||
ramachandran selected | |||
<scene name='77/778341/Phi_psi/1'>phi and psi in an alpha helix</scene> | |||
===Not yet categorized=== | ===Not yet categorized=== | ||
center visible | center visible | ||
Line 51: | Line 74: | ||
<jmol><jmolButton><text>center visible</text><script>center visible</script></jmolButton></jmol> | <jmol><jmolButton><text>center visible</text><script>center visible</script></jmolButton></jmol> | ||
This centers on all atoms that are visible, either explicitly or as part of a cartoon etc. | This centers on all atoms that are visible, either explicitly or as part of a cartoon etc. This is also available in the representation tab of the SAT. | ||
model | model all | ||
When multiple models are loaded (e.g. NMR structures), or multiple structures are loaded (e.g. superpositions), this shows all the structures at the same time. | When multiple models are loaded (e.g. NMR structures), or multiple structures are loaded (e.g. superpositions), this shows all the structures at the same time. | ||
Synonyms: <code>model 0, frame all, frame 0</code> | |||
zoom 0 | |||
Zoom out so that all displayed atoms etc. fit into the window (also centers on visible) | |||
<jmol><jmolButton><text>zoom visible</text><script>zoom 0</script></jmolButton></jmol> | |||
set perspectiveDepth ON | |||
Perspective depth shows close objects larger than those far away. Orthoscopic view shows them at the same size. When looking at crystal symmetry, orthoscopic is sometimes preferable. Try it for <scene name='82/824000/Contacts/4'>cellulose structure</scene>. | |||
<jmol> | |||
<jmolCheckbox> | |||
<scriptWhenChecked>set perspectiveDepth ON</scriptWhenChecked> | |||
<scriptWhenUnchecked>set perspectiveDepth OFF</scriptWhenUnchecked> | |||
<checked>true</checked> | |||
<text>Perspective depth</text> | |||
</jmolCheckbox> | |||
</jmol> | |||
moveto quaternion (61 and mainchain) | |||
Orients residue 61 in a specific way. If you use the same command on another amino acid residue, the C-alpha atom and its bonds will be oriented in the same way. This makes it easier to compare side chain conformations. | |||
</StructureSection> | </StructureSection> |