gramene-search 2.36.1 → 2.37.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/README.md +34 -5
- package/dist/index.js +47 -31
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -77,6 +77,31 @@ iframe to <code>dev.gramene.org/static/atlasWidget.html</code>.
|
|
|
77
77
|
band shows its factor values, sample id, replicates and TPM.
|
|
78
78
|
- **eFP Browser** (where BAR has the species): the eFP image for the chosen study.
|
|
79
79
|
|
|
80
|
+
**Download.** Paralogs and EBI Studies have a *Download* button among the heatmap's controls, and JGI Studies one in
|
|
81
|
+
the grid's toolbar. It opens a dialog that asks for a **file name** (prefilled, focused and selected) and a
|
|
82
|
+
**format**: *Tab-delimited text (.tsv)*, selected each time the dialog opens, or *JSON (.json)*. *Download* (or
|
|
83
|
+
Enter) saves the data the widget shows under that name, with the format's extension added unless the name already
|
|
84
|
+
has it, once however often it is clicked; *Cancel* saves nothing. The name is sanitised so that the browser saves the
|
|
85
|
+
file under exactly the name the dialog shows (path separators, <code>: * ? " < > |</code>, control and invisible
|
|
86
|
+
format characters and a leading <code>~</code> are removed, and it is cut to 200 bytes) and *Download* is disabled
|
|
87
|
+
while it is blank. When the heatmap shows no data ("No data match your filtering criteria…"), the dialog says there is
|
|
88
|
+
nothing to download and saves nothing.
|
|
89
|
+
|
|
90
|
+
| Sub-tab | Suggested file name | Saved |
|
|
91
|
+
| --- | --- | --- |
|
|
92
|
+
| Paralogs | <code><gene>-paralogs-<experiment></code> | the heatmap's rows (the paralogs) and columns as shown: after its filters and ordering, and only the columns in view while zoomed in |
|
|
93
|
+
| EBI Studies | <code><gene>-ebi-studies</code> | the same, one row per study (the JGI rows are left out, as on the page) |
|
|
94
|
+
| JGI Studies | <code><gene>-<JGI accession></code> | every sample of the study for the gene, one per line, whatever the grid's axes: gene, study, the study's factors, sample id, replicates and TPM |
|
|
95
|
+
|
|
96
|
+
<code><gene></code> is the id the tab queries (the gene's <code>atlas_id</code>, or its id). The TSV of a heatmap
|
|
97
|
+
starts with <code>#</code> comment lines (page URL, time, query or experiment, unit), then a header line of column
|
|
98
|
+
labels and a line per row; the grid's TSV is a plain table. The JSON has the same data with ids, units and
|
|
99
|
+
<code>null</code> for no data, and credits the data to their source: <code>Expression Atlas</code> for EBI studies,
|
|
100
|
+
<code>phytozome-next.jgi.doe.gov</code> for a JGI study drawn in Paralogs (see gramene-atlas-heatmap's README,
|
|
101
|
+
*Downloads*). For an EBI experiment the dialog of a Paralogs heatmap also links to the *Full experiment data on
|
|
102
|
+
Expression Atlas* (EBI's download, formerly the "All data" menu item); JGI studies have no such download, so it is
|
|
103
|
+
left out for them.
|
|
104
|
+
|
|
80
105
|
Details:
|
|
81
106
|
- <code>atlasUrl</code> in the site configuration names the gramene-swagger <code>/gxa/</code> instance to query,
|
|
82
107
|
e.g. <code>'https://data.sorghumbase.org/sorghum_v11/gxa/'</code>. Unset, the tab queries
|
|
@@ -89,21 +114,25 @@ Details:
|
|
|
89
114
|
- EBI Studies and JGI Studies send the gene's <code>atlas_id</code> (or its id).
|
|
90
115
|
- Links open in a new tab. <code>resolveUrl</code> in <code>Expression.js</code> points row, experiment,
|
|
91
116
|
"more information", Expression Atlas and download links at EBI, because gramene-swagger returns
|
|
92
|
-
relative gene links and an empty <code>geneQuery</code>; JGI studies keep their Phytozome links.
|
|
117
|
+
relative gene links and an empty <code>geneQuery</code>; JGI studies keep their Phytozome links. For
|
|
118
|
+
<code>'download'</code> it returns <code>null</code> when the experiment is a JGI study (a <code>source: 'JGI'</code>
|
|
119
|
+
study of the species, or a download URL at <code>jgi.doe.gov</code>, whose payload names Phytozome's genome page as
|
|
120
|
+
its download), which drops the dialog's full data link.
|
|
93
121
|
- The chosen sub-tab, Paralogs experiment, JGI study and the grid's axes per JGI study
|
|
94
122
|
(<code>jgiExperiment</code>, <code>jgiAxes</code>) are kept in <code>uiViewState.byGene[geneId].expression</code> and
|
|
95
123
|
saved with shared views.
|
|
96
124
|
- Styles are injected at runtime; Bootstrap 5 CSS and react-bootstrap 2 come from the host.
|
|
97
125
|
|
|
98
|
-
<code>gramene-atlas-heatmap</code> is a dependency (<code>^6.
|
|
99
|
-
<code>ExpressionFactorGrid</code
|
|
126
|
+
<code>gramene-atlas-heatmap</code> is a dependency (<code>^6.3.0</code>: 6.2.0 added <code>filterRows</code> and
|
|
127
|
+
<code>ExpressionFactorGrid</code>, 6.3.0 the Download dialog and <code>downloadFileName</code>) and brings in
|
|
128
|
+
<code>gramene-anatomogram</code>. To try unreleased fork changes,
|
|
100
129
|
install packed tarballs of both packages over the registry versions (not <code>npm link</code> or
|
|
101
130
|
<code>file:</code>, which load a second React); the next <code>npm install</code> puts the registry versions back.
|
|
102
131
|
```bash
|
|
103
132
|
cd ../anatomogram && npm run pack:local # gramene-anatomogram-3.0.0.tgz
|
|
104
|
-
cd ../atlas-heatmap && npm run pack:local # gramene-atlas-heatmap-6.
|
|
133
|
+
cd ../atlas-heatmap && npm run pack:local # gramene-atlas-heatmap-6.3.0.tgz
|
|
105
134
|
cd ../gramene-search && npm install --no-save ../anatomogram/gramene-anatomogram-3.0.0.tgz \
|
|
106
|
-
../atlas-heatmap/gramene-atlas-heatmap-6.
|
|
135
|
+
../atlas-heatmap/gramene-atlas-heatmap-6.3.0.tgz && rm -rf .parcel-cache*
|
|
107
136
|
```
|
|
108
137
|
Run the sorghum demo against another atlas instance (<code>ATLAS_URL</code>) and data release
|
|
109
138
|
(<code>GRAMENE_DATA</code>, default <code>https://data.sorghumbase.org/sorghum_v10b</code>); sorghum_v11 has the
|
package/dist/index.js
CHANGED
|
@@ -8158,39 +8158,43 @@ const $9e29a4f60318db7a$var$editSearch = (url, edit)=>{
|
|
|
8158
8158
|
// (genes/<id>) that only some instances redirect to EBI, and atlasUrl itself is
|
|
8159
8159
|
// not a browsable page, so point the heatmap's links at EBI's Expression Atlas.
|
|
8160
8160
|
// JGI studies link to Phytozome, which takes no geneQuery. undefined keeps the
|
|
8161
|
-
// heatmap's own URL.
|
|
8162
|
-
|
|
8163
|
-
|
|
8164
|
-
|
|
8165
|
-
|
|
8166
|
-
|
|
8167
|
-
|
|
8161
|
+
// heatmap's own URL, null drops the link. isJgiExperiment(accession) tells the
|
|
8162
|
+
// JGI studies apart: they have no full data download (their payload's download
|
|
8163
|
+
// URL is Phytozome's page for the genome), so the Download dialog of a Paralogs
|
|
8164
|
+
// heatmap drawn from one leaves out "Full experiment data on Expression Atlas".
|
|
8165
|
+
const $9e29a4f60318db7a$var$isJgiUrl = (url)=>/^https?:\/\/([^/]+\.)?jgi\.doe\.gov\//i.test(url);
|
|
8166
|
+
const $9e29a4f60318db7a$var$makeResolveUrl = (isJgiExperiment)=>(kind, url, context)=>{
|
|
8167
|
+
const genes = $9e29a4f60318db7a$var$genesOf(context);
|
|
8168
|
+
const withGenes = (params)=>{
|
|
8169
|
+
if (genes.length) params.set('geneQuery', JSON.stringify(genes.map((value)=>({
|
|
8170
|
+
value: value
|
|
8171
|
+
}))));
|
|
8172
|
+
};
|
|
8173
|
+
switch(kind){
|
|
8174
|
+
case 'row':
|
|
8175
|
+
{
|
|
8176
|
+
const uri = context.row && context.row.uri;
|
|
8177
|
+
return uri && !/^https?:/i.test(uri) ? new URL(uri, $9e29a4f60318db7a$var$EBI_GXA).href : undefined;
|
|
8178
|
+
}
|
|
8179
|
+
case 'atlas':
|
|
8180
|
+
return $9e29a4f60318db7a$var$EBI_GXA;
|
|
8181
|
+
case 'experiment':
|
|
8182
|
+
return $9e29a4f60318db7a$var$isEbiUrl(url) ? $9e29a4f60318db7a$var$editSearch(url, withGenes) : undefined;
|
|
8183
|
+
case 'moreInformation':
|
|
8184
|
+
if (context.experiment) return $9e29a4f60318db7a$var$isEbiUrl(url) ? $9e29a4f60318db7a$var$editSearch(url, withGenes) : undefined;
|
|
8185
|
+
return genes.length ? `${$9e29a4f60318db7a$var$EBI_GXA}genes/${encodeURIComponent(genes[0])}` : undefined;
|
|
8186
|
+
case 'download':
|
|
8187
|
+
if (isJgiExperiment(context.experiment) || $9e29a4f60318db7a$var$isJgiUrl(url)) return null;
|
|
8188
|
+
return $9e29a4f60318db7a$var$editSearch(url, (params)=>params.delete('geneQuery'));
|
|
8189
|
+
default:
|
|
8190
|
+
return undefined;
|
|
8191
|
+
}
|
|
8168
8192
|
};
|
|
8169
|
-
switch(kind){
|
|
8170
|
-
case 'row':
|
|
8171
|
-
{
|
|
8172
|
-
const uri = context.row && context.row.uri;
|
|
8173
|
-
return uri && !/^https?:/i.test(uri) ? new URL(uri, $9e29a4f60318db7a$var$EBI_GXA).href : undefined;
|
|
8174
|
-
}
|
|
8175
|
-
case 'atlas':
|
|
8176
|
-
return $9e29a4f60318db7a$var$EBI_GXA;
|
|
8177
|
-
case 'experiment':
|
|
8178
|
-
return $9e29a4f60318db7a$var$isEbiUrl(url) ? $9e29a4f60318db7a$var$editSearch(url, withGenes) : undefined;
|
|
8179
|
-
case 'moreInformation':
|
|
8180
|
-
if (context.experiment) return $9e29a4f60318db7a$var$isEbiUrl(url) ? $9e29a4f60318db7a$var$editSearch(url, withGenes) : undefined;
|
|
8181
|
-
return genes.length ? `${$9e29a4f60318db7a$var$EBI_GXA}genes/${encodeURIComponent(genes[0])}` : undefined;
|
|
8182
|
-
case 'download':
|
|
8183
|
-
return $9e29a4f60318db7a$var$editSearch(url, (params)=>params.delete('geneQuery'));
|
|
8184
|
-
default:
|
|
8185
|
-
return undefined;
|
|
8186
|
-
}
|
|
8187
|
-
};
|
|
8188
8193
|
const $9e29a4f60318db7a$var$HEATMAP_OPTIONS = {
|
|
8189
8194
|
showAnatomogram: true,
|
|
8190
8195
|
isWidget: true,
|
|
8191
8196
|
showControlMenu: true,
|
|
8192
|
-
linkTarget: '_blank'
|
|
8193
|
-
resolveUrl: $9e29a4f60318db7a$var$resolveUrl
|
|
8197
|
+
linkTarget: '_blank'
|
|
8194
8198
|
};
|
|
8195
8199
|
const $9e29a4f60318db7a$var$studyLabel = (e)=>`${e.type}:${e.description || e._id}`;
|
|
8196
8200
|
const $9e29a4f60318db7a$var$jgiStudyLabel = (e)=>e.description ? `${e.name || e._id}: ${e.description}` : e.name || e._id;
|
|
@@ -8326,6 +8330,13 @@ const $9e29a4f60318db7a$var$Detail = (props)=>{
|
|
|
8326
8330
|
}, [
|
|
8327
8331
|
allJgiKey
|
|
8328
8332
|
]);
|
|
8333
|
+
// A new resolveUrl does not redraw a heatmap: it asks the latest one for its links.
|
|
8334
|
+
const resolveUrl = (0, $gXNCa$react.useMemo)(()=>{
|
|
8335
|
+
const accessions = new Set(allJgiStudies.map((e)=>e._id));
|
|
8336
|
+
return $9e29a4f60318db7a$var$makeResolveUrl((accession)=>accessions.has(accession));
|
|
8337
|
+
}, [
|
|
8338
|
+
allJgiKey
|
|
8339
|
+
]);
|
|
8329
8340
|
// The EBI Studies heatmap waits for the studies list, which names the JGI
|
|
8330
8341
|
// studies its filter drops: drawn before the list is in (a first visit; the
|
|
8331
8342
|
// list is persisted), it would show the JGI rows and then redraw without
|
|
@@ -8388,9 +8399,11 @@ const $9e29a4f60318db7a$var$Detail = (props)=>{
|
|
|
8388
8399
|
}),
|
|
8389
8400
|
activeTab === "paralogs" && /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)((0, $gXNCa$grameneatlasheatmap.ExpressionAtlasHeatmap), {
|
|
8390
8401
|
...$9e29a4f60318db7a$var$HEATMAP_OPTIONS,
|
|
8402
|
+
resolveUrl: resolveUrl,
|
|
8391
8403
|
atlasUrl: atlasUrl,
|
|
8392
8404
|
query: paralogsQuery,
|
|
8393
|
-
experiment: atlasExperiment
|
|
8405
|
+
experiment: atlasExperiment,
|
|
8406
|
+
downloadFileName: `${geneQuery}-paralogs-${atlasExperiment}`
|
|
8394
8407
|
}, `${atlasUrl} ${atlasExperiment} ${paralogQuery}`)
|
|
8395
8408
|
]
|
|
8396
8409
|
}, "gxaparalogs"),
|
|
@@ -8406,10 +8419,12 @@ const $9e29a4f60318db7a$var$Detail = (props)=>{
|
|
|
8406
8419
|
}),
|
|
8407
8420
|
activeTab === "gene" && studiesSettled && /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)((0, $gXNCa$grameneatlasheatmap.ExpressionAtlasHeatmap), {
|
|
8408
8421
|
...$9e29a4f60318db7a$var$HEATMAP_OPTIONS,
|
|
8422
|
+
resolveUrl: resolveUrl,
|
|
8409
8423
|
atlasUrl: atlasUrl,
|
|
8410
8424
|
query: allStudiesQuery,
|
|
8411
8425
|
experiment: false,
|
|
8412
|
-
filterRows: filterRows
|
|
8426
|
+
filterRows: filterRows,
|
|
8427
|
+
downloadFileName: `${geneQuery}-ebi-studies`
|
|
8413
8428
|
}, `${atlasUrl} all ${geneQuery}`)
|
|
8414
8429
|
]
|
|
8415
8430
|
}, "gxa"),
|
|
@@ -8453,8 +8468,9 @@ const $9e29a4f60318db7a$var$Detail = (props)=>{
|
|
|
8453
8468
|
rowFactor: jgiAxesOfStudy.rowFactor,
|
|
8454
8469
|
columnFactor: jgiAxesOfStudy.columnFactor,
|
|
8455
8470
|
onChangeFactors: setJgiAxes,
|
|
8471
|
+
downloadFileName: `${geneQuery}-${jgiExperiment}`,
|
|
8456
8472
|
linkTarget: "_blank",
|
|
8457
|
-
resolveUrl:
|
|
8473
|
+
resolveUrl: resolveUrl
|
|
8458
8474
|
}, `${atlasUrl} ${jgiExperiment} ${geneQuery}`)
|
|
8459
8475
|
]
|
|
8460
8476
|
}, "jgi"),
|