Coder Social home page Coder Social logo

Comments (8)

TomKellyGenetics avatar TomKellyGenetics commented on August 15, 2024 2

My opinion: maybe it's time to use igraph directly.
https://igraph.org/r/doc/cluster_leiden.html

@SamGG the leiden package already does this by default for igraph objects, although limited parameters are supported compared to calling Python. This has been supported for over a year with the 0.4 version.

maybe it has to do with inefficient transfer of data between R and Python

@szhorvat that’s correct it does (reticulate supports dense matrices but not sparse matrices or igraph objects so igraph objects are passed as an edge list and recreated in Python). This only applies to older versions of the R package for the reasons discussed above so the comment in Seurat documentation is likely no longer relevant for users running igraph 1.2.7 and leiden 0.4.0 or later.

from leidenalg.

szhorvat avatar szhorvat commented on August 15, 2024 1

Presumably yes. But you need to discuss this with the packages that implemented these methods. This choice of methods does not come from the leidenalg Python package.

from leidenalg.

denvercal1234 avatar denvercal1234 commented on August 15, 2024 1

Thanks Szabolcs. Hopefully someone from Seurat will give some input.

from leidenalg.

szhorvat avatar szhorvat commented on August 15, 2024

Using a matrix is not a feature of this library. It is entirely specific to the leiden R package, which will convert that matrix to a graph before doing any community detection.

Given what the leiden package does, the claim in Seurat's documentation that the "matrix" method is faster for small data seems rather strange ... maybe it has to do with inefficient transfer of data between R and Python.

from leidenalg.

denvercal1234 avatar denvercal1234 commented on August 15, 2024

Thanks @szhorvat -- just so I understand it correctly, did you mean specifying method="matrix" or method="igraph" does not really impact the resulting clusters but it is simply helpful for efficiency of how the data is processed before community detection? For example, with large dataset, specifying method=igraph will skip the conversion of the data to a dense matrix, thereby speeding up the whole clustering (community detection).

from leidenalg.

SamGG avatar SamGG commented on August 15, 2024

Probably @TomKellyGenetics could bring some clues.

My opinion: maybe it's time to use igraph directly.
https://igraph.org/r/doc/cluster_leiden.html

from leidenalg.

SamGG avatar SamGG commented on August 15, 2024

Thanks for this information and your feedback.

from leidenalg.

vtraag avatar vtraag commented on August 15, 2024

Thanks all for commenting in my absence! I believe all questions are addressed, so I'm closing this.

from leidenalg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.