bbknn: Run bbknn clustering algorithm

Description Usage Arguments Value

View source: R/bbknn.R

Description

Implements the bbknn clustering algorithm in R using reticulate to run the Python version. Requires the python "bbknn" and "igraph" modules to be installed. Returns a vector of partition indices.

Usage

1
2
bbknn(data_matrix, batch, pca = TRUE, compute_pca = "python",
  nPcs = NULL)

Arguments

data_matrix

A matrix (genes x samples or cells) for expression data

batch

An integer vector of batches to correct for (converts factors or numeric vectors)

pca

whether to compute pca (defaults to TRUE) or apply correction to the raw matrix (FALSE)

compute_pca

whether to compute PCA in Python (defaults to TRUE, requires scanpy library) or with R functions (FALSE)

nPcs

number of principal components to compute (defaults to 50 if more than 50 genes)

Value

returns a list with the following components

corrected matrix

matrix of data corrected by the BBKNN (batch based K nearest neighbours)

pca

principal components(matrix with row for every sample and column for each component)

tsne

t-distributed stochastic neighbour embedding (matrix with row for every sample)

umap

uniform manifold approximation and projection (matrix with row for every sample)


TomKellyGenetics/bbknn documentation built on Sept. 23, 2019, 3:07 p.m.