refImageBinaryKmeansMulti: Calculate the binary reference image using k-means clustering...

View source: R/binary_refimg.R

refImageBinaryKmeansMultiR Documentation

Calculate the binary reference image using k-means clustering with multi-cluster merging. K-means is run on the first 'npcs' principal components to speed up the calculations.

Description

Calculate the binary reference image using k-means clustering with multi-cluster merging. K-means is run on the first 'npcs' principal components to speed up the calculations.

Usage

refImageBinaryKmeansMulti(
  dataset,
  npcs = 10,
  mzQuery = numeric(),
  mzTolerance = Inf,
  useFullMZ = TRUE,
  numClusters = 4,
  kernelSize = 5,
  cores = 1,
  verbose = TRUE
)

Arguments

dataset

msi.dataset-class object. See msiDataset.

npcs

int (default = 10). Number of principal components to calculate.

mzQuery

numeric. Values of m/z used to calculate the reference image. 2 values are interpreted as interval, multiple or single values are searched in the m/z vector. It overrides the argument useFullMZ.

mzTolerance

numeric (default = Inf). Tolerance in PPM to match the mzQueryRef values in the m/z vector.

useFullMZ

logical (default = TRUE). Whether all the peaks should be used to calculate the reference image.

numClusters

numeric (default = 4). Number of clusters.

kernelSize

4-D numeric array or numeric (default = 5). Each element of the 4-D array represents the size of the corners square kernels used to determine the off-tissue clusters. The element order is clockwise: top-left, top-right, bottom-left, bottom-right. If negative, the corresponding corner is skipped. If only a single value is passed, the same kernel size is used for the 4 corners.

cores

numeric (default = 1). Number of CPU cores for parallel k-means.

verbose

boolean (default = TRUE). Additional output.

Value

ms.image-class object with binary intensities.


paoloinglese/SPUTNIK documentation built on April 18, 2024, 8:56 p.m.