scanpy
scanpy copied to clipboard
Add support for passing boolean columns in .obs when plotting clustermap or dendrogram.
- [x] Additional function parameters / changed functionality / changed defaults?
- [ ] New analysis tool: A simple analysis tool you have been using and are missing in
sc.tools
? - [ ] New plotting function: A kind of plot you would like to seein
sc.pl
? - [ ] External tools: Do you know an existing package that should go into
sc.external.*
? - [ ] Other?
Hey,
currently, when trying to use plotting functions that require categorical obs columns (for example sc.pl.clustermap
obs_keys
parameter), but one passes a boolean column key in .obs,
scanpy will raise an error (or pandas does but the origin is in scanpy's codebase): AttributeError: Can only use .cat accessor with a 'category' dtype
.
Would it be possible to let the passed key be from a column of dtype bool
as well? Are there any downsides? Happy to provide more detail if needed.