bnprks / BPCells

Scaling Single Cell Analysis to Millions of Cells
https://bnprks.github.io/BPCells
Other
165 stars 17 forks source link

load data #36

Closed yuq1993 closed 1 year ago

yuq1993 commented 1 year ago

Hi,

Thank you for developing this tool. I am trying to use open_matrix_anndata_hdf5 to load anndata from a paper. I got below error:

Error in eval(expr, envir, enclos): Error in opening AnnData matrix: "X" is a dataset rather than a group. This likely indicates a dense matrix which is not yet supported by BPCells.

Does this mean this anndata is not compatible with BPCells? Is there a way to solve it? My second question is can BPCells load in MEX-format gene-barcode counts from 10x output?

Thank you! Best, Qian

bnprks commented 1 year ago

Hi Qian, thanks for your questions. AnnData with sparse matrices (the most common case) is compatible with BPCells, but as described by this error message and issue #17, dense expression matrix formats are not yet supported.

You can likely convert the AnnData to use a sparse matrix format within python, using the SciPy sparse functionality (tutorial) and the AnnData API.

For your second question, MEX-format import is supported in BPCells, via the import_matrix_market and import_matrix_market_10x functions (link). For technical reasons this is an import (i.e. file format conversion) rather than a direct load, but it should work similarly from your perspective as an end-user.

yuq1993 commented 1 year ago

Thank you for your help!