-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
238 lines (236 loc) · 9.31 KB
/
index.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
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
226
227
228
229
230
231
232
233
234
235
236
237
238
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Clozapine Toxicity Predictor</title>
<link rel="icon" type="image/x-icon" href="favicon.ico">
</head>
<body>
<center>
<form>
<table>
<tr>
<td colspan=4>
<center>
<h3>Clozapine Toxicity Predictor</h3>
<h3>Enter patient's data</h3>
</center>
</td>
</tr>
<tr>
<td style="text-align:right">
<label for="sex">Sex:</label>
</td>
<td>
<select id="sex">
<option value="0">female</option>
<option value="1">male</option>
</select>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td style="text-align:right">
<label for="clo_dose">Total clozapine dose [mg/day]:</label>
</td>
<td>
<input type="number" id="clo_dose" name="clo_dose" min="0" max="2000" value="0" step="12.5">
</td>
<td style="text-align:right">
<label for="age">Age [years]:</label>
</td>
<td>
<input type="number" id="age" name="age" min="1" max="100" value="18">
</td>
</tr>
<tr>
<td style="text-align:right">
<label for="bmi">BMI [kg/m^2]:</label>
</td>
<td>
<input type="number" id="bmi" name="bmi" min="20" max="50" value="25" step="0.1">
</td>
<td style="text-align:right">
<label for="crp">CRP [mg/L]:</label>
</td>
<td>
<input type="number" id="crp" name="crp" min="0" max="100" value="0.0" step="0.1">
</td>
</tr>
<tr>
<td style="text-align:right">
<label for="1a2_s">Number of <a href="https://codeberg.org/AdamWysokinski/CTP.jl/src/branch/main/1a2_substrates.md" target=_blank>CYP1A2 substrates</a>:</label>
</td>
<td>
<input type="number" id="1a2_s" name="1a2_s" min="0" max="10" value="0">
</td>
<td style="text-align:right">
<label for="3a4_s">Number of <a href="https://codeberg.org/AdamWysokinski/CTP.jl/src/branch/main/3a4_substrates.md" target=_blank>CYP3A4 substrates</a>:</label>
</td>
<td>
<input type="number" id="3a4_s" name="3a4_s" min="0" max="10" value="0">
</td>
</tr>
<tr>
<td style="text-align:right">
<label for="1a2_inh">Number of <a href="https://codeberg.org/AdamWysokinski/CTP.jl/src/branch/main/1a2_inhibitors.md" target=_blank>CYP1A2 inhibitors</a>:</label>
</td>
<td>
<input type="number" id="1a2_inh" name="1a2_inh" min="0" max="10" value="0">
</td>
<td style="text-align:right">
<label for="3a4_inh">Number of <a href="https://codeberg.org/AdamWysokinski/CTP.jl/src/branch/main/3a4_inhibitors.md" target=_blank>CYP3A4 inhibitors</a>:</label>
</td>
<td>
<input type="number" id="3a4_inh" name="3a4_inh" min="0" max="10" value="0">
</td>
</tr>
<tr>
<td style="text-align:right">
<label for="1a2_ind">Number of <a href="https://codeberg.org/AdamWysokinski/CTP.jl/src/branch/main/1a2_inducers.md" target=_blank>CYP1A2 inducers</a>:</label>
</td>
<td>
<input type="number" id="1a2_ind" name="1a2_ind" min="0" max="10" value="0">
</td>
<td style="text-align:right">
<label for="3a4_ind">Number of <a href="https://codeberg.org/AdamWysokinski/CTP.jl/src/branch/main/3a4_inducers.md" target=_blank>CYP3A4 inducers</a>:</label>
</td>
<td>
<input type="number" id="3a4_ind" name="3a4_ind" min="0" max="10" value="0">
</td>
</tr>
<tr>
<td colspan=4>
<br>
<center>
A searchable list of CYP substrates, inhibitors and inducers is available <a href="https://neuroanalyzer.org/misc/table.html" target=_blank>here</a></label>
</center>
<br>
<center>
A comprehensive list of CYP substrates, inhibitors and inducers is also available <a href="https://drug-interactions.medicine.iu.edu/MainTable.aspx" target=_blank>here</a></label>
</center>
<br>
</td>
</tr>
<tr>
<td colspan=4>
<center>
<button id="submit" type="button">PREDICT</button>
</center>
</td>
</tr>
<tr>
<td colspan=4>
<br>
<center>
<b>Predictions</b>
</center>
</td>
</tr>
<tr>
<td style="text-align:right">Clozapine [ng/mL]:</td>
<td id="clo_level" style="font-weight:bold"></td>
<td style="text-align:right">Norclozapine [ng/mL]:</td>
<td id="nclo_level" style="font-weight:bold"></td>
</tr>
<tr>
<td style="text-align:right">Clozapine [nmol/L]:</td>
<td id="clo_level_nmol" style="font-weight:bold"></td>
<td style="text-align:right">Norclozapine [nmol/L]:</td>
<td id="nclo_level_nmol" style="font-weight:bold"></td>
</tr>
<tr>
<td style="text-align:right">Clozapine level:</td>
<td id="clo_group" style="font-weight:bold"></td>
<td style="text-align:right">Clozapine level (adjusted):</td>
<td id="clo_group_adj" style="font-weight:bold"></td>
</tr>
<tr>
<td colspan=4>
<center>
<b>Recommended clozapine doses:</b>
</center>
</td>
</tr>
<tr>
<td style="text-align:right">Minimum [mg/day]:</td>
<td id="dose1" style="font-weight:bold"></td>
<td style="text-align:right">Maximum [mg/day]:</td>
<td id="dose2" style="font-weight:bold"></td>
</tr>
<tr>
<td colspan=4>
<center>
<img id="imgPlot" width="500"></img>
</center>
</td>
</tr>
</table>
</form>
</center>
<br>
<center>
<b>Source:</b> <a href="https://codeberg.org/AdamWysokinski/CloToP.jl" target=_blank>https://codeberg.org/AdamWysokinski/CloToP.jl</a>
</center>
<script>
document.getElementById("clo_group").innerHTML = "";
document.getElementById("clo_group_adj").innerHTML = "";
document.getElementById("clo_level").innerHTML = "";
document.getElementById("nclo_level").innerHTML = "";
document.getElementById("submit").addEventListener("click", async() => {
response = await fetch("http://localhost:8080", {
method: "POST",
body: JSON.stringify({
"sex": parseInt(document.getElementById("sex").value),
"age": parseFloat(document.getElementById("age").value),
"clo_dose": parseFloat(document.getElementById("clo_dose").value),
"bmi": parseInt(document.getElementById("bmi").value),
"crp": parseInt(document.getElementById("crp").value),
"a2_s": parseFloat(document.getElementById("1a2_s").value),
"a2_inh": parseFloat(document.getElementById("1a2_inh").value),
"a2_ind": parseFloat(document.getElementById("1a2_ind").value),
"a4_s": parseFloat(document.getElementById("3a4_s").value),
"a4_inh": parseFloat(document.getElementById("3a4_inh").value),
"a4_ind": parseFloat(document.getElementById("3a4_ind").value),
})
});
const clo_prediction_response = await response.text();
clo_group = clo_prediction_response.split(" ")[0];
clo_group_adj = clo_prediction_response.split(" ")[1];
clo_level = clo_prediction_response.split(" ")[2];
nclo_level = clo_prediction_response.split(" ")[3];
dose1 = clo_prediction_response.split(" ")[4];
dose2 = clo_prediction_response.split(" ")[5];
plot = clo_prediction_response.split(" ")[6];
clo_level_nmol = clo_level * 3.06
nclo_level_nmol = nclo_level * 3.20
console.log(clo_group);
console.log(clo_group_adj);
if (clo_group == 0) {
document.getElementById("clo_group").style.color="green"
document.getElementById("clo_group").innerHTML = "NORMAL"; }
else {
document.getElementById("clo_group").style.color="red"
document.getElementById("clo_group").innerHTML = "TOXIC"; }
if (clo_group_adj == 0) {
document.getElementById("clo_group_adj").style.color="green"
document.getElementById("clo_group_adj").innerHTML = "NORMAL"; }
else {
document.getElementById("clo_group_adj").style.color="red"
document.getElementById("clo_group_adj").innerHTML = "TOXIC"; }
document.getElementById("clo_level").innerHTML = clo_level;
document.getElementById("nclo_level").innerHTML = nclo_level;
document.getElementById("clo_level_nmol").innerHTML = clo_level_nmol.toFixed(1);
document.getElementById("nclo_level_nmol").innerHTML = nclo_level_nmol.toFixed(1);
document.getElementById("dose1").innerHTML = dose1;
document.getElementById("dose2").innerHTML = dose2;
imgPlot.setAttribute('src', "data:image/jpg;base64," + plot);
})
</script>
</body>
</html>