scran
C++ library for basic single-cell RNA-seq analyses
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
scran::ClusterSnnGraphLeiden Class Reference

Leiden clustering on a shared nearest-neighbor graph. More...

#include <ClusterSnnGraph.hpp>

Classes

struct  Defaults
 Default parameter settings. More...
 
struct  Results
 Result of the igraph leiden community detection algorithm. More...
 

Public Member Functions

ClusterSnnGraphLeidenset_seed (int s=Defaults::seed)
 
ClusterSnnGraphLeidenset_resolution (double r=Defaults::resolution)
 
ClusterSnnGraphLeidenset_beta (double b=Defaults::beta)
 
ClusterSnnGraphLeidenset_iterations (int i=Defaults::iterations)
 
ClusterSnnGraphLeidenset_modularity (bool m=Defaults::modularity)
 
Results run (const BuildSnnGraph::Results &store) const
 
Results run (const igraph::Graph &graph, const igraph_real_t *weights) const
 

Detailed Description

Leiden clustering on a shared nearest-neighbor graph.

This applies Leiden clustering on a shared nearest neighbor graph. See here for more details on the Leiden algorithm.

Member Function Documentation

◆ set_seed()

ClusterSnnGraphLeiden & scran::ClusterSnnGraphLeiden::set_seed ( int  s = Defaults::seed)
inline
Parameters
sSeed for the default igraph random number generator.
Returns
A reference to this ClusterSnnGraphLeiden object.

◆ set_resolution()

ClusterSnnGraphLeiden & scran::ClusterSnnGraphLeiden::set_resolution ( double  r = Defaults::resolution)
inline
Parameters
rResolution of the clustering. Larger values result in more fine-grained communities.
Returns
A reference to this ClusterSnnGraphLeiden object.

◆ set_beta()

ClusterSnnGraphLeiden & scran::ClusterSnnGraphLeiden::set_beta ( double  b = Defaults::beta)
inline
Parameters
bLevel of randomness used during refinement.
Returns
A reference to this ClusterSnnGraphLeiden object.

◆ set_iterations()

ClusterSnnGraphLeiden & scran::ClusterSnnGraphLeiden::set_iterations ( int  i = Defaults::iterations)
inline
Parameters
iNumber of iterations of the Leiden algorithm. More iterations can improve separation at the cost of computational time.
Returns
A reference to this ClusterSnnGraphLeiden object.

◆ set_modularity()

ClusterSnnGraphLeiden & scran::ClusterSnnGraphLeiden::set_modularity ( bool  m = Defaults::modularity)
inline
Parameters
mWhether to optimize the modularity instead of the Constant Potts Model.

The modularity is closely related to the Constant Potts Model, but the magnitude of the resolution is different.

Returns
A reference to this ClusterSnnGraphLeiden object.

◆ run() [1/2]

Results scran::ClusterSnnGraphLeiden::run ( const BuildSnnGraph::Results store) const
inline

Run the Leiden community detection algorithm on a shared nearest-neighbor graph constructed from knncolle::Base object.

Parameters
storeSNN graph built by BuildSnnGraph::run().
Returns
A Results object containing the clustering results for all cells.

◆ run() [2/2]

Results scran::ClusterSnnGraphLeiden::run ( const igraph::Graph graph,
const igraph_real_t *  weights 
) const
inline

Run the Leiden community detection algorithm on a pre-constructed shared nearest-neighbor graph as a Graph object.

Parameters
graphAn existing igraph::Graph object, typically built by BuildSnnGraph::Results::to_igraph().
weightsPointer to an array of weights of length equal to the number of edges in graph.
Returns
A Results object containing the clustering results for all cells.

The documentation for this class was generated from the following file: