# the file of VCF
(vcf.fn <- seqExampleFileName("vcf"))
# convert
seqVCF2GDS(vcf.fn, "tmp1.gds", storage.option=seqStorage.Option())
(f1 <- seqOpen("tmp1.gds"))
# convert (maximize the compression ratio)
seqVCF2GDS(vcf.fn, "tmp2.gds", storage.option=seqStorage.Option("ZIP_RA.max"))
(f2 <- seqOpen("tmp2.gds"))
# does not compress the genotypic data
seqVCF2GDS(vcf.fn, "tmp3.gds", storage.option=
seqStorage.Option(c("ZIP_RA", genotype="")))
(f3 <- seqOpen("tmp3.gds"))
# close and remove
seqClose(f1)
seqClose(f2)
seqClose(f3)
unlink(c("tmp1.gds", "tmp2.gds", "tmp3.gds"))
Run the code above in your browser using DataLab