A virtual class for indexing structures of different nearest-neighbor search algorithms.
The BiocNeighborIndex class is a virtual base class on which other index objects are built. There are 4 concrete subclasses:
KmknnIndex: exact nearest-neighbor search with the KMKNN algorithm.
VptreeIndex: exact nearest-neighbor search with a VP tree.
AnnoyIndex: approximate nearest-neighbor search with the Annoy algorithm.
HnswIndex: approximate nearest-neighbor search with the HNSW algorithm.
These objects hold indexing structures for a given data set - see the associated documentation pages for more details. It also retains information about the input data as well as the sample names.
The main user-accessible methods are:
Display the class and dimensions of a BiocNeighborIndex
Return the dimensions of a BiocNeighborIndex
x, in terms of the matrix used to construct it.
Return the dimension names of a BiocNeighborIndex
Only the row names of the input matrix are stored, in the same order.
More advanced methods (intended for developers of other packages) are:
Return a numeric matrix containing the data used to construct
Each column should represent a data point and each row should represent a variable
(i.e., it is transposed compared to the usual input, for efficient column-major access in C++ code).
Columns may be reordered from the input matrix according to
Return an integer vector specifying the new ordering of columns in
This generally only needs to be considered if
Return a string specifying the distance metric to be used for searching, usually
Obviously, this should be the same as the distance metric used for constructing the index.
buildIndex for construction on an actual data set.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.