Learn R Programming

SPUTNIK (version 1.1)

binKmeans2,msi.dataset-method: Return a binary mask generated applying k-means clustering on peaks intensities. A finer segmentation is obtained by using a larger number of clusters than 2. The off-sample clusters are merged looking at the most frequent labels in the image corners. The lookup areas are defined by the kernel size.

Description

Return a binary mask generated applying k-means clustering on peaks intensities. A finer segmentation is obtained by using a larger number of clusters than 2. The off-sample clusters are merged looking at the most frequent labels in the image corners. The lookup areas are defined by the kernel size.

Usage

# S4 method for msi.dataset
binKmeans2(object, mzQuery = numeric(),
  useFullMZ = TRUE, mzTolerance = numeric(), numClusters = 4,
  kernelSize = c(3, 3, 3, 3), numCores = 1, verbose = TRUE)

Arguments

object
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 should be left unset when using useFullMZRef = TRUE.

useFullMZ

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

mzTolerance

numeric. Tolerance in PPM to match the mzQueryRef values in the m/z vector. Only valid when useFullMZ = FALSE.

numClusters

numeric (default = 4). Number of k-means clusters.

kernelSize

4D array (default = c(3, 3, 3, 3)). Array of sizes in pixels of the corner kernels used to identify the off-sample clusters. The elements represent the size of the top-left, top-right, bottom-right and bottom-left corners. A negative value can be used to skip the corresponding corner.

numCores

(default = 1). Multi-core parallel computation of k-means clusters.

verbose

logical (default = `TRUE``). Show additional output.

Value

ms.image-class object representing the binary mask image.