feat: a dosage
command for storing TR motif counts in PGEN files
#221
Labels
enhancement
New feature or request
dosage
command for storing TR motif counts in PGEN files
#221
Note: This idea originated from the bottom of #73 (comment)
Once PGEN files can store multiallelic dosages, we should consider creating a command called
dosage
that can append dosage info computed using haptools' Genotypes classes to an existing PGEN file:GenotypesPLINKTR
to compute the genotypes, sum them to compute the dosages (and possibly divide by 2 so that they remain in the range [0, 2]?) and then write them to the existing file usingPgenWriter.append_dosages_batch()
. It should only change the PGEN file. The PVAR and PSAM files can remain the same--out
is specified, we should create a new PGEN file instead of overwriting the existing one. In the former case, we should also copy (or symlink?) the PVAR and PSAM files.Once we do all of this, we should be able to use PLINK2 to analyze TRs! For example, we could do the following:
haptools dosage
to add dosages to the PGEN fileplink2
. For example, we could use it with--r[2]-[un]phased
,--ld-*
,--pca
,--glm
,--freq
,--clump
, or--maf/--mac
. Quoting from the documentation:The text was updated successfully, but these errors were encountered: