snpgdsGDS2BED {SNPRelate} | R Documentation

## Conversion from GDS to PLINK BED

### Description

Convert a GDS file to a PLINK binary ped (BED) file.

### Usage

    snpgdsGDS2BED(gdsobj, bed.fn, sample.id=NULL, snp.id=NULL, snpfirstdim=NULL,
        verbose=TRUE)

### Arguments

`gdsobj` | an object of class `SNPGDSFileClass`, a SNP GDS file; or characters, the file name of GDS
`bed.fn` | the file name of output, without the filename extension ".bed"
`sample.id` | a vector of sample id specifying selected samples; if NULL, all samples are used
`snp.id` | a vector of snp id specifying selected SNPs; if NULL, all SNPs are used
`snpfirstdim` | if TRUE, genotypes are stored in the individual-major mode, (i.e, list all SNPs for the first individual, and then list all SNPs for the second individual, etc); if NULL, determine automatically
`verbose` | if TRUE, show information

### Details

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

BED – the PLINK binary ped format.

### 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

`snpgdsBED2GDS`, `snpgdsGDS2PED`

### Examples

    # open an example dataset (HapMap)
    genofile <- snpgdsOpen(snpgdsExampleFileName())

    snpset <- snpgdsSelectSNP(genofile, missing.rate=0.95)
    snpgdsGDS2BED(genofile, bed.fn="test", snp.id=snpset)

    # close the genotype file
    snpgdsClose(genofile)

    # delete the temporary files
    unlink(c("test.bed", "test.bim", "test.fam"), force=TRUE)

[Package SNPRelate version 1.18.1 Index]