snpgdsOpen: Open a SNP GDS File

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

View source: R/AllUtilities.R

Description

Open a SNP GDS file

Usage

1
snpgdsOpen(filename, readonly=TRUE, allow.duplicate=FALSE, allow.fork=TRUE)

Arguments

filename

the file name

readonly

whether read-only or not

allow.duplicate

if TRUE, it is allowed to open a GDS file with read-only mode when it has been opened in the same R session, see openfn.gds

allow.fork

TRUE for parallel environment using forking, see openfn.gds

Details

It is strongly suggested to call snpgdsOpen instead of openfn.gds, since snpgdsOpen will perform internal checking for data integrality.

Value

Return an object of class SNPGDSFileClass.

Author(s)

Xiuwen Zheng

See Also

snpgdsClose

Examples

1
2
3
4
5
6
7
# open an example dataset (HapMap)
genofile <- snpgdsOpen(snpgdsExampleFileName())

genofile

# close the file
snpgdsClose(genofile)

Example output

Loading required package: gdsfmt
SNPRelate -- supported by Streaming SIMD Extensions 2 (SSE2)
File: /usr/local/lib/R/site-library/SNPRelate/extdata/hapmap_geno.gds (709.6K)
+    [  ] *
|--+ sample.id   { VStr8 279 ZIP(29.9%), 679B }
|--+ snp.id   { Int32 9088 ZIP(34.8%), 12.3K }
|--+ snp.rs.id   { VStr8 9088 ZIP(40.1%), 36.2K }
|--+ snp.position   { Int32 9088 ZIP(94.7%), 33.6K }
|--+ snp.chromosome   { UInt8 9088 ZIP(0.94%), 85B } *
|--+ snp.allele   { VStr8 9088 ZIP(11.3%), 4.0K }
|--+ genotype   { Bit2 279x9088, 619.0K } *
\--+ sample.annot   [ data.frame ] *
   |--+ family.id   { VStr8 279 ZIP(34.4%), 514B }
   |--+ father.id   { VStr8 279 ZIP(31.5%), 220B }
   |--+ mother.id   { VStr8 279 ZIP(30.9%), 214B }
   |--+ sex   { VStr8 279 ZIP(17.0%), 95B }
   \--+ pop.group   { VStr8 279 ZIP(6.18%), 69B }

SNPRelate documentation built on Nov. 8, 2020, 5:31 p.m.