gramene-search 2.20.1 → 2.20.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.
package/dist/index.js CHANGED
@@ -2643,10 +2643,25 @@ function $0f839422d0d8c772$var$buildExperimentTitleIndex(expressionStudies) {
2643
2643
  }
2644
2644
  return index;
2645
2645
  }
2646
+ // Label for each species group, used by the expression and differential-expression
2647
+ // field pickers.
2648
+ //
2649
+ // A group can hold many genomes — sorghum_v11 has 120 under 4558 — so which one
2650
+ // supplies the label matters. This took the first it encountered, and since
2651
+ // grameneMaps is keyed by taxon_id, Object.values walks integer-like keys in
2652
+ // ascending numeric order: 4558001 (Sb verticilliflorum 353, a wild relative) beat
2653
+ // the anchor 4558006 (Sb bicolor BTx623 v3). Searching msd2 then returned a BTx623
2654
+ // gene while the picker was labelled with a different genome entirely. Every other
2655
+ // group here holds exactly one genome, which is why only sorghum showed it.
2656
+ //
2657
+ // Prefer the group's anchor, falling back to first-seen for releases that carry no
2658
+ // anchor flags at all (gramene main today).
2646
2659
  function $0f839422d0d8c772$var$buildSpeciesNameIndex(grameneMaps) {
2647
2660
  const idx = {};
2648
2661
  if (!grameneMaps) return idx;
2649
- for (const m of Object.values(grameneMaps))if (m && m.anchor_taxon_id && !idx[m.anchor_taxon_id]) idx[m.anchor_taxon_id] = m.display_name || String(m.anchor_taxon_id);
2662
+ const genomes = Object.values(grameneMaps);
2663
+ for (const m of genomes)if (m && m.anchor_taxon_id && m.is_anchor) idx[m.anchor_taxon_id] = m.display_name || String(m.anchor_taxon_id);
2664
+ for (const m of genomes)if (m && m.anchor_taxon_id && !idx[m.anchor_taxon_id]) idx[m.anchor_taxon_id] = m.display_name || String(m.anchor_taxon_id);
2650
2665
  return idx;
2651
2666
  }
2652
2667
  function $0f839422d0d8c772$var$fieldExperimentId(name) {