scverse / anndata

Annotated data.
http://anndata.readthedocs.io
BSD 3-Clause "New" or "Revised" License
555 stars 150 forks source link

ValueError: unsupported data types in input on subsetted anndata object (can't reproduce bug) #1378

Open Dario-Rocha opened 8 months ago

Dario-Rocha commented 8 months ago

Please make sure these conditions are met

What happened?

Subsetting an anndata object with .copy() or trying to add variables to the .obs of a subsetted anndata object, results in

ValueError: unsupported data types in input

I cannot reproduce the error with randomly generated data or with some other datasets (sometimes it works though) and I cannot figure out what is wrong and/or how to fix the datatsets that generate the error. Saving the anndata object into a new file and reloading it doesn't fix the issue

The anndata object is

adata

AnnData object with n_obs × n_vars = 40000 × 31251 obs: 'bpcells_name' var: 'bpcells_name'

adata.X

<40000x31251 sparse matrix of type '<class 'numpy.uint32'>' with 69973634 stored elements in Compressed Sparse Row format>

Minimal code sample

#sorry I can't provide an example because I can't reproduce the bug on simulated data
adata = sc.read_h5ad(configs.model_input_data_dir + '/full_matrix_subset.h5ad')
adata_subset = adata[:50,:].copy()

Error output

ValueError: unsupported data types in input

Versions

``` ----- anndata 0.10.3 scanpy 1.9.6 ----- PIL 10.1.0 appnope 0.1.3 asttokens NA cloudpickle 3.0.0 comm 0.2.0 configs NA cycler 0.12.1 cython_runtime NA dateutil 2.8.2 debugpy 1.8.0 decorator 5.1.1 exceptiongroup 1.2.0 executing 2.0.1 h5py 3.10.0 ipykernel 6.27.1 ipywidgets 8.1.1 jedi 0.19.1 joblib 1.3.2 kiwisolver 1.4.5 llvmlite 0.41.1 matplotlib 3.8.2 ... Python 3.10.13 (main, Sep 11 2023, 08:39:02) [Clang 14.0.6 ] macOS-10.16-x86_64-i386-64bit ----- Session information updated at 2023-12-19 14:30 ```
ivirshup commented 6 months ago

Sorry for the late reply, looks like we missed this over the winter break. I've moved this over to anndata since it doesn't seem to involve scanpy.

Can you provide any more info here? If you can't recreate the object, can you share the file?

And can we get a full traceback?

github-actions[bot] commented 4 months ago

This issue has been automatically marked as stale because it has not had recent activity. Please add a comment if you want to keep the issue open. Thank you for your contributions!