pca {SeqVarTools} | R Documentation

## Principal Component Analysis

### Description

Calculates the eigenvalues and eignevectors of a SeqVarGDSClass object with Principal Component Analysis

### Usage

    ## S4 method for signature 'SeqVarGDSClass'
    pca(gdsobj, eigen.cnt=32)

### Arguments

`gdsobj` | A `SeqVarGDSClass` object with VCF data.
`eigen.cnt` | An integer indicating how many eigenvalues and eignvectors to return.

### Details

Calculates the genetic covariance matrix and finds the eigen decomposition.

### Value

A list with two elements:

`eigenval` | A vector of length `eigen.cnt` with eigenvalues
`eigenvect` | A matrix of dimension ("selected samples", `eigen.cnt`).

### Author(s)

Xiuwen Zheng, Stephanie Gogarten

### References

Patterson N, Price AL, Reich D (2006) Population structure and eigenanalysis. PLoS Genetics 2:e190.

### See Also

`SeqVarGDSClass`, `applyMethod`

### Examples

    gds <- seqOpen(seqExampleFileName("gds"))
    pca <- pca(gds)
    pca$eigenval
    head(pca$eigenvect)
    seqClose(gds)

[Package SeqVarTools version 1.30.0 Index]