spatialFastmap-methods {Cardinal} | R Documentation

## Spatially-aware FastMap projection

### Description

Performs spatially-aware FastMap projection.

### Usage

    ## S4 method for signature 'SparseImagingExperiment'
    spatialFastmap(x, r = 1, ncomp = 3,
        method = c("gaussian", "adaptive"),
        dist = "chebyshev", tol.dist = 1e-9,
        iter.max = 1, BPPARAM = bpparam(), ...)

    ## S4 method for signature 'SpatialFastmap2'
    summary(object, ...)

    ## S4 method for signature 'SImageSet'
    spatialFastmap(x, r = 1, ncomp = 3,
        method = c("gaussian", "adaptive"),
        iter.max = 1, ...)

### Arguments

`x` | The imaging dataset for which to calculate the FastMap components.
`r` | The neighborhood spatial smoothing radius.
`ncomp` | The number of FastMap components to calculate.
`method` | The method to use to calculate the spatial smoothing kernels for the embedding. The 'gaussian' method refers to spatially-aware (SA) weights, and 'adaptive' refers to spatially-aware structurally-adaptive (SASA) weights.
`dist` | The type of distance metric to use when calculating neighboring pixels based on `r`. The options are ‘radial’, ‘manhattan’, ‘minkowski’, and ‘chebyshev’ (the default).
`tol.dist` | The distance tolerance used for matching pixels when calculating pairwise distances between neighborhoods. This parameter should only matter when the data is not gridded. (Only considers ‘radial’ distance.)
`iter.max` | The number of iterations to perform when choosing the pivot vectors for each dimension.
`...` | Ignored.
`object` | A fitted model object to summarize.
`BPPARAM` | An optional instance of `BiocParallelParam`. See documentation for `bplapply`.

### Value

An object of class `SpatialFastmap2`, which is a `ResultImagingExperiment`, or an object of class `SpatialFastmap`, which is a `ResultSet`. Each element of the `resultData` slot contains at least the following components:

`scores`:

  A matrix with the FastMap component scores.

`correlation`:

  A matrix with the feature correlations with each FastMap component.

`sdev`:

  The standard deviations of the FastMap scores.

### Author(s)

Kylie A. Bemis

### See Also

`PCA`, `spatialKMeans`, `spatialShrunkenCentroids`

### Examples

    register(SerialParam())

    set.seed(1)
    data <- simulateImage(preset=2, npeaks=20, dim=c(6,6),
        representation="centroid")

    # project to FastMap components
    fm <- spatialFastmap(data, r=1, ncomp=2, method="adaptive")

    # visualize first 2 components
    image(fm, superpose=FALSE)

[Package Cardinal version 2.2.6 Index]