Hello:
How should I calculate the knn entropy using the leiden clusters?
https://arxiv.org/pdf/1506.06501v1
Thanks a lot
Hello:
How should I calculate the knn entropy using the leiden clusters?
https://arxiv.org/pdf/1506.06501v1
Thanks a lot
you will need to measure how much the points in each leiden cluster differ from the surrounding points in the KNN graph.
given you are working with adata and scvi latent space:
knn graph can be computed with: sc.pp.neighbors(adata, use_rep=SCVI_LATENT_KEY)
leiden clusters can be made with: sc.tl.leiden(adata, key_added="leiden_scVI")
then use this information to perform:
−∑p_i*log(p_i)
, where p_i is the probability of a point being in a specific cluster (based on its KNN neighbours).