2
$\begingroup$

I'm currently working with the PLINK file system to store large amounts of genotype data.

The plain format consists of three files, two files for storing phenotype and marker information as well as one file (.PED) containing the genotype matrix.

There exists a binary version of the .PED file (.BED), which stores the data in a number of consecutive byte blocks, with each block encoding the genotype of all samples for a specific marker.

While there exists a transposed version of the .PED file (.TPED) which is also supported by PLINK, I couldn't find out whether there also exists a transposed version of the binary .BED file.

Does it exist at all? Are there other file formats to compactly store a genotype matrix for fast sample / marker extraction?

$\endgroup$
2
$\begingroup$

Yes, this exists, and can be efficiently generated by plink 2.0's --export ind-major-bed command. (The third byte is 0 instead of 1, and the specification is otherwise identical to that of regular plink .bed files with samples and variants swapped.)

$\endgroup$
2
  • $\begingroup$ Thanks you. So the sample/variant-swapped binary file has the same .BED suffix? Does PLINK2 detect the file based on the third byte and is there a noticeable speedup when extracting a samples genotypes? $\endgroup$
    – Scholar
    Apr 17 '19 at 17:12
  • 1
    $\begingroup$ It has the same suffix, yes. PLINK 1.9 and 2.0 automatically create temporary variant-major .bed files when they see a sample-major .bed file, since almost all the code assumes variant-major, so this never speeds up PLINK. But it can be useful input for other programs. $\endgroup$ Apr 17 '19 at 17:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.