malariagen / malariagen-data-python

Analyse MalariaGEN data from Python
https://malariagen.github.io/malariagen-data-python/latest/
MIT License
13 stars 23 forks source link

Write SNP calls to plink binary file #248

Open alimanfoo opened 2 years ago

alimanfoo commented 2 years ago

Add support for writing a selection of SNP call data to a plink binary format file. Useful to export data for analysis with tools like ADMIXTURE.

Prototype implementation here.

alimanfoo commented 6 months ago

We now have a functions biallelic_snp_calls() and biallelic_diplotypes() which could be used to set up the data to be written out to plink format.

alimanfoo commented 6 months ago

Proposed API:

def biallelic_snp_calls_to_plink(
    path: str,
    ...  # All the same parameters as biallelic_snp_calls().
):
    ...

Here path should be the base path, and .bed, .bim and .fam suffixes will be added.