read.bed: Read the binary PLINK format (BED, BIM, and FAM)

Description Usage Arguments Details Value See Also Examples

View source: R/plinkformat.R

Description

Require the complete set of 3 files in the binary PLINK format. It includes BED file, BIM file and BAM file. For more information about the binary PLINK format, please check in the manual of PLINK.

Usage

1
read.bed(bed, bim, fam, only.snp = FALSE)

Arguments

bed

A path of BED file

bim

A path of BIM file

fam

A path of FAM file

only.snp

If TRUE, the function to read only SNP matrix, otherwise all files are loaded. The default value is FALSE.

Details

For more details about the binary PLINK format, please check http://zzz.bwh.harvard.edu/plink/binary.shtml

Value

The list containing the matrices of $snp, $snp.info, and $ind.info.

See Also

write.bed

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
#Use the example files embedded in the package.
bed <- system.file("extdata", "example_SNP.bed", package="KRIS")
bim <- system.file("extdata", "example_SNP.bim", package="KRIS")
fam <- system.file("extdata", "example_SNP.fam", package="KRIS")
snp <- read.bed(bed, bim, fam )

#Check the objects inside 'snp'
ls(snp)

#Preview $snp
print(snp$snp[1:10, 1:10])

#Preview $snp.info
head(snp$snp.info)

#Preview $ind.info
head(snp$ind.info)

KRIS documentation built on Jan. 21, 2021, 5:08 p.m.