Labels and annotations¶
Cell annotations are .obs columns: clusters, cell types, sample of origin, your own hand-drawn calls. This page covers browsing them in the Cells panel, making your own, and editing their labels: renaming one, merging several, and folding a sub-clustering back into its parent annotation.
Where to find it
The Cells panel on the left: Add Annotation at the top, then the Categorical and Continuous tabs. Per-column actions are on each column's row and its ⋯ menu.
Browse columns¶
The Cells panel splits .obs into two tabs, each with its column count.
Categorical columns expand to a list of their categories with cell counts. On each category row:
- click the name to select its cells; tick the checkbox to add them to the selection (Select, mask and delete),
- double-click the name to rename the label (below),
- the small two-color dot adds the category as a highlight layer.
Continuous columns show their range and mean.
Each column row has Color (Color cells) and, on hover, Hide and Delete.
- Hide moves the column to a collapsed Hidden list at the bottom of the tab, with Show to bring it back. Hiding does not change the dataset and lasts for the browser session.
- Delete removes the column from the dataset after an inline confirmation (see Delete a column).
- Double-clicking a column's name gives it a display name in the panel. This changes only what the panel shows; to rename the
.obscolumn itself, use the .obs manager.
For a table of every column with types, counts and bulk actions (rename, duplicate, convert, delete several), open ⚙ .obs beside the Cells title: see The .obs manager.
Make your own annotation¶
- Under Add Annotation, type a column name and click Create (or press Enter). Skopia adds a categorical
.obscolumn with every cell set tounassigned. - Select cells (Select, mask and delete).
- At the bottom of the Cells panel, choose the column under Label with annotation…, type a label and click Apply. The selected cells take that label; a new label becomes a new category.
- Repeat with other selections and labels.
The Label with annotation… list includes every categorical column, not only ones you created, so you can also correct individual cells in an existing clustering. A name that already exists in .obs is refused.
Select cells… on a gene or gene set makes a two-label annotation (high / low) in one step: see Select by expression threshold.
Rename a label¶
Double-click a category's name in the expanded list, type the new name, and press Enter (Esc cancels). This works on any categorical or string column: Leiden clusters, Contour results, your own annotations. The label keeps its color, and the plot and legend update.
The new name must not already be a label in that column. To fold one label into another, use Merge labels….
Merge labels¶
- On a categorical column, open ⋯ → Merge labels….
- Tick two or more labels.
- Type the New label name and click Merge.
If the new name matches an existing label that you did not tick, the ticked labels merge into it. You can also reuse one of the ticked names. Unused categories are dropped and uns['<column>_colors'] is rebuilt to match the remaining categories.
To merge two columns rather than labels within one, see The .obs manager.
Refine with subcluster labels¶
After sub-clustering part of the data, you usually want one annotation that holds the original labels for most cells and the finer labels for the cells you re-clustered. Refine with subcluster labels… builds it.
- On the parent column (for example
leidenorcell_type), open ⋯ → Refine with subcluster labels…. - Parent category (to refine) is the column you opened it from. Under New labels from (subcluster), pick the sub-clustering column (for example
leiden_chondro). - Choose how to Name the incoming labels:
- Prefix with parent label (recommended): a subcluster
0among cells labeledMesenbecomesMesen.0. This keeps provenance and avoids a subcluster called0colliding with a parent cluster0. - Use new labels as-is.
- Custom prefix.
- Prefix with parent label (recommended): a subcluster
- Treat these source values as "unassigned" (keep parent): values in the source that mean "not in the subcluster". Default
unassigned, which is what a subset run writes for cells outside the subset. - Output: a New column (default name
<parent>_refined) or Overwritein place . - Apply.
Every cell with a real subcluster label takes the new label; every other cell keeps its parent label, and surviving parent labels keep their colors.
The same tool opens from a subset's Leiden chip in the Subsets list, with the column already picked as the source.
Delete a column¶
Delete on a column row, after its inline confirmation, removes the column from .obs together with its uns['<column>_colors']. If the column was a saved subset's membership column (subset_<name>), the subset is removed too. If the plot was colored by the column or showed its labels, those are cleared. The deletion is recorded in the analysis record.
What it writes¶
| Where | What |
|---|---|
obs['<name>'] |
A new annotation (categorical; unassigned until labeled), a refined column, or an edited existing column. |
uns['<column>_colors'] |
Kept aligned to the column's categories after a rename or merge; removed with the column. |