Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while loading custom data in NCEM #108

Closed
archanabhardwaj opened this issue Jul 18, 2022 · 2 comments
Closed

Error while loading custom data in NCEM #108

archanabhardwaj opened this issue Jul 18, 2022 · 2 comments
Labels
question Further information is requested

Comments

@archanabhardwaj
Copy link

archanabhardwaj commented Jul 18, 2022

Hello

I am trying to run NCEM after running the deconvolution in cell2location method. I followed entire workflow as given in https://github.com/theislab/ncem_benchmarks/blob/main/notebooks/data_preparation/deconvolution/cell2location_human_lymphnode.ipynb and saved dataset as "cell2location_test.h5ad" based on the information given in the "Collect ncem anndata object" section. Next, I tried to read h5ad data into NCEM for further analysis with custom loader function.

adata_vis # stores information of my cell2location_test.h5ad file

ncem = InterpreterInteraction()

ncem.data = customLoader(
adata=adata_vis, cluster='cell_type', patient='A1', library_id='sam_A1', radius=52
)

But its giving me error such as AttributeError: 'numpy.ndarray' object has no attribute 'toarray'

If I am doing something wrong, please correct me.

Thanks in advance

@archanabhardwaj archanabhardwaj added the question Further information is requested label Jul 18, 2022
@AnnaChristina
Copy link
Member

Hi @archanabhardwaj,

thank you for your interest in running ncem on your own data.

Please store .X as sparse matrix format and the stated code will work. However, the stated tutorial is specifically designed for targeted spatial omics data. You can still use the stated tutorial, but we will also push a specific tutorial for deconvoluted visium soon.

@AnnaChristina
Copy link
Member

I am closing the issue for now, but feel free to open it again in case of further questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants