We first build a SNN graph, where each node is a cell connected to its neighbours in high dimensional space. Input multiple values for 'k' and 'ndim' -- the nearest neighbours and number of dimensions to use --- and the function will generate a graph for every combination. We then apply a clustering method to each of the graph(s) to identify clusters of cells. You can choose multiple clustering methods and the function will assign cells to clusters based on each method and for each graph. The clustering methods are taken from the igraph package. For a good and practical introduction of graph-based clustering, see: https://osca.bioconductor.org/clustering.html#clustering-graph

ohmySNNclusters(
  m,
  all.methods = FALSE,
  methods = c("walktrap", "louvain"),
  k = c(10, 30, 50),
  ndim = nrow(m),
  ...
)

Arguments

m

matrix of features (genes/principal components) by observations (cells)

all.methods

logical value. Methods: walktrap, louvain, infomap, fast_greedy, label_prop, leading_edge. See the igraph package for details. Default: FALSE

methods

one or more clustering methods to use. If multiple, each will be run. Default: c("walktrap", "louvain")

k

number of nearest neighbours to use in the graph construction. If multiple values are inputted, each will be run. Default: c(10, 30, 50)

ndim

number of dimensions to use in the graph construction. If multiple values are inputted, each will be run. Default: nrow(m)

...

other arguments for graph construction passed to scran::buildSNNGraph

Value

a dataframe

Details

The function provides a friendly interface for trying several combinations of parameters for graph construction and cluster identification. The output is a dataframe with columns: id, k, ndim and one column per clustering method.