gramene-search 2.0.0 → 2.0.2

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
+ 299767252
2
+ 1777063118526964000
package/dist/index.js CHANGED
@@ -1526,7 +1526,8 @@ const $24971af0a229e0e3$var$grameneViews = {
1526
1526
  const hasFilters = !!(filters && filters.rightIdx > 1);
1527
1527
  const resultDependentIds = new Set([
1528
1528
  'taxonomy',
1529
- 'list'
1529
+ 'list',
1530
+ 'export'
1530
1531
  ]);
1531
1532
  const autoDisable = numFound === 0 || !hasFilters;
1532
1533
  const hasFirebase = !!(config && config.firebaseConfig);
@@ -1534,9 +1535,9 @@ const $24971af0a229e0e3$var$grameneViews = {
1534
1535
  if (!hasFirebase) options = options.filter((v)=>v.id !== 'userLists');
1535
1536
  if (overrides) options = options.filter((v)=>overrides[v.id] !== 'hidden');
1536
1537
  options = options.map((v)=>{
1537
- if (autoDisable && resultDependentIds.has(v.id)) return {
1538
+ if (resultDependentIds.has(v.id) && autoDisable) return {
1538
1539
  ...v,
1539
- show: 'disabled'
1540
+ show: 'off'
1540
1541
  };
1541
1542
  if (!overrides) return v;
1542
1543
  const o = overrides[v.id];
@@ -1551,6 +1552,11 @@ const $24971af0a229e0e3$var$grameneViews = {
1551
1552
  show: o
1552
1553
  };
1553
1554
  });
1555
+ const anyOtherOn = options.some((v)=>v.id !== 'help' && v.show === 'on');
1556
+ if (!anyOtherOn) options = options.map((v)=>v.id === 'help' ? {
1557
+ ...v,
1558
+ show: 'on'
1559
+ } : v);
1554
1560
  return {
1555
1561
  ...raw,
1556
1562
  options: options
@@ -2037,7 +2043,7 @@ var $0d54502f6cafe273$export$2e2bcd8739ae039 = $0d54502f6cafe273$var$grameneGeno
2037
2043
 
2038
2044
 
2039
2045
  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"]}');
2046
+ $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
2047
 
2042
2048
 
2043
2049
  const $49d5cbca2ec74b2f$export$428c2f647a2a7545 = {
@@ -2126,10 +2132,24 @@ const $49d5cbca2ec74b2f$export$428c2f647a2a7545 = {
2126
2132
  };
2127
2133
 
2128
2134
 
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;
2135
+ // Fields matched by these globs are multi-valued in Solr.
2136
+ const $0f839422d0d8c772$var$MULTIVALUED_PATTERNS = [
2137
+ /__expr$/,
2138
+ /__ancestors$/,
2139
+ /__xrefs$/,
2140
+ /^VEP__/,
2141
+ /^homology__/
2142
+ ];
2143
+ function $0f839422d0d8c772$var$parseCsvHeader(text) {
2144
+ if (!text) return [];
2145
+ const line = text.split(/\r?\n/, 1)[0] || '';
2146
+ return line.split(',').map((s)=>s.trim().replace(/^"|"$/g, '')).filter(Boolean);
2147
+ }
2148
+ function $0f839422d0d8c772$var$synthesizedValue(name) {
2149
+ return $0f839422d0d8c772$var$MULTIVALUED_PATTERNS.some((re)=>re.test(name)) ? [
2150
+ 0
2151
+ ] : 0;
2152
+ }
2133
2153
  function $0f839422d0d8c772$var$applyTemplate(tpl, match) {
2134
2154
  if (!tpl) return null;
2135
2155
  return tpl.replace(/\$(\d+)/g, (_, n)=>match[+n] || '');
@@ -2178,40 +2198,13 @@ function $0f839422d0d8c772$var$inferType(value) {
2178
2198
  if (Array.isArray(value)) return 'array<' + (value.length ? $0f839422d0d8c772$var$inferType(value[0]) : 'unknown') + '>';
2179
2199
  return typeof value;
2180
2200
  }
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) {
2201
+ function $0f839422d0d8c772$var$buildCatalog(sampleDocs) {
2208
2202
  const hidden = new Set((0, (/*@__PURE__*/$parcel$interopDefault($65709bd8598fce20$exports))).hidden || []);
2209
2203
  const overlayFields = (0, (/*@__PURE__*/$parcel$interopDefault($65709bd8598fce20$exports))).fields || {};
2210
2204
  const patterns = (0, (/*@__PURE__*/$parcel$interopDefault($65709bd8598fce20$exports))).patterns || [];
2211
2205
  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));
2206
+ // Union keys from overlay.fields (hardcoded catalog entries) and sample docs.
2207
+ const keys = new Set(Object.keys(overlayFields));
2215
2208
  const sampleValues = {};
2216
2209
  for (const doc of sampleDocs || [])for (const [k, v] of Object.entries(doc)){
2217
2210
  keys.add(k);
@@ -2225,8 +2218,7 @@ function $0f839422d0d8c772$var$buildCatalog(swagger, sampleDocs) {
2225
2218
  if (classified && classified.isHidden) continue;
2226
2219
  const sampleVal = sampleValues[name];
2227
2220
  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');
2221
+ const group = overlayEntry && overlayEntry.group || classified && classified.group || 'other';
2230
2222
  let label = overlayEntry && overlayEntry.label || classified && classified.label || name;
2231
2223
  let tsvHeader = null;
2232
2224
  if (classified && classified.patternId === 'vep_detail') {
@@ -2243,13 +2235,13 @@ function $0f839422d0d8c772$var$buildCatalog(swagger, sampleDocs) {
2243
2235
  tsvHeader: tsvHeader,
2244
2236
  group: group,
2245
2237
  order: overlayEntry && overlayEntry.order != null ? overlayEntry.order : null,
2246
- description: overlayEntry && overlayEntry.description || swaggerEntry && swaggerEntry.description || '',
2247
- type: sampleType || swaggerEntry && swaggerEntry.type || 'unknown',
2238
+ description: overlayEntry && overlayEntry.description || '',
2239
+ type: sampleType || 'unknown',
2248
2240
  multiValued: multiValued,
2249
2241
  patternId: classified ? classified.patternId : null,
2250
2242
  matchGroups: classified ? classified.matchGroups : null,
2251
2243
  expression: !!(classified && classified.expression),
2252
- source: overlayEntry ? 'overlay' : swaggerEntry ? 'swagger' : 'sample'
2244
+ source: overlayEntry ? 'overlay' : 'sample'
2253
2245
  };
2254
2246
  }
2255
2247
  // Build groups (explicit overlay.order first, then natural sort by label)
@@ -2273,7 +2265,6 @@ function $0f839422d0d8c772$var$buildCatalog(swagger, sampleDocs) {
2273
2265
  })).sort((a, b)=>a.order - b.order);
2274
2266
  return {
2275
2267
  fetchedAt: Date.now(),
2276
- swaggerInfo: swagger && swagger.info ? swagger.info : null,
2277
2268
  groups: groups,
2278
2269
  fields: fields
2279
2270
  };
@@ -2285,52 +2276,10 @@ const $0f839422d0d8c772$var$grameneFieldCatalog = (0, $gXNCa$reduxbundler.create
2285
2276
  staleAfter: 300000,
2286
2277
  getPromise: ({ store: store })=>{
2287
2278
  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
- });
2279
+ const url = `${api}/search?q=*:*&rows=0&wt=csv&fl=*`;
2280
+ return fetch(url).then((r)=>r.text()).then((text)=>$0f839422d0d8c772$var$parseCsvHeader(text)).catch(()=>null);
2327
2281
  }
2328
2282
  });
2329
- $0f839422d0d8c772$var$grameneFieldCatalog.reactGrameneFieldCatalog = (0, $gXNCa$reduxbundler.createSelector)('selectGrameneFieldCatalogShouldUpdate', (shouldUpdate)=>{
2330
- if (shouldUpdate) return {
2331
- actionCreator: 'doFetchGrameneFieldCatalog'
2332
- };
2333
- });
2334
2283
  function $0f839422d0d8c772$var$assayFactorLabel(assay) {
2335
2284
  if (!assay) return '';
2336
2285
  const factors = Array.isArray(assay.factor) ? assay.factor : [];
@@ -2705,7 +2654,48 @@ function $0f839422d0d8c772$var$enrichLabels(catalog, expressionStudies, expressi
2705
2654
  groups: groups
2706
2655
  };
2707
2656
  }
2708
- $0f839422d0d8c772$var$grameneFieldCatalog.selectFieldCatalog = (0, $gXNCa$reduxbundler.createSelector)('selectGrameneFieldCatalog', 'selectExpressionStudies', 'selectExpressionSamples', 'selectGrameneSearch', 'selectGrameneMaps', $0f839422d0d8c772$var$enrichLabels);
2657
+ function $0f839422d0d8c772$var$filterCatalogByPresentFields(catalog, present) {
2658
+ if (!catalog || !catalog.fields || !present) return catalog;
2659
+ const filteredFields = {};
2660
+ for (const [name, f] of Object.entries(catalog.fields))if (present.has(name)) filteredFields[name] = f;
2661
+ const hasContent = (g)=>g.fields && g.fields.length > 0 || g.subgroups && g.subgroups.some(hasContent);
2662
+ const filterGroup = (g)=>{
2663
+ const fields = (g.fields || []).filter((n)=>present.has(n));
2664
+ const subgroups = (g.subgroups || []).map(filterGroup).filter(hasContent);
2665
+ return {
2666
+ ...g,
2667
+ fields: fields,
2668
+ subgroups: subgroups
2669
+ };
2670
+ };
2671
+ const groups = (catalog.groups || []).map(filterGroup).filter(hasContent);
2672
+ return {
2673
+ ...catalog,
2674
+ fields: filteredFields,
2675
+ groups: groups
2676
+ };
2677
+ }
2678
+ $0f839422d0d8c772$var$grameneFieldCatalog.selectFieldCatalog = (0, $gXNCa$reduxbundler.createSelector)('selectGrameneFieldCatalog', 'selectExpressionStudies', 'selectExpressionSamples', 'selectGrameneSearch', 'selectGrameneMaps', (fieldNames, studies, samples, search, maps)=>{
2679
+ if (!fieldNames || !fieldNames.length) return null;
2680
+ const present = new Set(fieldNames);
2681
+ // Build a synthetic doc from the discovered field names; values carry the
2682
+ // right JS type so inferType picks the correct multiValued/type (arrays
2683
+ // for multi-valued fields, scalars otherwise). Derive pval/logfc
2684
+ // companions from every l2fc field.
2685
+ const doc = {};
2686
+ for (const name of present){
2687
+ doc[name] = $0f839422d0d8c772$var$synthesizedValue(name);
2688
+ if (/_l2fc_attr_f$/.test(name)) {
2689
+ doc[name.replace('_l2fc_', '_pval_')] = 0;
2690
+ doc[name.replace('_l2fc_', '_logfc_')] = 0;
2691
+ }
2692
+ }
2693
+ const catalog = $0f839422d0d8c772$var$buildCatalog([
2694
+ doc
2695
+ ]);
2696
+ const enriched = $0f839422d0d8c772$var$enrichLabels(catalog, studies, samples, search, maps);
2697
+ return $0f839422d0d8c772$var$filterCatalogByPresentFields(enriched, present);
2698
+ });
2709
2699
  $0f839422d0d8c772$var$grameneFieldCatalog.selectFieldCatalogGroups = (0, $gXNCa$reduxbundler.createSelector)('selectFieldCatalog', (catalog)=>catalog && catalog.groups || []);
2710
2700
  $0f839422d0d8c772$var$grameneFieldCatalog.selectFieldCatalogByName = (0, $gXNCa$reduxbundler.createSelector)('selectFieldCatalog', (catalog)=>catalog && catalog.fields || {});
2711
2701
  var $0f839422d0d8c772$export$2e2bcd8739ae039 = $0f839422d0d8c772$var$grameneFieldCatalog;
@@ -10079,11 +10069,17 @@ var $76f7f9e488184bf9$export$2e2bcd8739ae039 = (0, $gXNCa$reduxbundlerreact.conn
10079
10069
  const $37b3bb0145d266b0$var$MIN_LEFT_PCT = 15;
10080
10070
  const $37b3bb0145d266b0$var$MAX_LEFT_PCT = 85;
10081
10071
  const $37b3bb0145d266b0$var$ExporterViewCmp = (props)=>{
10082
- const { fieldCatalog: catalog, grameneFieldCatalogIsLoading: isLoading, grameneFieldCatalogRaw: raw } = props;
10072
+ const { fieldCatalog: catalog, grameneFieldCatalogIsLoading: isLoading, grameneFieldCatalogRaw: raw, grameneFieldCatalogShouldUpdate: shouldUpdate, doFetchGrameneFieldCatalog: doFetchGrameneFieldCatalog } = props;
10083
10073
  const [fieldQuery, setFieldQuery] = (0, $gXNCa$react.useState)('');
10084
10074
  const [leftPct, setLeftPct] = (0, $gXNCa$react.useState)(50);
10085
10075
  const [dragging, setDragging] = (0, $gXNCa$react.useState)(false);
10086
10076
  const containerRef = (0, $gXNCa$react.useRef)(null);
10077
+ (0, $gXNCa$react.useEffect)(()=>{
10078
+ if (shouldUpdate) doFetchGrameneFieldCatalog();
10079
+ }, [
10080
+ shouldUpdate,
10081
+ doFetchGrameneFieldCatalog
10082
+ ]);
10087
10083
  const onPointerMove = (0, $gXNCa$react.useCallback)((e)=>{
10088
10084
  const el = containerRef.current;
10089
10085
  if (!el) return;
@@ -10197,7 +10193,7 @@ const $37b3bb0145d266b0$var$ExporterViewCmp = (props)=>{
10197
10193
  ]
10198
10194
  });
10199
10195
  };
10200
- var $37b3bb0145d266b0$export$2e2bcd8739ae039 = (0, $gXNCa$reduxbundlerreact.connect)('selectFieldCatalog', 'selectGrameneFieldCatalogIsLoading', 'selectGrameneFieldCatalogRaw', $37b3bb0145d266b0$var$ExporterViewCmp);
10196
+ var $37b3bb0145d266b0$export$2e2bcd8739ae039 = (0, $gXNCa$reduxbundlerreact.connect)('selectFieldCatalog', 'selectGrameneFieldCatalogIsLoading', 'selectGrameneFieldCatalogRaw', 'selectGrameneFieldCatalogShouldUpdate', 'doFetchGrameneFieldCatalog', $37b3bb0145d266b0$var$ExporterViewCmp);
10201
10197
 
10202
10198
 
10203
10199