forked from CCGE-BOADICEA/pedigreejs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
179 lines (159 loc) · 7.78 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
<!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,maximum-scale=2">
<link href="https://code.jquery.com/ui/1.12.1/themes/cupertino/jquery-ui.css" rel="stylesheet" type="text/css"
media="all" crossorigin="anonymous" />
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"
crossorigin="anonymous">
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet"
type="text/css" media="all" crossorigin="anonymous" />
<link rel="stylesheet" href="./css/pedigreejs.css" />
<link rel="stylesheet" href="./css/dialog.css" />
<script src="https://code.jquery.com/jquery-3.2.1.min.js" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://unpkg.com/[email protected]/build/d3.min.js" crossorigin="anonymous"></script>
<script src="https://code.jquery.com/ui/1.12.0/jquery-ui.min.js" crossorigin="anonymous"></script>
<script src="./js/io.js"></script>
<script src="./js/pedigree_form.js"></script>
<script src="./js/pedigree.js"></script>
<script src="./js/undo_redo_refresh.js"></script>
<script src="./js/widgets.js"></script>
<script src="./js/input_validation.js"></script>
<!-- TODO update hpo_terms to all HPO-terms -->
<!-- TODO add HGNC terms for genes autocomplete -->
<script src="./js/res.js"></script>
<script src="./js/btn_setup.js"></script>
<script type="text/javascript">
function capitaliseFirstLetter(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}
// TODO remove HPO terms from disease names
var DEFAULT_DISEASES = [
{ 'type': 'breast_cancer', 'hpo': 'HP:0003002 Breast carcinoma', 'colour': 'darkgrey' },
{ 'type': 'breast_cancer2', 'hpo': 'HP:0003002 second Breast carcinoma', 'colour': 'darkgrey'},
{ 'type': 'pancreatic_cancer', 'hpo': 'HP:0002894 Neoplasm of the pancreas', 'colour': 'darkgrey' },
{ 'type': 'ovarian_cancer', 'hpo': 'HP:0100615 Ovarian neoplasm', 'colour': 'darkgrey' },
{ 'type': 'prostate_cancer', 'hpo': 'HP:0012125 Prostate cancer', 'colour': 'darkgrey' }
];
// TODO all genes names to upper case
var DEFAULT_GENE_TESTS = [
{ 'name': 'brca1', 'explanation': 'This test looks for harmful changes in the BRCA1 gene.' },
{ 'name': 'brca2', 'explanation': 'This test looks for harmful changes in the BRCA2 gene.' },
{ 'name': 'palb2', 'explanation': 'This test looks for mutations that result in loss of function of the corresponding protein of the PALB2 gene.' },
{ 'name': 'atm', 'explanation': 'This test looks for a pathogenic mutation in the ATM gene.' },
{ 'name': 'bard1', 'explanation': 'This test looks for a pathogenic mutation in the bard1 gene.' },
{ 'name': 'brip1', 'explanation': 'This test looks for mutations in the brip1 gene.' },
{ 'name': 'cdh1', 'explanation': 'This test looks for harmful changes in the cdh1 gene.' },
{ 'name': 'chek2', 'explanation': 'This test looks for harmful changes in the chek2 gene.' },
{ 'name': 'rad51c', 'explanation': 'This test looks for mutations that result in loss of function of the corresponding protein of the rad51c gene.' },
{ 'name': 'rad51d', 'explanation': 'This test looks for a pathogenic mutation in the rad51d gene.' },
{ 'name': 'stk11', 'explanation': 'This test looks for a pathogenic mutation in the STK11 gene.' },
{ 'name': 'tp53', 'explanation': 'This test looks for mutations in the TP53 gene.' },
];
var DEFAULT_PATHOLOGY_TESTS = [
{ 'name': 'er', 'explanation': 'Result of an ImmunoHistoChemistry test (IHC). About the patients breast cancer being estrogen-receptor (ER) positiv or negativ.' },
{ 'name': 'pr', 'explanation': 'Result of an ImmunoHistoChemistry test (IHC). About the pathogenicity being progesterone-receptor (PR) positiv or negativ.' },
{ 'name': 'her2', 'explanation': 'Result of either an IHC test or a FISH test. About the pathogenicity of the human epidermal growth factor receptor 2 (HER2).' },
{ 'name': 'ck14', 'explanation': 'About the pathogenicity of the tested cytokeratin-14 (CK14).' },
{ 'name': 'ck56', 'explanation': 'About the pathogenicity of the tested cytokeratin-5/6 (CK56).' }
];
$(document).ready(function () {
var parent_width = $('#pedigrees').parent().width();
var svg_width = (parent_width * 0.90);
var parent_height = $('#wrapper').parent().height();
var svg_height = (parent_height * 0.70);
var opts = {
'targetDiv': 'pedigrees',
'btn_target': 'demo_history',
'store_type': 'session',
'width': svg_width,
'height': svg_height,
'symbol_size': 50,
'background': 'white',
'diseases': $.extend(true, [], DEFAULT_DISEASES),
'additional_diseases': [],
'gene_tests': $.extend(true, [], DEFAULT_GENE_TESTS),
'additional_gene_tests': [],
'pathology_tests': $.extend(true, [], DEFAULT_PATHOLOGY_TESTS),
'DEBUG': (pedigree_util.urlParam('debug') === null ? false : true)
};
$('#opts').append(JSON.stringify(opts, null, 4));
var local_dataset = pedcache.current(opts);
if (local_dataset !== undefined && local_dataset !== null) {
opts.dataset = local_dataset;
}
// to reset diseases in case sth went wrong
//localStorage.diseases = JSON.stringify(DEFAULT_DISEASES);
//localStorage.additional_diseases = JSON.stringify([]);
var dis = localStorage.getItem('diseases');
var add_dis = localStorage.getItem('additional_diseases')
if (dis !== undefined && dis !== null) {
opts.diseases = JSON.parse(dis);
}
if (add_dis !== undefined && add_dis !== null) {
opts.additional_diseases = JSON.parse(add_dis);
}
var gen = localStorage.getItem('gene_tests');
var add_gen = localStorage.getItem('additional_gene_tests')
if (gen !== undefined && gen !== null) {
opts.gene_tests = JSON.parse(gen);
}
if (add_gen !== undefined && add_gen !== null) {
opts.additional_gene_tests = JSON.parse(add_gen);
}
opts = ptree.build(opts);
btn_setup(opts);
});
</script>
</head>
<body>
<h1>pedigreejs</h1>
<div id="wrapper">
<div id="buttons-area">
<label class="btn btn-default btn-file">
<input id="newPedigree" type="button" style="display: none;" />New
</label>
<label class="btn btn-default btn-file">
<input id="load" type="file" style="display: none;" />Load
</label>
<label class="btn btn-default btn-file">
<input id="save" type="button" style="display: none;" />Save
</label>
<br><br>
<label class="btn btn-default btn-file">
<input id="fh_edit_settings" type="button" style="display: none;" />Change Diseases
</label>
<label class="btn btn-default btn-file">
<input id="fh_edit_settings2" type="button" style="display: none;" />Configure Genes
</label>
<br><br>
<label class="btn btn-default btn-file">
<input id="saveBOADICEA" type="button" style="display: none;" />Export BOADICEA
</label>
<label class="btn btn-default btn-file">
<input id="print" type="button" style="display: none;" />Print
</label>
<label class="btn btn-default btn-file">
<input id="svg_download" type="button" style="display: none;" />SVG
</label>
<label class="btn btn-default btn-file">
<input id="png_download" type="button" style="display: none;" />PNG
</label>
</div>
<div id="content">
<div id='demo_history'></div>
<div id="pedigrees"></div>
</div>
</div>
<div id="node_properties"></div>
<div id="conganguity_info"></div>
<div id="fh_settings"></div>
<div id="fh_settings2"></div>
<div id="crash_msg"></div>
<div id="boadicea-error"></div>
<div id="reset_dialog" title="Confirmation Disease Reset"></div>
<div id="delete_dialog" title="Confirmation Delete Disease"></div>
</body>