getmutualknn: getmutualknn

View source: R/getmutualknn.R

getmutualknnR Documentation

getmutualknn

Description

Get a mutual kNN graph (M-kNN) from the latent space (LSI) of single cell profiles

Usage

getmutualknn(lsimat, num_k = 30)

Arguments

lsimat

A dense or sparse matrix of cell (rows) x LSI (cols)

num_k

A numeric input (30 by default) for k used for graph construction

Value

A sparse matrix indicating adjacent matrix from single cells used for graph construction

Examples

SE_pbmc5k <- example_data(name="pbmc5k_SE.rda")
peak_by_cell_mat <- SummarizedExperiment::assay(SE_pbmc5k)
#### Downsample to speed up example ####
peak_by_cell_mat <- peak_by_cell_mat[seq_len(500), seq_len(100)]
tfidf_mat <- tfidf(bmat=peak_by_cell_mat)
lsi_mat <- do_lsi(mat=tfidf_mat, dims=30)
mknn_graph <- getmutualknn(lsimat=lsi_mat, num_k=30)

sankaranlab/SCAVENGE documentation built on March 2, 2023, 2:17 a.m.