
Reduce BBKNN results to the k nearest neighbours
rs_bbknn_filtering.Rd
Keeps the batch-balanced
no_neighbours_to_keep nearest neighbours of
each row of the BBKNN distance CSR: the nearest
ceil(no_neighbours_to_keep / n_batches) per batch, with slots a batch
cannot fill going to the nearest remaining neighbours. Rows come back
sorted by distance (ties by index). Rows with fewer stored entries are
padded by repeating their last neighbour; an empty row points at the cell
itself at distance zero.
Arguments
- indptr
Integer vector. The index pointers of the underlying data.
- indices
Integer vector. The indices of the nearest neighbours.
- data
Numeric vector. The distances to the nearest neighbours.
- batch_labels
Integer vector. The batch of each cell, as passed to
rs_bbknn().- no_neighbours_to_keep
Integer. Number of nearest neighbours to keep.