chrchang / plink-ng

A comprehensive update to the PLINK association analysis toolset. Beta testing of the first new version (1.90), focused on speed and memory efficiency improvements, is finishing up. Development is now focused on building out support for multiallelic, phased, and dosage data in PLINK 2.0.

Home Page:https://www.cog-genomics.org/plink/2.0/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[help] Vector/matrix encoding of alleles

opened this issue · comments

Sorry about this,

Can you help me find the bit of code responsible for converting a record with an allele to a vector encoding (0, 1, 2)?

plink2 itself tends to operate on the records in bit-packed form, so there isn't such a function under include/. However, the functions in pgenlib_ffi_support.cc probably do what you want.

Thank you.

You use const int8_t* genobytes and uintptr_t* genoarr throughout the file. I suspect this is the data that i'm interested in. Can you clarify what these arrays are when you have a chance?

genoarr is the 2-bit-per-element packed format returned/expected by pgenlib functions, while genobytes is a byte-per-element {0,1,2,-9} representation.