-
Notifications
You must be signed in to change notification settings - Fork 681
feat: add jaccard as an additional method in sc.pp.neighbors
#3831
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
Conversation
for more information, see https://pre-commit.ci
Use to build unweighted adjacency matrix.\nFilter out zeros while creating matrix.
|
Hi! Sorry we didn’t react for so long! This looks very nice! Great addition and implementation! |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3831 +/- ##
==========================================
+ Coverage 76.77% 76.79% +0.02%
==========================================
Files 115 115
Lines 12369 12383 +14
==========================================
+ Hits 9496 9510 +14
Misses 2873 2873
Flags with carried forward coverage won't be shown. Click here to find out more.
|
jaccard as an additional method in sc.pp.neighborsjaccard as an additional method in sc.pp.neighbors
|
Thank you for looking over it and fixing it up! And no worries about the delayed response - I know how busy things get! |
Adds
jaccardas amethodinsc.pp.neighborsalongsideumapandgauss. The method performs a weighting of the kNN adjacency graph using Jaccard coefficients between pairs of connected vertices. This is the weighting used in the PhenoGraph package and in Seurat, and it is especially useful to include it here in light of PhenoGraph no longer being actively maintained and thesc.externalAPI being slated for removal, as mentioned in #3828.N.b., the present implementation of the weighting is notably faster than that in PhenoGraph, since it avoids looping over set intersections in favour of sparse matrix operations, but it returns identical results for identical input matrices of kNN indices.
jaccardas an additionalmethodinsc.pp.neighbors#3828umapandgauss)