﻿## Please note that all actions from all_tutorials_preamble.txt will be added here!

c:itemstate home-start 2
c:showQ True

p:Welcome to this introductory tutorial. To get the most out of it, please read this text carefully and when you are done press the <b>Next</b> button - or simply hit the Return key!<br>

p:We suggest that you go through the whole tutorial first, then run it again and exit at a suitable point from which you can try and do for yourself what you have learned from previous times you have gone through the tutorial.

p:In this tutorial, we will be solving and refining one of the sample structures that come with Olex2 - Sucrose.

p:We load the structure from the <b>Start</b> tool. The tool will be highlighted after you move to the next page.
h:h2-start
c:itemstate home-start 1
c:refresh
c:freeze(true)
c:reap 'DataDir()/samples/sucrose/sucrose.res'
c:spy.revert_to_original()
c:mpln -n
c:freeze(false)
c:refresh

p:In order to open a sample structure click on one of the links next to the title <b>Sample Structure</b>, the structure should already have been opened since the last page.

p:By clicking on the <b>Work</b> tab, we get access to the main tools:
h:tab-work
c:spy.switch_tab_for_tutorials(work)

p:Structure <b>Solution</b>...
h:btn-solve;1

p:Structure <b>Refinement</b>...
h:btn-refine;1

p:... and make <b>Reports</b>.
h:btn-report;1

p:For example, we can solve the structure by typing <c>solve</c> or by clicking the <b>Solve</b> button. We will do this now.
h:btn-solve;1
c:solve
c:waitfor process
c:refresh

p:We can tidy this solution by typing <c>clean</c> or by pressing the <b>Clean</b> button.
h:toolbar-tidy
c:clean
c:compaq -a
c:refresh

p:Let's press the <b>Refine</b> button or type <c>refine</c> and refine what we've got so far.
h:btn-refine;1
c:refine

p:With the <b>Uiso Slider</b> in the <b>Toolbox Work</b> we can select all those atoms that look 'too small'
c:itemstate work-main-toolbar 1
c:html.setBG(UISO_SELECT_SLIDER,#ff0000)
c:html.setvalue(UISO_SELECT_SLIDER,-7)
c:html.setvalue(UisoSelectVal,<0.035)
c:sel atoms where xatom.uiso < 0.035&&xatom.type!='Q'
c:refresh

p:... and make them into Oxygen by pressing the <b>O</b> button.
h:btn-elementO
c:name sel O
c:refresh

p:Refine this again...
c:refine

p:Now it's time to make everything <b>anisotropic</b>. Type <c>anis</c> or click on the <b>ANIS</b> button.
h:toolbar-anis
c:anis
c:refine

p:... clean it ...
c:clean

p:Let's add some hydrogen atoms to this. Type <c>hadd</c> or click on the <b>ADD H</b> button:
h:button_small-add_h
c:hadd
c:refine
c:refresh

p:You can toggle the display of electron density peaks (Q-peaks) by repeatedly pressing the <b>Q</b> button or by <c>CTRL+Q</c>
h:toolbar-q
c:showQ False
c:refresh
##

p:Of course, we can change the settings of the solution program.

p:We do this, by clicking the <b>Solution Settings</b> Button.
h:cbtn-solve
c:itemstate solve-settings 1


p:Here we can choose solution programs and settings ...
h:SET_snum_solution_PROGRAM_bg
h:SET_snum_solution_METHOD_bg

p:... set the <b>Formula</b> and can determine the <b>space group</b>.
h:SET_SNUM_REFINEMENT_FORMULA_bg
h:SET_SNUM_REFINEMENT_SPACE_GROUP_bg

p:When you click on <b>Suggest SG</b> link, or type <c>sg</c>, watch what happens!
c:sg
c:refresh

p:In order to see all the console output, you can type <c>lines -1</c>.
c:lines -1
c:refresh

p:If you type <c>text</c> or press the little text icon, you will get a 'transcript' of the console in your text editor
h:toolbar-text
c:text
c:refresh

p:To show only 10 lines, type <c>lines 10</c>
c:lines 10
c:refresh
c:itemstate solve-settings 2

c:spy.switch_tab_for_tutorials(home)
p:End of tutorial, press next to repeat the tutorial or cancel to exit. <br><font size='1'>Written by Simon Harries.</font>