Skip to content

Use dataset defined labels instead of hard-coded “cells” and “genes”#239

Open
davehorsfall wants to merge 1 commit intodevfrom
feat/obs-var-labels
Open

Use dataset defined labels instead of hard-coded “cells” and “genes”#239
davehorsfall wants to merge 1 commit intodevfrom
feat/obs-var-labels

Conversation

@davehorsfall
Copy link
Member

@davehorsfall davehorsfall commented Feb 24, 2026

Description

This PR enhances the UI to use dataset-driven labels instead of hard-coded terminology like “cells” and “genes”. This makes text flexible to different data modalities by using values from the dataset configuration (DatasetContext), including:

  • obs axis (cells, spots, samples, nuclei, …)
  • var axis (genes, peaks, proteins, features, …)
  • value semantics (expression, accessibility, activity)

Changes include:

  • Adding new values into the dataset configuration to store semantic values for "obs", "var" and matrix "values".
  • Replacing static strings in search modals, lists, and toolbars to use these dynamic terms dataset.varLabel, dataset.obsLabel, and dataset.valueLabel
  • Updated static text used when searching "obs" (i.e. perturbgen), to use string value from obsSearchCol
  • Cleaning up legacy hardcoded text and removing unnecessary props like displayName

Fixes #238
Related to # (if applicable)

Type of change

  • 🐛 Bug fix (non-breaking change that resolves an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • ⚡ Optimisation (non-breaking improvement to performance or efficiency)
  • 🧩 Documentation (adds or improves documentation)
  • 🧱 Maintenance (refactor, dependency update, CI/CD, etc.)
  • 🔥 Breaking change (fix or feature that causes existing functionality to change)

Checklist

  • All tests pass (eg. npm test)
  • Pre-commit hooks run successfully (eg. pre-commit run --all-files)
  • Documentation updated (if required)

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 8.00000% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 13.85%. Comparing base (8e7eb6a) to head (9bdd0e7).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/lib/components/plot/PlotTypeSelector.jsx 0.00% 6 Missing ⚠️
src/lib/components/search-bar/SearchBar.jsx 0.00% 5 Missing ⚠️
src/lib/components/search-bar/SearchResults.jsx 0.00% 3 Missing ⚠️
src/lib/components/icons/HeatmapIcon.jsx 0.00% 2 Missing ⚠️
src/lib/components/offcanvas/OffCanvas.jsx 0.00% 2 Missing ⚠️
src/lib/components/scatterplot/Scatterplot.jsx 0.00% 2 Missing ⚠️
src/lib/components/scatterplot/SpatialControls.jsx 0.00% 1 Missing ⚠️
src/lib/components/scatterplot/Toolbox.jsx 0.00% 1 Missing ⚠️
src/lib/components/var-list/VarSet.jsx 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #239      +/-   ##
==========================================
- Coverage   13.96%   13.85%   -0.11%     
==========================================
  Files          73       73              
  Lines        2385     2403      +18     
  Branches      576      577       +1     
==========================================
  Hits          333      333              
- Misses       1991     2009      +18     
  Partials       61       61              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@davehorsfall davehorsfall changed the title Feat/obs var labels Use dataset defined labels instead of hard-coded “cells” and “genes” Feb 24, 2026
@davehorsfall davehorsfall changed the base branch from main to dev February 24, 2026 14:26
@davehorsfall davehorsfall requested a review from dannda February 24, 2026 14:27
Comment on lines +77 to +80
valueLabel: {
singular: 'expression',
plural: 'expression',
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just to check, does valueLabel need a singular and plural? or does it only need to be a string value

{!varList.length ? (
<Alert variant="light">Search for a feature.</Alert>
<Alert variant="light">
Search for a {dataset.varLabel.singular}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just flagging if we want to avoid using "a {something}" to avoid needing to check if it is "a" or "an"

'features'
dataset.varLabel.plural
)}{' '}
to display their expression distributions across all observations.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
to display their expression distributions across all observations.
to display their {dataset.valueLabel.singular} distributions across all observations.

'features'
dataset.varLabel.plural
)}{' '}
to display their expression across groups, then choose a{' '}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
to display their expression across groups, then choose a{' '}
to display their {dataset.valueLabel.singular} across groups, then choose a{' '}

'features'
dataset.varLabel.plural
)}{' '}
to display their expression, then choose a{' '}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
to display their expression, then choose a{' '}
to display their {dataset.valueLabel.singular}, then choose a{' '}

Copy link
Contributor

@dannda dannda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be added to the docs please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Remove hard-coded “cells” and “genes” terminology

3 participants