PDMByFactorAnalysis: Calculate phenotypic distance matrix by factor analysis

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/PDMatrix.R

Description

This function transforms the cell features by factor analysis and computes the phenotypic distance matrix.

Usage

1
PDMByFactorAnalysis(x, unames, selectedCellFtrs, distMethod=c('manhattan','euclidean', 'correlation','mahalanobis'), nFactors, scores=c('regression','Bartlett'), ...)

Arguments

x

An imageHTS object.

unames

A character vector, containing the well names from where to collect the cell features. See getUnames for details.

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'.

nFactors

An integer scalar for the number of factors.

scores

A character string indicating the type of scores to be reported by factor analysis. This must be (an abbreviation of) one of the strings 'regression' or 'Bartlett'.

...

Additional arguments to be passed to the factanal function of the stats pacakge.

Details

This function first collects individual cell features in all wells (which could be time and memory consuming), performs factor analysis on cell features and transforms cell features into a certain number of factors, and then the factors are averaged by well and passed to PDMByWellAvg to calculate the phenotypic distance matrix.

Value

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

Author(s)

Xian Zhang

See Also

factanal, PDMByWellAvg

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
  library('phenoDist')

  ## load the imageHTS object
  load(system.file('kimorph', 'kimorph.rda', package='phenoDist'))
  x@localPath <- file.path(tempdir(), 'kimorph')
  
  ## segmentation and feature extraction
  unames <- setdiff(getUnames(x), getUnames(x, content='empty'))

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

phenoDist documentation built on May 2, 2018, 4:46 a.m.