gramene-search 1.6.47 → 1.7.0

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.47",
3
+ "version": "1.7.0",
4
4
  "description": "search wrapper for gramene",
5
5
  "source": "src/index.js",
6
6
  "main": "dist/index.js",
@@ -8,7 +8,8 @@ class TaxDist extends React.Component {
8
8
  constructor(props) {
9
9
  super(props);
10
10
  this.state = {
11
- collapseEmpties: true
11
+ collapseEmpties: true,
12
+ comparaOnly: true
12
13
  };
13
14
  }
14
15
  handleSelection(selections) {
@@ -23,6 +24,9 @@ class TaxDist extends React.Component {
23
24
  toggleEmpties() {
24
25
  this.setState({collapseEmpties: !this.state.collapseEmpties})
25
26
  }
27
+ toggleCompara() {
28
+ this.setState({comparaOnly: !this.state.comparaOnly})
29
+ }
26
30
  render() {
27
31
  let selectedTaxa = {};
28
32
  if (this.props.grameneSearch && this.state.collapseEmpties) {
@@ -31,15 +35,34 @@ class TaxDist extends React.Component {
31
35
  })
32
36
  }
33
37
  else {
34
- selectedTaxa = this.props.grameneGenomes.active
38
+ if (Object.keys(this.props.grameneGenomes.active).length === 0 && this.props.grameneMaps) {
39
+ Object.keys(this.props.grameneMaps).forEach(tid => selectedTaxa[tid] = true);
40
+ }
41
+ else {
42
+ selectedTaxa = this.props.grameneGenomes.active
43
+ }
44
+ }
45
+ if (this.state.comparaOnly && this.props.grameneMaps) {
46
+ Object.keys(selectedTaxa).forEach(tid => {
47
+ if (!this.props.grameneMaps[tid].in_compara) {
48
+ delete selectedTaxa[tid];
49
+ }
50
+ })
35
51
  }
36
52
  return (
37
53
  <div className="results-vis big-vis">
38
- {this.props.grameneTaxDist && <button type="button"
39
- className="btn btn-primary btn-sm"
40
- onClick={this.toggleEmpties.bind(this)}>
54
+ {this.props.grameneTaxDist && <span>
55
+ <button type="button"
56
+ className="btn btn-outline-primary btn-sm"
57
+ onClick={this.toggleEmpties.bind(this)}>
41
58
  {this.state.collapseEmpties ? 'Expand' : 'Collapse'} empty branches
42
- </button>}
59
+ </button>
60
+ <button type="button"
61
+ className="btn btn-outline-success btn-sm"
62
+ onClick={this.toggleCompara.bind(this)}>
63
+ Show {this.state.comparaOnly ? 'all genomes' : 'compara only'}
64
+ </button>
65
+ </span>}
43
66
  {this.props.grameneTaxDist && <Vis taxonomy={this.props.grameneTaxDist}
44
67
  selectedTaxa={selectedTaxa}
45
68
  onSelection={this.handleSelection.bind(this)}
@@ -63,5 +86,6 @@ export default connect(
63
86
  'selectGrameneTaxDist',
64
87
  'selectGrameneGenomes',
65
88
  'selectGrameneSearch',
89
+ 'selectGrameneMaps',
66
90
  TaxDist
67
91
  );
@@ -34,6 +34,7 @@ const Detail = props => {
34
34
  const gene = props.geneDocs[props.searchResult.id];
35
35
  const [atlasExperiment, setAtlasExperiment] = useState(null);
36
36
  const [atlasExperimentList, setAtlasExperimentList] = useState([]);
37
+ const [atlasFacets, setAtlasFacets] = useState(null);
37
38
  const [isLocal, setIsLocal] = useState(false);
38
39
  const [activeTab, setActiveTab] = useState('gene');
39
40
 
@@ -43,6 +44,7 @@ const Detail = props => {
43
44
  useEffect(() => {
44
45
  const tid = Math.floor(gene.taxon_id / 1000);
45
46
  if (props.expressionStudies[tid]) {
47
+ let facets={Differential: {}, Baseline: {}};
46
48
  let eList = props.expressionStudies[tid].sort((a,b) => {
47
49
  const a_name = `${a.type}:${a.description || a._id}`;
48
50
  const b_name = `${b.type}:${b.description || b._id}`;
@@ -52,8 +54,9 @@ const Detail = props => {
52
54
  const in_gxa = new Set(props.searchResult.expressed_in_gxa_attr_ss);
53
55
  eList = eList.filter(e => in_gxa.has(e._id))
54
56
  }
57
+ eList.forEach(e => {e.factors.forEach(factor => facets[e.type][factor] = 1);});
55
58
  setAtlasExperimentList(eList);
56
-
59
+ setAtlasFacets(facets);
57
60
  let refExp = eList.filter(e => e.isRef);
58
61
  if (refExp.length === 1) {
59
62
  setAtlasExperiment(refExp[0]._id);
package/src/demo.js CHANGED
@@ -138,9 +138,9 @@ const panSites = [
138
138
  ensemblURL: 'https://ensembl-dev.sorghumbase.org',
139
139
  ensemblSite: 'https://ensembl-dev.sorghumbase.org',
140
140
  ensemblRest: 'https://data.gramene.org/pansite-ensembl-108',
141
- grameneData: 'https://data.sorghumbase.org/auth_testing',
141
+ grameneData: 'https://data.sorghumbase.org/sorghum_v10',
142
142
  ga: 'G-L5KXDCCZ16',
143
- targetTaxonId: 4558003,
143
+ targetTaxonId: 4558001,
144
144
  alertText: 'Click the search icon in the menu bar or type /',
145
145
  showViews: true,
146
146
  details: {
package/src/index.html CHANGED
@@ -5,7 +5,7 @@
5
5
  <title>Gramene Search</title>
6
6
  <script>
7
7
  window.gramene = {};
8
- gramene.defaultServer = 'https://data.gramene.org/v68/swagger';
8
+ gramene.defaultServer = 'https://data.gramene.org/v69/swagger';
9
9
  </script>
10
10
  <script async src="./static/gramene-dalliance/dalliance-all.js"></script>
11
11
  <script async src="https://plantreactome.gramene.org/DiagramJs/diagram/diagram.nocache.js"></script>
@@ -38,4 +38,4 @@
38
38
  }
39
39
  </script>
40
40
  </body>
41
- </html>
41
+ </html>
package/src/sorghum.html CHANGED
@@ -5,7 +5,7 @@
5
5
  <title>Gramene Search</title>
6
6
  <script>
7
7
  window.gramene = {};
8
- gramene.defaultServer = 'https://data.sorghumbase.org/sorghum_v9/swagger';
8
+ gramene.defaultServer = 'https://data.sorghumbase.org/sorghum_v10/swagger';
9
9
  </script>
10
10
  <script async src="./static/gramene-dalliance/dalliance-all.js"></script>
11
11
  <script async src="https://plantreactome.gramene.org/DiagramJs/diagram/diagram.nocache.js"></script>