snpgdsBED2GDS: Conversion from PLINK BED to GDS

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/SNPRelate_Main.r

Description

Convert a PLINK binary ped file to a GDS file.

Usage

1
2
snpgdsBED2GDS(bed.fn, fam.fn, bim.fn, out.gdsfn, family=FALSE,
	compress.annotation="ZIP.max", option=NULL, verbose=TRUE)

Arguments

bed.fn

the file name of binary file, genotype information

fam.fn

the file name of first six columns of *.ped

bim.fn

the file name of extended MAP file: two extra cols = allele names

out.gdsfn

the output gds file

family

if TRUE, to include family information in the sample annotation

compress.annotation

the compression flag of the nodes stored, except "genotype"; the string value is defined in the function of add.gdsn

option

NULL or an object from snpgdsOption, see details

verbose

if TRUE, show information

Details

GDS – Genomic Data Structures, the extended file name used for storing genetic data, and the file format is used in the gdsfmt package.

BED – the PLINK binary ped format.

The user could use option to specify the range of code for autosomes. For humans there are 22 autosomes (from 1 to 22), but dogs have 38 autosomes. Note that the default settings are used for humans. The user could call option = snpgdsOption(autosome.end=38) for importing the BED file of dog. It also allow define new chromosome coding, e.g., option = snpgdsOption(Z=27).

Value

None.

Author(s)

Xiuwen Zheng

References

Purcell S, Neale B, Todd-Brown K, Thomas L, Ferreira MAR, Bender D, Maller J, Sklar P, de Bakker PIW, Daly MJ & Sham PC. 2007. PLINK: a toolset for whole-genome association and population-based linkage analysis. American Journal of Human Genetics, 81.

http://corearray.sourceforge.net/

See Also

snpgdsOption, snpgdsBED2GDS, snpgdsGDS2PED

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# PLINK BED files
bed.fn <- system.file("extdata", "plinkhapmap.bed", package="SNPRelate")
bim.fn <- system.file("extdata", "plinkhapmap.bim", package="SNPRelate")
fam.fn <- system.file("extdata", "plinkhapmap.fam", package="SNPRelate")

# convert
snpgdsBED2GDS(bed.fn, fam.fn, bim.fn, "HapMap.gds")

# open
genofile <- openfn.gds("HapMap.gds")
genofile

# close
closefn.gds(genofile)

SNPRelate documentation built on May 2, 2019, 4:56 p.m.