gramene-search 2.0.5 → 2.0.6

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
- 316800798
2
- 1777346326753367000
1
+ 316936686
2
+ 1777348108097495000
package/dist/index.js CHANGED
@@ -2076,7 +2076,7 @@ var $0d54502f6cafe273$export$2e2bcd8739ae039 = $0d54502f6cafe273$var$grameneGeno
2076
2076
 
2077
2077
 
2078
2078
  var $65709bd8598fce20$exports = {};
2079
- $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"]}');
2079
+ $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|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"]}');
2080
2080
 
2081
2081
 
2082
2082
  const $49d5cbca2ec74b2f$export$428c2f647a2a7545 = {
@@ -2379,14 +2379,13 @@ function $0f839422d0d8c772$var$buildSpeciesNameIndex(grameneMaps) {
2379
2379
  function $0f839422d0d8c772$var$fieldExperimentId(name) {
2380
2380
  let m = name.match(/^(\w+?)_g\d+__expr$/);
2381
2381
  if (m) return m[1].replace(/_/g, '-');
2382
- m = name.match(/^(\w+?)_g\d+_g\d+_(pval|logfc|l2fc)_attr_[a-z]$/);
2382
+ m = name.match(/^(\w+?)_g\d+_g\d+_(pval|l2fc)_attr_[a-z]$/);
2383
2383
  if (m) return m[1].replace(/_/g, '-');
2384
2384
  return null;
2385
2385
  }
2386
2386
  const $0f839422d0d8c772$var$STAT_RANK = {
2387
2387
  l2fc: 0,
2388
- logfc: 1,
2389
- pval: 2
2388
+ pval: 1
2390
2389
  };
2391
2390
  function $0f839422d0d8c772$var$collapseDiffExprInSubgroups(subgroups, fieldsOut, collator) {
2392
2391
  for (const taxGroup of subgroups)for (const expGroup of taxGroup.subgroups || []){
@@ -2423,7 +2422,7 @@ function $0f839422d0d8c772$var$collapseDiffExprInSubgroups(subgroups, fieldsOut,
2423
2422
  });
2424
2423
  const rep = names[0];
2425
2424
  const repEntry = fieldsOut[rep];
2426
- const label = (repEntry.label || rep).replace(/\s+\((?:pval|logfc|l2fc)\)/, '');
2425
+ const label = (repEntry.label || rep).replace(/\s+\((?:pval|l2fc)\)/, '');
2427
2426
  fieldsOut[rep] = {
2428
2427
  ...repEntry,
2429
2428
  label: label,
@@ -2726,15 +2725,12 @@ $0f839422d0d8c772$var$grameneFieldCatalog.selectFieldCatalog = (0, $gXNCa$reduxb
2726
2725
  const present = new Set(fieldNames);
2727
2726
  // Build a synthetic doc from the discovered field names; values carry the
2728
2727
  // right JS type so inferType picks the correct multiValued/type (arrays
2729
- // for multi-valued fields, scalars otherwise). Derive pval/logfc
2730
- // companions from every l2fc field.
2728
+ // for multi-valued fields, scalars otherwise). Derive the pval companion
2729
+ // from every l2fc field.
2731
2730
  const doc = {};
2732
2731
  for (const name of present){
2733
2732
  doc[name] = $0f839422d0d8c772$var$synthesizedValue(name);
2734
- if (/_l2fc_attr_f$/.test(name)) {
2735
- doc[name.replace('_l2fc_', '_pval_')] = 0;
2736
- doc[name.replace('_l2fc_', '_logfc_')] = 0;
2737
- }
2733
+ if (/_l2fc_attr_f$/.test(name)) doc[name.replace('_l2fc_', '_pval_')] = 0;
2738
2734
  }
2739
2735
  const catalog = $0f839422d0d8c772$var$buildCatalog([
2740
2736
  doc
@@ -2749,7 +2745,7 @@ var $0f839422d0d8c772$export$2e2bcd8739ae039 = $0f839422d0d8c772$var$grameneFiel
2749
2745
 
2750
2746
 
2751
2747
  const $6d28e8e62a4d602f$var$EXPR_FIELD_RE = /^(E[-_][A-Za-z0-9_-]+?)_g(\d+)__expr$/;
2752
- const $6d28e8e62a4d602f$var$DIFFEXPR_FIELD_RE = /^(E[-_][A-Za-z0-9_-]+?)_g(\d+)_g(\d+)_(pval|logfc|l2fc)_attr_([a-z])$/;
2748
+ const $6d28e8e62a4d602f$var$DIFFEXPR_FIELD_RE = /^(E[-_][A-Za-z0-9_-]+?)_g(\d+)_g(\d+)_(pval|l2fc)_attr_([a-z])$/;
2753
2749
  const $6d28e8e62a4d602f$export$adbe84e3322ddf23 = [
2754
2750
  'experiment',
2755
2751
  'experiment_name',
@@ -2874,7 +2870,7 @@ function $6d28e8e62a4d602f$export$ba4cd509d0763838(doc, diffExpressionFields, ex
2874
2870
  byContrast.set(key, entry);
2875
2871
  }
2876
2872
  if (parsed.stat === 'pval') entry.pval = val;
2877
- else entry.l2fc = val; // l2fc or logfc
2873
+ else entry.l2fc = val;
2878
2874
  }
2879
2875
  const maxPval = cutoffs && cutoffs.diffMaxPval;
2880
2876
  const maxPvalActive = maxPval !== null && maxPval !== undefined && maxPval !== '' && Number.isFinite(+maxPval);
@@ -11390,12 +11386,22 @@ const $4ab64e76c1caef59$var$baseColDefs = [
11390
11386
  suppressMovable: true
11391
11387
  }
11392
11388
  ];
11389
+ // Hoisted so the reference is stable across renders. ag-grid otherwise sees a
11390
+ // "new" defaultColDef on every parent re-render (e.g. when hovering a row
11391
+ // triggers setHoveredId in the parent) and re-applies column state, which
11392
+ // snaps any user-resized columns back to their original widths.
11393
+ const $4ab64e76c1caef59$var$DEFAULT_COL_DEF = {
11394
+ resizable: true,
11395
+ sortable: true,
11396
+ filter: false,
11397
+ suppressMenu: true
11398
+ };
11393
11399
  function $4ab64e76c1caef59$var$arraysEqual(a, b) {
11394
11400
  if (a.length !== b.length) return false;
11395
11401
  for(let i = 0; i < a.length; i++)if (a[i] !== b[i]) return false;
11396
11402
  return true;
11397
11403
  }
11398
- function $4ab64e76c1caef59$var$buildFieldInfo(fields, studies, expressionSamples) {
11404
+ function $4ab64e76c1caef59$export$7b242440eb2c300d(fields, studies, expressionSamples) {
11399
11405
  const info = {};
11400
11406
  if (!fields || !studies || !expressionSamples) return info;
11401
11407
  const wanted = new Set(fields);
@@ -11684,7 +11690,7 @@ function $4ab64e76c1caef59$var$buildColumnDefs(fields, fieldInfo, expanded, togg
11684
11690
  ];
11685
11691
  }
11686
11692
  const $4ab64e76c1caef59$var$ExprTable = ({ rows: rows, fields: fields, onReorder: onReorder, studies: studies, expressionSamples: expressionSamples, onHoverRow: onHoverRow })=>{
11687
- const fieldInfo = (0, $gXNCa$react.useMemo)(()=>$4ab64e76c1caef59$var$buildFieldInfo(fields, studies, expressionSamples), [
11693
+ const fieldInfo = (0, $gXNCa$react.useMemo)(()=>$4ab64e76c1caef59$export$7b242440eb2c300d(fields, studies, expressionSamples), [
11688
11694
  fields,
11689
11695
  studies,
11690
11696
  expressionSamples
@@ -11730,12 +11736,7 @@ const $4ab64e76c1caef59$var$ExprTable = ({ rows: rows, fields: fields, onReorder
11730
11736
  children: /*#__PURE__*/ (0, $gXNCa$reactjsxruntime.jsx)((0, $gXNCa$aggridreact.AgGridReact), {
11731
11737
  rowData: rows,
11732
11738
  columnDefs: columnDefs,
11733
- defaultColDef: {
11734
- resizable: true,
11735
- sortable: true,
11736
- filter: false,
11737
- suppressMenu: true
11738
- },
11739
+ defaultColDef: $4ab64e76c1caef59$var$DEFAULT_COL_DEF,
11739
11740
  animateRows: false,
11740
11741
  suppressFieldDotNotation: true,
11741
11742
  suppressDragLeaveHidesColumns: true,
@@ -12380,20 +12381,50 @@ function $1fd2507769d5bd00$var$tsvCell(v) {
12380
12381
  const s = typeof v === 'object' ? JSON.stringify(v) : String(v);
12381
12382
  return s.replace(/[\t\r\n]+/g, ' ');
12382
12383
  }
12383
- function $1fd2507769d5bd00$var$downloadTsv(filename, rows, fields) {
12384
+ // Mirror the on-screen table header in the TSV: one row per metadata level
12385
+ // the table is showing (Study, then one row per distinct factor type, then
12386
+ // one row per distinct characteristic type), followed by the leaf header
12387
+ // (Gene ID / Name / per-sample group). The first two columns are repurposed
12388
+ // to carry the row category and the row's specific name, matching the
12389
+ // pinned-column labels in ExprTable.
12390
+ function $1fd2507769d5bd00$var$downloadTsv(filename, rows, fields, studies, expressionSamples) {
12384
12391
  const cols = [
12385
12392
  'id',
12386
12393
  'name',
12387
12394
  ...fields
12388
12395
  ];
12389
- const headerLabels = [
12390
- 'id',
12391
- 'name',
12392
- ...fields.map((f)=>f.replace(/__expr$/, ''))
12393
- ];
12394
- const lines = [
12395
- headerLabels.join('\t')
12396
- ];
12396
+ const fieldInfo = (0, $4ab64e76c1caef59$export$7b242440eb2c300d)(fields, studies, expressionSamples);
12397
+ const factorTypes = new Set();
12398
+ const charTypes = new Set();
12399
+ for (const f of fields){
12400
+ const info = fieldInfo[f];
12401
+ if (!info) continue;
12402
+ Object.keys(info.factors || {}).forEach((t)=>factorTypes.add(t));
12403
+ Object.keys(info.characteristics || {}).forEach((t)=>charTypes.add(t));
12404
+ }
12405
+ const factorTypeList = Array.from(factorTypes).sort();
12406
+ const charTypeList = Array.from(charTypes).sort();
12407
+ const metaRow = (cat, label, getValue)=>{
12408
+ const cells = [
12409
+ cat,
12410
+ label
12411
+ ];
12412
+ for (const f of fields)cells.push($1fd2507769d5bd00$var$tsvCell(getValue(fieldInfo[f] || {})));
12413
+ return cells.join('\t');
12414
+ };
12415
+ const lines = [];
12416
+ lines.push(metaRow('Study', 'Title', (info)=>info.studyDescription || ''));
12417
+ for (const t of factorTypeList)lines.push(metaRow('Factor', t, (info)=>info.factors && info.factors[t] || ''));
12418
+ for (const t of charTypeList)lines.push(metaRow('Characteristic', t, (info)=>info.characteristics && info.characteristics[t] || ''));
12419
+ // Leaf header — column ids for the data rows.
12420
+ lines.push([
12421
+ 'Gene ID',
12422
+ 'Name',
12423
+ ...fields.map((f)=>{
12424
+ const info = fieldInfo[f];
12425
+ return info && info.group || f.replace(/__expr$/, '');
12426
+ })
12427
+ ].join('\t'));
12397
12428
  for (const r of rows)lines.push(cols.map((c)=>$1fd2507769d5bd00$var$tsvCell(r[c])).join('\t'));
12398
12429
  const blob = new Blob([
12399
12430
  lines.join('\n') + '\n'
@@ -12551,7 +12582,7 @@ const $1fd2507769d5bd00$var$TaxonPanel = ({ taxon: taxon, studies: studies, expr
12551
12582
  size: "sm",
12552
12583
  variant: "outline-secondary",
12553
12584
  disabled: filteredRows.length === 0 || visibleFields.length === 0,
12554
- onClick: ()=>$1fd2507769d5bd00$var$downloadTsv(`expression_${taxon}.tsv`, filteredRows, visibleFields),
12585
+ onClick: ()=>$1fd2507769d5bd00$var$downloadTsv(`expression_${taxon}.tsv`, filteredRows, visibleFields, studies, expressionSamples),
12555
12586
  title: "Download the visible rows and columns as tab-delimited text",
12556
12587
  children: "Download TSV"
12557
12588
  }),