-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathalpha.html
112 lines (103 loc) · 3.84 KB
/
alpha.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<script type="text/javascript" src="jsmol/JSmol.min.js"></script>
<script type="text/javascript">
var Info = {
color: "#FFFFFF", // white background
height: 400,
width: "100%", // fill the JSMol box to its container's width
coverImage: "images/white.png",
deferApplet: true, // don't load until user clicks on JSMol box
deferUncover: true, // don't uncover until script fully executed
script: "script scripts/alpha1.txt",
use: "HTML5",
j2sPath: "jsmol/j2s",
serverURL: "http://chemapps.stolaf.edu/jmol/jsmol/php/jsmol.php",
disableInitialConsole: true,
debug: false,
};
// don't load any JSMol until the page itself has finished loading
$(document).ready(function(){
// prevent JSMol from taking entire page
Jmol.setDocument(0);
// create new JSMol instance with parameters defined in Info above
Jmol.getApplet("myJmol1", Info);
// reuse Info parameters for subsequent JSMol instances, changing
// only the script path
Info.script = "script scripts/alpha2.txt";
Jmol.getApplet("myJmol2", Info);
// put JSMol code into the correct containers (id=jsmolWindowN)
$("#jsmolWindow1").html(Jmol.getAppletHtml(myJmol1));
$("#jsmolWindow2").html(Jmol.getAppletHtml(myJmol2));
// give our JSMol containers breathing room above and below
$("#myJmol1_appletinfotablediv").css({
"margin-top": "10px",
"margin-right": "auto",
"margin-bottom": "10px",
"margin-left": "auto"
});
$("#myJmol2_appletinfotablediv").css({
"margin-top": "10px",
"margin-right": "auto",
"margin-bottom": "10px",
"margin-left": "auto"
});
$("#resetBtn1").click(reset1);
$("#resetBtn2").click(reset2);
$("#spinBox1").click(spin1);
$("#spinBox2").click(spin2);
});
function reset1(event){
Jmol.script(myJmol1, "script scripts/alpha1.txt")
};
function reset2(event){
Jmol.script(myJmol2, "script scripts/alpha2.txt")
};
function spin1(event){
if (event.target.checked){
Jmol.script(myJmol1, "set spin x 10; set spin y 10; spin on")
} else {
Jmol.script(myJmol1, "spin off")
};
};
function spin2(event){
if (event.target.checked){
Jmol.script(myJmol2, "set spin x 10; set spin y 10; spin on")
} else {
Jmol.script(myJmol2, "spin off")
};
};
// turn off the JSMol alert that binary file loading is limited
Jmol._alertNoBinary = false;
</script>
<!-- Page Title: α-Helix -->
<h2>Introduction</h2>
<p>
This script shows some properties of the α-helix.
</p>
<br>
<h2>α-helix 1</h2>
<p>
In this "peptide" the phi and psi angles have been set to those
corresponding to the α-helix.
</p>
<!-- JSMol Window Container -->
<div id="jsmolWindow1"></div>
<!-- UI Control Box -->
<div style="text-align: center;">
<!-- give the button a right margin for spacing -->
<button type="button" id="resetBtn1" style="margin-right: 10px;">Reset</button>
<input type="checkbox" id="spinBox1"> Spin On/Off
</div>
<br>
<h2>α-helix 2</h2>
<p>
Here is an α-helix. Note the pattern of
<span style="color:green;">hydrogen bonding</span> - the hydrogen bonds are
intrachain and form between elements of the peptide bond that are separated
by four residues in the primary sequence. (Based on 1wfb.pdb, Sicheri
& Yang (1995) Nature <strong>375</strong>: 427-431)
</p>
<div id="jsmolWindow2"></div>
<div style="text-align: center; margin-top: 10px;">
<button type="button" id="resetBtn2" style="margin-right: 10px;">Reset</button>
<input type="checkbox" id="spinBox2"> Spin On/Off
</div>