forked from project-gemmi/pdb-stats
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcod-tags.html
223 lines (206 loc) · 5.96 KB
/
cod-tags.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
<!DOCTYPE html>
<html lang="en">
<head>
<title>COD Tags</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="theme-color" content="#f0e0d0">
<style>
html { margin: 0 auto; overflow-y: scroll; color: #3b4044;
background-color: #ddc; }
body { font: 13px sans-serif; line-height: 150%; margin: 0; }
h1 { text-align: center; font-size: 30px; font-weight: normal; }
h2 { text-align: center; font-size: 20px; margin-top: 40px; }
a { text-decoration: none; border-bottom: 1px dashed; color: #24a; }
#footnote { font-size: 12px; text-align: center; padding: 30px 0; }
table { width: 100%; border-collapse: collapse; background-color: #f8f8f8; }
table, th, td { border: 1px solid #888; }
table { box-shadow: 2px 2px 4px rgba(0,0,0,0.20); }
th, td { padding: 6px; }
table th { background: #eee; }
td { text-align: right; }
td:first-child, td:last-child { text-align: left; }
code { background: #68A; color: #fff; font: 12px sans-serif; padding: 0 1px;
margin-bottom: 4px; }
@media only screen and (max-width: 950px) { html { margin: 0; } }
nav { font-size: 16px; margin: 30px; }
nav a { margin-left: 15px; }
/* tablesort.css */
th[role=columnheader]:not(.no-sort) {
cursor: pointer;
}
th[role=columnheader]:not(.no-sort):after {
content: '';
float: right;
margin-top: 7px;
border-width: 0 4px 4px;
border-style: solid;
border-color: #404040 transparent;
visibility: hidden;
opacity: 0;
-ms-user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
th[aria-sort=ascending]:not(.no-sort):after {
border-bottom: none;
border-width: 4px 4px 0;
}
th[aria-sort]:not(.no-sort):after {
visibility: visible;
opacity: 0.4;
}
th[role=columnheader]:not(.no-sort):hover:after {
visibility: visible;
opacity: 1;
}
span[eg] {
position: relative;
}
span[eg]:hover:after {
content: "e.g.\00a0" attr(eg);
display: block;
z-index: 10;
background-color: rgba(255,255,204,0.8); /*#ffc*/
padding: 0 3px;
border: 1px solid rgba(238,238,170,0.8); /*#eea*/
position: absolute;
top: -100%;
left: 10%;
}
code[full] {
position: relative;
white-space: nowrap;
}
code[full]:hover:after {
content: attr(full);
display: block;
z-index: 8;
background-color: #68A;
padding: 0 1px 2px;
position: absolute;
top: 0;
left: 0;
white-space: normal;
}
</style>
</head>
<body>
<h1>Crystallography Open Database CIF Tags</h1>
<nav id="nav">
Jump to:
<a href="#coor">CIF Files</a>
<a href="#sf">HKL Files</a>
</nav>
<h2 id="coor">CIF Files</h2>
<table id="coor-table">
<thead>
<tr data-sort-method='thead'>
<th rowspan="2" aria-sort="ascending">Tag</th>
<th rowspan="2" data-sort-method="number">in %</th>
<th data-sort-method="number">min</th>
<th data-sort-method="number">avg</th>
<th data-sort-method="number">max</th>
<th rowspan="2" data-sort-method="none" class="no-sort">values</th>
</tr>
<tr>
<th colspan="3">values per block</th>
</tr>
</thead>
</table>
<h2 id="sf">HKL Files</h2>
<table id="sf-table">
<thead>
<tr data-sort-method='thead'>
<th rowspan="2" aria-sort="ascending">Tag</th>
<th rowspan="2" data-sort-method="number">in %</th>
<th data-sort-method="number">min</th>
<th data-sort-method="number">avg</th>
<th data-sort-method="number">max</th>
<th rowspan="2" data-sort-method="none" class="no-sort">values</th>
</tr>
<tr>
<th colspan="3">values per block</th>
</tr>
</thead>
</table>
<div id="footnote">
This is part of the
<a href="https://project-gemmi.github.io/">project GEMMI</a>.
Uses <a href="https://d3js.org/">d3.js</a>
and <a href="http://tristen.ca/tablesort/demo/">tablesort</a>.
Data was extracted from the COD on 2021-04-23.
<p><b><a href="https://github.com/project-gemmi/pdb-stats">
Source code and info...</a></b>
</div>
<!--script src="https://d3js.org/d3.v4.min.js"></script-->
<script src="js/d3-collection.v1.min.js"></script>
<script src="js/d3-dispatch.v1.min.js"></script>
<script src="js/d3-dsv.v1.min.js"></script>
<script src="js/d3-request.v1.min.js"></script>
<script src="js/d3-selection.v1.min.js"></script>
<script src="js/tablesort.min.js"></script>
<script>
"use strict";
function wrap_value(value) {
if (value.length <= 40) {
return '<code>' + value + '</code>';
}
return '<code full="' + value + '">' + value.substring(0, 30) + '…</code>';
}
function tr_html(d) {
var row = '<td>' + d[0] + '</td><td>' + d[1] + '</td><td>' +
d[2] + '</td><td>' + d[3] + '</td><td>' + d[4] + '</td><td>';
var i = 4;
var sum = 0;
while (++i < d.length) {
var g = d[i];
if (g[0] == '/') {
row += ' ☞ ' + g.substring(1) + ' distinct values ' + '(';
break;
}
var s1 = g.indexOf(' ');
var s2 = g.indexOf(' ', s1+1);
var count_str = g.substring(0, s1);
row += '<span eg="' + g.substring(s1+1, s2) + '">' + count_str + '×';
sum += +count_str;
var value = g.substring(s2+1);
if (value[0] === '{') {
row += value;
} else {
row += wrap_value(value);
}
row += '</span> ';
}
if (i < d.length) { // previous loop exited through break
while (++i < d.length) {
var g = d[i];
var s1 = g.indexOf(' ');
var s2 = g.indexOf(' ', s1+1);
var pct = +g.substring(0, s1) * (100 / sum);
row += ('<span eg="' + g.substring(s1+1, s2) + '">' +
pct.toFixed(pct > 1 && pct < 99 ? 1 : 2) + '% ' +
wrap_value(g.substring(s2+1)) + '</span>, ');
}
row += '…)';
}
return row + '</td>';
}
function add_content(text, elem_id) {
var data = d3.tsvParseRows(text);
var elem = document.getElementById(elem_id);
var tbody = d3.select(elem).append('tbody');
tbody.selectAll('tr').data(data).enter().append('tr').html(tr_html);
new Tablesort(elem);
}
d3.text('cod-cif-tags.tsv', function(text) {
add_content(text, 'coor-table');
});
d3.text('cod-hkl-tags.tsv', function(text) {
add_content(text, 'sf-table');
});
</script>
</body>
</html>
<!-- vim: set et ts=2 sw=2: -->