KmknnIndex {BiocNeighbors} | R Documentation

## The KmknnIndex class

### Description

A class to hold indexing structures for the KMKNN algorithm for exact nearest neighbor identification.

### Usage

    KmknnIndex(data, centers, info, order, NAMES=NULL)

    KmknnIndex_clustered_data(x)

    KmknnIndex_cluster_centers(x)

    KmknnIndex_cluster_info(x)

    KmknnIndex_clustered_order(x)

    ## S4 method for signature 'KmknnIndex'
    show(object)

    ## S4 method for signature 'KmknnIndex'
    dim(x)

    ## S4 method for signature 'KmknnIndex'
    dimnames(x)

### Arguments

`data` | A numeric matrix with data points in columns and dimensions in rows.
`centers` | A numeric matrix with clusters in columns and dimensions in rows.
`info` | A list of statistics for each cluster.
`order` | An integer vector of length equal to `ncol(data)`, specifying the order of observations.
`NAMES` | A character vector of sample names or `NULL`.
`x, object` | A KmknnIndex object.

### Details

The KmknnIndex class holds the indexing structure required to run the KMKNN algorithm. Users should never need to call the constructor explicitly, but should generate instances of KmknnIndex classes with `buildKmknn`.

### Value

The `KmknnIndex` constructor will return an instance of the KmknnIndex class.

`KmknnIndex_clustered_data` and related getters will return the corresponding slots of `object`.

`dim` will return the dimensions of `t(data)`.

`dimnames` will return a list of length 2 where the first element is the supplied `NAMES`.

### Author(s)

Aaron Lun

### See Also

`buildKmknn`

### Examples

    example(buildKmknn)

    dim(out)

    str(KmknnIndex_clustered_data(out))
    str(KmknnIndex_cluster_centers(out))
    str(KmknnIndex_clustered_order(out))

[Package BiocNeighbors version 1.0.0 Index]