-
Notifications
You must be signed in to change notification settings - Fork 0
/
raw-exp-data.html
217 lines (210 loc) · 10.5 KB
/
raw-exp-data.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
<link rel="import" href="bower_components/polymer/polymer.html">
<link rel="import" href="bower_components/iron-ajax/iron-ajax.html">
<dom-module id="raw-exp-data">
<template>
<link rel="stylesheet" href="https://www.ebi.ac.uk/pdbe/entry/static/css/ebi-core.min.css">
<link rel="stylesheet" href="https://www.ebi.ac.uk/pdbe/entry/static/bundle-pdbe-ui_head.min.css">
<style>
:host {
display: block;
}
.diffrn-thumbnail {
width: 150px;
max-width: 90%;
}
</style>
<template is="dom-if" if="{{dataExists(data, dataAlt, dataEm)}}">
<div class="panel-separator" style="height: 18px;"></div>
<div class="shortcuts">
<div class="clearfix hide_in_print">
<h3 class="pane-title">Experimental raw data</h3>
<div class="pane-content pdbe_quick_links">
<template is="dom-if" if="{{data.doi}}" style="padding-bottom: 15px;">
<div class="container_pdbe" style="padding:6px">
<p>Protein diffraction data related to PDB entry {{data.pdb_id}} found at the Integrated Resource for Reproducibility in Macromolecular Crystallography (IRRMC)</p>
<div class="grid_24">
<div class="grid_20">
<span>Data DOI:</span>
<a href="https://dx.doi.org/{{data.doi}}" target="_blank" data-icon="x">{{data.doi}}</a>
<a class="ext active" style="text-decoration:none;border:0;outline: 0;margin-left:5px" data-icon="x" href="https://dx.doi.org/{{data.doi}}" target="_blank" title="Go to IRRMC"></a>
</div>
</div>
<div class="grid_24">
<div class="grid_12">
<template is="dom-if" if="{{data.number_dataset}}">
<span>Number of sets:</span>
{{data.number_dataset}}
<br>
</template>
<template is="dom-if" if="{{data.total_size_gb}}">
<span>Total size:</span>
{{data.total_size_gb}}Gb
<br>
</template>
</div>
<template is="dom-if" if="{{data.thumbnail_url}}">
<div class="grid_12">
<a href="https://dx.doi.org/{{data.doi}}" target="_blank">
<img class="diffrn-thumbnail" src="https://{{data.thumbnail_url}}" alt="Protein diffraction thumbnail">
</a>
</div>
</template>
</div>
</div>
<hr>
</template>
<template is="dom-if" if="{{lengthCheck(dataAlt.datasets)}}">
<div class="container_pdbe" style="padding:6px">
<p>Protein diffraction data related to PDB entry {{data.pdb_id}} found at the SBGrid Data Bank</p>
<template is="dom-repeat" items="{{dataAlt.datasets}}">
<template is="dom-if" if="{{item.data_doi}}">
<div class="grid_24">
<div class="grid_20">
<span>Data DOI:</span>
<a href="{{item.landing_page}}" target="_blank">{{item.data_doi}}</a>
<a class="ext active" style="text-decoration:none;border:0;outline: 0;margin-left:5px" data-icon="x" href="{{item.landing_page}}" target="_blank" title="Go to SBGrid Data Bank"></a>
</div>
</div>
<div class="grid_24">
<div class="grid_12">
<template is="dom-if" if="{{item.storage_requirements}}">
<span>Total size:</span>
{{processSizeData(item.storage_requirements)}}Gb
<br>
</template>
</div>
<template is="dom-if" if="{{item.dataset_thumbnail_url}}">
<div class="grid_12">
<a href="{{item.landing_page}}" target="_blank">
<img class="diffrn-thumbnail" src="{{item.dataset_thumbnail_url}}" alt="Protein diffraction thumbnail">
</a>
</div>
</template>
</div>
</template>
</template>
</div>
<hr>
</template>
<template is="dom-if" if="{{lengthCheck(dataEm)}}">
<div class="container_pdbe" style="padding:6px">
<p>Electron microscopy data related to PDB entry {{data.pdb_id}} found at the Electron Microscopy Public Image Archive (EMPIAR)</p>
<template is="dom-repeat" items="{{dataEm}}">
<template is="dom-if" if="{{item.doi}}">
<div class="grid_24">
<div class="grid_20">
<span>Data DOI:</span>
<a href="https://dx.doi.org/{{item.doi}}" target="_blank">{{item.doi}}</a><a class="ext active" style="text-decoration:none;border:0;outline:0" data-icon="x" href="https://dx.doi.org/{{item.doi}}" target="_blank" title="Go to EMPIAR"></a>
</div>
</div>
<div class="grid_24" style="padding-bottom:15px;">
<div class="grid_12">
<template is="dom-if" if="{{item.total_size_gb}}">
<span>Number of datasets:</span>
{{item.number_dataset}}
<br>
</template>
<template is="dom-if" if="{{item.total_size_gb}}">
<span>Total size:</span>
{{item.total_size_gb}}Gb
<br>
</template>
</div>
<template is="dom-if" if="{{item.thumbnail_url}}">
<div class="grid_12">
<a href="https://dx.doi.org/{{item.doi}}" target="_blank">
<img class="diffrn-thumbnail" src="{{item.thumbnail_url}}" alt="EMPIAR thumbnail">
</a>
</div>
</template>
</div>
</template>
</template>
</div>
</template>
</div>
</div>
</div>
</template>
<iron-ajax
id="diffrn_data"
url="https://proteindiffraction.org/api/ebi/{{pdbid}}"
params='{"type":"all"}'
handle-as="json"
on-response="handleResponse">
</iron-ajax>
<iron-ajax
id="diffrn_data_alt"
url="https://data.sbgrid.org/api/pdbe/{{pdbid}}"
params='{"type":"all"}'
handle-as="json"
on-response="handleResponseAlt">
</iron-ajax>
<iron-ajax
id="em_data"
url="https://wwwdev.ebi.ac.uk/pdbe/emdb/empiar/api/pdb_ref/{{pdbid}}"
params='{"type":"all"}'
handle-as="json"
on-response="handleResponseEm">
</iron-ajax>
</template>
<script>
Polymer({
is: 'raw-exp-data',
properties: {
pdbid: String,
data: {
type: Object
},
dataAlt: {
type: Object
},
dataEm: {
type: Object
}
},
ready: function () {
this.pdbid = this.pdbid.toLowerCase();
this.$.diffrn_data.generateRequest();
this.$.diffrn_data_alt.generateRequest();
this.$.em_data.generateRequest();
},
handleResponse: function (data) {
this.data = data.detail.response;
},
handleResponseAlt: function (data) {
this.dataAlt = data.detail.response;
},
handleResponseEm: function (data) {
this.dataEm = data.detail.response;
},
dataExists: function (data, dataAlt, dataEm){
if (data || dataAlt || dataEm) {
if (data){
if (data.doi) {
return true
}
} else if (dataAlt) {
if (dataAlt.datasets.length > 0) {
return true
}
}
if (dataEm.length > 0){
return true
}
}
return false
},
lengthCheck: function(data) {
if (data.length > 0) {
return true
} else {
return false
}
},
processSizeData: function(data) {
return data.slice(0,data.indexOf("G"))
}
});
</script>
</dom-module>