gramene-search 1.6.26 → 1.6.27

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gramene-search",
3
- "version": "1.6.26",
3
+ "version": "1.6.27",
4
4
  "description": "search wrapper for gramene",
5
5
  "source": "src/index.js",
6
6
  "main": "dist/index.js",
@@ -43,6 +43,7 @@
43
43
  "querystringify": "^2.2.0",
44
44
  "react": "^17.0.2",
45
45
  "react-bootstrap": "^2.7.2",
46
+ "react-bootstrap-typeahead": "^6.4.1",
46
47
  "react-debounce-input": "^3.2.5",
47
48
  "react-dom": "17.0.2",
48
49
  "react-ga4": "^2.1.0",
@@ -1,6 +1,9 @@
1
1
  import React, { useRef, useEffect, useState } from 'react'
2
2
  import {connect} from "redux-bundler-react";
3
3
  import {Tabs, Tab, Form, Row, Col} from 'react-bootstrap';
4
+ import { Typeahead } from 'react-bootstrap-typeahead'; // ES2015
5
+ // Import as a module in your JS
6
+ import 'react-bootstrap-typeahead/css/Typeahead.css';
4
7
  import BAR, {haveBAR} from "gramene-efp-browser";
5
8
 
6
9
  function DynamicIframe(props) {
@@ -42,7 +45,11 @@ const Detail = props => {
42
45
  useEffect(() => {
43
46
  const tid = Math.floor(gene.taxon_id / 1000);
44
47
  if (props.expressionStudies[tid]) {
45
- let eList = props.expressionStudies[tid].filter(e => e.type === "Baseline");
48
+ let eList = props.expressionStudies[tid];
49
+ if (props.searchResult.hasOwnProperty('expressed_in_gxa_attr_ss')) {
50
+ const in_gxa = new Set(props.searchResult.expressed_in_gxa_attr_ss);
51
+ eList = props.expressionStudies[tid].filter(e => in_gxa.has(e._id));
52
+ }
46
53
  setAtlasExperimentList(eList);
47
54
 
48
55
  let refExp = eList.filter(e => e.isRef);
@@ -56,7 +63,7 @@ const Detail = props => {
56
63
  }, [props.expressionStudies]);
57
64
 
58
65
  let paralogs_url;
59
- let gene_url = `https://dev.gramene.org/static/atlasWidget.html?genes=${gene.atlas_id || gene._id}&localAPI=${isLocal}`;
66
+ let gene_url = `https://dev.gramene.org/static/atlasWidget.html?genes=${gene.atlas_id || gene._id}&experiment=${atlasExperiment}&localAPI=${isLocal}`;
60
67
  let paralogs = [];
61
68
  if (gene.homology && gene.homology.homologous_genes && gene.homology.homologous_genes.within_species_paralog) {
62
69
  paralogs = gene.homology.homologous_genes.within_species_paralog;
@@ -64,38 +71,39 @@ const Detail = props => {
64
71
  if (paralogs.length > 1 && atlasExperiment) {
65
72
  paralogs_url= `https://dev.gramene.org/static/atlasWidget.html?genes=${paralogs.join(' ')}&experiment=${atlasExperiment}&localAPI=${isLocal}`;
66
73
  }
74
+ const ref = useRef(null);
75
+ const ref2 = useRef(null);
67
76
  return <Tabs>
68
77
  {paralogs_url &&
69
78
  <Tab tabClassName="gxa" eventKey="paralogs" title={`Paralogs`} key="gxaparalogs">
70
- <Form>
71
- <Form.Check
72
- type="switch"
73
- id="localAPI"
74
- label="Local API"
75
- checked={isLocal}
76
- onChange={handleLocalAPIChange}
77
- />
78
- <Form.Group as={Row} className="mb-3" controlId="formGroupExperiment">
79
- <Form.Label column sm={1}>Experiment</Form.Label>
80
- <Col sm={5}>
81
- <Form.Select defaultValue={atlasExperiment} onChange={(e) => setAtlasExperiment(e.target.value)}>
82
- {atlasExperimentList.map((experiment, index) => (
83
- <option key={index} value={experiment._id}>{experiment.description || experiment._id}</option>
84
- ))}
85
- </Form.Select>
86
- </Col>
87
- </Form.Group>
88
- </Form>
79
+ <Typeahead clearButton size='sm'
80
+ id="experiment-selector"
81
+ ref={ref}
82
+ labelKey="experiment"
83
+ onChange={(exps) => {if (exps.length > 0) {setAtlasExperiment(exps[0]._id);setTimeout(() => ref.current?.clear(), 2000)}}}
84
+ placeholder="Choose an experiment..."
85
+ options={atlasExperimentList}
86
+ labelKey={(experiment) => `${experiment.type}: ${experiment.description || experiment._id}`}
87
+ />
89
88
  <DynamicIframe url={paralogs_url}/>
90
89
  </Tab>
91
90
  }
92
91
  <Tab tabClassName="gxa" eventKey="gene" title="All Studies" key="gxa">
93
- <Form.Check
94
- type="switch"
95
- id="localAPI"
96
- label="Local API"
97
- checked={isLocal}
98
- onChange={handleLocalAPIChange}
92
+ {/*<Form.Check*/}
93
+ {/* type="switch"*/}
94
+ {/* id="localAPI"*/}
95
+ {/* label="Local API"*/}
96
+ {/* checked={isLocal}*/}
97
+ {/* onChange={handleLocalAPIChange}*/}
98
+ {/*/>*/}
99
+ <Typeahead clearButton size='sm'
100
+ id="experiment-selector2"
101
+ ref={ref}
102
+ labelKey="experiment"
103
+ onChange={(exps) => {if (exps.length > 0) {setAtlasExperiment(exps[0]._id);setTimeout(() => ref.current?.clear(), 2000)}}}
104
+ placeholder="Choose an experiment..."
105
+ options={atlasExperimentList}
106
+ labelKey={(experiment) => `${experiment.type}: ${experiment.description || experiment._id}`}
99
107
  />
100
108
  <DynamicIframe url={gene_url}/>
101
109
  </Tab>
@@ -106,9 +114,9 @@ const Detail = props => {
106
114
  };
107
115
 
108
116
  export default connect(
109
- // 'selectParalogExpression',
117
+ //'selectParalogExpression',
110
118
  'selectExpressionStudies',
111
- 'doRequestParalogExpression',
119
+ //'doRequestParalogExpression',
112
120
  Detail
113
121
  );
114
122
 
package/src/demo.js CHANGED
@@ -44,8 +44,8 @@ const panSites = [
44
44
  url: 'https://www.gramene.org',
45
45
  ensemblURL: 'https://ensembl.gramene.org',
46
46
  ensemblSite: 'https://ensembl.gramene.org',
47
- ensemblRest: 'https://data.gramene.org/ensembl68',
48
- grameneData: 'https://data.gramene.org/v68',
47
+ ensemblRest: 'https://data.gramene.org/ensembl69',
48
+ grameneData: 'https://data.gramene.org/v69',
49
49
  ga: 'G-ZTEQBFCRXZ',
50
50
  targetTaxonId: 3702,
51
51
  alertText: 'Main site',
@@ -89,10 +89,10 @@ const panSites = [
89
89
  ensemblURL: 'https://test.gramene.org',
90
90
  ensemblSite: 'https://test.gramene.org',
91
91
  ensemblRest: 'https://data.gramene.org/pansite-ensembl-108',
92
- grameneData: 'https://data.gramene.org/maize_v5',
92
+ grameneData: 'https://data.sorghumbase.org/auth_testing',
93
93
  targetTaxonId: 4577,
94
94
  ga: "G-Y7ZYG1R8QT",
95
- showViews: false,
95
+ showViews: true,
96
96
  not_downtime: 'The search interface will be undergoing maintenance on Tuesday, July 20 from 3:00 - 4:00 PM EDT',
97
97
  details: {
98
98
  sequences: true,