-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
409 lines (361 loc) · 24.6 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
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta content="text/html; charset=utf-8" http-equiv="content-type">
<meta content="noindex, nofollow" name="robots">
<meta content="noindex, nofollow" name="googlebot">
<meta content="width=device-width, initial-scale=1" name="viewport">
<link href='css/bootstrap.min.css' rel='stylesheet' type="text/css">
<link href="css/style.css" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro" rel="stylesheet">
<title>cSCCscore: a Squamous Cell Skin Cancer Wed Prediction Tool</title>
<!-- cSCCscore: a Squamous Cell Skin Cancer Wed Prediction Tool>
Copyright (C) 2017 Vanessa Sochat-->
</head>
<body>
<div class="container" style="padding-top:100px">
<div class="row">
<div class="col-md-1">
<ul class="nav nav-pills nav-stacked red" style="margin-top:55px">
<li class="active" style="width:75px">
<a data-toggle="pill" href="#pill-calculate">History</a>
</li>
<li style="width:75px">
<a data-toggle="pill" href="#pill-about">About</a>
</li>
</ul>
</div>
<div class="col-md-10">
<div class="tab-content">
<div class="tab-pane fade in active" id="pill-calculate">
<div class="row">
<div class="col-md-12">
<div class="container" style="margin:0px 50px 50px 50px">
<form class="form-horizontal">
<fieldset>
<legend style="margin-bottom:30px"> Squamous Cell Skin Cancer (cSCC) Web Prediction Tool.</legend>
<!-- Past Rx of Invasive: Prepended checkbox -->
<div class="form-group" id="past_rx_invasive_div">
<label class="col-md-3 control-label" for="past_rx_invasive">Patient History</label>
<div class="col-md-8">
<p class="help-block">I have been diagnosed in the past with an invasive squamous cell skin cancer</p>
<div class="radio">
<label for="past_rx_invasive-0"><input class="past_rx_invasive" id="past_rx_invasive-0" name="past_rx_invasive" type="radio" value="1" required> True</label>
</div>
<div class="radio">
<label for="past_rx_invasive-1"><input class="past_rx_invasive" id="past_rx_invasive-1" name="past_rx_invasive" type="radio" value="0" required> False</label>
</div>
</div>
</div>
<hr class="past_rx_invasive_div" style="display:none">
<!-- Past Rx Insitu: Appended checkbox -->
<div class="form-group" id="past_rx_insitu_div" style='display:none'>
<label class="col-md-3 control-label" for="past_rx_insitu"></label>
<div class="col-md-8">
<p class="help-block">I have been diagnosed in the past with a non-invasive (also called in-situ) squamous cell skin cancer</p>
<div class="radio">
<label for="past_rx_insitu-0"><input id="past_rx_insitu-0" name="past_rx_insitu" type="radio" value="1"> True</label>
</div>
<div class="radio">
<label for="past_rx_insitu-1"><input id="past_rx_insitu-1" name="past_rx_insitu" type="radio" value="0"> False</label>
</div>
</div>
</div>
<hr>
<!-- Past Rx Keratosis: Appended checkbox -->
<div class="form-group" id="past_rx_keratosis_div">
<label class="col-md-3 control-label" for="past_rx_keratosis"></label>
<div class="col-md-8">
<p class="help-block">I have been diagnosed in the past with an actinic keratosis</p>
<div class="radio">
<label for="past_rx_keratosis-0"><input id="past_rx_keratosis-0" name="past_rx_keratosis" type="radio" value="1" required> True</label>
</div>
<div class="radio">
<label for="past_rx_keratosis-1"><input id="past_rx_keratosis-1" name="past_rx_keratosis" type="radio" value="0" required> False</label>
</div>
</div>
</div>
<hr>
<!-- Prepended checkbox -->
<div class="form-group" id='genotyped_div'>
<label class="col-md-3 control-label" for="genotyped">Genetic Risk</label>
<div class="col-md-8">
<p class="help-block">I have been typed for the
<a id="show-alleles-button"
data-toggle="modal"
style="cursor:pointer"
data-target="#alleles-modal">16 genetic variants</a> associated with increased risk of squamous cell skin cancer (<a id="show-poly-button"
data-toggle="modal"
style="cursor:pointer"
data-target="#poly-modal">view polymorphisms</a>)</p>
<div class="radio">
<label for="genotyped-0">
<input id="genotyped-0"
name="genotyped"
type="radio"
class="genotyped"
value="1" required> True</label>
</div>
<div class="radio">
<label for="genotyped-1">
<input id="genotyped-1"
name="genotyped"
type="radio"
class="genotyped"
value="0" required> False</label>
</div>
</div>
</div>
<!-- Risk Alleles: Select Basic -->
<div class="form-group" id="risk_alleles_div" style="display:none">
<label class="col-md-3 control-label" for="risk_alleles">The number of risk alleles that I carry is</label>
<div class="col-md-3">
<select class="form-control"
id="risk_alleles" name="risk_alleles">
<option value="0">
less than 8
</option>
<option value="1">
8 or 9
</option>
<option value="2">
10 or more
</option>
</select>
</div>
</div>
<!-- Genomic Risk: Select Basic -->
<div class="form-group" id="genomic_risk_div">
<label class="col-md-3 control-label" for="genomic_risk">Family History</label>
<div class="col-md-8">
<p class="help-block">Based on the squamous cell skin cancer histories of my parents, siblings and children, my genetic risk for this cancer is</p><select class="form-control" id="genomic_risk" name="genomic_risk">
<option value="0"
selected="selected">
Low
</option>
<option value="1">
Moderate
</option>
<option value="2">
High
</option>
</select>
</div>
</div>
<hr>
<!-- Age in Years: Appended Input-->
<div class="form-group" id="age_years_div">
<label class="col-md-3 control-label" for="age_years">My current age is</label>
<div class="col-md-3">
<div class="input-group">
<input class="form-control" id="age_years" name="age_years" placeholder="60" required="" type="text"> <span class="input-group-addon">years</span>
</div>
</div>
</div>
<!-- Gender: Multiple Radios -->
<div class="form-group" id="gender_div">
<label class="col-md-3 control-label" for="gender">My gender is</label>
<div class="col-md-3">
<div class="radio">
<label for="gender-0"><input id="gender-0" name="gender" type="radio" value="male" required> Male</label>
</div>
<div class="radio">
<label for="gender-1"><input id="gender-1" name="gender" type="radio" value="female" required> Female</label>
</div>
</div>
</div>
<!-- Tendency Sunburn: Select Basic -->
<div class="form-group" id="tendency_sunburn_div">
<label class="col-md-3 control-label" for="tendency_sunburn">My tendency to sunburn is</label>
<div class="col-md-3">
<select class="form-control"
id="tendency_sunburn"
name="tendency_sunburn">
<option value="0" selected="selected">
Low
</option>
<option value="1">
Moderate
</option>
<option value="2">
High
</option>
</select>
</div>
</div>
<!-- Calculate Button -->
<div class="form-group">
<label class="col-md-3 control-label" for="submit"></label>
<div class="col-md-3">
<button class="btn btn-success" id="submit" name="submit">Calculate</button>
</div>
</div>
<!-- Rx message -->
<div class="form-group">
<label class="col-md-3 control-label" for="submit"></label>
<div class="col-md-8" id="message" style="display:none">
<p class="alert alert-info">Your chance of developing a new squamous cell skin cancer in the next 3 years is <span id="rx" style="font-weight:600"></span></p>
</div>
</div>
</fieldset>
</form>
</div>
</div>
</div>
</div>
<div class="tab-pane fade in" id="pill-about">
<div class="container" style="margin:0px 50px 50px 50px">
<p class="well">Squamous cell skin cancers occur more frequently among people of non-Hispanic White race/ethnicity . If you are non-Hispanic white, this tool provides your estimated probability of developing a squamous cell skin cancer within the next three years. For reference, one-third of a typical sample of non-Hispanic white men had risks less than 1.3%, one-third had risks between 1.3% and 5.0%, and the remaining men had risks greater than 5.0%. The risks for non-Hispanic white women were lower: one-third were less than 0.8%, one third were between 0.8% and 2.3& and the remaining risks were greater than 2.3%.</p>
<legend>What is this for?</legend>
<p class="well">This is a diagnosis tool intended to be used with a doctor.</p><legend>Who is involved?</legend>
<p class="well">The algorithm is developed by <a href="http://med.stanford.edu/hrp.html" target="_blank">Health Research and Policy</a> at the Stanford University School of Medicine. The web interface and associated code is maintained <a href="https://www.github.com/researchapps/cSCCscore">on Github</a> and you should <a href="https://www.github.com/researchapps/cSCCscore/issues">open an issue</a> if you have any questions.</p>
<div style="padding-top:50px; float:left">
<a href="https://srcc.stanford.edu" style="padding-right:30px" target="_blank"><img src="img/srcc.png" style="border-radius:5px; width:200px"></a> <a href="http://med.stanford.edu/hrp.html" target="_blank"><img src="img/stanford_medicine.png" style="border-radius:5px; width:250px"></a>
</div>
<p></p>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Modal for SNP Table -->
<div class="modal" id='alleles-modal'>
<div class="modal-dialog" role="document">
<div class="modal-content" style="width:800px;height:800px">
<div class="modal-body" id="alleles-body">
<iframe src="https://researchapps.github.io/cSCCscore/docs/table"
width="800" height="760"
frameborder="0" marginheight="0"
marginwidth="0">Loading...</iframe>
</div>
</div>
</div>
</div>
<!-- Modal for Polymorphism -->
<div class="modal" id='poly-modal'>
<div class="modal-dialog" role="document">
<div class="modal-content" style="width:800px;height:800px">
<div class="modal-body" id="poly-body">
<iframe src="https://researchapps.github.io/cSCCscore/docs/polymorphism"
width="760" height="760"
frameborder="0" marginheight="0"
marginwidth="0">Loading...</iframe>
</div>
</div>
</div>
</div>
<script src="js/jquery-2.2.2.js" type="text/javascript"></script>
<script src='js/tether.min.js'></script>
<script src='js/lodash.min.js'></script>
<script src='js/bootstrap.min.js'></script>
<script type='text/javascript'>
$(document).ready(function(){
// If past rx invasive selected, non-invasive (in-situ) is changed to false, not required
$(".past_rx_invasive").change(function(){
if ($(this).val()==1) {
$("#past_rx_insitu_div").hide();
$(".past_rx_insitu_div").hide();
$('input[name=past_rx_insitu]').prop('checked', false)
$('input[name=past_rx_insitu]').prop('required', false)
} else {
$("#past_rx_insitu_div").show();
$(".past_rx_insitu_div").show();
$('input[name=past_rx_insitu]').prop('required', true)
}
})
// If the patient hasn't been genotyped, ask for family history
$(".genotyped").change(function(){
if ($('input[name=genotyped]').prop('checked')) {
$("#risk_alleles_div").show();
$("#genomic_risk_div").hide();
} else {
$("#risk_alleles_div").hide();
$("#genomic_risk_div").show();
}
})
// Main calculation goes here
$("form").submit(function(e){
e.preventDefault();
var gender = $('input[name=gender]:checked').val();
var age_years = parseInt($('input[name=age_years]').val());
var sunburn_tendency = parseInt($('#tendency_sunburn').val());
var past_rx_invasive = + $('input[name=past_rx_invasive]').prop('checked');
var past_rx_insitu = 0;
if (past_rx_invasive == 0){
var past_rx_insitu = + $('input[name=past_rx_insitu]').prop('checked');
}
var past_rx_keratosis = + $('input[name=past_rx_keratosis]').prop('checked');
// If genotyped, then use risk alleles
if ($('input[name=genotyped]').prop('checked')) {
var genomic_risk = parseInt($('#risk_alleles').find(":selected").val());
// Otherwise use family history
} else {
var genomic_risk = parseInt($('#genomic_risk').find(":selected").val());
}
// Step 1: define variables based on gender.
if (gender == "female"){
// Female
var B = [0.67, 0.08, 0.27, 0.16, 0.54, 1.74, 0.98, 1.51],
alpha0 = -10.50
alpha1 = 0.17
phi = 3.42;
} else {
// Male
var B = [0.62, 0.09, 0.13, 0.30, 0.66, 1.80, 1.02, 1.37],
alpha0 = -9.89,
alpha1 = 0.17,
phi = 2.60;
}
console.log('Betas are ' + B);
console.log('alpha0 ' + alpha0);
console.log('alpha1 ' + alpha1);
console.log('phi ' + phi);
// Step 2: parse input for covariates
var z1 = age_years/10.0;
var z2 = + (sunburn_tendency==1); // moderate, + converts bool to int
var z3 = + (sunburn_tendency==2); // high,
var z4 = + (genomic_risk=="1") // moderate genetic risk
var z5 = + (genomic_risk=="2") // high genetic risk (either by way of alleles or report)
var z6 = past_rx_keratosis // 1 indicates past diagnosis of actinic keratosis
var z7 = past_rx_insitu // 1 indicates past diagnosis of non invasive (in-situ)
var z8 = past_rx_invasive; // 1 indicates past diagnosis of invasive carcinoma
// Variable sanity check
console.log('gender: ' + gender);
console.log('age: ' + age_years);
console.log('moderate sunburn tendency: ' + z2);
console.log('high sunburn tendency: ' + z3);
console.log('moderate genetic risk: ' + z4);
console.log('high genetic risk: ' + z5);
console.log('past_rx_invasive: ' + past_rx_invasive);
console.log('past_rx_insitu: ' + past_rx_insitu);
console.log('past_rx_keratosis: ' + past_rx_keratosis);
var Z = [z1, z2, z3, z4, z5, z6, z7, z8]
console.log('Z is ' + Z);
// The output is the probability P of developing a squamous cell cancer in the next three years. P is given by
var summation = 0
$.each(new Array(8),function(i){
summation+=(B[i]*Z[i]);
}
);
console.log("Dot product of Z and B is " + summation);
// Calculate assigned probability P of developing a new cancer in the next three years.
var inner_left = ((phi/alpha1) * (Math.exp(3*alpha1) - 1))
console.log("Inner left ((phi/alpha1) * (Math.exp(3*alpha1) - 1)) is " + inner_left);
var inner_right = Math.exp(alpha0+summation)
console.log("Inner right Math.exp(alpha0+summation) is " + inner_right);
var inner = 1 + (inner_left*inner_right)
console.log("Inner 1 + (inner_left*inner_right) is " + inner);
var exponent = -1*(1/phi)
console.log("exponent -1*(1/phi) is " + exponent);
var P = ((1 - (inner**exponent)) * 100).toFixed(2);
console.log("P (1 - (inner**exponent)) * 100).toFixed(2) is " + P);
// 2.2 Final Output to user:
$("#rx").text(P + "%")
$('#message').show();
})
})
</script>
</body>
</html>