Question: How does plink read bed files?
0
gravatar for kindlychung
5.4 years ago by
kindlychung60
Netherlands
kindlychung60 wrote:

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?

plink • 2.5k views
ADD COMMENTlink modified 5.4 years ago by chrchang5237.1k • written 5.4 years ago by kindlychung60

Have you gone through the source code?

ADD REPLYlink written 5.4 years ago by Devon Ryan95k

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?

 

ADD REPLYlink written 5.4 years ago by kindlychung60

I'd search the source code for fopen and fread, since those will give you a clue where to start.

ADD REPLYlink written 5.4 years ago by Devon Ryan95k
1
gravatar for chrchang523
5.4 years ago by
chrchang5237.1k
United States
chrchang5237.1k wrote:

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.

ADD COMMENTlink written 5.4 years ago by chrchang5237.1k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 805 users visited in the last hour