Learn R Programming

phenoDist (version 1.20.0)

PDMByKS: Compute phenotypic distance matrix by Kolmogorov-Smirnov statistics

Description

This function calculates the Kolmogorov-Smirnov statistic between a given sample and the negative control, for each feature, and then computes the phenotypic distance matrix based on the Kolmogorov-Smirnov statistics.

Usage

PDMByKS(x, unames, neg='rluc', selectedCellFtrs, distMethod=c('manhattan', 'euclidean', 'correlation', 'mahalanobis'))

Arguments

x
An imageHTS object.
unames
A character vector, containing the well names from where to collect the cell features. See getUnames for details.
neg
A character string to identify negative controls.
selectedCellFtrs
A character vector for cell features to be used in the calculation. If missing, all features are used.
distMethod
A character string indicating which distance method should be used. This must be (an abbreviation of) one of the strings 'manhattan', 'euclidean', 'correlation' or 'mahalanobis'.

Value

A symmetric distance matrix with the number of rows equaling to the length of unames.

Details

For each well, this function collects features of all cells, and performs a Kolmogorov-Smirnov test for each feature against the corresponding cell features from negative control wells, with the function ks.test of the stats package. The Kolmogorov-Smirnov statistics are collected for all wells and passed to PDMByWellAvg to calculate the phenotypic distance matrix.

See Also

ks.test, PDMByWellAvg

Examples

Run this code

  library('phenoDist')

  ## load the imageHTS object
  load(system.file('kimorph', 'kimorph.rda', package='phenoDist'))
  x@localPath <- file.path(tempdir(), 'kimorph')

  ## calculate pair-wise svm distance matrix
  load(system.file('kimorph', 'selectedFtrs.rda', package='phenoDist'))
  pdm <- PDMByKS(x, unames=getUnames(x,plate=1, row=2:3, col=3), neg='rluc', selectedCellFtrs=selectedCellFtrs, distMethod='euclidean')
  pdm

Run the code above in your browser using DataLab