gramene-search 1.6.46 → 1.6.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,13 +1,16 @@
1
1
  require("./index.css");
2
+ var $gXNCa$reactjsxruntime = require("react/jsx-runtime");
3
+ var $gXNCa$react = require("react");
4
+ var $gXNCa$reduxbundlerreact = require("redux-bundler-react");
5
+ var $gXNCa$aggridreact = require("ag-grid-react");
6
+ require("ag-grid-community/styles/ag-grid.css");
7
+ require("ag-grid-community/styles/ag-theme-quartz.css");
2
8
  var $gXNCa$reduxbundler = require("redux-bundler");
3
9
  var $gXNCa$lodash = require("lodash");
4
10
  var $gXNCa$gramenebinsclient = require("gramene-bins-client");
5
11
  var $gXNCa$gramenetreesclient = require("gramene-trees-client");
6
12
  var $gXNCa$gramenetaxonomywithgenomes = require("gramene-taxonomy-with-genomes");
7
13
  var $gXNCa$reactga4 = require("react-ga4");
8
- var $gXNCa$reactjsxruntime = require("react/jsx-runtime");
9
- var $gXNCa$reduxbundlerreact = require("redux-bundler-react");
10
- var $gXNCa$react = require("react");
11
14
  var $gXNCa$reactbootstrap = require("react-bootstrap");
12
15
  var $gXNCa$reactswitch = require("react-switch");
13
16
  var $gXNCa$reacticonsio5 = require("react-icons/io5");
@@ -22,9 +25,6 @@ var $gXNCa$lodashget = require("lodash/get");
22
25
  var $gXNCa$lodashisEqual = require("lodash/isEqual");
23
26
  var $gXNCa$flattonested = require("flat-to-nested");
24
27
  var $gXNCa$reactsimpletreemenu = require("react-simple-tree-menu");
25
- var $gXNCa$aggridreact = require("ag-grid-react");
26
- require("ag-grid-community/styles/ag-grid.css");
27
- require("ag-grid-community/styles/ag-theme-quartz.css");
28
28
  require("@fortawesome/fontawesome-free/css/all.min.css");
29
29
  var $gXNCa$gramenedbxrefs = require("gramene-dbxrefs");
30
30
  var $gXNCa$reacticonsai = require("react-icons/ai");
@@ -33,6 +33,10 @@ var $gXNCa$numeral = require("numeral");
33
33
  var $gXNCa$firebaseauth = require("firebase/auth");
34
34
 
35
35
 
36
+ function $parcel$defineInteropFlag(a) {
37
+ Object.defineProperty(a, '__esModule', {value: true, configurable: true});
38
+ }
39
+
36
40
  function $parcel$export(e, n, v, s) {
37
41
  Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
38
42
  }
@@ -74,8 +78,133 @@ if (parcelRequire == null) {
74
78
  }
75
79
 
76
80
  var parcelRegister = parcelRequire.register;
77
- parcelRegister("7u0Mi", function(module, exports) {
78
- module.exports = Promise.resolve(require("./Study.826d318c.js")).then(()=>parcelRequire('7zuJ6'));
81
+ parcelRegister("7zuJ6", function(module, exports) {
82
+
83
+ $parcel$defineInteropFlag(module.exports);
84
+
85
+ $parcel$export(module.exports, "default", () => $5833a2eeefc77457$export$2e2bcd8739ae039);
86
+
87
+
88
+
89
+
90
+
91
+
92
+ const $5833a2eeefc77457$var$metaRenderer = (params)=>{
93
+ if (params.value.ontology) return /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("a", {
94
+ href: `http://purl.obolibrary.org/obo/${params.value.id.replace(":", "_")}`,
95
+ target: "_blank",
96
+ children: params.value.label
97
+ });
98
+ return params.value.label;
99
+ };
100
+ const $5833a2eeefc77457$var$sampleRenderer = (params)=>{
101
+ const sampleMeta = params.value;
102
+ return /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)("label", {
103
+ children: [
104
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("input", {
105
+ type: "checkbox",
106
+ checked: params.desiredSamples.hasOwnProperty(sampleMeta._id),
107
+ onChange: ()=>params.doToggleExpressionSample(sampleMeta._id)
108
+ }),
109
+ "\xa0",
110
+ sampleMeta.experiment,
111
+ "-",
112
+ sampleMeta.group
113
+ ]
114
+ });
115
+ // return JSON.stringify(sampleMeta,null,2);
116
+ };
117
+ const $5833a2eeefc77457$var$connectedSampleRenderer = (0, $gXNCa$reduxbundlerreact.connect)('selectDesiredSamples', 'doToggleExpressionSample', $5833a2eeefc77457$var$sampleRenderer);
118
+ const $5833a2eeefc77457$var$Study = (props)=>{
119
+ let samples = props.expressionSamples[props.id];
120
+ let sampleMetadata = [];
121
+ let metadataFields = [
122
+ {
123
+ field: "sampleId",
124
+ cellRenderer: $5833a2eeefc77457$var$connectedSampleRenderer
125
+ }
126
+ ];
127
+ let isFactor = {};
128
+ samples.forEach((sample, idx)=>{
129
+ if (idx === 0) {
130
+ let factors = {
131
+ headerName: 'Experimental Variables',
132
+ children: []
133
+ };
134
+ sample.factor.forEach((factor)=>{
135
+ factors.children.push({
136
+ field: factor.type,
137
+ cellRenderer: $5833a2eeefc77457$var$metaRenderer
138
+ });
139
+ isFactor[factor.type] = true;
140
+ });
141
+ metadataFields.push(factors);
142
+ let characteristics = {
143
+ headerName: 'Sample Characteristics',
144
+ children: []
145
+ };
146
+ sample.characteristic.forEach((ch)=>{
147
+ if (!isFactor[ch.type]) characteristics.children.push({
148
+ field: ch.type,
149
+ cellRenderer: $5833a2eeefc77457$var$metaRenderer
150
+ });
151
+ });
152
+ metadataFields.push(characteristics);
153
+ }
154
+ let s_info = {
155
+ sampleId: sample
156
+ };
157
+ sample.factor.forEach((factor)=>{
158
+ s_info[factor.type] = {
159
+ label: factor.label
160
+ };
161
+ if (factor.ontology) {
162
+ s_info[factor.type]['ontology'] = factor.ontology;
163
+ s_info[factor.type]['id'] = factor.id;
164
+ }
165
+ });
166
+ sample.characteristic.forEach((ch)=>{
167
+ s_info[ch.type] = {
168
+ label: ch.label
169
+ };
170
+ if (ch.ontology) {
171
+ s_info[ch.type]['ontology'] = ch.ontology;
172
+ s_info[ch.type]['id'] = ch.id;
173
+ }
174
+ });
175
+ sampleMetadata.push(s_info);
176
+ });
177
+ const [rowData, setRowData] = (0, $gXNCa$react.useState)(sampleMetadata);
178
+ const [colDefs, setColDefs] = (0, $gXNCa$react.useState)(metadataFields);
179
+ const defaultColDef = (0, $gXNCa$react.useMemo)(()=>{
180
+ return {
181
+ filter: true
182
+ };
183
+ }, []);
184
+ return /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)("div", {
185
+ children: [
186
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("div", {
187
+ className: "ag-theme-quartz",
188
+ style: {
189
+ height: `${44 * (samples.length + 2)}px`
190
+ },
191
+ children: /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)((0, $gXNCa$aggridreact.AgGridReact), {
192
+ rowData: rowData,
193
+ columnDefs: colDefs,
194
+ defaultColDef: defaultColDef
195
+ })
196
+ }),
197
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)("a", {
198
+ href: `https://www.ebi.ac.uk/gxa/experiments/${props.id}`,
199
+ children: [
200
+ "EBI Atlas Experiment: ",
201
+ props.id
202
+ ]
203
+ })
204
+ ]
205
+ });
206
+ };
207
+ var $5833a2eeefc77457$export$2e2bcd8739ae039 = (0, $gXNCa$reduxbundlerreact.connect)('selectExpressionSamples', $5833a2eeefc77457$var$Study);
79
208
 
80
209
  });
81
210
 
@@ -95,10 +224,11 @@ $parcel$export(module.exports, "Views", () => $693dd8c7a5607c3a$export$5cb791131
95
224
 
96
225
  const $9d9aeaf9299e61a1$var$facets = [
97
226
  "{!facet.limit='300' facet.mincount='1' key='taxon_id'}taxon_id",
98
- "{!facet.limit='100' facet.mincount='1' key='genetree'}gene_tree",
99
- "{!facet.limit='100' facet.mincount='1' key='pathways'}pathways__ancestors",
100
- "{!facet.limit='100' facet.mincount='1' key='domains'}domain_roots",
101
- "{!facet.limit='-1' facet.mincount='1' key='fixed_1000__bin'}fixed_1000__bin"
227
+ // "{!facet.limit='100' facet.mincount='1' key='genetree'}gene_tree",
228
+ // "{!facet.limit='100' facet.mincount='1' key='pathways'}pathways__ancestors",
229
+ // "{!facet.limit='100' facet.mincount='1' key='domains'}domain_roots",
230
+ "{!facet.limit='-1' facet.mincount='1' key='fixed_1000__bin'}fixed_1000__bin",
231
+ "{!facet.limit='100' facet.mincount='0' key='AED' type='range' start=0 end=1.0 gap=0.01}MAKER__AED__attr_f"
102
232
  ];
103
233
  const $9d9aeaf9299e61a1$var$genomesOfInterest = '(taxon_id:2769) OR (taxon_id:3055) OR (taxon_id:3218) OR (taxon_id:3702) OR (taxon_id:3847) OR (taxon_id:4555) OR (taxon_id:4558) OR (taxon_id:4577) OR (taxon_id:13333) OR (taxon_id:15368) OR (taxon_id:29760) OR (taxon_id:39947) OR (taxon_id:55577) OR (taxon_id:88036) OR (taxon_id:214687)';
104
234
  const $9d9aeaf9299e61a1$var$sites = [
@@ -314,138 +444,80 @@ $9d9aeaf9299e61a1$var$grameneGermplasm.reactGrameneGermplasm = (0, $gXNCa$reduxb
314
444
  // }
315
445
  // }
316
446
  // );
317
- const $9d9aeaf9299e61a1$var$attribFacetFields = [
318
- "{!facet.limit='10' facet.mincount='1' key='age'}panset_age_attr_s",
319
- "{!facet.limit='100' facet.mincount='1' key='taxa'}panset_ntaxa_attr_i",
320
- "{!facet.limit='100' facet.mincount='1' key='AED' type='range' start=0 end=1.0 gap=0.25}MAKER_AED_attr_f",
321
- "{!facet.limit='100' facet.mincount='1' key='QI2' type='range' start=0 end=1.0 gap=0.25}MAKER_QI2_attr_f",
322
- "{!facet.limit='100' facet.mincount='1' key='QI3' type='range' start=0 end=1.0 gap=0.25}MAKER_QI3_attr_f",
323
- "{!facet.limit='100' facet.mincount='1' key='QI4' type='range' start=0 end=1.0 gap=0.25}MAKER_QI4_attr_f",
324
- "{!facet.limit='100' facet.mincount='1' key='QI5' type='range' start=0 end=1.0 gap=0.25}MAKER_QI5_attr_f",
325
- "{!facet.limit='100' facet.mincount='1' key='QI6' type='range' start=0 end=1.0 gap=0.25}MAKER_QI6_attr_f"
447
+ const $9d9aeaf9299e61a1$var$MAKERAttribs = [
448
+ 'MAKER__AED__attr_f',
449
+ 'MAKER__QI1__attr_i',
450
+ 'MAKER__QI2__attr_f',
451
+ 'MAKER__QI3__attr_f',
452
+ 'MAKER__QI4__attr_f',
453
+ 'MAKER__QI5__attr_f',
454
+ 'MAKER__QI6__attr_f',
455
+ 'MAKER__QI7__attr_i',
456
+ 'MAKER__QI8__attr_i',
457
+ 'MAKER__QI9__attr_i'
326
458
  ];
327
- const $9d9aeaf9299e61a1$var$attribFacets = {
328
- "age": {
329
- "type": "terms",
330
- "field": "panset_age_attr_s"
331
- },
332
- "nTaxa": {
333
- "type": "terms",
334
- "field": "panset_ntaxa_attr_i",
335
- "limit": 100
336
- },
337
- "AED": {
338
- "type": "range",
339
- "field": "MAKER_AED_attr_f",
340
- "start": 0.0,
341
- "end": 1.0,
342
- "gap": 0.25
343
- },
344
- "QI2": {
345
- "type": "range",
346
- "field": "MAKER_QI2_attr_f",
347
- "start": 0.0,
348
- "end": 1.0,
349
- "gap": 0.25
350
- },
351
- "QI3": {
352
- "type": "range",
353
- "field": "MAKER_QI3_attr_f",
354
- "start": 0.0,
355
- "end": 1.0,
356
- "gap": 0.25
357
- },
358
- "QI4": {
359
- "type": "range",
360
- "field": "MAKER_QI4_attr_f",
361
- "start": 0.0,
362
- "end": 1.0,
363
- "gap": 0.25
364
- },
365
- "QI5": {
366
- "type": "range",
367
- "field": "MAKER_QI5_attr_f",
368
- "start": 0.0,
369
- "end": 1.0,
370
- "gap": 0.25
371
- },
372
- "QI6": {
373
- "type": "range",
374
- "field": "MAKER_QI6_attr_f",
375
- "start": 0.0,
376
- "end": 1.0,
377
- "gap": 0.25
378
- },
379
- "byAge": {
380
- "type": "terms",
381
- "field": "panset_age_attr_s",
382
- "facet": {
383
- "nTaxa": {
384
- "type": "terms",
385
- "field": "panset_ntaxa_attr_i",
386
- "limit": 100
387
- },
388
- "AED": {
389
- "type": "range",
390
- "field": "MAKER_AED_attr_f",
391
- "start": 0.0,
392
- "end": 1.0,
393
- "gap": 0.25
394
- },
395
- "QI2": {
396
- "type": "range",
397
- "field": "MAKER_QI2_attr_f",
398
- "start": 0.0,
399
- "end": 1.0,
400
- "gap": 0.25
401
- },
402
- "QI3": {
403
- "type": "range",
404
- "field": "MAKER_QI3_attr_f",
405
- "start": 0.0,
406
- "end": 1.0,
407
- "gap": 0.25
408
- },
409
- "QI4": {
410
- "type": "range",
411
- "field": "MAKER_QI4_attr_f",
412
- "start": 0.0,
413
- "end": 1.0,
414
- "gap": 0.25
415
- },
416
- "QI5": {
417
- "type": "range",
418
- "field": "MAKER_QI5_attr_f",
419
- "start": 0.0,
420
- "end": 1.0,
421
- "gap": 0.25
422
- },
423
- "QI6": {
424
- "type": "range",
425
- "field": "MAKER_QI6_attr_f",
426
- "start": 0.0,
427
- "end": 1.0,
428
- "gap": 0.25
429
- }
459
+ const $9d9aeaf9299e61a1$var$geneAttribs = {
460
+ "MAKER transcript metrics": [
461
+ {
462
+ name: "AED",
463
+ description: "Annotation Edit Distance",
464
+ dtype: "f",
465
+ fieldName: "MAKER__AED__attr_f"
466
+ },
467
+ {
468
+ name: "QI1",
469
+ description: "Length of the 5' UTR",
470
+ dtype: "i",
471
+ fieldName: "MAKER__QI1__attr_i"
472
+ },
473
+ {
474
+ name: "QI2",
475
+ description: "Fraction of splice sites confirmed by an EST alignment",
476
+ dtype: "f",
477
+ fieldName: "MAKER__QI2__attr_f"
478
+ },
479
+ {
480
+ name: "QI3",
481
+ description: "Fraction of exons that overlap an EST alignment",
482
+ dtype: "f",
483
+ fieldName: "MAKER__QI3__attr_f"
484
+ },
485
+ {
486
+ name: "QI4",
487
+ description: "Fraction of exons that overlap EST or Protein alignments",
488
+ dtype: "f",
489
+ fieldName: "MAKER__QI4__attr_f"
490
+ },
491
+ // { name: "QI5", description: "Fraction of splice sites confirmed by a SNAP prediction", dtype: "f", fieldName: "MAKER__QI5__attr_f" },
492
+ // { name: "QI6", description: "Fraction of exons that overlap a SNAP prediction", dtype: "f", fieldName: "MAKER__QI6__attr_f" },
493
+ {
494
+ name: "QI7",
495
+ description: "Number of exons in the mRNA",
496
+ dtype: "i",
497
+ fieldName: "MAKER__QI7__attr_i"
498
+ },
499
+ {
500
+ name: "QI8",
501
+ description: "Length of the 3' UTR",
502
+ dtype: "i",
503
+ fieldName: "MAKER__QI8__attr_i"
504
+ },
505
+ {
506
+ name: "QI9",
507
+ description: "Length of the protein sequence produced by the mRNA",
508
+ dtype: "i",
509
+ fieldName: "MAKER__QI9__attr_i"
430
510
  }
431
- }
511
+ ]
432
512
  };
513
+ const $9d9aeaf9299e61a1$var$statsFields = $9d9aeaf9299e61a1$var$geneAttribs['MAKER transcript metrics'].map(// (f) => `stats.field={!min=true max=true count=true mean=true stddev=true percentiles='20,40,60,80,90,95,99'}${f}`
514
+ (f)=>`stats.field={!min=true max=true count=true mean=true stddev=true percentiles='10,20,30,40,50,60,70,80,90,99.99'}${f.fieldName}`);
433
515
  const $9d9aeaf9299e61a1$var$grameneGeneAttribs = (0, $gXNCa$reduxbundler.createAsyncResourceBundle)({
434
516
  name: 'grameneGeneAttribs',
435
517
  actionBaseType: 'GRAMENE_GENE_ATTRIBS',
436
518
  persist: false,
437
519
  getPromise: ({ store: store })=>{
438
- const g = store.selectGrameneGenomes();
439
- const taxa = Object.keys(g.active);
440
- let fq = '';
441
- if (taxa.length) {
442
- console.log('search add a fq for ', taxa);
443
- fq = `&fq=taxon_id:(${taxa.join(' OR ')})`;
444
- }
445
- return fetch(`${store.selectGrameneAPI()}/search?q=${store.selectGrameneFiltersQueryString()}&json.facet=${JSON.stringify($9d9aeaf9299e61a1$var$attribFacets)}&rows=0${fq}`)// return fetch(`${store.selectGrameneAPI()}/search?rows=1&q=MAKER_AED_attr_f:*&json.facet=${JSON.stringify(attribFacets)}`)
446
- .then((res)=>res.json()).then((res)=>{
447
- return res.facets;
448
- });
520
+ return fetch(`${store.selectGrameneAPI()}/geneAttributes`).then((res)=>$9d9aeaf9299e61a1$var$geneAttribs);
449
521
  }
450
522
  });
451
523
  $9d9aeaf9299e61a1$var$grameneGeneAttribs.reactGrameneGeneAttribs = (0, $gXNCa$reduxbundler.createSelector)('selectGrameneGeneAttribsShouldUpdate', 'selectGrameneFiltersStatus', 'selectGrameneViews', (shouldUpdate, status, views)=>{
@@ -470,7 +542,7 @@ const $9d9aeaf9299e61a1$var$grameneSearch = (0, $gXNCa$reduxbundler.createAsyncR
470
542
  console.log('search add a fq for ', taxa);
471
543
  fq = `&fq=taxon_id:(${taxa.join(' OR ')})`;
472
544
  }
473
- return fetch(`${store.selectGrameneAPI()}/search?q=${store.selectGrameneFiltersQueryString()}&facet.field=${$9d9aeaf9299e61a1$var$facets}&rows=${rows}&start=${offset}${fq}`).then((res)=>res.json()).then((res)=>{
545
+ return fetch(`${store.selectGrameneAPI()}/search?q=${store.selectGrameneFiltersQueryString()}&facet.field=${$9d9aeaf9299e61a1$var$facets}&rows=${rows}&start=${offset}${fq}&stats=true&${$9d9aeaf9299e61a1$var$statsFields.join('&')}`).then((res)=>res.json()).then((res)=>{
474
546
  res.response.docs.forEach((d)=>{
475
547
  d.can_show = {};
476
548
  d.capabilities.forEach((c)=>{
@@ -603,9 +675,11 @@ const $9d9aeaf9299e61a1$var$grameneParalogs = {
603
675
  });
604
676
  const API = store.selectGrameneAPI();
605
677
  const q = supertree ? `supertree_attr_s:${supertree}` : `homology__within_species_paralog:${geneId}`;
606
- fetch(`${API}/search?q=${q}&rows=100&fq=taxon_id:${taxon_id}`).then((res)=>res.json()).then((res)=>{
678
+ fetch(`${API}/search?q=${q}&rows=1000&fq=taxon_id:${taxon_id}`).then((res)=>res.json()).then((res)=>{
607
679
  let newParalogs = {};
608
- newParalogs[geneId] = res.response.docs.map((d)=>d.id);
680
+ newParalogs[geneId] = res.response.numFound > 0 ? res.response.docs.map((d)=>d.id) : [
681
+ geneId
682
+ ];
609
683
  dispatch({
610
684
  type: 'GRAMENE_PARALOGS_RECEIVED',
611
685
  payload: newParalogs
@@ -671,6 +745,7 @@ var // function selectFacetIDs(store, field) {
671
745
  $9d9aeaf9299e61a1$export$2e2bcd8739ae039 = [
672
746
  $9d9aeaf9299e61a1$var$grameneSuggestions,
673
747
  $9d9aeaf9299e61a1$var$grameneSearch,
748
+ $9d9aeaf9299e61a1$var$grameneGeneAttribs,
674
749
  $9d9aeaf9299e61a1$var$grameneMaps,
675
750
  $9d9aeaf9299e61a1$var$grameneTaxonomy,
676
751
  $9d9aeaf9299e61a1$var$grameneTaxDist,
@@ -678,7 +753,6 @@ $9d9aeaf9299e61a1$export$2e2bcd8739ae039 = [
678
753
  $9d9aeaf9299e61a1$var$grameneParalogs,
679
754
  $9d9aeaf9299e61a1$var$curatedGenes,
680
755
  $9d9aeaf9299e61a1$var$grameneGermplasm,
681
- $9d9aeaf9299e61a1$var$grameneGeneAttribs,
682
756
  $9d9aeaf9299e61a1$var$expressionSamples,
683
757
  $9d9aeaf9299e61a1$var$expressionStudies
684
758
  ];
@@ -1370,7 +1444,7 @@ const $24971af0a229e0e3$var$grameneViews = {
1370
1444
  {
1371
1445
  id: 'attribs',
1372
1446
  name: 'Gene attributes',
1373
- show: 'disabled',
1447
+ show: 'off',
1374
1448
  shouldScroll: false
1375
1449
  }
1376
1450
  ]
@@ -1556,6 +1630,7 @@ const $671312b287158a8a$var$grameneDocs = {
1556
1630
  else newState.desiredSamples[payload] = {
1557
1631
  status: 'need'
1558
1632
  };
1633
+ return newState;
1559
1634
  }
1560
1635
  return state;
1561
1636
  };
@@ -2390,7 +2465,7 @@ const $9e29a4f60318db7a$var$Detail = (props)=>{
2390
2465
  // if (gene.homology && gene.homology.homologous_genes && gene.homology.homologous_genes.within_species_paralog) {
2391
2466
  // paralogs = gene.homology.homologous_genes.within_species_paralog;
2392
2467
  // }
2393
- if (paralogs.length > 1 && atlasExperiment) paralogs_url = `https://dev.gramene.org/static/atlasWidget.html?genes=${paralogs.join(' ')}&experiment=${atlasExperiment}&localAPI=${isLocal}`;
2468
+ if (paralogs.length > 0 && atlasExperiment) paralogs_url = `https://dev.gramene.org/static/atlasWidget.html?genes=${paralogs.join(' ')}&experiment=${atlasExperiment}&localAPI=${isLocal}`;
2394
2469
  return /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)((0, $gXNCa$reactbootstrap.Tabs), {
2395
2470
  activeKey: activeTab,
2396
2471
  onSelect: (k)=>setActiveTab(k),
@@ -5493,21 +5568,461 @@ var $b36244140732570a$export$2e2bcd8739ae039 = (0, $gXNCa$reduxbundlerreact.conn
5493
5568
 
5494
5569
 
5495
5570
 
5571
+
5572
+
5573
+ function $dbdedae66c619d9b$export$2e2bcd8739ae039({ groups: groups, stats: stats }) {
5574
+ const fields = stats?.stats_fields || {};
5575
+ return /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("div", {
5576
+ style: {
5577
+ fontFamily: "system-ui, -apple-system, Segoe UI, Roboto, sans-serif",
5578
+ lineHeight: 1.35
5579
+ },
5580
+ children: Object.entries(groups).map(([groupName, attrs])=>/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($dbdedae66c619d9b$var$GroupTable, {
5581
+ groupName: groupName,
5582
+ attributes: attrs,
5583
+ fields: fields
5584
+ }, groupName))
5585
+ });
5586
+ }
5587
+ function $dbdedae66c619d9b$var$GroupTable({ groupName: groupName, attributes: attributes, fields: fields }) {
5588
+ const hasAny = attributes?.some((a)=>fields[a.fieldName]);
5589
+ const columns = (0, $gXNCa$react.useMemo)(()=>[
5590
+ {
5591
+ key: "attr",
5592
+ label: "Attribute",
5593
+ min: 120
5594
+ },
5595
+ {
5596
+ key: "desc",
5597
+ label: "Description",
5598
+ min: 380,
5599
+ flex: true
5600
+ },
5601
+ {
5602
+ key: "mean",
5603
+ label: "Mean",
5604
+ min: 100
5605
+ },
5606
+ {
5607
+ key: "stddev",
5608
+ label: "Std Dev",
5609
+ min: 110
5610
+ },
5611
+ {
5612
+ key: "min",
5613
+ label: "Min",
5614
+ min: 90
5615
+ },
5616
+ {
5617
+ key: "max",
5618
+ label: "Max",
5619
+ min: 90
5620
+ },
5621
+ {
5622
+ key: "count",
5623
+ label: "Count",
5624
+ min: 90
5625
+ },
5626
+ {
5627
+ key: "dist",
5628
+ label: "Distribution",
5629
+ min: 220
5630
+ }
5631
+ ], []);
5632
+ const initial = (0, $gXNCa$react.useMemo)(()=>columns.map((c)=>c.flex ? Math.max(380, c.min) : c.min), [
5633
+ columns
5634
+ ]);
5635
+ const { colWidths: colWidths, startResize: startResize, resizing: resizing } = $dbdedae66c619d9b$var$useResizableColumns({
5636
+ initialWidths: initial,
5637
+ minWidths: columns.map((c)=>c.min || 60)
5638
+ });
5639
+ const nfInt = (0, $gXNCa$react.useMemo)(()=>new Intl.NumberFormat("en-US", {
5640
+ maximumFractionDigits: 0
5641
+ }), []);
5642
+ const nfFloat = (0, $gXNCa$react.useMemo)(()=>new Intl.NumberFormat("en-US", {
5643
+ minimumFractionDigits: 0,
5644
+ maximumFractionDigits: 3
5645
+ }), []);
5646
+ return /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)("section", {
5647
+ style: {
5648
+ marginBottom: 24
5649
+ },
5650
+ children: [
5651
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)("header", {
5652
+ style: {
5653
+ display: "flex",
5654
+ alignItems: "baseline",
5655
+ gap: 12,
5656
+ marginBottom: 8
5657
+ },
5658
+ children: [
5659
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("h2", {
5660
+ style: {
5661
+ margin: 0,
5662
+ fontSize: 18
5663
+ },
5664
+ children: groupName
5665
+ }),
5666
+ !hasAny && /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("span", {
5667
+ style: {
5668
+ fontSize: 12,
5669
+ color: "#666"
5670
+ },
5671
+ children: "No stats available for this group."
5672
+ })
5673
+ ]
5674
+ }),
5675
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("div", {
5676
+ style: {
5677
+ overflowX: "auto",
5678
+ border: "1px solid #eee",
5679
+ borderRadius: 8,
5680
+ boxShadow: "0 1px 2px rgba(0,0,0,0.04)"
5681
+ },
5682
+ children: /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)("table", {
5683
+ style: $dbdedae66c619d9b$var$tableStyle,
5684
+ children: [
5685
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("colgroup", {
5686
+ children: colWidths.map((w, i)=>/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("col", {
5687
+ style: {
5688
+ width: w
5689
+ }
5690
+ }, i))
5691
+ }),
5692
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("thead", {
5693
+ children: /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("tr", {
5694
+ children: columns.map((col, i)=>/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($dbdedae66c619d9b$var$ResizableTh, {
5695
+ label: col.label,
5696
+ index: i,
5697
+ onResizeStart: startResize
5698
+ }, col.key))
5699
+ })
5700
+ }),
5701
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("tbody", {
5702
+ children: attributes.map((a)=>{
5703
+ const s = fields[a.fieldName] || {};
5704
+ return /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)("tr", {
5705
+ children: [
5706
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($dbdedae66c619d9b$var$Td, {
5707
+ mono: true,
5708
+ title: a.fieldName,
5709
+ children: a.name
5710
+ }),
5711
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($dbdedae66c619d9b$var$Td, {
5712
+ title: a.description,
5713
+ children: a.description
5714
+ }),
5715
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($dbdedae66c619d9b$var$Td, {
5716
+ align: "right",
5717
+ children: $dbdedae66c619d9b$var$fmtValue(s.mean, a.dtype, true, nfInt, nfFloat)
5718
+ }),
5719
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($dbdedae66c619d9b$var$Td, {
5720
+ align: "right",
5721
+ children: $dbdedae66c619d9b$var$fmtValue(s.stddev, a.dtype, true, nfInt, nfFloat)
5722
+ }),
5723
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($dbdedae66c619d9b$var$Td, {
5724
+ align: "right",
5725
+ children: $dbdedae66c619d9b$var$fmtValue(s.min, a.dtype, false, nfInt, nfFloat)
5726
+ }),
5727
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($dbdedae66c619d9b$var$Td, {
5728
+ align: "right",
5729
+ children: $dbdedae66c619d9b$var$fmtValue(s.max, a.dtype, false, nfInt, nfFloat)
5730
+ }),
5731
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($dbdedae66c619d9b$var$Td, {
5732
+ align: "right",
5733
+ children: $dbdedae66c619d9b$var$fmtCount(s.count, nfInt)
5734
+ }),
5735
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($dbdedae66c619d9b$var$Td, {
5736
+ children: /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($dbdedae66c619d9b$var$PercentileHeatmapNormalized, {
5737
+ percentilesArr: s.percentiles,
5738
+ min: s.min,
5739
+ max: s.max
5740
+ })
5741
+ })
5742
+ ]
5743
+ }, a.fieldName);
5744
+ })
5745
+ })
5746
+ ]
5747
+ })
5748
+ }),
5749
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)("div", {
5750
+ style: {
5751
+ marginTop: 6,
5752
+ fontSize: 12,
5753
+ color: "#666"
5754
+ },
5755
+ children: [
5756
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("em", {
5757
+ children: "Tip:"
5758
+ }),
5759
+ " Drag the divider at the right edge of any header to resize.",
5760
+ resizing && /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("span", {
5761
+ style: {
5762
+ marginLeft: 8,
5763
+ color: "#999"
5764
+ },
5765
+ children: "(resizing\u2026)"
5766
+ })
5767
+ ]
5768
+ })
5769
+ ]
5770
+ });
5771
+ }
5772
+ /* ===================== Percentiles / Heatmap ===================== */ /**
5773
+ * Convert alternating array into ordered pairs: [["10.0", v10], ["20.0", v20], ...]
5774
+ * - Preserves the exact order provided by Solr
5775
+ */ function $dbdedae66c619d9b$var$percentilesArrayToPairs(arr) {
5776
+ if (!Array.isArray(arr)) return [];
5777
+ const out = [];
5778
+ for(let i = 0; i < arr.length - 1; i += 2)out.push([
5779
+ String(arr[i]),
5780
+ arr[i + 1]
5781
+ ]);
5782
+ return out;
5783
+ }
5784
+ function $dbdedae66c619d9b$var$normalizeBetween(value, min, max) {
5785
+ if (!isFinite(min) || !isFinite(max) || max <= min || !isFinite(value)) return null;
5786
+ return (value - min) / (max - min);
5787
+ }
5788
+ // White -> Blue (0 -> 1)
5789
+ function $dbdedae66c619d9b$var$rgbWhiteToBlue(vNorm) {
5790
+ const t = $dbdedae66c619d9b$var$clamp01(vNorm);
5791
+ const rg = Math.round(255 * (1 - t));
5792
+ return `rgb(${rg}, ${rg}, 255)`;
5793
+ }
5794
+ function $dbdedae66c619d9b$var$clamp01(x) {
5795
+ if (typeof x !== "number" || !isFinite(x)) return 0;
5796
+ return Math.max(0, Math.min(1, x));
5797
+ }
5798
+ function $dbdedae66c619d9b$var$fmtFloat(v) {
5799
+ if (v == null || !isFinite(v)) return "n/a";
5800
+ return v.toFixed(3);
5801
+ }
5802
+ /**
5803
+ * PercentileHeatmapNormalized
5804
+ * - Infers bins from percentilesArr (order preserved)
5805
+ * - Colors normalized by row min/max
5806
+ */ function $dbdedae66c619d9b$var$PercentileHeatmapNormalized({ percentilesArr: percentilesArr, min: min, max: max }) {
5807
+ const pairs = (0, $gXNCa$react.useMemo)(()=>$dbdedae66c619d9b$var$percentilesArrayToPairs(percentilesArr), [
5808
+ percentilesArr
5809
+ ]);
5810
+ const n = pairs.length || 1; // avoid zero columns
5811
+ const validScale = isFinite(min) && isFinite(max) && max > min;
5812
+ return /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("div", {
5813
+ style: {
5814
+ ...$dbdedae66c619d9b$var$heatRowDynamic,
5815
+ gridTemplateColumns: `repeat(${n}, 1fr)`
5816
+ },
5817
+ children: pairs.map(([pStr, raw], idx)=>{
5818
+ const rawNum = typeof raw === "number" && isFinite(raw) ? raw : null;
5819
+ const norm = rawNum == null ? null : validScale ? $dbdedae66c619d9b$var$normalizeBetween(rawNum, min, max) : null;
5820
+ const bg = norm == null ? "#f2f2f2" : $dbdedae66c619d9b$var$rgbWhiteToBlue(norm);
5821
+ const label = `${pStr} \u{2192} raw ${$dbdedae66c619d9b$var$fmtFloat(rawNum)} (norm ${$dbdedae66c619d9b$var$fmtFloat(norm)})`;
5822
+ return /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($dbdedae66c619d9b$var$HeatCell, {
5823
+ background: bg,
5824
+ label: label
5825
+ }, `${pStr}-${idx}`);
5826
+ })
5827
+ });
5828
+ }
5829
+ function $dbdedae66c619d9b$var$HeatCell({ background: background, label: label }) {
5830
+ const [hover, setHover] = (0, $gXNCa$react.useState)(false);
5831
+ return /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("div", {
5832
+ style: {
5833
+ ...$dbdedae66c619d9b$var$heatCell,
5834
+ background: background
5835
+ },
5836
+ onMouseEnter: ()=>setHover(true),
5837
+ onMouseLeave: ()=>setHover(false),
5838
+ title: label,
5839
+ children: hover && /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("span", {
5840
+ style: $dbdedae66c619d9b$var$popover,
5841
+ children: label
5842
+ })
5843
+ });
5844
+ }
5845
+ /* ===================== Resizable columns ===================== */ function $dbdedae66c619d9b$var$useResizableColumns({ initialWidths: initialWidths, minWidths: minWidths }) {
5846
+ const [colWidths, setColWidths] = (0, $gXNCa$react.useState)(initialWidths);
5847
+ const [resizing, setResizing] = (0, $gXNCa$react.useState)(false);
5848
+ const activeRef = (0, $gXNCa$react.useRef)(null); // { index, startX, startW }
5849
+ (0, $gXNCa$react.useEffect)(()=>{
5850
+ if (initialWidths?.length) setColWidths(initialWidths);
5851
+ }, [
5852
+ initialWidths?.length
5853
+ ]); // eslint-disable-line react-hooks/exhaustive-deps
5854
+ const onMouseMove = (e)=>{
5855
+ if (!activeRef.current) return;
5856
+ const { index: index, startX: startX, startW: startW } = activeRef.current;
5857
+ const dx = e.clientX - startX;
5858
+ const next = [
5859
+ ...colWidths
5860
+ ];
5861
+ const minW = minWidths?.[index] ?? 60;
5862
+ next[index] = Math.max(minW, startW + dx);
5863
+ setColWidths(next);
5864
+ };
5865
+ const endResize = ()=>{
5866
+ activeRef.current = null;
5867
+ setResizing(false);
5868
+ document.body.style.cursor = "";
5869
+ document.body.style.userSelect = "";
5870
+ window.removeEventListener("mousemove", onMouseMove);
5871
+ window.removeEventListener("mouseup", endResize);
5872
+ };
5873
+ const startResize = (index, ev)=>{
5874
+ const startX = ev.clientX;
5875
+ const startW = colWidths[index];
5876
+ activeRef.current = {
5877
+ index: index,
5878
+ startX: startX,
5879
+ startW: startW
5880
+ };
5881
+ setResizing(true);
5882
+ document.body.style.cursor = "col-resize";
5883
+ document.body.style.userSelect = "none";
5884
+ window.addEventListener("mousemove", onMouseMove);
5885
+ window.addEventListener("mouseup", endResize);
5886
+ };
5887
+ (0, $gXNCa$react.useEffect)(()=>{
5888
+ return ()=>{
5889
+ window.removeEventListener("mousemove", onMouseMove);
5890
+ window.removeEventListener("mouseup", endResize);
5891
+ };
5892
+ }, []); // eslint-disable-line react-hooks/exhaustive-deps
5893
+ return {
5894
+ colWidths: colWidths,
5895
+ setColWidths: setColWidths,
5896
+ startResize: startResize,
5897
+ resizing: resizing
5898
+ };
5899
+ }
5900
+ function $dbdedae66c619d9b$var$ResizableTh({ label: label, index: index, onResizeStart: onResizeStart }) {
5901
+ return /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("th", {
5902
+ style: $dbdedae66c619d9b$var$thStyle,
5903
+ children: /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)("div", {
5904
+ style: {
5905
+ position: "relative",
5906
+ width: "100%"
5907
+ },
5908
+ children: [
5909
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("span", {
5910
+ children: label
5911
+ }),
5912
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("span", {
5913
+ onMouseDown: (e)=>onResizeStart(index, e),
5914
+ role: "separator",
5915
+ "aria-orientation": "vertical",
5916
+ title: "Drag to resize column",
5917
+ style: $dbdedae66c619d9b$var$resizerStyle
5918
+ })
5919
+ ]
5920
+ })
5921
+ });
5922
+ }
5923
+ /* ===================== Formatting helpers ===================== */ function $dbdedae66c619d9b$var$fmtCount(v, nfInt) {
5924
+ if (v === null || v === undefined) return "\u2014";
5925
+ return nfInt.format(v);
5926
+ }
5927
+ function $dbdedae66c619d9b$var$fmtValue(v, dtype = "f", isStat = false, nfInt, nfFloat) {
5928
+ if (v === null || v === undefined || Number.isNaN(v)) return "\u2014";
5929
+ const isIntType = dtype === "i";
5930
+ return isIntType && !isStat ? nfInt.format(v) : nfFloat.format(v);
5931
+ }
5932
+ /* ===================== Cells & Styles ===================== */ function $dbdedae66c619d9b$var$Td({ children: children, align: align = "left", mono: mono = false, title: title }) {
5933
+ return /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("td", {
5934
+ title: title,
5935
+ style: {
5936
+ ...$dbdedae66c619d9b$var$cellBase,
5937
+ textAlign: align,
5938
+ borderBottom: "1px solid #eee",
5939
+ padding: "8px 10px",
5940
+ fontFamily: mono ? "ui-monospace, SFMono-Regular, Menlo, monospace" : undefined,
5941
+ whiteSpace: "nowrap",
5942
+ overflow: "hidden",
5943
+ textOverflow: "ellipsis",
5944
+ verticalAlign: "top"
5945
+ },
5946
+ children: children
5947
+ });
5948
+ }
5949
+ const $dbdedae66c619d9b$var$tableStyle = {
5950
+ width: "100%",
5951
+ borderCollapse: "collapse",
5952
+ tableLayout: "fixed",
5953
+ minWidth: 980
5954
+ };
5955
+ const $dbdedae66c619d9b$var$cellBase = {
5956
+ fontSize: 13,
5957
+ lineHeight: 1.35,
5958
+ whiteSpace: "nowrap",
5959
+ overflow: "hidden",
5960
+ textOverflow: "ellipsis"
5961
+ };
5962
+ const $dbdedae66c619d9b$var$thStyle = {
5963
+ ...$dbdedae66c619d9b$var$cellBase,
5964
+ textAlign: "left",
5965
+ borderBottom: "1px solid #ddd",
5966
+ background: "#fafafa",
5967
+ fontWeight: 600,
5968
+ padding: "10px 10px",
5969
+ position: "relative"
5970
+ };
5971
+ const $dbdedae66c619d9b$var$resizerStyle = {
5972
+ position: "absolute",
5973
+ right: -5,
5974
+ top: 0,
5975
+ height: "100%",
5976
+ width: 10,
5977
+ cursor: "col-resize",
5978
+ boxShadow: "inset -1px 0 0 rgba(0,0,0,0.08)"
5979
+ };
5980
+ const $dbdedae66c619d9b$var$heatRowDynamic = {
5981
+ display: "grid",
5982
+ gap: 2,
5983
+ alignItems: "center",
5984
+ width: "100%",
5985
+ minWidth: 200
5986
+ };
5987
+ const $dbdedae66c619d9b$var$heatCell = {
5988
+ height: 16,
5989
+ borderRadius: 3,
5990
+ position: "relative",
5991
+ boxShadow: "inset 0 0 0 1px rgba(0,0,0,0.06)"
5992
+ };
5993
+ const $dbdedae66c619d9b$var$popover = {
5994
+ position: "absolute",
5995
+ left: "50%",
5996
+ top: -26,
5997
+ transform: "translateX(-50%)",
5998
+ padding: "2px 6px",
5999
+ fontSize: 11,
6000
+ background: "rgba(0,0,0,0.8)",
6001
+ color: "#fff",
6002
+ borderRadius: 4,
6003
+ whiteSpace: "nowrap",
6004
+ pointerEvents: "none"
6005
+ };
6006
+
6007
+
5496
6008
  class $67bf5a43401bffdc$var$GeneAttribs extends (0, ($parcel$interopDefault($gXNCa$react))).Component {
5497
6009
  constructor(props){
5498
6010
  super(props);
5499
6011
  this.state = {};
5500
6012
  }
5501
6013
  render() {
5502
- return /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("div", {
5503
- className: "gramene-attribs",
5504
- children: this.props.grameneGeneAttribs && /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("pre", {
5505
- children: "hi"
5506
- })
5507
- });
6014
+ if (this.props.grameneGeneAttribs && this.props.grameneSearch) {
6015
+ const groups = this.props.grameneGeneAttribs;
6016
+ const stats = this.props.grameneSearch.stats;
6017
+ return /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)((0, $dbdedae66c619d9b$export$2e2bcd8739ae039), {
6018
+ groups: groups,
6019
+ stats: stats
6020
+ });
6021
+ }
6022
+ return null;
5508
6023
  }
5509
6024
  }
5510
- var $67bf5a43401bffdc$export$2e2bcd8739ae039 = (0, $gXNCa$reduxbundlerreact.connect)('selectGrameneGeneAttribs', $67bf5a43401bffdc$var$GeneAttribs);
6025
+ var $67bf5a43401bffdc$export$2e2bcd8739ae039 = (0, $gXNCa$reduxbundlerreact.connect)('selectGrameneSearch', 'selectGrameneGeneAttribs', $67bf5a43401bffdc$var$GeneAttribs);
5511
6026
 
5512
6027
 
5513
6028
 
@@ -5635,7 +6150,9 @@ var $76e15aea9236bd47$export$2e2bcd8739ae039 = (0, $gXNCa$reduxbundlerreact.conn
5635
6150
 
5636
6151
 
5637
6152
 
5638
- const $261baeb81c4d4d8a$var$LazyStudy = /*#__PURE__*/ (0, ($parcel$interopDefault($gXNCa$react))).lazy(()=>(parcelRequire("7u0Mi")));
6153
+ var $7zuJ6 = parcelRequire("7zuJ6");
6154
+
6155
+ const $261baeb81c4d4d8a$var$LazyStudy = /*#__PURE__*/ (0, ($parcel$interopDefault($gXNCa$react))).lazy(()=>Promise.resolve((parcelRequire("7zuJ6"))));
5639
6156
  const $261baeb81c4d4d8a$var$StudyList = (props)=>{
5640
6157
  return /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)((0, $gXNCa$reactbootstrap.Accordion), {
5641
6158
  alwaysOpen: true,
@@ -5648,13 +6165,8 @@ const $261baeb81c4d4d8a$var$StudyList = (props)=>{
5648
6165
  children: study.description
5649
6166
  }),
5650
6167
  /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)((0, $gXNCa$reactbootstrap.Accordion).Body, {
5651
- children: /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)((0, $gXNCa$react.Suspense), {
5652
- fallback: /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("div", {
5653
- children: "Loading..."
5654
- }),
5655
- children: /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($261baeb81c4d4d8a$var$LazyStudy, {
5656
- id: study._id
5657
- })
6168
+ children: /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)((0, $7zuJ6.default), {
6169
+ id: study._id
5658
6170
  })
5659
6171
  })
5660
6172
  ]
@@ -5666,15 +6178,21 @@ const $261baeb81c4d4d8a$var$Expression = (props)=>{
5666
6178
  let searchTaxa = {};
5667
6179
  if (props.grameneSearch) {
5668
6180
  const taxon_id_facet = props.grameneSearch.facet_counts.facet_fields.taxon_id;
5669
- taxon_id_facet.filter((tid, idx)=>idx % 2 === 0).forEach((tid)=>searchTaxa[tid] = true);
6181
+ taxon_id_facet.filter((tid, idx)=>idx % 2 === 0).forEach((tid)=>{
6182
+ if (tid > 1000000) {
6183
+ const tid2 = Math.floor(tid / 1000);
6184
+ if (props.expressionStudies[tid2]) searchTaxa[tid2] = tid;
6185
+ } else searchTaxa[tid] = tid;
6186
+ });
5670
6187
  }
5671
- const availableTaxa = Object.keys(props.expressionStudies).filter((tid)=>searchTaxa[tid] || searchTaxa[tid + '001']).sort((a, b)=>props.grameneMaps[a + '001'].left_index - props.grameneMaps[b + '001'].left_index);
6188
+ const availableTaxa = Object.keys(props.expressionStudies).filter((tid)=>searchTaxa[tid]).sort((a, b)=>props.grameneMaps[searchTaxa[a]].left_index - props.grameneMaps[searchTaxa[b]].left_index);
5672
6189
  return availableTaxa && props.grameneTaxonomy && /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)("div", {
5673
6190
  children: [
5674
6191
  /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)("div", {
5675
6192
  children: [
5676
6193
  "This is where you can launch a component for the selected samples. props.desiredSamples lists them. This component can request the data from the API organize samples by factor metadata? One big table with all the studies?",
5677
6194
  /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)((0, $gXNCa$reactbootstrap.Button), {
6195
+ onClick: console.log(Object.keys(props.desiredSamples)),
5678
6196
  children: [
5679
6197
  "Show Samples (",
5680
6198
  Object.keys(props.desiredSamples).length,
@@ -5687,7 +6205,8 @@ const $261baeb81c4d4d8a$var$Expression = (props)=>{
5687
6205
  alwaysOpen: true,
5688
6206
  defaultActiveKey: availableTaxa.length === 1 ? "tax_0" : undefined,
5689
6207
  children: availableTaxa.map((tid, idx)=>{
5690
- const n = props.expressionStudies[tid].length;
6208
+ const baselineStudies = props.expressionStudies[tid].filter((study)=>study.type === 'Baseline');
6209
+ const n = baselineStudies.length;
5691
6210
  return /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)((0, $gXNCa$reactbootstrap.Accordion).Item, {
5692
6211
  eventKey: 'tax_' + idx,
5693
6212
  children: [
@@ -5702,7 +6221,7 @@ const $261baeb81c4d4d8a$var$Expression = (props)=>{
5702
6221
  }),
5703
6222
  /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)((0, $gXNCa$reactbootstrap.Accordion).Body, {
5704
6223
  children: /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($261baeb81c4d4d8a$var$StudyList, {
5705
- studies: props.expressionStudies[tid]
6224
+ studies: baselineStudies
5706
6225
  })
5707
6226
  })
5708
6227
  ]
@@ -5761,6 +6280,28 @@ const $0f50f369018a42ef$var$GeneListDisplayComponent = (props)=>{
5761
6280
  setError('Failed to fetch gene lists. Please try again later.');
5762
6281
  }
5763
6282
  };
6283
+ // Example functions for viewing and deleting lists
6284
+ const viewGeneList = (list)=>{
6285
+ alert(`Viewing gene list: ${list.label}`);
6286
+ props.addFilter({
6287
+ category: 'Gene List',
6288
+ fq_field: 'saved_search',
6289
+ fq_value: list.hash,
6290
+ name: list.label
6291
+ });
6292
+ };
6293
+ const deleteGeneList = async (api, listId)=>{
6294
+ if (window.confirm('Are you sure you want to delete this gene list?')) // Replace with the actual delete request
6295
+ try {
6296
+ await fetch(`${api}/gene_lists/${listId}`, {
6297
+ method: 'DELETE'
6298
+ });
6299
+ alert('Gene list deleted!');
6300
+ // Optionally refetch the updated list
6301
+ } catch (err) {
6302
+ alert('Failed to delete gene list.');
6303
+ }
6304
+ };
5764
6305
  // Fetch data when the component is mounted
5765
6306
  (0, $gXNCa$react.useEffect)(()=>{
5766
6307
  fetchPublicGeneLists();
@@ -5786,20 +6327,28 @@ const $0f50f369018a42ef$var$GeneListDisplayComponent = (props)=>{
5786
6327
  hover: true,
5787
6328
  className: "mt-4",
5788
6329
  children: [
5789
- /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("thead", {
5790
- children: /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)("tr", {
5791
- children: [
5792
- /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("th", {
5793
- children: "List Name"
5794
- }),
5795
- /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("th", {
5796
- children: "Number of Genes"
5797
- }),
5798
- /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("th", {
5799
- children: "Actions"
6330
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)("thead", {
6331
+ children: [
6332
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("tr", {
6333
+ children: /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("th", {
6334
+ colspan: 3,
6335
+ children: "My gene lists"
5800
6336
  })
5801
- ]
5802
- })
6337
+ }),
6338
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)("tr", {
6339
+ children: [
6340
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("th", {
6341
+ children: "List Name"
6342
+ }),
6343
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("th", {
6344
+ children: "Number of Genes"
6345
+ }),
6346
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("th", {
6347
+ children: "Actions"
6348
+ })
6349
+ ]
6350
+ })
6351
+ ]
5803
6352
  }),
5804
6353
  /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("tbody", {
5805
6354
  children: privateGeneLists.map((list, index)=>/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)("tr", {
@@ -5808,18 +6357,18 @@ const $0f50f369018a42ef$var$GeneListDisplayComponent = (props)=>{
5808
6357
  children: list.label
5809
6358
  }),
5810
6359
  /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("td", {
5811
- children: list.hash
6360
+ children: list.n_genes || 0
5812
6361
  }),
5813
6362
  /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)("td", {
5814
6363
  children: [
5815
6364
  /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)((0, $gXNCa$reactbootstrap.Button), {
5816
6365
  variant: "info",
5817
- onClick: ()=>$0f50f369018a42ef$var$viewGeneList(list),
6366
+ onClick: ()=>viewGeneList(list),
5818
6367
  children: "View"
5819
6368
  }),
5820
6369
  /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)((0, $gXNCa$reactbootstrap.Button), {
5821
6370
  variant: "danger",
5822
- onClick: ()=>$0f50f369018a42ef$var$deleteGeneList(props.api, list._id),
6371
+ onClick: ()=>deleteGeneList(props.api, list._id),
5823
6372
  className: "ml-2",
5824
6373
  children: "Delete"
5825
6374
  })
@@ -5836,20 +6385,28 @@ const $0f50f369018a42ef$var$GeneListDisplayComponent = (props)=>{
5836
6385
  hover: true,
5837
6386
  className: "mt-4",
5838
6387
  children: [
5839
- /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("thead", {
5840
- children: /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)("tr", {
5841
- children: [
5842
- /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("th", {
5843
- children: "List Name"
5844
- }),
5845
- /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("th", {
5846
- children: "Number of Genes"
5847
- }),
5848
- /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("th", {
5849
- children: "Actions"
6388
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)("thead", {
6389
+ children: [
6390
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("tr", {
6391
+ children: /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("th", {
6392
+ colSpan: 3,
6393
+ children: "Public gene lists"
5850
6394
  })
5851
- ]
5852
- })
6395
+ }),
6396
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)("tr", {
6397
+ children: [
6398
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("th", {
6399
+ children: "List Name"
6400
+ }),
6401
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("th", {
6402
+ children: "Number of Genes"
6403
+ }),
6404
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("th", {
6405
+ children: "Actions"
6406
+ })
6407
+ ]
6408
+ })
6409
+ ]
5853
6410
  }),
5854
6411
  /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("tbody", {
5855
6412
  children: publicGeneLists.map((list, index)=>/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)("tr", {
@@ -5858,18 +6415,18 @@ const $0f50f369018a42ef$var$GeneListDisplayComponent = (props)=>{
5858
6415
  children: list.label
5859
6416
  }),
5860
6417
  /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("td", {
5861
- children: list.hash
6418
+ children: list.n_genes || 0
5862
6419
  }),
5863
6420
  /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)("td", {
5864
6421
  children: [
5865
6422
  /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)((0, $gXNCa$reactbootstrap.Button), {
5866
6423
  variant: "info",
5867
- onClick: ()=>$0f50f369018a42ef$var$viewGeneList(list),
6424
+ onClick: ()=>viewGeneList(list),
5868
6425
  children: "View"
5869
6426
  }),
5870
6427
  /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)((0, $gXNCa$reactbootstrap.Button), {
5871
6428
  variant: "danger",
5872
- onClick: ()=>$0f50f369018a42ef$var$deleteGeneList(props.api, list._id),
6429
+ onClick: ()=>deleteGeneList(props.api, list._id),
5873
6430
  className: "ml-2",
5874
6431
  children: "Delete"
5875
6432
  })
@@ -5887,22 +6444,6 @@ const $0f50f369018a42ef$var$GeneListDisplayComponent = (props)=>{
5887
6444
  ]
5888
6445
  });
5889
6446
  };
5890
- // Example functions for viewing and deleting lists
5891
- const $0f50f369018a42ef$var$viewGeneList = (list)=>{
5892
- alert(`Viewing gene list: ${list.name}\nGenes: ${list.genes.join(', ')}`);
5893
- };
5894
- const $0f50f369018a42ef$var$deleteGeneList = async (api, listId)=>{
5895
- if (window.confirm('Are you sure you want to delete this gene list?')) // Replace with the actual delete request
5896
- try {
5897
- await fetch(`${api}/gene_lists/${listId}`, {
5898
- method: 'DELETE'
5899
- });
5900
- alert('Gene list deleted!');
5901
- // Optionally refetch the updated list
5902
- } catch (err) {
5903
- alert('Failed to delete gene list.');
5904
- }
5905
- };
5906
6447
  const $0f50f369018a42ef$var$GeneListComponent = (props)=>{
5907
6448
  const [geneList, setGeneList] = (0, $gXNCa$react.useState)('');
5908
6449
  const [listHash, setListHash] = (0, $gXNCa$react.useState)(null);
@@ -5964,6 +6505,7 @@ const $0f50f369018a42ef$var$GeneListComponent = (props)=>{
5964
6505
  label: listName,
5965
6506
  hash: listHash,
5966
6507
  site: props.site,
6508
+ n_genes: validatedList.length,
5967
6509
  isPublic: listIsPublic
5968
6510
  };
5969
6511
  const queryString = new URLSearchParams(queryParams).toString();
@@ -6124,14 +6666,15 @@ const $0f50f369018a42ef$var$UserGeneListsComponent = (props)=>{
6124
6666
  /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)((0, $gXNCa$reactbootstrap.Col), {
6125
6667
  children: /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($0f50f369018a42ef$var$GeneListDisplayComponent, {
6126
6668
  api: props.configuration.grameneData,
6127
- site: props.configuration.id
6669
+ site: props.configuration.id,
6670
+ addFilter: props.doAcceptGrameneSuggestion
6128
6671
  })
6129
6672
  })
6130
6673
  ]
6131
6674
  })
6132
6675
  });
6133
6676
  };
6134
- var $0f50f369018a42ef$export$2e2bcd8739ae039 = (0, $gXNCa$reduxbundlerreact.connect)('selectConfiguration', $0f50f369018a42ef$var$UserGeneListsComponent);
6677
+ var $0f50f369018a42ef$export$2e2bcd8739ae039 = (0, $gXNCa$reduxbundlerreact.connect)('selectConfiguration', 'doAcceptGrameneSuggestion', $0f50f369018a42ef$var$UserGeneListsComponent);
6135
6678
 
6136
6679
 
6137
6680