if TRUE, to include family information in the
sample annotation
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.
PED – PLINK 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.
See Also
snpgdsGDS2PED, snpgdsBED2GDS,
snpgdsGDS2BED
Examples
# open
genofile <- snpgdsOpen(snpgdsExampleFileName())
snpgdsGDS2PED(genofile, "tmp")
# close
snpgdsClose(genofile)
# PED ==> GDS
snpgdsPED2GDS("tmp.ped", "tmp.map", "test.gds")
# delete the temporary file
unlink(c("tmp.ped", "tmp.map", "test.gds"), force=TRUE)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(SNPRelate)
Loading required package: gdsfmt
SNPRelate -- supported by Streaming SIMD Extensions 2 (SSE2)
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/SNPRelate/snpgdsPED2GDS.Rd_%03d_medium.png", width=480, height=480)
> ### Name: snpgdsPED2GDS
> ### Title: Conversion from PLINK PED to GDS
> ### Aliases: snpgdsPED2GDS
> ### Keywords: GDS GWAS
>
> ### ** Examples
>
> # open
> genofile <- snpgdsOpen(snpgdsExampleFileName())
>
> snpgdsGDS2PED(genofile, "tmp")
Converting from GDS to PLINK PED:
Output a MAP file DONE.
Output a PED file ...
Output: Wed Jul 6 05:34:48 2016 0%
Output: Wed Jul 6 05:34:48 2016 100%
>
> # close
> snpgdsClose(genofile)
>
>
> # PED ==> GDS
> snpgdsPED2GDS("tmp.ped", "tmp.map", "test.gds")
PLINK PED/MAP to GDS Format:
Import 9088 variants from 'tmp.map'
Chromosome:
1 10 11 12 13 14 15 16 17 18 19 2 20 21 22 3 4 5 6 7
716 483 447 427 344 282 262 278 207 266 120 742 229 126 116 609 562 566 565 472
8 9 X
488 416 365
Reading 'tmp.ped'
Output: 'test.gds'
Import 279 samples
Transpose the genotypic matrix ...
Done.
Optimize the access efficiency ...
Clean up the fragments of GDS file:
open the file 'test.gds' (1.3M)
# of fragments: 56
save to 'test.gds.tmp'
rename 'test.gds.tmp' (711.4K, reduced: 619.4K)
# of fragments: 26
>
>
> # delete the temporary file
> unlink(c("tmp.ped", "tmp.map", "test.gds"), force=TRUE)
>
>
>
>
>
> dev.off()
null device
1
>