seqGetFilter: Get the Filter of GDS File

Description Usage Arguments Value Author(s) See Also Examples

View source: R/Methods.R

Description

Gets the filter of samples and variants.

Usage

1
seqGetFilter(gdsfile, .useraw=FALSE)

Arguments

gdsfile

a SeqVarGDSClass object

.useraw

returns logical vectors if FALSE, and returns raw vectors if TRUE

Value

Return a list:

sample.sel

a logical/raw vector indicating selected samples

variant.sel

a logical/raw vector indicating selected variants

Author(s)

Xiuwen Zheng

See Also

seqSetFilter

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# the GDS file
(gds.fn <- seqExampleFileName("gds"))

# display
(f <- seqOpen(gds.fn))

# get 'sample.id
(samp.id <- seqGetData(f, "sample.id"))
# "NA06984" "NA06985" "NA06986" ...

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


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

# get filter
z <- seqGetFilter(f)

# the number of selected samples
sum(z$sample.sel)
# the number of selected variants
sum(z$variant.sel)


z <- seqGetFilter(f, .useraw=TRUE)
head(z$sample.sel)
head(z$variant.sel)


# close the GDS file
seqClose(f)

SeqArray documentation built on Nov. 8, 2020, 5:08 p.m.