gramene-search 1.6.28 → 1.6.30

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.
Binary file
Binary file
@@ -1,2 +1,2 @@
1
- 165937747
2
- 1749778115582705000
1
+ 180977149
2
+ 1750274546364043000
package/dist/index.js CHANGED
@@ -569,6 +569,47 @@ const $9d9aeaf9299e61a1$var$grameneOrthologs = {
569
569
  },
570
570
  selectGrameneOrthologs: (state)=>state.grameneOrthologs
571
571
  };
572
+ const $9d9aeaf9299e61a1$var$grameneParalogs = {
573
+ name: 'grameneParalogs',
574
+ getReducer: ()=>{
575
+ const initialState = {};
576
+ return (state = initialState, { type: type, payload: payload })=>{
577
+ let newState;
578
+ switch(type){
579
+ case 'GRAMENE_PARALOGS_REQUESTED':
580
+ if (!state.hasOwnProperty(payload)) {
581
+ newState = Object.assign({}, state);
582
+ newState[payload] = [];
583
+ return newState;
584
+ }
585
+ break;
586
+ case 'GRAMENE_PARALOGS_RECEIVED':
587
+ return Object.assign({}, state, payload);
588
+ }
589
+ return state;
590
+ };
591
+ },
592
+ doRequestParalogs: (geneId, supertree, taxon_id)=>({ dispatch: dispatch, store: store })=>{
593
+ const paralogs = store.selectGrameneParalogs();
594
+ if (!paralogs.hasOwnProperty(geneId)) {
595
+ dispatch({
596
+ type: 'GRAMENE_PARALOGS_REQUESTED',
597
+ payload: geneId
598
+ });
599
+ const API = store.selectGrameneAPI();
600
+ const q = supertree ? `supertree_attr_s:${supertree}` : `homology__within_species_paralog:${geneId}`;
601
+ fetch(`${API}/search?q=${q}&rows=100&fq=taxon_id:${taxon_id}`).then((res)=>res.json()).then((res)=>{
602
+ let newParalogs = {};
603
+ newParalogs[geneId] = res.response.docs.map((d)=>d.id);
604
+ dispatch({
605
+ type: 'GRAMENE_PARALOGS_RECEIVED',
606
+ payload: newParalogs
607
+ });
608
+ });
609
+ }
610
+ },
611
+ selectGrameneParalogs: (state)=>state.grameneParalogs
612
+ };
572
613
  var // function selectFacetIDs(store, field) {
573
614
  // const path = `grameneGenes.data.facet_counts.facet_fields.${field}`;
574
615
  // if (_.has(store,path)) {
@@ -629,6 +670,7 @@ $9d9aeaf9299e61a1$export$2e2bcd8739ae039 = [
629
670
  $9d9aeaf9299e61a1$var$grameneTaxonomy,
630
671
  $9d9aeaf9299e61a1$var$grameneTaxDist,
631
672
  $9d9aeaf9299e61a1$var$grameneOrthologs,
673
+ $9d9aeaf9299e61a1$var$grameneParalogs,
632
674
  $9d9aeaf9299e61a1$var$curatedGenes,
633
675
  $9d9aeaf9299e61a1$var$grameneGermplasm,
634
676
  $9d9aeaf9299e61a1$var$grameneGeneAttribs,
@@ -2258,12 +2300,14 @@ const $9e29a4f60318db7a$var$Detail = (props)=>{
2258
2300
  props.expressionStudies
2259
2301
  ]);
2260
2302
  let paralogs_url;
2261
- let gene_url = `https://dev.gramene.org/static/atlasWidget.html?genes=${gene.atlas_id || gene._id}&experiment=${atlasExperiment}&localAPI=${isLocal}`;
2303
+ let gene_url = `https://dev.gramene.org/static/atlasWidget.html?genes=${gene.atlas_id || gene._id}&localAPI=${isLocal}`;
2262
2304
  let paralogs = [];
2263
- if (gene.homology && gene.homology.homologous_genes && gene.homology.homologous_genes.within_species_paralog) paralogs = gene.homology.homologous_genes.within_species_paralog;
2305
+ if (props.grameneParalogs && props.grameneParalogs[gene._id]) paralogs = props.grameneParalogs[gene._id];
2306
+ else if (gene.homology && gene.homology.supertree) props.doRequestParalogs(gene._id, gene.homology.supertree, gene.taxon_id);
2307
+ // if (gene.homology && gene.homology.homologous_genes && gene.homology.homologous_genes.within_species_paralog) {
2308
+ // paralogs = gene.homology.homologous_genes.within_species_paralog;
2309
+ // }
2264
2310
  if (paralogs.length > 1 && atlasExperiment) paralogs_url = `https://dev.gramene.org/static/atlasWidget.html?genes=${paralogs.join(' ')}&experiment=${atlasExperiment}&localAPI=${isLocal}`;
