snpgdsGEN2GDS: Conversion from Oxford GEN format to GDS

View source: R/Conversion.R

snpgdsGEN2GDSR Documentation

Conversion from Oxford GEN format to GDS

Description

Convert an Oxford GEN file (text format) to a GDS file.

Usage

snpgdsGEN2GDS(gen.fn, sample.fn, out.fn, chr.code=NULL,
    call.threshold=0.9, version=c(">=2.0", "<=1.1.5"),
    snpfirstdim=FALSE, compress.annotation="ZIP_RA.max", compress.geno="",
    verbose=TRUE)

Arguments

gen.fn

the file name of Oxford GEN text file(s), it could be a vector indicate merging all files

sample.fn

the file name of sample annotation

out.fn

the output GDS file

chr.code

a vector of chromosome code according to gen.fn, indicating chromosomes. It could be either numeric or character-type

call.threshold

the threshold to determine missing genotypes

version

either ">=2.0" or "<=1.1.5", see details

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)

compress.annotation

the compression method for the GDS variables, except "genotype"; optional values are defined in the function add.gdsn

compress.geno

the compression method for "genotype"; optional values are defined in the function add.gdsn

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.

NOTE : the sample file format (sample.fn) has changed with the release of SNPTEST v2. Specifically, the way in which covariates and phenotypes are coded on the second line of the header file has changed. version has to be specified, and the function uses ">=2.0" by default.

Value

Return the file name of GDS format with an absolute path.

Author(s)

Xiuwen Zheng

References

https://code.enkre.net/bgen

See Also

snpgdsBED2GDS, snpgdsVCF2GDS

Examples

cat("running snpgdsGEN2GDS ...\n")
## Not run: 
snpgdsGEN2GDS("test.gen", "test.sample", "output.gds", chr.code=1)

## End(Not run)

zhengxwen/SNPRelate documentation built on Nov. 19, 2024, 1:02 p.m.