Learn R Programming

BGLR (version 1.1.3)

read_bed: read_bed

Description

This function reads genotype information stored in binary PED (BED) files used in plink. These files save space and time. The pedigree/phenotype information is stored in a separate file (*.fam) and the map information is stored in an extededed MAP file (*.bim) that contains information about the allele names, which would otherwise be lost in the BED file. More details http://zzz.bwh.harvard.edu/plink/binary.shtml.

Usage

read_bed(bed_file,bim_file,fam_file,na.strings,verbose)

Value

The routine will return a vector of dimension n*p (n=number of individuals, p=number of snps), with the snps(individuals) stacked, depending whether the BED file is in SNP-major or individual-major mode.

The vector contains integer codes:

Integer codeGenotype
000 Homozygote "1"/"1"
101 Heterozygote
210 Missing genotype
311 Homozygote "2"/"2"

Arguments

bed_file

binary file with genotype information.

bim_file

text file with pedigree/phenotype information.

fam_file

text file with extended map information.

na.strings

missing value indicators, default=c("0","-9").

verbose

logical, if true print hex dump of bed file.

Author

Gustavo de los Campos, Paulino Perez Rodriguez,

Examples

Run this code

if (FALSE) {

library(BGLR)
demo(read_bed)

}

Run the code above in your browser using DataLab