cellxgene icon indicating copy to clipboard operation
cellxgene copied to clipboard

Users want ability to maintain the order of their labels rather than default to alphabetical

Open liaprins-czi opened this issue 4 years ago • 3 comments

Thanks for the feedback, [email protected]! In his words, they want to order "the contents of categorical metadata non-alphabetically. One use case is listing the cell types (our ‘free_annotation’ at https://hlca.ds.czbiohub.org/) on the left hand panel (and future DotPlot/VlnPlot visualizations) by tissue compartment as we did throughout our manuscript.

Sometimes the order of one's categories is meaningful. A few initial solutions come to mind:

  • Always display labels in the incoming order, never alphabetical unless that's how users made them intentionally
  • Have a "Sort by" option in the UI that could include the incoming order, alphabetical order, even by cell count (this could apply to the all categories, or could be per category)
  • Have another flag in the CLI, like sort--arbitrarily (probably better words than that, but same concept) which would apply to all categories. Note that this idea only addresses the CLI use case, not the hosted use case.

liaprins-czi avatar Apr 16 '20 17:04 liaprins-czi

Krasnow lab conversation reinforced that sorting is important and could be used by #632, and that user generated / arbitrary sorts which are named sorts could be consumed by other features, ie., sorting heatmap rows

colinmegill avatar Aug 26 '20 21:08 colinmegill

Hi @liaprins-czi @colinmegill, We have a couple users who would also like to have an option such as --disable-category-sort which lists the categorical variables on the left hand side by the order they appear in adata.obs rather than alphabetical because they want cellxgene to match the list of categories the same way as their paper. Thanks, Simon

SimonDMurray avatar Mar 24 '21 18:03 SimonDMurray

Hey Simon,

Just wanted to chime in with a potential (temporary) work around - your users could potentially prepend numbers to the the colnames in adata.obs such that the sorting would occur based on their specification. something like 01_tissue, 02_cellType, ...

MaximilianLombardo avatar Mar 24 '21 19:03 MaximilianLombardo