Quick testing of the Jensen-Shannon implementation in the philentropy package
✓ Published0🌍 Public
FFloWuenne
Last edited Nov 9, 2018
Created on Nov 9, 2018
This example tests the Jensen-Shannon divergence (JSD) and distance calculations in the `philentropy` R package, using toy distributions to validate the expected behavior for positive and negative controls. It shows that perfectly overlapping distributions yield a distance of 1, while fully independent distributions yield a distance of 0. The code manually normalizes two input vectors (regulon activity scores and cell identity indicators) and passes them as a matrix to `philentropy::JSD`, then applies the formula `1 - sqrt(JSD)` to derive the distance. The source is a public gist by FloWuenne, demonstrating a quick sanity check for the package's implementation.
AI-generated description