gramene-search 2.41.0 → 2.41.1
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 +15 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -232,6 +232,14 @@ $parcel$export(module.exports, "bootViewFromUrl", () => $c69c61828e36a328$export
|
|
|
232
232
|
|
|
233
233
|
|
|
234
234
|
|
|
235
|
+
// The API the gene Expression tab takes its studies from: configuration
|
|
236
|
+
// expressionApi when set, for a site whose own index has no expression studies
|
|
237
|
+
// or attributes but shares its genes (by id) with one that does, as Gramene
|
|
238
|
+
// Maize (maize_v5) does with Gramene's current release.
|
|
239
|
+
const $9d9aeaf9299e61a1$var$expressionApi = (store)=>{
|
|
240
|
+
const cfg = store.selectConfiguration();
|
|
241
|
+
return (cfg && cfg.expressionApi || store.selectGrameneAPI()).replace(/\/$/, '');
|
|
242
|
+
};
|
|
235
243
|
const $9d9aeaf9299e61a1$var$facets = [
|
|
236
244
|
"{!facet.limit='300' facet.mincount='1' key='taxon_id'}taxon_id",
|
|
237
245
|
// "{!facet.limit='100' facet.mincount='1' key='genetree'}gene_tree",
|
|
@@ -423,7 +431,7 @@ const $9d9aeaf9299e61a1$var$expressionStudies = (0, $gXNCa$reduxbundler.createAs
|
|
|
423
431
|
persist: true,
|
|
424
432
|
staleAfter: 86400000,
|
|
425
433
|
getPromise: ({ store: store })=>{
|
|
426
|
-
return fetch(`${store
|
|
434
|
+
return fetch(`${$9d9aeaf9299e61a1$var$expressionApi(store)}/experiments?rows=-1`).then((res)=>res.json()).then((res)=>(0, ($parcel$interopDefault($gXNCa$lodash))).groupBy(res, 'taxon_id'));
|
|
427
435
|
}
|
|
428
436
|
});
|
|
429
437
|
// Only fetch when a view that consumes expression studies is enabled.
|
|
@@ -766,8 +774,10 @@ const $9d9aeaf9299e61a1$var$grameneParalogs = {
|
|
|
766
774
|
// e.g. ['E-MTAB-3839', 'JGI-SB-2']), keyed by gene id. The search results do
|
|
767
775
|
// not carry the field (it is not among /search's default fields), so the
|
|
768
776
|
// Expression tab asks for it gene by gene. Each entry is {pending: true} while
|
|
769
|
-
// the request is out, then {studies: [...]}
|
|
770
|
-
//
|
|
777
|
+
// the request is out, then {studies: [...]}, or {studies: null} when the
|
|
778
|
+
// request failed (asked again next time) or the gene's doc lacks the field:
|
|
779
|
+
// older indexes (e.g. maize_v5) never carry it, so its absence can't be read
|
|
780
|
+
// as "in no study". A site with an expressionApi asks that instead.
|
|
771
781
|
const $9d9aeaf9299e61a1$var$grameneGeneStudies = {
|
|
772
782
|
name: 'grameneGeneStudies',
|
|
773
783
|
getReducer: ()=>(state = {}, { type: type, payload: payload })=>{
|
|
@@ -805,12 +815,12 @@ const $9d9aeaf9299e61a1$var$grameneGeneStudies = {
|
|
|
805
815
|
payload: geneId
|
|
806
816
|
});
|
|
807
817
|
const q = encodeURIComponent(`id:"${geneId}"`);
|
|
808
|
-
fetch(`${store
|
|
818
|
+
fetch(`${$9d9aeaf9299e61a1$var$expressionApi(store)}/search?q=${q}&fl=id,expressed_in_gxa_attr_ss&rows=1`).then((res)=>{
|
|
809
819
|
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
|
810
820
|
return res.json();
|
|
811
821
|
}).then((res)=>{
|
|
812
822
|
const doc = res.response.docs.find((d)=>d.id === geneId);
|
|
813
|
-
const studies = doc && doc.expressed_in_gxa_attr_ss ||
|
|
823
|
+
const studies = doc && doc.expressed_in_gxa_attr_ss || null;
|
|
814
824
|
dispatch({
|
|
815
825
|
type: 'GRAMENE_GENE_STUDIES_RECEIVED',
|
|
816
826
|
payload: {
|