How does plink read bed files?
plink bed files uses 2 bits for each genotype data point, which is most efficient in terms of storage space, but not so convenient for numerical analysis. I am wondering how does plink read these bits into a matrix of int/double for linear algebra operations?
• 4,274 views
•
link
1 answer
The short answer is that it usually doesn't. Whenever possible, PLINK 1.9 never unpacks the data; instead it uses bitwise operations and population count to perform computation directly on the 2-bit representation.
• 0 views
•
link
Log in to answer this question.
Have you gone through the source code?
I am trying to, but I am not that good at C. Could you tell what functions are involved so that I can focus on these?
I'd search the source code for
fopenandfread, since those will give you a clue where to start.