Learn R Programming

MultiPhen (version 2.0.3)

read.plink: A function to read (small) binary PLINK binary files in a R session

Description

read.plink is a convenience function designed to read PLINK binary files (i.e. files that end with the suffix ``.bed'') in a R session. Please be aware that binary PLINK files are binary for a reason, i.e. to store genotype data in a compact way. Once they are imported in R they exist in R in a un ``unpacked'' form, and can therefore be very big. If the .bed file is big, or very big, the result will be that R will run out of memory and crash, or make the whole system slow or unresponsive. It is MANDATORY that in the directory containing the binary file also reside two accesory files, with the same name as the binary file but with extensions .fam and .bim, both produced by PLINK.

Usage

read.plink(root,indiv = NULL, opts = mPhen.options("geno.input"))

Arguments

root

filename of the dataset in PLINK binary format, WITHOUT the .bed extension.

indiv

List of individuals, results will be in this order

opts

List of options, use mPhen.options("geno.input",descr=TRUE) for more details of each option.

Value

A matrix of dimesions n by m, with n rows corresponding to the n individuals in the dataset, and m columns corresponding to the m markers. The colnames are retrived from the .fam file, and (should) correspond to the markers' names.

Details

Please note that, if the binary file is listed a ``mydata.bed'', the filename is ``mydata'', and the extension is ``.bed''. In this case ``mydata'' would be used as root value.

References

The plink homepage is at: https://www.cog-genomics.org/plink2