galaxyproject / galaxyproject/brc-analytics

refactor: move the curated organism aliases into the catalog build as `otherNames`

Open
#1,731 1 comment 0 reactions 1 assignee Claimed by @hunterckx View on GitHub
refactor
Dominant language
TypeScript
Stars
7
Forks
11
Avg merge
3d 15h
Merged PRs (30d)
15

Description

## Summary

Move the curated organism aliases that currently live in code (`_ORGANISM_ALIASES` in `backend/api/app/services/sra_mirror.py`) into the catalog build as a curated input, so they land in the `otherNames` field alongside the NCBI-derived names. The catalog JSON becomes the single source of truth for organism naming.

Follow-on to #1730, which must land first.

Needs #1741 in order to work reliably.

## Why

`_ORGANISM_ALIASES` is 42 hand-written aliases over 21 taxids — "TB" and "mtb" for taxid 1773, "covid" and "sars-cov-2" for 3418604, "e. coli" for 562. They exist because NCBI doesn't supply them and users type them. But they're reachable only from `sra_mirror`'s term resolution: the catalog, the site's filter facets, and the assistant's catalog tools can't see them. Putting them in the catalog makes one list serve every consumer.

All 21 taxids are already present in `catalog/source/organisms.yml`, so there's a natural home with no new plumbing.

## What to do

**Curated input**
- Add an `other_names` list to entries in `catalog/source/organisms.yml`, next to the existing `ploidy`. It's already the curated per-organism source keyed by `taxonomy_id`.
- Extend the source schema (`catalog/schema/`) for the new key and regenerate.

**Curate the values, don't copy them verbatim.** `_ORGANISM_ALIASES` keys are normalized *matching* keys ("sarscov2", "m.tuberculosis", "covid"), and `otherNames` is now a user-facing filter facet and column. Store display forms — "SARS-CoV-2", "COVID-19", "M. tuberculosis", "TB" — and leave the normalization (lowercase, strip punctuation and spaces) to whatever matches against them. Also drop any alias NCBI already supplies as an `acronym`/`common name`; several of these 21 taxids are already covered.

**Merge in the build**
- Merge the curated names into `otherNames` in the same place the NCBI names are assembled, so both catalogs go through one path. Curated names should sort after the NCBI-derived ones, deduped case-insensitively against them, so the field's ordering stays deterministic.
- GA2 has none of these taxids today; the input is optional and its absence must be a no-op for that build.

**Out of scope**
- `sra_mirror.py` keeps `_ORGANISM_ALIASES` and keeps using it. Rewiring term resolution to read the catalog field, and deleting the in-code map, is a separate ticket. Until then the map is duplicated — note it in a comment on `_ORGANISM_ALIASES` pointing at the catalog source, so the two don't silently drift.

## Acceptance criteria

- [ ] Curated aliases live in `catalog/source/organisms.yml` as `other_names` and flow into `otherNames` in both `organisms.json` and `assemblies.json`.
- [ ] Values are display forms, not normalized lookup keys; entries NCBI already supplies are not duplicated.
- [ ] Merge is deduped (case-insensitive) and deterministically ordered.
- [ ] The GA2 build is unaffected — no curated names, no errors.
- [ ] Spot checks: "TB" on taxid 1773, "SARS-CoV-2" on 3418604.
- [ ] Source schema updated and regenerated; catalog validation passes.

## Context

Depends on #1730. Both replace #1368. Part of the assistant organism-resolution work under #1288, which will read `otherNames` as the single source — the ticket that deletes `_ORGANISM_ALIASES` belongs there.

---
*Issue written by Claude.*

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.