projectPCA
Project genomes onto pre-computed principal components widely used in ancient DNA. Enables fast analysis without re-computing the principal components. The software accepts ancient DNA data in eigenstrat or PLINK format as input. No modern samples are required, as the packages include the pre-computed PCA weights and PC coordinates for relevant modern samples (based on publicly available Human Origin array data).
Installation
The package projectPCAis available as a Python package via pip. To install, simply run a version of:
python3 -m pip install projectPCA
List of available PCAs
As of early 2026, three pre-computed PCAs are officially bundled into projectPCA. The bracket denotes the code you can use for all this PCA.
-
HO Westeurasia (HO) Standard Western Eurasian PCA, which is widely used in aDNA studies. PC1 corresponds to West-East, and PC2 to North-South.
-
HO Eurasian (EUAS) Standard whole-Eurasian PCA, widely used in aDNA studies. Excellent to resolve West versus East Asian ancestry (on PC1). PC2 generally corresponds to North-South.
-
HO Mediterranean (MED) This PCA is an extension of the standard Western Eurasian PCA (see above) and includes additional North African populations. That gives a more useful resolution for North African ancestry. The PCA is based on the one from the Puncic paper (Ringbauer et al 2025). Important: You have to use
maf=0.001here, which is different from the default. See an example Vignette here.
Usage
Project single Samples
To project onto a PCA, the key function is project_eigenstrat. To import it and run a single sample, use:
from projectPCA.run import project_eigenstrat
project_eigenstrat(es_path="/mnt/archgen/Autorun_eager/eager_outputs/TF/SUA/SUA002/genotyping/pileupcaller.double",
pca="HO", es_type="default")
This function also returns the dataframe with PCA coordinates. Note that the input path is the path of the eigenstrat files up to .geno but without the suffix.
The keyword pca denotes which PCA type to project onto (see above).
If you want to save the figure, you can add the keyword fig_path="". If this string is filled in, the program saves the resulting figure there.
If the path ends in .html, the figure is saved as an interactive plot, where you can hover over the individuals to see their labels (both ancient and modern reference samples). Otherwise, the standard matplotlib libraries are used to plot and save the figure (including in .png or .pdf format, based on the extension you provide).
project_eigenstrat(es_path="/mnt/archgen/Autorun_eager/eager_outputs/TF/SUA/SUA002/genotyping/pileupcaller.double",
pca="EUAS", es_type="unpacked_fast", plot_bgrd_c=False, fig_path='./figs/SUA002_EUAS.html')
Project multiple samples
It is also possible to project multiple samples. For this, you can use the keyword iids=[]. If the keyword is empty (the default), all samples in a file are projected and plotted. If you specify a list of individuals, only individuals with these IDs are projected.
Project PLINK files
To project PLINK files, you can use the keyword es_type="plink", and provide the path of the PLINK file up to the suffix:
project_eigenstrat(es_path="/mnt/archgen/users/hringbauer/git/EPIDEMIC/output/plink/bd_ptn_335",
pca="EUAS", es_type="plink", iids=[],
plot_bgrd_c=False, verbose=True, flip=True,
fig_path='/mnt/archgen/users/hringbauer/git/projectPCA/figs/ptn335PLINK_EUAS.html')
@Harald Ringbauer, 2026
Metadata
Release files for projectPCA 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| projectpca-0.5.0.tar.gz | 94.1 MB | Without provenance | Details for projectpca-0.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| projectpca-0.5.0-py3-none-any.whl | Python 3 | none | any | Details for projectpca-0.5.0-py3-none-any.whl |
Total release size: 188.2 MB
Release files / projectpca-0.5.0.tar.gz
| Download URL | projectpca-0.5.0.tar.gz |
|---|---|
| Size | 94.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
75e23c893a669054506c0c2f40f9f3648a9c6345f0138390ff2e62b985655724
|
|
BLAKE2b-256 checksum How to use checksums |
6ef96ea9148960c23629013f3169738c32342c53232c7dbf2e9f3e977faf0de5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / projectpca-0.5.0-py3-none-any.whl
| Download URL | projectpca-0.5.0-py3-none-any.whl |
|---|---|
| Size | 94.1 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ddda00d01bececa9a619c740a8770c8bca4a57ead0d52e588e8652d5f4c29a48
|
|
BLAKE2b-256 checksum How to use checksums |
2eb46d1724e3c616495938d9d87113ac4b1cd7428e69725f1c8d28d4d609134e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Security for projectPCA 0.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.