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

The Kernel crashed while executing code in the current cell #812

Closed
spatts14 opened this issue Mar 22, 2024 · 4 comments
Closed

The Kernel crashed while executing code in the current cell #812

spatts14 opened this issue Mar 22, 2024 · 4 comments

Comments

@spatts14
Copy link

spatts14 commented Mar 22, 2024

Hi! Thanks for writing Squidpy! Its really amazing!

I'm running into an issue and I'm not sure if its an issue with squidpy itself or how I'm running the code or space on my computer. I cannot run sq.gr.ligrec or sq.gr.spatial_autocorr without my kernel crashing. Is there something I am missing? Do I need to run this on the HPC?

Info about my data:

  • Xenium data
  • adata object is n_obs × n_vars = 53466 × 339
  • The size of the object is: 100039055 bytes (code: sys.getsizeof(adata))
  • The size of the object is: 151294272 bytes ( code: asizeof.asizeof(adata))

I've tried reducing my dataset to 0.2 and reducing the permutation to as low as 2 just to try to get it to work but every time I get the miss error:

The Kernel crashed while executing code in the current cell or a previous cell.

Please review the code in the cell(s) to identify a possible cause of the failure.

Here is the code I'm running

adata_subsample = sc.pp.subsample(adata, fraction=0.2, copy=True)
sq.gr.spatial_neighbors(adata_subsample, coord_type="generic", delaunay=True)
res = sq.gr.ligrec(
    adata,
    n_perms=2,
    cluster_key="new_clusters",
    copy=True,
    use_raw=False,
    transmitter_params={"categories": "ligand"},
    receiver_params={"categories": "receptor"},
)

and with the Moran I

adata_subsample = sc.pp.subsample(adata, fraction=0.2, copy=True)
sq.gr.spatial_neighbors(adata_subsample, coord_type="generic", delaunay=True)

sq.gr.spatial_autocorr(
    adata_subsample,
    mode="moran",
    n_perms=10,
    n_jobs=1,
)
adata_subsample.uns["moranI"].head(10)

...

Any suggestions would be really helpful!

@Rafael-Silva-Oliveira
Copy link

Rafael-Silva-Oliveira commented Apr 14, 2024

Also having the same issue with VisiumHD data (140k + spots/barcodes with over 15k genes).

@giovp Is Squidpy able to work with such granular data? It seems that more and more technologies are going towards that single-cell level resolution on spatial data

@LLehner
Copy link
Member

LLehner commented Jun 12, 2024

Hi @spatts14, @Rafael-Silva-Oliveira,

squidpy should be able to handle data sets of the size you mention. When the kernel crashes, is there any error message? Perhaps this is a RAM issue? Does it also happen if you run it on a machine with more RAM?

@LLehner LLehner closed this as completed Jun 12, 2024
@LLehner LLehner reopened this Jun 12, 2024
@Rafael-Silva-Oliveira
Copy link

Hi @spatts14, @Rafael-Silva-Oliveira,

squidpy should be able to handle data sets of the size you mention. When the kernel crashes, is there any error message? Perhaps this is a RAM issue? Does it also happen if you run it on a machine with more RAM?

Hei, I'm currently setting up the server with more memory, I will let you know when I give it a try and if it happens again! But it simply crashes, no memory errors in my local machine (32gb RAM, i7)

@spatts14
Copy link
Author

I think there was an issue with my conda environments. I had to uninstall anaconda and redownload and recreate my environments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants