Learn R Programming

SeqArray (version 1.10.1)

seqExport: Export to a GDS File

Description

Exports to a GDS file with selected samples and variants, which are defined by seqSetFilter().

Usage

seqExport(gdsfile, out.fn, info.var=NULL, fmt.var=NULL, samp.var=NULL, verbose=TRUE)

Arguments

gdsfile
out.fn
the file name of output GDS file
info.var
characters, the variable name(s) in the INFO field for import; or NULL for all variables
fmt.var
characters, the variable name(s) in the FORMAT field for import; or NULL for all variables
samp.var
characters, the variable name(s) in the folder "sample.annotation"
verbose
if TRUE, show information

Value

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

See Also

seqVCF2GDS

Examples

Run this code
# open the GDS file
(gds.fn <- seqExampleFileName("gds"))
(f <- seqOpen(gds.fn))

# get 'sample.id'
head(samp.id <- seqGetData(f, "sample.id"))

# get 'variant.id'
head(variant.id <- seqGetData(f, "variant.id"))

set.seed(100)
# set sample and variant filters
seqSetFilter(f, sample.id=samp.id[c(2,4,6,8,10,12,14,16)])
seqSetFilter(f, variant.id=sample(variant.id, 100))


# export
seqExport(f, "tmp.gds")

(f1 <- seqOpen("tmp.gds")); seqClose(f1)


# close
seqClose(f)

# delete the temporary file
unlink("tmp.gds")

Run the code above in your browser using DataLab