Skip to content

Filter unused categories from clonotype network legend#680

Open
LiudengZhang wants to merge 4 commits intoscverse:mainfrom
LiudengZhang:fix/filter-unused-clonotype-network-labels
Open

Filter unused categories from clonotype network legend#680
LiudengZhang wants to merge 4 commits intoscverse:mainfrom
LiudengZhang:fix/filter-unused-clonotype-network-labels

Conversation

@LiudengZhang
Copy link

Summary

  • The clonotype network plot legend now only shows categories that are actually present in the plotted data
  • Previously, all categories from the full dataset were listed, making it hard to identify colors when only a subset of categories appeared in the network
  • Collects which category colors are used in the pie chart rendering, then filters the legend entries accordingly

Closes #321

Test plan

  • Verify legend only shows categories present in the plotted network subset
  • Legend still works correctly when all categories are present
  • No visual regression for non-categorical coloring (continuous variables, uniform color)

LiudengZhang and others added 2 commits March 8, 2026 16:20
Only show legend entries for categories that are actually present in the
plotted clonotype network, rather than listing all categories from the
full dataset. This makes the legend easier to read when plotting subsets
of data with many possible category values.

Closes scverse#321
@codecov
Copy link

codecov bot commented Mar 8, 2026

Codecov Report

❌ Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 19.31%. Comparing base (0f68a0a) to head (58020ff).

Files with missing lines Patch % Lines
src/scirpy/pl/_clonotypes.py 0.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #680      +/-   ##
==========================================
- Coverage   19.33%   19.31%   -0.03%     
==========================================
  Files          51       51              
  Lines        4628     4633       +5     
==========================================
  Hits          895      895              
- Misses       3733     3738       +5     
Files with missing lines Coverage Δ
src/scirpy/pl/_clonotypes.py 10.87% <0.00%> (-0.20%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

LiudengZhang and others added 2 commits March 11, 2026 16:23
Verify that clonotype_network legend only shows categories
present in the plotted network, not all categories from the
full categorical palette.
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.

Remove unused labels from antigen-annotated clonotype networks

1 participant