ndcn / omicser

The NDCN omics browser app for browsing and sharing general omics data.
https://ndcn.github.io/omicser
Other
3 stars 3 forks source link

error when feature annotation is categorical #119

Open ricoderks opened 3 years ago

ricoderks commented 3 years ago

I noticed that anndata makes some vars categorical. This happens while saving the data to a h5ad file. This causes the following error while plotting the heatmap:

Warning: Error in <-: 'names' attribute [9] must be the same length as the vector [7]
  [No stack trace available]

It looks like that one of the categories is not going to be plotted. Decreasing the value for filtering the features (VMR) does create the heatmap.

ergonyc commented 3 years ago

The python backend is fairly aggressive on converting the annotation columns to categorial if possible. Probably need to force the type to numeric (or integer) if the number of levels is > than some small number.

Good zeroing in on the fact that the filtering might be reducing the total number of represented categories. I think that eventually we will want to create all the coloring (maps for categoricals, functions for numeric) and categorical as entries in the config table generated in ingest. That will provide safety for the filtering creating incomplete categories.

ergonyc commented 2 years ago

I think this is fixed but needs testing.