-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmmtf.htm
More file actions
225 lines (191 loc) · 7.22 KB
/
Copy pathmmtf.htm
File metadata and controls
225 lines (191 loc) · 7.22 KB
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="JSmol.min.js"></script>
<script type="text/javascript">
// 1/21/2013 10:54:15 PM -- adds image handling
var jmolApplet0; // set up in HTML table, below
// logic is set by indicating order of USE -- default is HTML5 for this test page, though
var use = "HTML5" // JAVA HTML5 WEBGL IMAGE are all otions
var s = document.location.search;
// Developers: The _debugCode flag is checked in j2s/core/core.z.js,
// and, if TRUE, skips loading the core methods, forcing those
// to be read from their individual directories. Set this
// true if you want to do some code debugging by inserting
// System.out.println, document.title, or alert commands
// anywhere in the Java or Jmol code.
Jmol._debugCode = (s.indexOf("debugcode") >= 0);
jmol_isReady = function(applet) {
Jmol._getElement(applet, "appletdiv").style.border="1px solid blue"
}
var xxxx = document.location.search
if (xxxx.indexOf("_USE=") > 0)xxxx = xxxx.substring(0, xxxx.indexOf("_USE=") - 1);
if (xxxx.length == 5 || xxxx.length == 0) {
xxxx = (xxxx + "?1crn").substring(1,5)
script = 'h2oOn=true;set animframecallback "jmolscript:if (!selectionHalos) {select model=_modelNumber}";'
+'set errorCallback "myCallback";'
+'set defaultloadscript "isDssp = false;set defaultVDW babel;if(!h2oOn){display !water}";'
+'set zoomlarge false;set echo top left;echo loading XXXX...;refresh;'
+'load "=XXXX.mmtf";set echo top center;echo XXXX;'
+'spacefill off;wireframe off;cartoons on;color structure;'
script = script.replace(/XXXX/g, xxxx)
} else {
script = unescape(xxxx.substring(1))
}
var Info = {
width: 450,
height: 450,
debug: false,
color: "white",
addSelectionOptions: false,
serverURL: "https://chemapps.stolaf.edu/jmol/jsmol/php/jsmol.php",
use: "HTML5",
j2sPath: "j2s",
readyFunction: jmol_isReady,
script: script,
//jarPath: "java",
//jarFile: (useSignedApplet ? "JmolAppletSigned.jar" : "JmolApplet.jar"),
//isSigned: useSignedApplet,
//disableJ2SLoadMonitor: true,
disableInitialConsole: true
//defaultModel: "$dopamine",
//console: "none", // default will be jmolApplet0_infodiv
}
Models = []
template = "xid='%1';load =%1.mmtf|%2 (%1)"
function addModel(xxxx, text) {
Models.push(template.replace(/\%1/g, xxxx).replace(/%2/g, text).split("|"))
}
addModel("1crn", "small")
addModel("1blu","Fe/S")
addModel("1bna","b-DNA")
addModel("1d66","transcription")
// these are conveniences that mimic behavior of Jmol.js
function jmolCheckbox(script1, script0,text,ischecked) {Jmol.jmolCheckbox(jmolApplet0,script1, script0, text, ischecked)}
function jmolButton(script, text) {Jmol.jmolButton(jmolApplet0, script,text)}
function jmolHtml(s) { document.write(s) };
function jmolBr() { jmolHtml("<br>") }
function jmolMenu(a) {Jmol.jmolMenu(jmolApplet0, a)}
</script>
</head>
<body>
<center>
<table><tr>
<td>
<pre style="font-size:7pt">
*
* Jmol RCSB MMTF (macromolecular transmission format) file reader
*
* see https://github.com/rcsb/mmtf/blob/master/spec.md
*
* /full/ specification as of 2016.4.18 is implemented,including:
*
* reading atoms, bonds, and DSSR secondary structure
*
* <a href='javascript:Jmol.script(jmolApplet0,"load =1f88.mmtf;cartoons only;color structure")'>load =1f88.mmtf;cartoons only;color structure</a>
*
*
* reading space groups and unit cells, and using those as per other readers
*
* <a href='javascript:Jmol.script(jmolApplet0,"load =1crn.mmtf {1 1 1};unitcell")'>load =1crn.mmtf {1 1 1};unitcell</a>
*
* reading bioassemblies (biomolecules) and applying those transformations
*
* <a href="javascript:Jmol.script(jmolApplet0,'set echo top left;echo loading...;refresh;load =1auy.mmtf FILTER "biomolecule 1;*.CA,*.P"')">load =1auy.mmtf FILTER "biomolecule 1;*.CA,*.P"</a>
*
* reading biomolecules and lattices, and loading course-grained
*
* <a href="javascript:Jmol.script(jmolApplet0,'set echo top left;echo loading...;refresh;load =1auy.mmtf {2 2 1} filter "biomolecule 1;bychain";spacefill 30.0; color property symop')">load =1auy.mmtf {2 2 1} filter "biomolecule 1;bychain";spacefill 30.0; color property symop</a>
*
*
</pre>
<a href="javascript:Jmol.script(jmolApplet0, 'antialiasDisplay = !antialiasdisplay')">Toggle antialias</a>
<br>
<i>set platformSpeed...</i>
<br>
<a href="javascript:Jmol.script(jmolApplet0, 'set platformSpeed 8')">8</a>
<a href="javascript:Jmol.script(jmolApplet0, 'set platformSpeed 7')">7</a>
<a href="javascript:Jmol.script(jmolApplet0, 'set platformSpeed 6')">6</a>
<a href="javascript:Jmol.script(jmolApplet0, 'set platformSpeed 5')">5</a>
<a href="javascript:Jmol.script(jmolApplet0, 'set platformSpeed 4')">4</a>
<a href="javascript:Jmol.script(jmolApplet0, 'set platformSpeed 3')">3</a>
<a href="javascript:Jmol.script(jmolApplet0, 'set platformSpeed 2')">2</a>
<a href="javascript:Jmol.script(jmolApplet0, 'set platformSpeed 1')">1</a>
</td>
<td align=center>
<script type="text/javascript">
jmolApplet0 = Jmol.getApplet("jmolApplet0", Info)
</script>
</td><td>
<form><!-- (FORM tag is important to automatically set checkbox off when page reloads) -->
<script type="text/javascript">
Jmol.setButtonCss(null,"style='width:160px'")
Jmol.setMenuCss(null,"style='width:160px'")
jmolButton("if (!xid) { xid = '1crn'};var x = prompt('Enter a four-digit PDB ID',xid);if (!x) { quit }; xid = x; load @{'=' + x + '.mmtf'}","Load PDB by ID")
jmolBr()
jmolCheckbox("set pdbAddHydrogens TRUE","set pdbAddHydrogens FALSE","with hydrogens",false)
jmolBr()
jmolCheckbox("set defaultLoadFilter 'biomolecule 1'","set defaultLoadFilter ''","biomolecule 1",false)
jmolBr()
jmolHtml("Examples:")
jmolBr()
jmolMenu(Models)
jmolBr()
jmolButton("if (!molname) { molname = 'tylenol'};var x = prompt('Enter the name or identifier (SMILES, InChI, CAS) of a molecule',molname);if (!x) { quit }; molname = x; load @{'$' + molname}","Load MOL by NAME")
jmolBr()
jmolButton("load ?","Load File or URL")
jmolBr()
jmolButton("script ?.spt","Load SCRIPT")
jmolBr()
jmolBr()
jmolCheckbox("h2oOn=true;display *","h2oOn=false;display !water","display water",true)
jmolBr()
jmolBr()
jmolButton("write FILE ?","Save FILE")
jmolBr()
jmolButton("write image jsmol.jpg","Save JPG")
jmolBr()
jmolButton("write image jsmol.png","Save PNG")
jmolBr()
jmolButton("write jsmol.jmol","Save Jmol")
jmolBr()
jmolButton("write PNGJ jsmol.png","Save PNG+Jmol")
jmolBr()
jmolButton("write state jsmol.spt","Save STATE")
jmolBr()
jmolButton("set window 800 800","800x800 window")
jmolBr()
jmolButton("set window 600 600","600x600 window")
jmolBr()
</script>
</form>
</td></tr>
<tr>
<td></td>
<td align=center>
<script type="text/javascript">
jmolBr()
Jmol.setButtonCss(null,"style='width:120px'")
jmolButton("color cpk")
jmolButton("color group")
jmolButton("color amino")
jmolButton("color structure")
jmolBr()
jmolButton("trace only")
jmolButton("cartoon only")
jmolButton("backbone only")
jmolButton("spacefill only;spacefill 23%;wireframe 0.15","ball&stick")
jmolBr()
Jmol.setButtonCss(null,"style='width:100px'")
jmolButton("Model")
Jmol.setButtonCss(null,"style='width:190px'")
jmolButton("Ramachandran relative")
jmolButton("Quaternion difference")
jmolBr()
Jmol.setButtonCss(null,"style='width:100px'")
jmolButton("console")
Jmol.jmolCommandInput(jmolApplet0)
</script>
</td></tr></table>
</body>
</html>