feat: add jaccard as an additional method in sc.pp.neighbors#3831
Merged
Conversation
for more information, see https://pre-commit.ci
Use to build unweighted adjacency matrix.\nFilter out zeros while creating matrix.
Member
|
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
Contributor
Author
|
Thank you for looking over it and fixing it up! And no worries about the delayed response - I know how busy things get! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)