gramene-search 1.6.21 → 1.6.23

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
- 87542176
2
- 1741101400395564000
1
+ 64094844
2
+ 1746629399112570000
package/dist/index.js CHANGED
@@ -142,7 +142,8 @@ $9d9aeaf9299e61a1$var$grameneSuggestions.selectGrameneSuggestionsStatus = (0, $g
142
142
  if (!queryString) return '';
143
143
  if (shouldUpdate) return 'update needed';
144
144
  if (isLoading) return 'loading';
145
- if (suggestionsRaw) return suggestionsRaw.data.grouped.category.matches + ' terms';
145
+ if (suggestionsRaw.data) return suggestionsRaw.data.grouped.category.matches + ' terms';
146
+ console.error(suggestionsRaw);
146
147
  return 'error';
147
148
  });
148
149
  $9d9aeaf9299e61a1$var$grameneSuggestions.selectGrameneSuggestionsReady = (0, $gXNCa$reduxbundler.createSelector)('selectGrameneSuggestionsStatus', (status)=>{
@@ -2261,30 +2262,93 @@ function $9e29a4f60318db7a$var$DynamicIframe(props) {
2261
2262
  }
2262
2263
  const $9e29a4f60318db7a$var$Detail = (props)=>{
2263
2264
  const gene = props.geneDocs[props.searchResult.id];
2265
+ const [atlasExperiment, setAtlasExperiment] = (0, $gXNCa$react.useState)(null);
2266
+ const [atlasExperimentList, setAtlasExperimentList] = (0, $gXNCa$react.useState)([]);
2267
+ const [isLocal, setIsLocal] = (0, $gXNCa$react.useState)(false);
2268
+ const handleLocalAPIChange = (event)=>{
2269
+ setIsLocal(event.target.checked);
2270
+ };
2271
+ (0, $gXNCa$react.useEffect)(()=>{
2272
+ const tid = Math.floor(gene.taxon_id / 1000);
2273
+ if (props.expressionStudies[tid]) {
2274
+ let eList = props.expressionStudies[tid].filter((e)=>e.type === "Baseline");
2275
+ setAtlasExperimentList(eList);
2276
+ let refExp = eList.filter((e)=>e.isRef);
2277
+ if (refExp.length === 1) setAtlasExperiment(refExp[0]._id);
2278
+ else // no reference experiment - choose first
2279
+ setAtlasExperiment(eList[0]._id);
2280
+ }
2281
+ }, [
2282
+ props.expressionStudies
2283
+ ]);
2264
2284
  let paralogs_url;
2265
- let gene_url = `/static/atlasWidget.html?reference=0&genes=${gene.atlas_id || gene._id}`;
2266
- if (props.paralogExpression && props.paralogExpression[gene._id]) {
2267
- let paralogs = props.paralogExpression[gene._id].map((p)=>p.atlas_id || p.id);
2268
- if (paralogs.length > 1) paralogs_url = `/static/atlasWidget.html?reference=1&genes=${paralogs.join(' ')}`;
2269
- } else props.doRequestParalogExpression(gene._id);
2285
+ let gene_url = `/static/atlasWidget.html?genes=${gene.atlas_id || gene._id}&localAPI=${isLocal}`;
2286
+ let paralogs = [];
2287
+ if (gene.homology && gene.homology.homologous_genes && gene.homology.homologous_genes.within_species_paralog) paralogs = gene.homology.homologous_genes.within_species_paralog;
2288
+ if (paralogs.length > 1 && atlasExperiment) paralogs_url = `/static/atlasWidget.html?genes=${paralogs.join(' ')}&experiment=${atlasExperiment}&localAPI=${isLocal}`;
2270
2289
  return /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)((0, $gXNCa$reactbootstrap.Tabs), {
2271
2290
  children: [
2272
- paralogs_url && /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)((0, $gXNCa$reactbootstrap.Tab), {
2291
+ paralogs_url && /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)((0, $gXNCa$reactbootstrap.Tab), {
2273
2292
  tabClassName: "gxa",
2274
2293
  eventKey: "paralogs",
2275
- title: "Reference Study (all paralogs)",
2276
- children: /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($9e29a4f60318db7a$var$DynamicIframe, {
2277
- url: paralogs_url
2278
- })
2279
- }),
2280
- /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)((0, $gXNCa$reactbootstrap.Tab), {
2294
+ title: `Paralogs`,
2295
+ children: [
2296
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)((0, $gXNCa$reactbootstrap.Form), {
2297
+ children: [
2298
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)((0, $gXNCa$reactbootstrap.Form).Check, {
2299
+ type: "switch",
2300
+ id: "localAPI",
2301
+ label: "Local API",
2302
+ checked: isLocal,
2303
+ onChange: handleLocalAPIChange
2304
+ }),
2305
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)((0, $gXNCa$reactbootstrap.Form).Group, {
2306
+ as: (0, $gXNCa$reactbootstrap.Row),
2307
+ className: "mb-3",
2308
+ controlId: "formGroupExperiment",
2309
+ children: [
2310
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)((0, $gXNCa$reactbootstrap.Form).Label, {
2311
+ column: true,
2312
+ sm: 1,
2313
+ children: "Experiment"
2314
+ }),
2315
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)((0, $gXNCa$reactbootstrap.Col), {
2316
+ sm: 5,
2317
+ children: /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)((0, $gXNCa$reactbootstrap.Form).Select, {
2318
+ defaultValue: atlasExperiment,
2319
+ onChange: (e)=>setAtlasExperiment(e.target.value),
2320
+ children: atlasExperimentList.map((experiment, index)=>/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("option", {
2321
+ value: experiment._id,
2322
+ children: experiment.name
2323
+ }, index))
2324
+ })
2325
+ })
2326
+ ]
2327
+ })
2328
+ ]
2329
+ }),
2330
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($9e29a4f60318db7a$var$DynamicIframe, {
2331
+ url: paralogs_url
2332
+ })
2333
+ ]
2334
+ }, "gxaparalogs"),
2335
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)((0, $gXNCa$reactbootstrap.Tab), {
2281
2336
  tabClassName: "gxa",
2282
2337
  eventKey: "gene",
2283
2338
  title: "All Studies",
2284
- children: /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($9e29a4f60318db7a$var$DynamicIframe, {
2285
- url: gene_url
2286
- })
2287
- }),
2339
+ children: [
2340
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)((0, $gXNCa$reactbootstrap.Form).Check, {
2341
+ type: "switch",
2342
+ id: "localAPI",
2343
+ label: "Local API",
2344
+ checked: isLocal,
2345
+ onChange: handleLocalAPIChange
2346
+ }),
2347
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)($9e29a4f60318db7a$var$DynamicIframe, {
2348
+ url: gene_url
2349
+ })
2350
+ ]
2351
+ }, "gxa"),
2288
2352
  (0, $gXNCa$grameneefpbrowser.haveBAR)(gene) && /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)((0, $gXNCa$reactbootstrap.Tab), {
2289
2353
  tabClassName: "eFP",
2290
2354
  eventKey: "eFP",
@@ -2292,11 +2356,12 @@ const $9e29a4f60318db7a$var$Detail = (props)=>{
2292
2356
  children: /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)((0, ($parcel$interopDefault($gXNCa$grameneefpbrowser))), {
2293
2357
  gene: gene
2294
2358
  })
2295
- })
2359
+ }, "bar")
2296
2360
  ]
2297
2361
  });
2298
2362
  };
2299
- var $9e29a4f60318db7a$export$2e2bcd8739ae039 = (0, $gXNCa$reduxbundlerreact.connect)('selectParalogExpression', 'doRequestParalogExpression', $9e29a4f60318db7a$var$Detail);
2363
+ var $9e29a4f60318db7a$export$2e2bcd8739ae039 = (0, $gXNCa$reduxbundlerreact.connect)(// 'selectParalogExpression',
2364
+ 'selectExpressionStudies', 'doRequestParalogExpression', $9e29a4f60318db7a$var$Detail);
2300
2365
 
2301
2366
 
2302
2367
 
@@ -3330,7 +3395,8 @@ const $283508ffcf8a47c4$var$ggURL = {
3330
3395
  IRRI: 'https://gringlobal.irri.org/gringlobal/accessiondetail?id=',
3331
3396
  ARS: 'https://npgsweb.ars-grin.gov/gringlobal/accessiondetail.aspx?id=',
3332
3397
  ICRISAT: 'https://genebank.icrisat.org/IND/PassportSummary?ID=',
3333
- sorbmutdb: 'https://www.depts.ttu.edu/igcast/sorbmutdb.php'
3398
+ sorbmutdb: 'https://www.depts.ttu.edu/igcast/sorbmutdb.php',
3399
+ maizeGDB: 'https://wgs.maizegdb.org/'
3334
3400
  };
3335
3401
  const $283508ffcf8a47c4$var$rice_studies = {
3336
3402
  '1': {
@@ -3440,6 +3506,11 @@ const $283508ffcf8a47c4$var$AccessionLink = ({ germplasm: germplasm, gene_id: ge
3440
3506
  })
3441
3507
  ]
3442
3508
  });
3509
+ if (germplasm.pop_id === '15' && germplasm.stock_center === 'NOT FOUND') return /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("a", {
3510
+ target: "_blank",
3511
+ href: $283508ffcf8a47c4$var$ggURL['maizeGDB'],
3512
+ children: "SNPVersity 2.0"
3513
+ });
3443
3514
  return /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("span", {
3444
3515
  children: germplasm.pub_id
3445
3516
  });
@@ -3598,7 +3669,6 @@ const $283508ffcf8a47c4$var$GridWithGroups = ({ groups: groups, gene_id: gene_id
3598
3669
  sortable: false,
3599
3670
  flex: 1,
3600
3671
  cellRenderer: (params)=>{
3601
- console.log(params.data);
3602
3672
  if (params.data.accession) return params.data.accession.germplasm.ens_id;
3603
3673
  return null;
3604
3674
  }
@@ -5512,17 +5582,38 @@ var $261baeb81c4d4d8a$export$2e2bcd8739ae039 = (0, $gXNCa$reduxbundlerreact.conn
5512
5582
  const $0f50f369018a42ef$var$auth = (0, $gXNCa$firebaseauth.getAuth)((0, $047461923b1badda$export$a4e2c8f07e884e));
5513
5583
  const $0f50f369018a42ef$var$MAX_GENE_IDS = 1000; // Define the maximum number of gene IDs allowed
5514
5584
  const $0f50f369018a42ef$var$GeneListDisplayComponent = (props)=>{
5515
- const [savedGeneLists, setSavedGeneLists] = (0, $gXNCa$react.useState)([]);
5585
+ const [publicGeneLists, setPublicGeneLists] = (0, $gXNCa$react.useState)([]);
5586
+ const [privateGeneLists, setPrivateGeneLists] = (0, $gXNCa$react.useState)([]);
5516
5587
  const [error, setError] = (0, $gXNCa$react.useState)(null);
5517
5588
  const [user, setUser] = (0, $gXNCa$react.useState)({});
5518
5589
  (0, $gXNCa$firebaseauth.onAuthStateChanged)($0f50f369018a42ef$var$auth, (user)=>setUser(user));
5590
+ const fetchPrivateGeneLists = async ()=>{
5591
+ try {
5592
+ const token = await user.getIdToken();
5593
+ // Replace this with actual fetch from your backend or storage
5594
+ const response = await fetch(`${props.api}/gene_lists?site=${props.site}&isPublic=false`, {
5595
+ method: 'GET',
5596
+ headers: {
5597
+ "Content-Type": "application/json",
5598
+ "Authorization": `Bearer ${token}`
5599
+ }
5600
+ });
5601
+ const result = await response.json();
5602
+ if (response.ok) {
5603
+ setError(null);
5604
+ setPrivateGeneLists(result); // array of saved gene lists
5605
+ } else setError('Error fetching gene lists.');
5606
+ } catch (err) {
5607
+ setError('Failed to fetch private gene lists. Please try again later.');
5608
+ }
5609
+ };
5519
5610
  // Fetch saved gene lists from a backend or local storage
5520
- const fetchSavedGeneLists = async ()=>{
5611
+ const fetchPublicGeneLists = async ()=>{
5521
5612
  try {
5522
5613
  // Replace this with actual fetch from your backend or storage
5523
- const response = await fetch(`${props.api}/gene-lists`);
5614
+ const response = await fetch(`${props.api}/gene_lists?site=${props.site}&isPublic=true`);
5524
5615
  const result = await response.json();
5525
- if (response.ok) setSavedGeneLists(result.savedLists); // Assuming savedLists is an array of saved gene lists
5616
+ if (response.ok) setPublicGeneLists(result); // array of saved gene lists
5526
5617
  else setError('Error fetching gene lists.');
5527
5618
  } catch (err) {
5528
5619
  setError('Failed to fetch gene lists. Please try again later.');
@@ -5530,8 +5621,13 @@ const $0f50f369018a42ef$var$GeneListDisplayComponent = (props)=>{
5530
5621
  };
5531
5622
  // Fetch data when the component is mounted
5532
5623
  (0, $gXNCa$react.useEffect)(()=>{
5533
- fetchSavedGeneLists();
5624
+ fetchPublicGeneLists();
5534
5625
  }, []);
5626
+ (0, $gXNCa$react.useEffect)(()=>{
5627
+ fetchPrivateGeneLists();
5628
+ }, [
5629
+ user
5630
+ ]);
5535
5631
  return /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)("div", {
5536
5632
  className: "gene-list-display-component",
5537
5633
  children: [
@@ -5542,7 +5638,7 @@ const $0f50f369018a42ef$var$GeneListDisplayComponent = (props)=>{
5542
5638
  variant: "danger",
5543
5639
  children: error
5544
5640
  }),
5545
- savedGeneLists.length > 0 ? /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)((0, $gXNCa$reactbootstrap.Table), {
5641
+ privateGeneLists.length > 0 && /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)((0, $gXNCa$reactbootstrap.Table), {
5546
5642
  striped: true,
5547
5643
  bordered: true,
5548
5644
  hover: true,
@@ -5564,13 +5660,13 @@ const $0f50f369018a42ef$var$GeneListDisplayComponent = (props)=>{
5564
5660
  })
5565
5661
  }),
5566
5662
  /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("tbody", {
5567
- children: savedGeneLists.map((list, index)=>/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)("tr", {
5663
+ children: privateGeneLists.map((list, index)=>/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)("tr", {
5568
5664
  children: [
5569
5665
  /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("td", {
5570
- children: list.name
5666
+ children: list.label
5571
5667
  }),
5572
5668
  /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("td", {
5573
- children: list.genes.length
5669
+ children: list.hash
5574
5670
  }),
5575
5671
  /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)("td", {
5576
5672
  children: [
@@ -5581,7 +5677,57 @@ const $0f50f369018a42ef$var$GeneListDisplayComponent = (props)=>{
5581
5677
  }),
5582
5678
  /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)((0, $gXNCa$reactbootstrap.Button), {
5583
5679
  variant: "danger",
5584
- onClick: ()=>$0f50f369018a42ef$var$deleteGeneList(props.api, list.id),
5680
+ onClick: ()=>$0f50f369018a42ef$var$deleteGeneList(props.api, list._id),
5681
+ className: "ml-2",
5682
+ children: "Delete"
5683
+ })
5684
+ ]
5685
+ })
5686
+ ]
5687
+ }, index))
5688
+ })
5689
+ ]
5690
+ }),
5691
+ publicGeneLists.length > 0 ? /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)((0, $gXNCa$reactbootstrap.Table), {
5692
+ striped: true,
5693
+ bordered: true,
5694
+ hover: true,
5695
+ className: "mt-4",
5696
+ children: [
5697
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("thead", {
5698
+ children: /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)("tr", {
5699
+ children: [
5700
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("th", {
5701
+ children: "List Name"
5702
+ }),
5703
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("th", {
5704
+ children: "Number of Genes"
5705
+ }),
5706
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("th", {
5707
+ children: "Actions"
5708
+ })
5709
+ ]
5710
+ })
5711
+ }),
5712
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("tbody", {
5713
+ children: publicGeneLists.map((list, index)=>/*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)("tr", {
5714
+ children: [
5715
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("td", {
5716
+ children: list.label
5717
+ }),
5718
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)("td", {
5719
+ children: list.hash
5720
+ }),
5721
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsxs)("td", {
5722
+ children: [
5723
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)((0, $gXNCa$reactbootstrap.Button), {
5724
+ variant: "info",
5725
+ onClick: ()=>$0f50f369018a42ef$var$viewGeneList(list),
5726
+ children: "View"
5727
+ }),
5728
+ /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)((0, $gXNCa$reactbootstrap.Button), {
5729
+ variant: "danger",
5730
+ onClick: ()=>$0f50f369018a42ef$var$deleteGeneList(props.api, list._id),
5585
5731
  className: "ml-2",
5586
5732
  children: "Delete"
5587
5733
  })
@@ -5606,7 +5752,7 @@ const $0f50f369018a42ef$var$viewGeneList = (list)=>{
5606
5752
  const $0f50f369018a42ef$var$deleteGeneList = async (api, listId)=>{
5607
5753
  if (window.confirm('Are you sure you want to delete this gene list?')) // Replace with the actual delete request
5608
5754
  try {
5609
- await fetch(`${api}/gene-lists/${listId}`, {
5755
+ await fetch(`${api}/gene_lists/${listId}`, {
5610
5756
  method: 'DELETE'
5611
5757
  });
5612
5758
  alert('Gene list deleted!');
@@ -5655,9 +5801,7 @@ const $0f50f369018a42ef$var$GeneListComponent = (props)=>{
5655
5801
  headers: {
5656
5802
  'Content-Type': 'application/json'
5657
5803
  },
5658
- body: JSON.stringify({
5659
- ids: geneArray
5660
- })
5804
+ body: JSON.stringify(geneArray)
5661
5805
  });
5662
5806
  const result = await response.json();
5663
5807
  if (result.hash) {
@@ -5683,7 +5827,7 @@ const $0f50f369018a42ef$var$GeneListComponent = (props)=>{
5683
5827
  const queryString = new URLSearchParams(queryParams).toString();
5684
5828
  const token = await user.getIdToken();
5685
5829
  try {
5686
- const response = await fetch(`${props.api}/gene_list?${queryString}`, {
5830
+ const response = await fetch(`${props.api}/gene_lists?${queryString}`, {
5687
5831
  method: 'POST',
5688
5832
  headers: {
5689
5833
  "Content-Type": "application/json",