An overview of what raw indices mean for neighbor-search implementations that contain a rearranged matrix in the BiocNeighborIndex object.
Consider the following call:
This yields the same output as:
raw.index=TRUE in the first call, the indices in
out$index matrix can be imagined to refer to columns of
PRE in the second call.
Moreover, all function arguments that previously referred to rows of
subset) are now considered to refer to columns of
The same reasoning applies to all functions where
precomputed can be specified in place of
This includes query-based searches (e.g.,
queryKmknn) and range searches (
raw.index=TRUE is intended for scenarios where the reordered data in
precomputed is used elsewhere.
By returning indices to the reordered data, the user does not need to hold onto the original data and/or switch between the original ordering and that in
This simplifies downstream code and provides a slight speed boost by avoiding the need for re-indexing.
Neighbor search implementations can only return raw indices if their index construction involves transposing
X and reordering its columns.
This tends to be the case for most implementations as transposition allows efficient column-major distance calculations and reordering improves data locality.
Both the KMKNN and VP tree implementations fulfill these requirements and thus have the
Note that setting
raw.index=TRUE makes little sense when
precomputed is not specified.
precomputed=NULL, a temporary index will be constructed that is not visible in the calling scope.
As index construction may be stochastic, the raw indices will not refer to anything that is meaningful to the end-user.
1 2 3 4 5 6
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.