genes.html 13.4 KB
Newer Older
Kenzo-Hugo Hillion's avatar
Kenzo-Hugo Hillion committed
1
<div class="genes">
2
3
4
  <template v-for="(item, index) in downloadAlerts">
    <v-alert
      :value="item.value"
5
      :type="item.type"
6
7
8
9
10
11
12
      icon="fas fa-download"
      transition="slide-y-transition"
    >
      <v-layout align-center>
        <v-spacer/>
        {{ item.text }}
        <v-spacer/>
13
        <v-flex md8>  
14
          <v-progress-linear
15
            v-if="item.progressBar"
16
17
18
19
20
21
            indeterminate
            height="2"
            color="primary"
          ></v-progress-linear>
        </v-flex>
        <v-spacer/>
22
      </v-layout>
23
24
    </v-alert>
  </template>
25
  <v-layout row wrap>
Kenzo-Hugo Hillion's avatar
Kenzo-Hugo Hillion committed
26
    <v-flex xs12>
27
      <v-toolbar
Kenzo-Hugo Hillion's avatar
Kenzo-Hugo Hillion committed
28
        class="secondary darken-1 white--text"
29
30
31
32
33
34
35
36
37
38
      >
      <v-icon class="white--text">format_list_bulleted</v-icon>
      <v-toolbar-title>Catalog content</v-toolbar-title>
      <v-text-field
        label="Search gene"
        solo
        class="mx-4 mt-2"
        flat
        append-icon="search"
        v-model="searchGeneName"
39
        v-on:keyup.enter.native="runNewSearch"
40
41
42
      ></v-text-field>
      </v-toolbar>
      <!-- Filters -->
43
      <v-expansion-panel v-model="showFilters" expand>
44
45
46
47
      <v-expansion-panel-content class="grey lighten-2">
        <template v-slot:header>
        <div>Show Filters</div>
        </template>
48
        <v-card class="grey lighten-2">
49
          <v-container fluid grid-list-md class="px-2 pt-0 pb-1">
50
            <v-layout row wrap justify-end>
51
              <v-flex md12 class="pt-0">
52
53
                <!-- Gene Information -->
                <v-toolbar dense flat dark class="primary lighten-3">
54
                  <v-icon>format_list_bulleted</v-icon>
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
                  <v-toolbar-title>
                    Gene information
                  </v-toolbar-title>
                  <v-spacer></v-spacer>
                  <v-btn icon @click="emptyGeneInformationFilter">
                    <v-icon>far fa-trash-alt</v-icon>
                  </v-btn>
                </v-toolbar>
                <v-card class="grey lighten-4">
                  <v-container fluid >
                    <v-layout wrap>
                      <!-- Gene source -->
                      <v-flex xs12 sm6 md4 lg2>
                        <v-select
                          :items="geneSources"
                          v-model="geneSource"
                          label="Gene source"
72
                          @input="getTaxoPresenceOptional"
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
                        ></v-select>
                      </v-flex>
                      <v-spacer></v-spacer>
                      <!-- Gene length -->
                      <v-flex xs12 sm6 md4 lg2>
                        <v-switch
                          v-model="filterGeneLength"
                          label="Filter on gene length"
                          color="secondary lighten-1"
                        ></v-switch>
                      </v-flex>
                      <v-spacer></v-spacer>
                      <v-flex lg6>
                        <v-layout>
                          <v-flex
                            shrink
                            style="width: 60px"
                            v-if="filterGeneLength"
                          >
                            <v-text-field
                              v-model="geneLengthFilterRange[0]"
                              class="mt-0"
                              hide-details
                              single-line
                              type="number"
                            ></v-text-field>
                          </v-flex>
                          <v-flex class="mx-4" v-if="filterGeneLength">
                            <v-range-slider
                              v-model="geneLengthFilterRange"
                              color="secondary lighten-1"
                              :max="maxGeneLength"
                              :min="minGeneLength"
                            ></v-range-slider>
                          </v-flex>
                          <v-flex
                            shrink
                            style="width: 60px"
                            v-if="filterGeneLength"
                          >
                            <v-text-field
                              v-model="geneLengthFilterRange[1]"
                              class="mt-0"
                              hide-details
                              single-line
                              type="number"
                            ></v-text-field>
                          </v-flex>
                        </v-layout>
                      </v-flex>
                    </v-layout>
                  </v-container>
                </v-card>
              </v-flex>
              <v-flex xs12 md6>
                <!-- Taxonomy -->
                <v-toolbar dense flat dark class="taxonomy lighten-3">
130
                  <v-icon>fa-sitemap</v-icon>
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
                  <v-toolbar-title>
                    Taxonomy
                  </v-toolbar-title>
                  <v-spacer></v-spacer>
                  <v-btn icon @click="emptyTaxonomyFilter">
                    <v-icon>far fa-trash-alt</v-icon>
                  </v-btn>
                </v-toolbar>
                <v-card class="grey lighten-4">
                  <v-container
                    fluid
                    grid-list-md
                  >
                    <v-layout>
                      <!-- Taxonomy ranks -->
146
                      <v-flex sm12 md5 lg4 d-flex>
147
148
149
150
151
152
153
                        <v-select
                          :items="taxLevels"
                          v-model="taxLevel"
                          label="Taxonomy level"
                          @input="getTaxoPresence"
                        ></v-select>
                      </v-flex>
154
155
                      <v-icon v-if="taxLevel" :color="taxLevel" class="mt-4 mx-3">fas fa-angle-double-right</v-icon>
                      <v-flex sm12 md5 lg4 d-flex v-if="taxLevel">
156
157
158
159
160
161
162
163
164
165
166
167
168
                        <v-select
                          :items="taxChoices"
                          v-model="taxChoice"
                          label="Taxonomy"
                        ></v-select>
                      </v-flex>
                    </v-layout>
                  </v-container>
                </v-card>
              </v-flex>
              <v-flex xs12 md6>
                <!-- Function -->
                <v-toolbar dense flat dark class="function">
169
                  <v-icon>fa-braille</v-icon>
170
171
172
173
174
175
176
177
178
179
180
181
182
183
                  <v-toolbar-title>
                    Function
                  </v-toolbar-title>
                  <v-spacer></v-spacer>
                  <v-btn icon @click="emptyFunctionFilter">
                    <v-icon>far fa-trash-alt</v-icon>
                  </v-btn>
                </v-toolbar>
                <v-card class="grey lighten-4">
                  <v-container
                    fluid
                    grid-list-md
                  >
                    <v-layout>
184
185
186
187
188
189
190
191

                      <v-flex sm12 md8 lg6 d-flex>
                        <v-switch
                          v-model="filterWithFunction"
                          label="Functional annotation"
                          color="secondary lighten-1"
                        ></v-switch>
                      </v-flex>
192
                      <!-- Source choice -->
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
                      <v-flex sm12 md8 lg6 d-flex>
                        <v-text-field
                          label="Enter KEGG KO of EggNOG ID"
                          v-model="functionID"
                        ></v-text-field>
                      </v-flex>
                    </v-layout>
                  </v-container>
                </v-card>
              </v-flex>
            </v-layout>
            <v-layout row wrap justify-end>
              <v-btn
                color="deep-orange lighten-1 white--text"
                @click="emptyFilters"
              >
                Clear all
              </v-btn>
              <v-btn
212
                color="secondary lighten-1"
213
                @click="runNewSearch"
214
215
216
217
218
              >
                Apply<v-icon right>far fa-check-square</v-icon>
              </v-btn>
            </v-layout>
          </v-container>
Kenzo-Hugo Hillion's avatar
Kenzo-Hugo Hillion committed
219
        </v-card>
220
221
      </v-expansion-panel-content>
      </v-expansion-panel>
222
223
224
225
226
227
228
229
230
231
      <!-- Table : Alert for backend error -->
      <v-alert
        v-if="listGenesError"
        :value="listGenesError"
        type="warning"
      >
        <v-layout align-center>
          Could not retrieve gene list from the server.
        </v-layout>
      </v-alert>
232
      <!-- Downloads -->
233
234
235
236
237
238
239
240
241
      <v-card flat id="tablegenes" v-if="!loadTable">
        <v-speed-dial
          v-model="fab"
          top
          :right="downloadRight"
          :left="downloadLeft"
          :direction="downloadOpen"
          transition="scale-transition"
          v-if="showDownloads"
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
          <template v-slot:activator>
            <v-tooltip bottom>
              <template v-slot:activator="{ on }">
                <v-btn
                  :loading="loadingDownloads"
                  v-model="fab"
                  color="secondary"
                  fab
                  small
                  class="pt-2"
                  v-on="on"
                >
                  <v-icon>fas fa-download</v-icon>
                  <v-icon>close</v-icon>
                </v-btn>
              </template>
              <span>Downloads</span>
            </v-tooltip>
          </template>
          <!-- FASTA file -->
          <v-tooltip bottom>
            <template v-slot:activator="{ on }">
              <v-btn
                fab
                small
                :loading="loadingFastaDownload"
                :disabled="loadingFastaDownload"
                color="primary lighten-3"
                @click="downloadFasta"
                v-on="on"
              >
                .FA
              </v-btn>
            </template>
            <span>Download sequences (.fasta)</span>
          </v-tooltip>
          <!-- CSV -->
          <v-tooltip bottom>
            <template v-slot:activator="{ on }">
              <v-btn
                fab
                small
285
286
                :loading="loadingCSVDownload"
                :disabled="loadingCSVDownload"
287
                color="primary lighten-3"
288
                @click="downloadMetadataCSV"
289
290
291
292
293
294
295
296
                v-on="on"
              >
                .CSV
              </v-btn>
            </template>
            <span>Download metadata (.csv)</span>
          </v-tooltip>
        </v-speed-dial>
297
        <!-- Table -->
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
        <v-list>
          <v-data-table
            :rows-per-page-items="rowsPerPageItems"
            :pagination.sync="pagination"
            :headers="headers"
            :items="genes"
            hide-actions
          >
            <template v-slot:items="props">
            <td>
              <router-link :to="/gene-detail/ + props.item.gene_id">{{ props.item.gene_id }}</router-link>
            </td>
            <td>{{ props.item.name }}</td>
            <td class="text-xs">{{ props.item.length }}</td>
            <td class="text-xs">
              {{ props.item.taxonomy }}
              <v-btn :href="props.item.tax_url" icon flat small target="_blank" class="taxonomy--text mt-1 ml-0" v-if="props.item.taxonomy">
315
316
317
318
              <v-icon small>
                open_in_new
              </v-icon>
              </v-btn>
319
320
321
322
323
            </td>
            <td class="text-xs">
              <template v-for="(kegg_item, kegg_index) in props.item.keggs">
                {{ kegg_item.kegg_id }}
                <v-btn :href="kegg_item.kegg_url" icon flat small target="_blank" class="kegg--text mt-1 ml-0" v-if="kegg_item.kegg_id">
324
325
326
                  <v-icon small>
                    open_in_new
                  </v-icon>
327
328
329
330
331
332
                </v-btn>
              </template>
            </td>
            <td class="text-xs">
              <template v-for="(eggnog_item, eggnog_index) in props.item.eggnogs">
                {{ eggnog_item.eggnog_id }}
333
334
335
336
337
                <v-btn :href="eggnog_item.eggnog_url" icon flat small target="_blank" class="eggnog--text mt-1 ml-0" v-if="eggnog_item.eggnog_url">
                  <v-icon small>
                    open_in_new
                  </v-icon>
                </v-btn>
338
339
              </template>
            </td>
340
341
342
343
344
345
346
347
            <td class="text-xs">
              {{ props.item.source }}
              <v-btn :href="props.item.source_url" icon flat small target="_blank" class="secondary--text mt-1 ml-0" v-if="props.item.source">
              <v-icon small>
                open_in_new
              </v-icon>
              </v-btn>
            </td>
348
            </template>
349
350
351
          </v-data-table>
        </v-list>
      </v-card>
352
      <!-- Loading bar -->
353
      <v-card class="text-xs-center" v-if="!requestDone">
354
355
356
357
358
        <v-progress-linear
          indeterminate
          height="4"
          color="secondary"
        ></v-progress-linear>
359
      </v-card>
360
      <v-card flat>
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
        <div class="text-xs-center" v-if="count">
          <v-pagination
            v-model="pageNumber"
            :length="pageTotalNumber"
            :total-visible="7"
            @input="getGenes"
          ></v-pagination>
        </div>
        <v-subheader>
          {{count}} genes found
          <v-spacer></v-spacer>
          <span v-if="tooManyPages" class="font-italic font-weight-light">
            Too many pages to be displayed (limited to {{maxNumberPages}}). You may want to apply filters to reduce pages number.
          </span>
        </v-subheader>
376
      </v-card>
Kenzo-Hugo Hillion's avatar
Kenzo-Hugo Hillion committed
377
    </v-flex>
378
  </v-layout>
Kenzo-Hugo Hillion's avatar
Kenzo-Hugo Hillion committed
379
</div>