Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

write_bed

write_bed


Description

This function writes genotype information into a binary PED (BED) filed used in plink. For more details about this format see http://zzz.bwh.harvard.edu/plink/binary.shtml.

Usage

write_bed(x,n,p,bed_file)

Arguments

n

integer, number of individuals.

p

integer, number of SNPs.

x

integer vector that contains the genotypic information coded as 0,1,2 and 3 (see details below). The information must be in snp major order. The vector should be of dimension n*p with the snps stacked.

bed_file

output binary file with genotype information.

Details

The vector contains integer codes:

Integer code Genotype
0 00 Homozygote "1"/"1"
1 01 Heterozygote
2 10 Missing genotype
3 11 Homozygote "2"/"2"

Author(s)

Gustavo de los Campos, Paulino Perez Rodriguez,

Examples

## Not run: 

library(BGLR)
demo(write_bed)


## End(Not run)

BGLR

Bayesian Generalized Linear Regression

v1.0.8
GPL-3
Authors
Gustavo de los Campos, Paulino Perez Rodriguez,
Initial release
2018-11-24

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.