-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJSME_inchi_direct.html
More file actions
60 lines (52 loc) · 2.12 KB
/
JSME_inchi_direct.html
File metadata and controls
60 lines (52 loc) · 2.12 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
<html>
<head>
<script>
var JSApplet = {};
JSApplet.Inchi = {};
function computeInchi(mol) {
var result;
var tmp_function_name = "__local_ff";
JSApplet.Inchi[tmp_function_name] = function (inchi_result) {
result = inchi_result
};
JSApplet.Inchi.computeInchi(mol, "JSApplet.Inchi." + tmp_function_name);
delete JSApplet.Inchi[tmp_function_name];
return result;
}
</script>
<script language="javascript" src="jsme/96E40B969193BD74B8A621486920E79C.cache.js" type="text/javascript"></script>
<script>
function inchiExample() {
var benzene = "c1ccccc1\n" +
"JME 2017-11-16 Mon May 14 20:40:26 GMT+200 2018\n" +
"\n" +
" 6 6 0 0 0 0 0 0 0 0999 V2000\n" +
" 2.4249 0.7000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n" +
" 2.4249 2.1000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n" +
" 1.2124 2.8000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n" +
" 0.0000 2.1000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n" +
" 0.0000 0.7000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n" +
" 1.2124 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0\n" +
" 1 2 1 0 0 0 0\n" +
" 2 3 2 0 0 0 0\n" +
" 3 4 1 0 0 0 0\n" +
" 4 5 2 0 0 0 0\n" +
" 5 6 1 0 0 0 0\n" +
" 6 1 2 0 0 0 0\n" +
"M END";
var result = computeInchi(benzene);
console.log(result);
var text = "";
Object.keys(result).forEach(function (k) {
text += k + ": " + result[k] + "<br>\n"
});
document.getElementById("inchi").innerHTML = text;
}
</script>
</head>
<body>
<br>
<button onclick="inchiExample()">Compute InChi of benzene</button>
<div id="inchi"></div>
</body>
</html>