How to calculate a neighbor graph from a different layer

Hi everyone,

What would be the best way to calculate a neighbor graph not based on .X, but on another layer? I do not need any dimensionality reduction, as I’m dealing with only 24 variables.

In scanpy.pp.neighbors(), the use_rep argument only accepts keys for adata.obsm, not another layer.



I think the best way to do this is to store your matrix in obsm.