2265
- const ref = (0, $gXNCa$react.useRef)(null);
2266
- const ref2 = (0, $gXNCa$react.useRef)(null);
2267
2311
  return /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)((0, $gXNCa$reactbootstrap.Tabs), {
2268
2312
  children: [
2269
2313
  paralogs_url && /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)((0, $gXNCa$reactbootstrap.Tab), {
@@ -2289,28 +2333,13 @@ const $9e29a4f60318db7a$var$Detail = (props)=>{
2289
2333
  })
2290
2334
  ]
2291
2335
  }, "gxaparalogs"),
2292
- /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)((0, $gXNCa$reactbootstrap.Tab), {
2336
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)((0, $gXNCa$reactbootstrap.Tab), {
2293
2337
  tabClassName: "gxa",
2294
2338
  eventKey: "gene",
2295
2339
  title: "All Studies",
2296
- children: [
2297
- /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)((0, $gXNCa$reactbootstrap.Form).Select, {
2298
- "aria-label": "experiment selector",
2299
- placeholder: "Select experiment",
2300
- onChange: (e)=>setAtlasExperiment(e.target.value),
2301
- children: atlasExperimentList.map((e, idx)=>/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)("option", {
2302
- value: e._id,
2303
- children: [
2304
- e.type,
2305
- ": ",
2306
- e.description || e._id
2307
- ]
2308
- }, idx))
2309
- }),
2310
- /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($9e29a4f60318db7a$var$DynamicIframe, {
2311
- url: gene_url
2312
- })
2313
- ]
2340
+ children: /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($9e29a4f60318db7a$var$DynamicIframe, {
2341
+ url: gene_url
2342
+ })
2314
2343
  }, "gxa"),
2315
2344
  (0, $gXNCa$grameneefpbrowser.haveBAR)(gene) && /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)((0, $gXNCa$reactbootstrap.Tab), {
2316
2345
  tabClassName: "eFP",
@@ -2323,8 +2352,7 @@ const $9e29a4f60318db7a$var$Detail = (props)=>{
2323
2352
  ]
2324
2353
  });
2325
2354
  };
2326
- var $9e29a4f60318db7a$export$2e2bcd8739ae039 = (0, $gXNCa$reduxbundlerreact.connect)(//'selectParalogExpression',
2327
- 'selectExpressionStudies', //'doRequestParalogExpression',
2355
+ var $9e29a4f60318db7a$export$2e2bcd8739ae039 = (0, $gXNCa$reduxbundlerreact.connect)('selectGrameneParalogs', 'selectExpressionStudies', 'doRequestParalogs', //'doRequestParalogExpression',
2328
2356
  $9e29a4f60318db7a$var$Detail);
2329
2357
 
2330
2358
 
@@ -2549,6 +2577,14 @@ class $64fad37f770d2bfe$var$Homology extends (0, ($parcel$interopDefault($gXNCa$
2549
2577
  name: `Paralogs of ${this.gene.name}`
2550
2578
  }));
2551
2579
  }
2580
+ searchSupertree() {
2581
+ this.props.doReplaceGrameneFilters((0, $047461923b1badda$export$964d88edb00bbcaa)({
2582
+ category: 'Gene Tree',
2583
+ fq_field: 'supertree_attr_s',
2584
+ fq_value: this.gene.homology.supertree,
2585
+ name: this.gene.homology.supertree
2586
+ }));
2587
+ }
2552
2588
  orthologList() {
2553
2589
  return this.orthoParaList('ortholog');
2554
2590
  }
@@ -2593,6 +2629,12 @@ class $64fad37f770d2bfe$var$Homology extends (0, ($parcel$interopDefault($gXNCa$
2593
2629
  count: this.paralogs.length,
2594
2630
  handleClick: this.filterParalogs.bind(this)
2595
2631
  });
2632
+ if (this.gene.homology.supertree) x.push({
2633
+ name: `Supertree`,
2634
+ category: `Gene Tree`,
2635
+ count: this.gene.homology.supertree,
2636
+ handleClick: this.searchSupertree.bind(this)
2637
+ });
2596
2638
  return x;
2597
2639
  }
2598
2640
  links() {