gramene-search 2.0.0 → 2.0.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.
Binary file
Binary file
@@ -1,2 +1,2 @@
1
- 299077950
2
- 1777056892357556000
1
+ 299715150
2
+ 1777062532991053000
package/dist/index.js CHANGED
@@ -1534,9 +1534,9 @@ const $24971af0a229e0e3$var$grameneViews = {
1534
1534
  if (!hasFirebase) options = options.filter((v)=>v.id !== 'userLists');
1535
1535
  if (overrides) options = options.filter((v)=>overrides[v.id] !== 'hidden');
1536
1536
  options = options.map((v)=>{
1537
- if (autoDisable && resultDependentIds.has(v.id)) return {
1537
+ if (resultDependentIds.has(v.id) && autoDisable) return {
1538
1538
  ...v,
1539
- show: 'disabled'
1539
+ show: 'off'
1540
1540
  };
1541
1541
  if (!overrides) return v;
1542
1542
  const o = overrides[v.id];
@@ -2037,7 +2037,7 @@ var $0d54502f6cafe273$export$2e2bcd8739ae039 = $0d54502f6cafe273$var$grameneGeno
2037
2037
 
2038
2038
 
2039
2039
  var $65709bd8598fce20$exports = {};
2040
- $65709bd8598fce20$exports = JSON.parse('{"groups":{"core":{"label":"Core identifiers","order":0},"location":{"label":"Genomic location","order":1},"structure":{"label":"Gene structure","order":2},"homology":{"label":"Homology","order":3},"expression":{"label":"Gene expression","order":4},"differential":{"label":"Differential expression","order":5},"hierarchical":{"label":"Hierarchical annotations","order":6},"pathways":{"label":"Pathways","order":7},"GO":{"label":"Gene Ontology","order":7},"PO":{"label":"Plant Ontology","order":8},"lof":{"label":"Loss of function alleles","order":9},"MAKER":{"label":"MAKER transcript metrics","order":10},"xrefs":{"label":"External references","order":11},"other":{"label":"Other","order":99}},"patterns":[{"id":"homology","match":"^homology__(.+)$","group":"homology","multiValued":true,"labelTemplate":"Homology: $1"},{"id":"pathways","match":"^pathways__(.+)$","group":"pathways","multiValued":true,"labelTemplate":"Pathway: $1"},{"id":"maker","match":"^MAKER__(.+)__attr_([a-z])$","group":"MAKER","labelTemplate":"MAKER: $1"},{"id":"xrefs","match":"^(.+)__xrefs$","group":"xrefs","multiValued":true,"labelTemplate":"$1 (xrefs)"},{"id":"expr","match":"^(E[-_][A-Za-z0-9_-]+?)_g(\\\\d+)__expr$","group":"expression","expression":true,"labelTemplate":"$1 \xb7 g$2"},{"id":"diffexpr","match":"^(E[-_][A-Za-z0-9_-]+?)_g(\\\\d+)_g(\\\\d+)_(pval|logfc|l2fc)_attr_([a-z])$","group":"differential","diffExpression":true,"labelTemplate":"$1 \xb7 g$2 vs g$3 \xb7 $4"},{"id":"bins","match":"^(fixed|uniform)_([0-9a-zA-Z]+)__bin$","group":"bins","is_hidden":true,"labelTemplate":"$1 bin ($2)"},{"id":"neighbors","match":".*neighbors_[0-9]+$","group":"neighbors","is_hidden":true,"labelTemplate":"neighbors"},{"id":"vep_merged","match":"^VEP__merged__(NAT|EMS)__attr_ss$","group":"lof","multiValued":true,"labelTemplate":"Merged $1 accessions"},{"id":"vep_detail","match":"^VEP__(.+?)__(homo|het)__(.+?)__(\\\\d+)__attr_ss$","group":"lof","multiValued":true,"labelTemplate":"$1 ($2) $3/$4"},{"id":"generic_attr","match":"^(.+)__attr_([a-z])$","group":"other","labelTemplate":"$1"}],"fields":{"id":{"group":"core","label":"Gene ID","order":1},"name":{"group":"core","label":"Name","order":2},"description":{"group":"core","label":"Description","order":4},"summary":{"group":"core","label":"Summary","order":5},"synonyms":{"group":"core","label":"Synonyms","multiValued":true,"order":3},"biotype":{"group":"core","label":"Biotype","order":6},"taxon_id":{"group":"core","label":"Taxon ID","order":8},"system_name":{"group":"core","label":"System name","order":7},"db_type":{"group":"core","label":"DB type","order":9},"closest_rep_id":{"group":"homology","label":"Closest representative ID","order":1},"closest_rep_name":{"group":"homology","label":"Closest representative name","order":2},"closest_rep_identity":{"group":"homology","label":"Closest representative identity","order":3},"closest_rep_taxon_id":{"group":"homology","label":"Closest representative taxon","order":4},"closest_rep_description":{"group":"homology","label":"Closest representative description","order":5},"model_rep_id":{"group":"homology","label":"Model representative ID","order":6},"model_rep_name":{"group":"homology","label":"Model representative name","order":7},"model_rep_identity":{"group":"homology","label":"Model representative identity","order":8},"model_rep_taxon_id":{"group":"homology","label":"Model representative taxon","order":9},"model_rep_description":{"group":"homology","label":"Model representative description","order":10},"gene_tree":{"group":"homology","label":"Gene tree ID","order":11},"pan_tree":{"group":"homology","label":"Pan-gene tree ID","order":14},"capabilities":{"group":"other","label":"Capabilities","multiValued":true},"map":{"group":"location","label":"Map","order":1},"region":{"group":"location","label":"Region","order":2},"start":{"group":"location","label":"Start","order":3},"end":{"group":"location","label":"End","order":4},"strand":{"group":"location","label":"Strand","order":5},"GO__ancestors":{"group":"hierarchical","label":"GO terms","multiValued":true,"order":1},"PO__ancestors":{"group":"hierarchical","label":"PO terms","multiValued":true,"order":2},"TO__ancestors":{"group":"hierarchical","label":"TO terms","multiValued":true,"order":3},"QTL_TO__ancestors":{"group":"hierarchical","label":"QTL traits (TO)","multiValued":true,"order":7},"domains__ancestors":{"group":"hierarchical","label":"Domains","multiValued":true,"order":4},"taxonomy__ancestors":{"group":"hierarchical","label":"Taxonomy","multiValued":true,"order":6},"supertree_attr_s":{"group":"homology","label":"Supertree","order":13},"gene_tree_root_taxon_id":{"group":"homology","label":"Gene tree root taxon","order":12},"protein__length":{"group":"structure","label":"Protein length"},"transcript__count":{"group":"structure","label":"Transcript count"},"transcript__exons":{"group":"structure","label":"Exon count"},"transcript__length":{"group":"structure","label":"Transcript length"},"expressed_in_gxa_attr_ss":{"group":"expression","label":"Expressed in GXA","multiValued":true},"MAKER__AED__attr_f":{"group":"MAKER","label":"AED","description":"Annotation Edit Distance"},"MAKER__QI1__attr_i":{"group":"MAKER","label":"QI1: Length of the 5\' UTR"},"MAKER__QI2__attr_f":{"group":"MAKER","label":"QI2: Fraction of splice sites confirmed by EST"},"MAKER__QI3__attr_f":{"group":"MAKER","label":"QI3: Fraction of exons overlapping an EST"},"MAKER__QI4__attr_f":{"group":"MAKER","label":"QI4: Fraction of exons overlapping EST or protein"},"MAKER__QI5__attr_f":{"group":"MAKER","label":"QI5: Fraction of splice sites confirmed by SNAP"},"MAKER__QI6__attr_f":{"group":"MAKER","label":"QI6: Fraction of exons overlapping a SNAP"},"MAKER__QI7__attr_i":{"group":"MAKER","label":"QI7: Number of exons in the mRNA"},"MAKER__QI8__attr_i":{"group":"MAKER","label":"QI8: Length of the 3\' UTR"},"MAKER__QI9__attr_i":{"group":"MAKER","label":"QI9: Length of the protein sequence"},"homology__all_orthologs":{"group":"homology","label":"All orthologs","multiValued":true,"order":15},"homology__ortholog_one2one":{"group":"homology","label":"1:1 orthologs","multiValued":true,"order":16},"homology__ortholog_one2many":{"group":"homology","label":"1:many orthologs","multiValued":true,"order":17},"homology__ortholog_many2many":{"group":"homology","label":"Many:many orthologs","multiValued":true,"order":18},"homology__syntenic_ortholog_one2one":{"group":"homology","label":"Syntenic 1:1 orthologs","multiValued":true,"order":19},"homology__within_species_paralog":{"group":"homology","label":"Within-species paralogs","multiValued":true,"order":20},"pathways__ancestors":{"group":"hierarchical","label":"Pathways","multiValued":true,"order":5},"canonical_transcript__attr_s":{"group":"structure","label":"Canonical transcript ID"}},"hidden":["_version_","_terms","score","gene_idx","gene_idx_multi","species_idx","compara_idx","compara_idx_multi","_id","annotations","bins","gene_structure","homology","location","xrefs","domain_roots","familyRoot__ancestors","taxonomy__ancestors","capabilities"]}');
2040
+ $65709bd8598fce20$exports = JSON.parse('{"groups":{"core":{"label":"Core identifiers","order":0},"location":{"label":"Genomic location","order":1},"structure":{"label":"Gene structure","order":2},"homology":{"label":"Homology","order":3},"expression":{"label":"Gene expression","order":4},"differential":{"label":"Differential expression","order":5},"hierarchical":{"label":"Hierarchical annotations","order":6},"pathways":{"label":"Pathways","order":7},"GO":{"label":"Gene Ontology","order":7},"PO":{"label":"Plant Ontology","order":8},"lof":{"label":"Loss of function alleles","order":9},"MAKER":{"label":"MAKER transcript metrics","order":10},"xrefs":{"label":"External references","order":11},"other":{"label":"Other","order":99}},"patterns":[{"id":"homology","match":"^homology__(.+)$","group":"homology","multiValued":true,"labelTemplate":"Homology: $1"},{"id":"pathways","match":"^pathways__(.+)$","group":"pathways","multiValued":true,"labelTemplate":"Pathway: $1"},{"id":"maker","match":"^MAKER__(.+)__attr_([a-z])$","group":"MAKER","labelTemplate":"MAKER: $1"},{"id":"xrefs","match":"^(.+)__xrefs$","group":"xrefs","multiValued":true,"labelTemplate":"$1 (xrefs)"},{"id":"expr","match":"^(E[-_][A-Za-z0-9_-]+?)_g(\\\\d+)__expr$","group":"expression","expression":true,"labelTemplate":"$1 \xb7 g$2"},{"id":"diffexpr","match":"^(E[-_][A-Za-z0-9_-]+?)_g(\\\\d+)_g(\\\\d+)_(pval|logfc|l2fc)_attr_([a-z])$","group":"differential","diffExpression":true,"labelTemplate":"$1 \xb7 g$2 vs g$3 \xb7 $4"},{"id":"bins","match":"^(fixed|uniform)_([0-9a-zA-Z]+)__bin$","group":"bins","is_hidden":true,"labelTemplate":"$1 bin ($2)"},{"id":"neighbors","match":".*neighbors_[0-9]+$","group":"neighbors","is_hidden":true,"labelTemplate":"neighbors"},{"id":"vep_merged","match":"^VEP__merged__(NAT|EMS)__attr_ss$","group":"lof","multiValued":true,"labelTemplate":"Merged $1 accessions"},{"id":"vep_detail","match":"^VEP__(.+?)__(homo|het)__(.+?)__(\\\\d+)__attr_ss$","group":"lof","multiValued":true,"labelTemplate":"$1 ($2) $3/$4"},{"id":"generic_attr","match":"^(.+)__attr_([a-z])$","group":"other","labelTemplate":"$1"}],"fields":{"id":{"group":"core","label":"Gene ID","order":1},"name":{"group":"core","label":"Name","order":2},"description":{"group":"core","label":"Description","order":4},"summary":{"group":"core","label":"Summary","order":5},"synonyms":{"group":"core","label":"Synonyms","multiValued":true,"order":3},"biotype":{"group":"core","label":"Biotype","order":6},"taxon_id":{"group":"core","label":"Taxon ID","order":8},"system_name":{"group":"core","label":"System name","order":7},"db_type":{"group":"core","label":"DB type","order":9},"closest_rep_id":{"group":"homology","label":"Closest representative ID","order":1},"closest_rep_name":{"group":"homology","label":"Closest representative name","order":2},"closest_rep_identity":{"group":"homology","label":"Closest representative identity","order":3},"closest_rep_taxon_id":{"group":"homology","label":"Closest representative taxon","order":4},"closest_rep_description":{"group":"homology","label":"Closest representative description","order":5},"model_rep_id":{"group":"homology","label":"Model representative ID","order":6},"model_rep_name":{"group":"homology","label":"Model representative name","order":7},"model_rep_identity":{"group":"homology","label":"Model representative identity","order":8},"model_rep_taxon_id":{"group":"homology","label":"Model representative taxon","order":9},"model_rep_description":{"group":"homology","label":"Model representative description","order":10},"gene_tree":{"group":"homology","label":"Gene tree ID","order":11},"pan_tree":{"group":"homology","label":"Pan-gene tree ID","order":14},"capabilities":{"group":"other","label":"Capabilities","multiValued":true},"map":{"group":"location","label":"Map","order":1},"region":{"group":"location","label":"Region","order":2},"start":{"group":"location","label":"Start","order":3},"end":{"group":"location","label":"End","order":4},"strand":{"group":"location","label":"Strand","order":5},"GO__ancestors":{"group":"hierarchical","label":"GO terms","multiValued":true,"order":1},"PO__ancestors":{"group":"hierarchical","label":"PO terms","multiValued":true,"order":2},"TO__ancestors":{"group":"hierarchical","label":"TO terms","multiValued":true,"order":3},"QTL_TO__ancestors":{"group":"hierarchical","label":"QTL traits (TO)","multiValued":true,"order":7},"domains__ancestors":{"group":"hierarchical","label":"Domains","multiValued":true,"order":4},"taxonomy__ancestors":{"group":"hierarchical","label":"Taxonomy","multiValued":true,"order":6},"supertree_attr_s":{"group":"homology","label":"Supertree","order":13},"gene_tree_root_taxon_id":{"group":"homology","label":"Gene tree root taxon","order":12},"protein__length":{"group":"structure","label":"Protein length"},"transcript__count":{"group":"structure","label":"Transcript count"},"transcript__exons":{"group":"structure","label":"Exon count"},"transcript__length":{"group":"structure","label":"Transcript length"},"expressed_in_gxa_attr_ss":{"group":"expression","label":"Expressed in GXA","multiValued":true},"MAKER__AED__attr_f":{"group":"MAKER","label":"AED","description":"Annotation Edit Distance"},"MAKER__QI1__attr_i":{"group":"MAKER","label":"QI1: Length of the 5\' UTR"},"MAKER__QI2__attr_f":{"group":"MAKER","label":"QI2: Fraction of splice sites confirmed by EST"},"MAKER__QI3__attr_f":{"group":"MAKER","label":"QI3: Fraction of exons overlapping an EST"},"MAKER__QI4__attr_f":{"group":"MAKER","label":"QI4: Fraction of exons overlapping EST or protein"},"MAKER__QI5__attr_f":{"group":"MAKER","label":"QI5: Fraction of splice sites confirmed by SNAP"},"MAKER__QI6__attr_f":{"group":"MAKER","label":"QI6: Fraction of exons overlapping a SNAP"},"MAKER__QI7__attr_i":{"group":"MAKER","label":"QI7: Number of exons in the mRNA"},"MAKER__QI8__attr_i":{"group":"MAKER","label":"QI8: Length of the 3\' UTR"},"MAKER__QI9__attr_i":{"group":"MAKER","label":"QI9: Length of the protein sequence"},"homology__all_orthologs":{"group":"homology","label":"All orthologs","multiValued":true,"order":15},"homology__ortholog_one2one":{"group":"homology","label":"1:1 orthologs","multiValued":true,"order":16},"homology__ortholog_one2many":{"group":"homology","label":"1:many orthologs","multiValued":true,"order":17},"homology__ortholog_many2many":{"group":"homology","label":"Many:many orthologs","multiValued":true,"order":18},"homology__syntenic_ortholog_one2one":{"group":"homology","label":"Syntenic 1:1 orthologs","multiValued":true,"order":19},"homology__within_species_paralog":{"group":"homology","label":"Within-species paralogs","multiValued":true,"order":20},"pathways__ancestors":{"group":"hierarchical","label":"Pathways","multiValued":true,"order":5},"canonical_transcript__attr_s":{"group":"structure","label":"Canonical transcript ID"}},"hidden":["_version_","_terms","score","gene_idx","gene_idx_multi","species_idx","compara_idx","compara_idx_multi","_id","annotations","bins","gene_structure","homology","location","xrefs","domain_roots","familyRoot__ancestors","taxonomy__ancestors","capabilities","saved_search"]}');
2041
2041
 
2042
2042
 
2043
2043
  const $49d5cbca2ec74b2f$export$428c2f647a2a7545 = {
@@ -2126,10 +2126,24 @@ const $49d5cbca2ec74b2f$export$428c2f647a2a7545 = {
2126
2126
  };
2127
2127
 
2128
2128
 
2129
- const $0f839422d0d8c772$var$SAMPLE_QUERY = 'capabilities:expression';
2130
- const $0f839422d0d8c772$var$SAMPLE_ROWS = 500;
2131
- const $0f839422d0d8c772$var$DIFFEXPR_FL = 'id,*_pval_attr_f,*_logfc_attr_f,*_l2fc_attr_f';
2132
- const $0f839422d0d8c772$var$DIFFEXPR_ROWS_PER_TAXON = 50;
2129
+ // Fields matched by these globs are multi-valued in Solr.
2130
+ const $0f839422d0d8c772$var$MULTIVALUED_PATTERNS = [
2131
+ /__expr$/,
2132
+ /__ancestors$/,
2133
+ /__xrefs$/,
2134
+ /^VEP__/,
2135
+ /^homology__/
2136
+ ];
2137
+ function $0f839422d0d8c772$var$parseCsvHeader(text) {
2138
+ if (!text) return [];
2139
+ const line = text.split(/\r?\n/, 1)[0] || '';
2140
+ return line.split(',').map((s)=>s.trim().replace(/^"|"$/g, '')).filter(Boolean);
2141
+ }
2142
+ function $0f839422d0d8c772$var$synthesizedValue(name) {
2143
+ return $0f839422d0d8c772$var$MULTIVALUED_PATTERNS.some((re)=>re.test(name)) ? [
2144
+ 0
2145
+ ] : 0;
2146
+ }
2133
2147
  function $0f839422d0d8c772$var$applyTemplate(tpl, match) {
2134
2148
  if (!tpl) return null;
2135
2149
  return tpl.replace(/\$(\d+)/g, (_, n)=>match[+n] || '');
@@ -2178,40 +2192,13 @@ function $0f839422d0d8c772$var$inferType(value) {
2178
2192
  if (Array.isArray(value)) return 'array<' + (value.length ? $0f839422d0d8c772$var$inferType(value[0]) : 'unknown') + '>';
2179
2193
  return typeof value;
2180
2194
  }
2181
- function $0f839422d0d8c772$var$extractSwaggerFields(swagger) {
2182
- const defs = swagger && swagger.definitions || {};
2183
- const out = {};
2184
- const collect = (schemaName, prefix = '')=>{
2185
- const def = defs[schemaName];
2186
- if (!def || !def.properties) return;
2187
- for (const [prop, spec] of Object.entries(def.properties)){
2188
- const fullName = prefix ? `${prefix}.${prop}` : prop;
2189
- let type = spec.type || 'object';
2190
- if (spec.$ref) type = 'ref:' + spec.$ref.split('/').pop();
2191
- if (spec.type === 'array') {
2192
- const inner = spec.items || {};
2193
- type = 'array<' + (inner.type || (inner.$ref ? inner.$ref.split('/').pop() : 'unknown')) + '>';
2194
- }
2195
- out[fullName] = {
2196
- name: fullName,
2197
- type: type,
2198
- description: spec.description || '',
2199
- source: 'swagger'
2200
- };
2201
- }
2202
- };
2203
- collect('Result');
2204
- collect('GeneDocument');
2205
- return out;
2206
- }
2207
- function $0f839422d0d8c772$var$buildCatalog(swagger, sampleDocs) {
2195
+ function $0f839422d0d8c772$var$buildCatalog(sampleDocs) {
2208
2196
  const hidden = new Set((0, (/*@__PURE__*/$parcel$interopDefault($65709bd8598fce20$exports))).hidden || []);
2209
2197
  const overlayFields = (0, (/*@__PURE__*/$parcel$interopDefault($65709bd8598fce20$exports))).fields || {};
2210
2198
  const patterns = (0, (/*@__PURE__*/$parcel$interopDefault($65709bd8598fce20$exports))).patterns || [];
2211
2199
  const groupsMeta = (0, (/*@__PURE__*/$parcel$interopDefault($65709bd8598fce20$exports))).groups || {};
2212
- const swaggerFields = $0f839422d0d8c772$var$extractSwaggerFields(swagger);
2213
- // Union keys across sample docs + swagger keys
2214
- const keys = new Set(Object.keys(swaggerFields));
2200
+ // Union keys from overlay.fields (hardcoded catalog entries) and sample docs.
2201
+ const keys = new Set(Object.keys(overlayFields));
2215
2202
  const sampleValues = {};
2216
2203
  for (const doc of sampleDocs || [])for (const [k, v] of Object.entries(doc)){
2217
2204
  keys.add(k);
@@ -2225,8 +2212,7 @@ function $0f839422d0d8c772$var$buildCatalog(swagger, sampleDocs) {
2225
2212
  if (classified && classified.isHidden) continue;
2226
2213
  const sampleVal = sampleValues[name];
2227
2214
  const sampleType = sampleVal !== undefined ? $0f839422d0d8c772$var$inferType(sampleVal) : null;
2228
- const swaggerEntry = swaggerFields[name];
2229
- const group = overlayEntry && overlayEntry.group || classified && classified.group || (swaggerEntry ? 'core' : 'other');
2215
+ const group = overlayEntry && overlayEntry.group || classified && classified.group || 'other';
2230
2216
  let label = overlayEntry && overlayEntry.label || classified && classified.label || name;
2231
2217
  let tsvHeader = null;
2232
2218
  if (classified && classified.patternId === 'vep_detail') {
@@ -2243,13 +2229,13 @@ function $0f839422d0d8c772$var$buildCatalog(swagger, sampleDocs) {
2243
2229
  tsvHeader: tsvHeader,
2244
2230
  group: group,
2245
2231
  order: overlayEntry && overlayEntry.order != null ? overlayEntry.order : null,
2246
- description: overlayEntry && overlayEntry.description || swaggerEntry && swaggerEntry.description || '',
2247
- type: sampleType || swaggerEntry && swaggerEntry.type || 'unknown',
2232
+ description: overlayEntry && overlayEntry.description || '',
2233
+ type: sampleType || 'unknown',
2248
2234
  multiValued: multiValued,
2249
2235
  patternId: classified ? classified.patternId : null,
2250
2236
  matchGroups: classified ? classified.matchGroups : null,
2251
2237
  expression: !!(classified && classified.expression),
2252
- source: overlayEntry ? 'overlay' : swaggerEntry ? 'swagger' : 'sample'
2238
+ source: overlayEntry ? 'overlay' : 'sample'
2253
2239
  };
2254
2240
  }
2255
2241
  // Build groups (explicit overlay.order first, then natural sort by label)
@@ -2273,7 +2259,6 @@ function $0f839422d0d8c772$var$buildCatalog(swagger, sampleDocs) {
2273
2259
  })).sort((a, b)=>a.order - b.order);
2274
2260
  return {
2275
2261
  fetchedAt: Date.now(),
2276
- swaggerInfo: swagger && swagger.info ? swagger.info : null,
2277
2262
  groups: groups,
2278
2263
  fields: fields
2279
2264
  };
@@ -2285,52 +2270,10 @@ const $0f839422d0d8c772$var$grameneFieldCatalog = (0, $gXNCa$reduxbundler.create
2285
2270
  staleAfter: 300000,
2286
2271
  getPromise: ({ store: store })=>{
2287
2272
  const api = store.selectGrameneAPI();
2288
- const swaggerUrl = typeof store.selectGrameneSwaggerURL === 'function' ? store.selectGrameneSwaggerURL() : `${api}/swagger`;
2289
- const sampleUrl = `${api}/search?q=${encodeURIComponent($0f839422d0d8c772$var$SAMPLE_QUERY)}&rows=${$0f839422d0d8c772$var$SAMPLE_ROWS}&fl=*`;
2290
- const experimentsUrl = `${api}/experiments?rows=-1`;
2291
- const mapsUrl = `${api}/maps?rows=-1`;
2292
- return Promise.all([
2293
- fetch(swaggerUrl).then((r)=>r.json()).catch(()=>null),
2294
- fetch(sampleUrl).then((r)=>r.json()).catch(()=>null),
2295
- fetch(experimentsUrl).then((r)=>r.json()).catch(()=>[]),
2296
- fetch(mapsUrl).then((r)=>r.json()).catch(()=>[])
2297
- ]).then(([swagger, sample, experiments, maps])=>{
2298
- const docs = sample && sample.response && sample.response.docs || [];
2299
- // Determine which species (anchor taxa) have differential experiments,
2300
- // then for each run a narrow discovery query scoped to that species'
2301
- // strain taxa so we actually surface their diffexpr field names.
2302
- const diffTaxa = [
2303
- ...new Set((experiments || []).filter((e)=>e && e.type === 'Differential' && e.taxon_id).map((e)=>e.taxon_id))
2304
- ];
2305
- const strainsByAnchor = {};
2306
- for (const m of maps || []){
2307
- const anchor = m && m.anchor_taxon_id;
2308
- if (!anchor) continue;
2309
- (strainsByAnchor[anchor] = strainsByAnchor[anchor] || []).push(m.taxon_id);
2310
- }
2311
- const discoveryFetches = diffTaxa.map((t)=>{
2312
- const strains = strainsByAnchor[t] || [
2313
- t
2314
- ];
2315
- const fq = `taxon_id:(${strains.join(' OR ')})`;
2316
- const url = `${api}/search?q=${encodeURIComponent($0f839422d0d8c772$var$SAMPLE_QUERY)}` + `&rows=${$0f839422d0d8c772$var$DIFFEXPR_ROWS_PER_TAXON}` + `&fl=${encodeURIComponent($0f839422d0d8c772$var$DIFFEXPR_FL)}` + `&fq=${encodeURIComponent(fq)}`;
2317
- return fetch(url).then((r)=>r.json()).catch(()=>null);
2318
- });
2319
- return Promise.all(discoveryFetches).then((results)=>{
2320
- const diffDocs = results.flatMap((r)=>r && r.response && r.response.docs || []);
2321
- return $0f839422d0d8c772$var$buildCatalog(swagger, [
2322
- ...docs,
2323
- ...diffDocs
2324
- ]);
2325
- });
2326
- });
2273
+ const url = `${api}/search?q=*:*&rows=0&wt=csv&fl=*`;
2274
+ return fetch(url).then((r)=>r.text()).then((text)=>$0f839422d0d8c772$var$parseCsvHeader(text)).catch(()=>null);
2327
2275
  }
2328
2276
  });
2329
- $0f839422d0d8c772$var$grameneFieldCatalog.reactGrameneFieldCatalog = (0, $gXNCa$reduxbundler.createSelector)('selectGrameneFieldCatalogShouldUpdate', (shouldUpdate)=>{
2330
- if (shouldUpdate) return {
2331
- actionCreator: 'doFetchGrameneFieldCatalog'
2332
- };
2333
- });
2334
2277
  function $0f839422d0d8c772$var$assayFactorLabel(assay) {
2335
2278
  if (!assay) return '';
2336
2279
  const factors = Array.isArray(assay.factor) ? assay.factor : [];
@@ -2705,7 +2648,48 @@ function $0f839422d0d8c772$var$enrichLabels(catalog, expressionStudies, expressi
2705
2648
  groups: groups
2706
2649
  };
2707
2650
  }
2708
- $0f839422d0d8c772$var$grameneFieldCatalog.selectFieldCatalog = (0, $gXNCa$reduxbundler.createSelector)('selectGrameneFieldCatalog', 'selectExpressionStudies', 'selectExpressionSamples', 'selectGrameneSearch', 'selectGrameneMaps', $0f839422d0d8c772$var$enrichLabels);
2651
+ function $0f839422d0d8c772$var$filterCatalogByPresentFields(catalog, present) {
2652
+ if (!catalog || !catalog.fields || !present) return catalog;
2653
+ const filteredFields = {};
2654
+ for (const [name, f] of Object.entries(catalog.fields))if (present.has(name)) filteredFields[name] = f;
2655
+ const hasContent = (g)=>g.fields && g.fields.length > 0 || g.subgroups && g.subgroups.some(hasContent);
2656
+ const filterGroup = (g)=>{
2657
+ const fields = (g.fields || []).filter((n)=>present.has(n));
2658
+ const subgroups = (g.subgroups || []).map(filterGroup).filter(hasContent);
2659
+ return {
2660
+ ...g,
2661
+ fields: fields,
2662
+ subgroups: subgroups
2663
+ };
2664
+ };
2665
+ const groups = (catalog.groups || []).map(filterGroup).filter(hasContent);
2666
+ return {
2667
+ ...catalog,
2668
+ fields: filteredFields,
2669
+ groups: groups
2670
+ };
2671
+ }
2672
+ $0f839422d0d8c772$var$grameneFieldCatalog.selectFieldCatalog = (0, $gXNCa$reduxbundler.createSelector)('selectGrameneFieldCatalog', 'selectExpressionStudies', 'selectExpressionSamples', 'selectGrameneSearch', 'selectGrameneMaps', (fieldNames, studies, samples, search, maps)=>{
2673
+ if (!fieldNames || !fieldNames.length) return null;
2674
+ const present = new Set(fieldNames);
2675
+ // Build a synthetic doc from the discovered field names; values carry the
2676
+ // right JS type so inferType picks the correct multiValued/type (arrays
2677
+ // for multi-valued fields, scalars otherwise). Derive pval/logfc
2678
+ // companions from every l2fc field.
2679
+ const doc = {};
2680
+ for (const name of present){
2681
+ doc[name] = $0f839422d0d8c772$var$synthesizedValue(name);
2682
+ if (/_l2fc_attr_f$/.test(name)) {
2683
+ doc[name.replace('_l2fc_', '_pval_')] = 0;
2684
+ doc[name.replace('_l2fc_', '_logfc_')] = 0;
2685
+ }
2686
+ }
2687
+ const catalog = $0f839422d0d8c772$var$buildCatalog([
2688
+ doc
2689
+ ]);
2690
+ const enriched = $0f839422d0d8c772$var$enrichLabels(catalog, studies, samples, search, maps);
2691
+ return $0f839422d0d8c772$var$filterCatalogByPresentFields(enriched, present);
2692
+ });
2709
2693
  $0f839422d0d8c772$var$grameneFieldCatalog.selectFieldCatalogGroups = (0, $gXNCa$reduxbundler.createSelector)('selectFieldCatalog', (catalog)=>catalog && catalog.groups || []);
2710
2694
  $0f839422d0d8c772$var$grameneFieldCatalog.selectFieldCatalogByName = (0, $gXNCa$reduxbundler.createSelector)('selectFieldCatalog', (catalog)=>catalog && catalog.fields || {});
2711
2695
  var $0f839422d0d8c772$export$2e2bcd8739ae039 = $0f839422d0d8c772$var$grameneFieldCatalog;
@@ -10079,11 +10063,17 @@ var $76f7f9e488184bf9$export$2e2bcd8739ae039 = (0, $gXNCa$reduxbundlerreact.conn
10079
10063
  const $37b3bb0145d266b0$var$MIN_LEFT_PCT = 15;
10080
10064
  const $37b3bb0145d266b0$var$MAX_LEFT_PCT = 85;
10081
10065
  const $37b3bb0145d266b0$var$ExporterViewCmp = (props)=>{
10082
- const { fieldCatalog: catalog, grameneFieldCatalogIsLoading: isLoading, grameneFieldCatalogRaw: raw } = props;
10066
+ const { fieldCatalog: catalog, grameneFieldCatalogIsLoading: isLoading, grameneFieldCatalogRaw: raw, grameneFieldCatalogShouldUpdate: shouldUpdate, doFetchGrameneFieldCatalog: doFetchGrameneFieldCatalog } = props;
10083
10067
  const [fieldQuery, setFieldQuery] = (0, $gXNCa$react.useState)('');
10084
10068
  const [leftPct, setLeftPct] = (0, $gXNCa$react.useState)(50);
10085
10069
  const [dragging, setDragging] = (0, $gXNCa$react.useState)(false);
10086
10070
  const containerRef = (0, $gXNCa$react.useRef)(null);
10071
+ (0, $gXNCa$react.useEffect)(()=>{
10072
+ if (shouldUpdate) doFetchGrameneFieldCatalog();
10073
+ }, [
10074
+ shouldUpdate,
10075
+ doFetchGrameneFieldCatalog
10076
+ ]);
10087
10077
  const onPointerMove = (0, $gXNCa$react.useCallback)((e)=>{
10088
10078
  const el = containerRef.current;
10089
10079
  if (!el) return;
@@ -10197,7 +10187,7 @@ const $37b3bb0145d266b0$var$ExporterViewCmp = (props)=>{
10197
10187
  ]
10198
10188
  });
10199
10189
  };
10200
- var $37b3bb0145d266b0$export$2e2bcd8739ae039 = (0, $gXNCa$reduxbundlerreact.connect)('selectFieldCatalog', 'selectGrameneFieldCatalogIsLoading', 'selectGrameneFieldCatalogRaw', $37b3bb0145d266b0$var$ExporterViewCmp);
10190
+ var $37b3bb0145d266b0$export$2e2bcd8739ae039 = (0, $gXNCa$reduxbundlerreact.connect)('selectFieldCatalog', 'selectGrameneFieldCatalogIsLoading', 'selectGrameneFieldCatalogRaw', 'selectGrameneFieldCatalogShouldUpdate', 'doFetchGrameneFieldCatalog', $37b3bb0145d266b0$var$ExporterViewCmp);
10201
10191
 
10202
10192
 
10203
10193