genotype_pca
Principal components of a call set's genotypes, the population-structure picture: biallelic sites above a minor-allele count, LD-pruned by sliding windows, scaled per site (Patterson, standard or centring) and decomposed; every sample's coordinates with its population, and the variance each component explains (scikit-allel pca). Validated on 1000 Genomes phase 3 APOL1, all 2,504 samples.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| vcf | Yes | the call set as VCF text (a .vcf, or a .vcf.gz already decompressed); every record's GT is read, ploidy 2. | |
| prune | No | drop sites in LD before the decomposition (locate_unlinked), as scikit-allel's PCA assumes. | |
| _files | No | The project: record references shaped like _subject. Their records become library documents a tool names in sequences/parts/document; a trace or alignment is found by file name. | |
| minMac | No | keep biallelic sites whose REF and first ALT are each seen at least this many times. | |
| scaler | No | per-site scaling before the decomposition: Patterson divides the centred dosage by √(p(1−p)); standard by its standard deviation; center only centres. Values: patterson (Patterson (√(p(1−p)))), standard (Standard deviation), center (Centre only). | patterson |
| groupBy | No | which column of the sample table groups the samples; empty is its first grouping column. | |
| _subject | No | The record to act on: exactly one of sequence, accession (+source), sample (an id from list_samples) or file ({name, text} or {name, base64}); record_index picks one record of several. | |
| precision | No | float64, or float16: scikit-allel's own path when handed integer genotypes, which rounds the scaled matrix to half precision. Values: float64 (Double precision), float16 (Half precision (as scikit-allel on integer genotypes)). | float64 |
| pruneSize | No | pruning window, in sites. Only applies when prune is true. | |
| pruneStep | No | sites the pruning window advances. Only applies when prune is true. | |
| nComponents | No | components to report. | |
| populations | No | a sample table: a header row with a `sample` column and one or more grouping columns (tab-separated, as 1000 Genomes' .panel). Samples it does not list belong to no group. | |
| pruneThreshold | No | prune the later site of a pair whose Rogers–Huff r² exceeds this. Only applies when prune is true. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sites | Yes | how many sites qualified, how many pruning kept, and their positions | |
| coords | Yes | one row per sample: sample, its group, and its coordinate on each component | |
| explainedVariance | Yes | the variance each reported component explains, in the data's own units (the eigenvalues) | |
| explainedVarianceRatio | Yes | the share of variance each reported component explains |