Teichlab / celltypist

A tool for semi-automatic cell type classification
https://www.celltypist.org/
MIT License
278 stars 44 forks source link

Filtering labels in celltypist.dotplot #7

Closed emdann closed 2 years ago

emdann commented 2 years ago

Hello CellTypist team, It would be great to have an option to specify a subset of labels to plot in celltypist.dotplot. E.g. when predicting from a model with > 100 cell types and using majority_voting=False, often certain labels are assigned to just a few cells, so I get a huge dotplot, but I am really interested in just a few of those labels.

In scanpy.pl.dotplot I would do this by simply filtering the anndata object, but I don't seem to be able to manipulate predictions.adata in this case.

ChuanXu1 commented 2 years ago

Good suggestion!

Will filtering the predicted cell types based on the maximal fraction suffice? I added an argument to show in the dot plot only cell types with fraction/dot size >= filter_prediction in at least one reference cell type. 123492d299a41801c288295578e8b0f8232ee5f9

ChuanXu1 commented 2 years ago

Modified the plot function to enable plotting only subset of labels or filtering by fraction

681fed50e3aad5dfe68d78a1ccc0602a519680aa