kanaverse / kana

Single cell analysis in the browser
https://kanaverse.org/kana/
MIT License
142 stars 12 forks source link

Error: expected all arrays in 'columns' to have equal length when bool column in adata.var #214

Closed fbnrst closed 1 year ago

fbnrst commented 1 year ago

I created test data like this:

adata = sc.datasets.pbmc3k_processed()
adata.var['mito'] = True
adata.write('./results/pbmc3k_processed.h5ad')

you can download the resulting file here: https://cloudstore.zih.tu-dresden.de/index.php/s/R7cjGgC86b9fSmN/download

when I try to open this file in explore mode, I run into an error:

PREFLIGHT INPUT_DATA Error: expected all arrays in 'columns' to have equal length

Log:

13:43:01: (downloadsdb) store initialized
13:43:01: analysis state created
13:43:01: bakana initialized
13:43:21: preflight_input finished
13:43:21: Error: expected all arrays in 'columns' to have equal length

might be a duplicate of #201

LTLA commented 1 year ago

Looks like h5py likes to save arrays of bools as HDF5 enums, which aren't currently supported by our HDF5 parser.

The simple fix is to just ignore this column. This should be handled by updating to bakana 2.0.18.

The proper fix is to support HDF5 enums, which I started at kanaverse/scran.js#74 but this is more effort than I thought.

LTLA commented 1 year ago

And bakana 2.0.19 should now handle this column correctly. This fix should be absorbed in the next kana build.