Description Usage Arguments Details Value

`pcadapt`

performs principal component analysis and computes p-values to
test for outliers. The test for outliers is based on the correlations between
genetic variation and the first `K`

principal components. `pcadapt`

also handles Pool-seq data for which the statistical analysis is performed on
the genetic markers frequencies. Returns an object of class `pcadapt`

.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ```
pcadapt(input, K = 2, method = "mahalanobis", min.maf = 0.05,
ploidy = 2, LD.clumping = NULL, pca.only = FALSE)
## S3 method for class 'pcadapt_matrix'
pcadapt(input, K = 2, method = c("mahalanobis",
"componentwise"), min.maf = 0.05, ploidy = 2, LD.clumping = NULL,
pca.only = FALSE)
## S3 method for class 'pcadapt_bed'
pcadapt(input, K = 2, method = c("mahalanobis",
"componentwise"), min.maf = 0.05, ploidy = 2, LD.clumping = NULL,
pca.only = FALSE)
## S3 method for class 'pcadapt_pool'
pcadapt(input, K = (nrow(input) - 1),
method = "mahalanobis", min.maf = 0.05, ploidy = NULL,
LD.clumping = NULL, pca.only = FALSE)
``` |

`input` |
a genotype matrix or a character string specifying the name of
the file to be processed with |

`K` |
an integer specifying the number of principal components to retain. |

`method` |
a character string specifying the method to be used to compute
the p-values. Two statistics are currently available, |

`min.maf` |
a value between |

`ploidy` |
Number of trials, parameter of the binomial distribution. Default is 2, which corresponds to diploidy, such as for the human genome. |

`LD.clumping` |
Default is |

`pca.only` |
a logical value indicating whether PCA results should be returned (before computing any statistic). |

First, a principal component analysis is performed on the scaled and
centered genotype data. To account for missing data, the correlation matrix
between individuals is computed using only the markers available for each
pair of individuals. Depending on the specified `method`

, different test
statistics can be used.

`mahalanobis`

(default): the robust Mahalanobis distance is computed for
each genetic marker using a robust estimate of both mean and covariance
matrix between the `K`

vectors of z-scores.

`communality`

: the communality statistic measures the proportion of
variance explained by the first `K`

PCs. Deprecated in version 4.0.0.

`componentwise`

: returns a matrix of z-scores.

To compute p-values, test statistics (`stat`

) are divided by a genomic
inflation factor (`gif`

) when `method="mahalanobis"`

. When using
`method="mahalanobis"`

, the scaled statistics
(`chi2_stat`

) should follow a chi-squared distribution with `K`

degrees of freedom. When using `method="componentwise"`

, the z-scores
should follow a chi-squared distribution with `1`

degree of freedom. For
Pool-seq data, `pcadapt`

provides p-values based on the Mahalanobis
distance for each SNP.

The returned value `x`

is an object of class `pcadapt`

.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.