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

Question on computing niches on spatial data #8

Open
abs51295 opened this issue Apr 3, 2024 · 2 comments
Open

Question on computing niches on spatial data #8

abs51295 opened this issue Apr 3, 2024 · 2 comments

Comments

@abs51295
Copy link

abs51295 commented Apr 3, 2024

Hey,

I just want to use the COVET method to compute niches on spatial data. I have several batches in my data. Should I just use compute_covet function with batch_key to get the COVET_SQRT representation of the spatial data? Can I just compute neighbors and run louvain clustering on that representation to cluster my data? I am assuming adding batch information wouldn't result in separate clusters per batch.

Also, can I use a latent space representation like one from scVI instead of selecting HVGs and compute COVET on the latent representation instead of genes?

Thanks

@DoronHav
Copy link
Collaborator

DoronHav commented Apr 3, 2024

Hi!

Regarding batch information. Yes, just add the batch_key for make sure that COVET knows to ensure that spatial neighbors are only with-in batch. You can just ran analysis on 'COVET_SQRT' from there on out.

Right now, the COVET code just uses the .X from the anndata. In a future version, we will add the option to use any layer/obsm instead. As a hack, you can create an anndata where the .X is the scVI latent and run compute_covet with 'g=-1' and it should produce what you are looking for.

@abs51295
Copy link
Author

abs51295 commented Apr 3, 2024

Thanks for the quick response! I did run the function with batch_key and I computed the neighbors using sc.pp.neighbors and louvain clusters with sc.tl.louvain with resolution=0.5 and it gave me 1000s of clusters. Is that expected? I have 1.3M cells in my data from a Xenium experiment.

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

No branches or pull requests

2 participants