// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

// Snap DNA to Reset position and cut it down to AT.

var s_at_cut =
"select all\n\
hbonds off\n\
view set 0.00 10.00 90.00 200.00\n\
wireframe 0\n\
\n\
delay 0.8\n\
\n\
color [128,128,128]\n\
select a10,t29\n\
color cpk\n\
select all\n\
\n\
delay 0.8\n\
move 90 0 0   0   0 0 0   0 2 30\n\
\n\
#TRIM OFF ENDS UNTIL JUST 2 BASE PAIRS LEFT\n\
hbonds off\n\
restrict 2-18:d or 21-37:e\n\
delay 0.1\n\
restrict 3-17:d or 22-36:e\n\
delay 0.1\n\
restrict 4-16:d or 23-35:e\n\
delay 0.1\n\
restrict 5-15:d or 24-34:e\n\
delay 0.1\n\
restrict 6-14:d or 25-33:e\n\
delay 0.1\n\
restrict 7-13:d or 26-32:e\n\
delay 0.1\n\
restrict 8-12:d or 27-31:e\n\
delay 0.1\n\
restrict 9-11:d or 28-30:e\n\
delay 0.1\n\
restrict 10:d or 29:e\n\
delay 1.0\n\
select all\n\
color black\n\
";

// Final color black is to hide the misoriented pair in IE before view set.
// This works in local mode only, not for IE on server.

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

// Load and display AT base pair with double bonds, ball and stick.
// Zoom and spin into optimal view.
// Final move is from Todd Carlson's
// http://faculty.gvsu.edu/carlsont/grant/moveutil/moveutil.htm

var s_at_pair =
"color cpk\n\
set bonds on\n\
set zoom center\n\
select atomno=43 or atomno=16\n\
define at_center selected\n\
center selected\n\
select all\n\
\
view set 143.08 12.58 91.27 85\n\
\
restrict not hydrogen\n\
wireframe 0.05\n\
spacefill 0.3\n\
" +

// AT-HB: AT minus long HBonds: hide long hbonds in GC

"select atomno=43 or atomno=17 or atomno=42 or atomno=19\n\
define at_lhb selected\n\
wireframe off\n\
\
monitors off #turn off any existing monitors\n\
monitor 43 17 #make long hbonds dotted monitor lines\n\
monitor 42 19\n\
\
set monitors off; #don't show distances\n\
color monitors white\n\
delay 1.0\n\
\
move 82.18 -63.61 -71.34   104.96   0 0 0   0   2 30 3\n\
select all\n\
";

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

var s_at_unpair =
"select atomno=43 or atomno=16\n\
center selected\n\
select all\n\
view set -75.63 24.55 -178.93 189.96\n\
delay 1\n\
move -83.12 62.34 72.43   -104.96   0 0 0   0   2 30 3\n\
color black\n\
";

// Final color black is to hide the misoriented pair in IE before view set.
// This works in local mode only, not for IE on server.

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

// Starting with AT,
// adds back base pairs progressively restoring full double helix.

var s_at_uncut =
"color cpk\n\
wireframe 0\n\
rotate z 90\n\
rotate y 10\n\
rotate x -90\n\
zoom 200\n\
\n\
hbonds off\n\
\n\
restrict 10:d or 29:e\n\
wireframe 0.3\n\
refresh\n\
delay 0.5\n\
\n\
select 9-11:d or 28-30:e\n\
wireframe 0\n\
select 10:d or 29:e\n\
wireframe 0.3\n\
refresh\n\
delay 0.1\n\
\n\
select (8-12:d or 27-31:e) and not (10:d or 29:e)\n\
wireframe 0\n\
refresh\n\
delay 0.1\n\
\n\
select (7-13:d or 26-32:e) and not (10:d or 29:e)\n\
wireframe 0\n\
refresh\n\
delay 0.1\n\
\n\
select (6-14:d or 25-33:e) and not (10:d or 29:e)\n\
wireframe 0\n\
refresh\n\
delay 0.1\n\
\n\
select (5-15:d or 24-34:e) and not (10:d or 29:e)\n\
wireframe 0\n\
refresh\n\
delay 0.1\n\
\n\
select (4-16:d or 23-35:e) and not (10:d or 29:e)\n\
wireframe 0\n\
refresh\n\
delay 0.1\n\
\n\
select (3-17:d or 22-36:e) and not (10:d or 29:e)\n\
wireframe 0\n\
refresh\n\
delay 0.1\n\
\n\
select (2-18:d or 21-37:e) and not (10:d or 29:e)\n\
wireframe 0\n\
refresh\n\
delay 0.1\n\
\n\
select all\n\
hbonds\n\
color hbonds white\n\
\n\
select 10:d or 29:e\n\
hbonds 0.2\n\
\n\
center selected\n\
delay 0.1\n\
";

// Final delay is to prevent IE from executing the last few lines
// after a subsequent reset.spt.

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

// Resets stick DNA, cuts off base pairs progressively till one GC remains.

var s_gc_cut =
"select all\n\
view set 0.00 10.00 90.00 200.00\n\
wireframe 0\n\
\
delay 0.8\n\
hbonds off\n\
color [128,128,128]\n\
select g30,c9\n\
color cpk\n\
delay 0.8\n\
\
hbonds off\n\
restrict 2-18:d or 21-37:e\n\
delay 0.1\n\
restrict 3-17:d or 22-36:e\n\
delay 0.1\n\
restrict 4-16:d or 23-35:e\n\
delay 0.1\n\
restrict 5-15:d or 24-34:e\n\
delay 0.1\n\
restrict 6-14:d or 25-33:e\n\
delay 0.1\n\
restrict 7-13:d or 26-32:e\n\
delay 0.1\n\
restrict 8-12:d or 27-31:e\n\
delay 0.1\n\
restrict 9-11:d or 28-30:e\n\
delay 0.1\n\
restrict 9-10:d or 29-30:e\n\
delay 0.1\n\
restrict 9:d or 30:e\n\
delay 1.0\n\
\
center selected\n\
set zoom center off\n\
select all\n\
color black\n\
";

// Final color black is to hide the misoriented DNA in IE before view set.
// This works in local mode only, not for IE on server.

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Load and display GC base pair with double bonds, ball and stick.
// Zoom and spin into optimal view.

var s_gc_pair =
"color cpk\n\
set bonds on\n\
view set 134.51 11.37 96.35 62 -5.00 0.00 0.00 \n\
\
restrict not hydrogen\n\
wireframe 0.05\n\
spacefill 0.3\n\
\
select atomno=42 or atomno=18 or atomno=40 or atomno=19 or atomno=39 or atomno=21\n\
define gc_lhb selected\n\
wireframe off\n\
\
monitors off\n\
\
monitor 42 18\n\
monitor 40 19\n\
monitor 39 21\n\
\
set monitors off #don't show distances\n\
color monitors white\n\
delay 1.0\n\
\
select all\n\
\
move 71.72 -62.02 -57.70   130   0 0 0   0   2 30 3\n\
";

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

var s_gc_unpair =
"view set -87.06 48.04 -179.45 192.00 -5.00 0.00 0.00\n\
delay 1\n\
move -72.47 61.11 58.66   -130   0 0 0   0   2 30 3\n\
color black\n\
";

// Final color black is to hide the misoriented pair in IE before view set.
// This works in local mode only, not for IE on server.

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

var s_gc_uncut =
"color cpk\n\
view set 0.00 10.00 90.00 200.00\n\
wireframe 0\n\
\
hbonds off\n\
\
restrict 9:d or 30:e\n\
wireframe 0.3\n\
refresh\n\
delay 0.1\n\
\
select 9-10:d or 29-30:e\n\
wireframe 0\n\
select 9:d or 30:e\n\
wireframe 0.3\n\
refresh\n\
delay 0.1\n\
\
select 10-11:d or 28-29:e\n\
wireframe 0\n\
refresh\n\
delay 0.1\n\
\
select 8-12:d or 27-31:e\n\
wireframe 0\n\
select 9:d or 30:e\n\
wireframe 0.3\n\
refresh\n\
delay 0.1\n\
\
select (7-13:d or 26-32:e) and not (9:d or 30:e)\n\
wireframe 0\n\
refresh\n\
delay 0.1\n\
\
select (6-14:d or 25-33:e) and not (9:d or 30:e)\n\
wireframe 0\n\
refresh\n\
delay 0.1\n\
\
select (5-15:d or 24-34:e) and not (9:d or 30:e)\n\
wireframe 0\n\
refresh\n\
delay 0.1\n\
\
select (4-16:d or 23-35:e) and not (9:d or 30:e)\n\
wireframe 0\n\
refresh\n\
delay 0.1\n\
\
select (3-17:d or 22-36:e) and not (9:d or 30:e)\n\
wireframe 0\n\
refresh\n\
delay 0.1\n\
\
select (2-18:d or 21-37:e) and not (9:d or 30:e)\n\
wireframe 0\n\
refresh\n\
\
select all\n\
hbonds\n\
color hbonds white\n\
\
select 9:d or 30:e\n\
hbonds 0.2\n\
\
center selected\n\
delay 0.1\n\
";

// Final delay is to prevent IE from executing the last few lines
// after a subsequent reset.spt.

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
var s_at_bases =
//#Thymine
"select (atomno >= 14 and atomno <= 22) or (atomno >= 56 and atomno <=60)\n\
define thymine selected\n\
" +

//#Adenine
"select (atomno >= 37 and atomno <= 46) or (atomno >= 69 and atomno <=72)\n\
define adenine selected\n\
\
select adenine or thymine\n\
define at_bases selected\n\
";

var s_gc_bases =
//#Guanine
"select (atomno >= 13 and atomno <= 23) or (atomno >= 55 and atomno <=58)\n\
define guanine selected\n\
" +

//#Cytosine
"select (atomno >= 37 and atomno <= 44) or (atomno >= 68 and atomno <=71)\n\
define cytosine selected\n\
\
select cytosine or guanine\n\
define gc_bases selected\n\
";

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// LH = long hydrogen bonds; SH = short.
// TK = ThicK, TN = ThiN, DT = DoTted.

var s_at_lh_tk =
"define temp selected\n\
\
#first, hide thin hbonds (from hydrogens)\n\
monitor off\n\
\
#now, hide the H atoms which will become thick bonds\n\
select atomno=56 or atomno=70\n\
define hhbonded selected\n\
spacefill off\n\
\
#now select the N/O atoms as well so we can erase the short bonds\n\
select atomno=42 or atomno=17\n\
select selected or hhbonded\n\
wireframe off\n\
\
#now show fat ones\n\
select atomno=43 or atomno=17 or atomno=42 or atomno=19\n\
wireframe 0.3\n\
color bonds white\n\
\
select temp and not hhbonded\n\
";

var s_at_lh_tn =
"define temp selected\n\
\
#first, hide thin hbonds (from hydrogens)\n\
monitor off\n\
\
#now, hide the H atoms which will become thick bonds\n\
select atomno=56 or atomno=70\n\
define hhbonded selected\n\
spacefill off\n\
\
#now select the N/O atoms as well so we can erase the short bonds\n\
select atomno=42 or atomno=17\n\
select selected or hhbonded\n\
wireframe off\n\
\
#now show thin ones\n\
select atomno=43 or atomno=17 or atomno=42 or atomno=19\n\
wireframe 0\n\
color bonds white\n\
\
select temp and not hhbonded\n\
";

var s_at_lh_dt =
"define temp selected\n\
\
select at_lhb\n\
wireframe off\n\
\
monitors off #turn off any existing monitors\n\
\
#make long hbonds dotted monitor lines\n\
monitor 43 17\n\
monitor 42 19\n\
\
set monitors off #don't show distances\n\
color monitors white\n\
\
select temp\n\
";

var s_at_sh_dt =
"define temp selected\n\
\
select at_lhb\n\
wireframe off\n\
\
select all # else color monitors fails\n\
monitors off # turn off lhb monitors\n\
set monitors off # don't show distances\n\
\
monitor 19 70\n\
monitor 43 56\n\
\
color monitors white\n\
\
select temp\n\
";

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n\
var s_gc_lh_tk =
"define temp selected\n\
\
#first, hide thin hbonds (from hydrogens)\n\
monitor off\n\
\
#now, hide the H atoms which will become thick bonds\n\
select atomno=58 or atomno=56 or atomno=68\n\
define hhbonded selected\n\
spacefill off\n\
\
#now select the N/O atoms as well so we can erase the short bonds\n\
select atomno=42 or atomno=19 or atomno=21\n\
select selected or hhbonded\n\
wireframe off\n\
\
#now show fat ones\n\
select atomno=42 or atomno=18 or atomno=40 or atomno=19 or atomno=39 or atomno=21\n\
wireframe 0.3\n\
color bonds white\n\
\
select temp and not hhbonded\n\
";

var s_gc_lh_tn =
"define temp selected\n\
\
#first, hide thin hbonds (from hydrogens)\n\
monitor off\n\
\
#now, hide the H atoms which will become thick bonds\n\
select atomno=58 or atomno=56 or atomno=68\n\
define hhbonded selected\n\
spacefill off\n\
\
select selected or atomno=42 or atomno=19 or atomno=21\n\
wireframe off\n\
\
#now show fat ones\n\
select atomno=42 or atomno=18 or atomno=40 or atomno=19 or atomno=39 or atomno=21\n\
wireframe 0\n\
color bonds white\n\
\
select temp and not hhbonded\n\
";

var s_gc_lh_dt =
"define temp selected\n\
\
select gc_lhb\n\
wireframe off\n\
\
monitors off #turn off any existing monitors\n\
\
#make long hbonds dotted monitor lines\n\
monitor 42 18\n\
monitor 40 19\n\
monitor 39 21\n\
\
set monitors off #don't show distances\n\
color monitors white\n\
\
select temp\n\
";

var s_gc_sh_dt =
"define temp selected\n\
\
select gc_lhb\n\
wireframe off\n\
\
select all # else color monitors fails\n\
monitors off # turn off lhb monitors\n\
set monitors off # don't show distances\n\
\
monitor 18 68\n\
monitor 40 56\n\
monitor 39 58\n\
\
color monitors white\n\
\
select temp\n\
";

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n\\n\
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n\\n\
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n\\n\
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n\\n\
