SeqVarGDSClass-class: SeqVarGDSClass

Description Details Accessors Coercion methods Author(s) See Also Examples

Description

A SeqVarGDSClass object provides access to a GDS file containing Variant Call Format (VCF) data. It extends gds.class.

Details

A SeqArray GDS file is created from a VCF file with seqVCF2GDS. This file can be opened with seqOpen to create a SeqVarGDSClass object.

Accessors

In the following code snippets x is a SeqVarGDSClass object.

granges(x): Returns the chromosome and position of variants as a GRanges object. Names correspond to the variant.id.

ref(x): Returns the reference alleles as a DNAStringSet.

alt(x): Returns the alternate alleles as a DNAStringSetList.

qual(x): Returns the quality scores.

filt(x): Returns the filter data.

fixed(x): Returns the fixed fields (ref, alt, qual, filt).

header(x): Returns the header as a DataFrameList.

rowRanges(x): Returns a GRanges object with metadata.

colData(x): Returns a DataFrame with sample identifiers and any information in the 'sample.annotation' node.

info(x, info=NULL): Returns the info fields as a DataFrame. info is a character vector with the names of fields to return (default is to return all).

geno(x, geno=NULL): Returns the geno (format) fields as a SimpleList. geno is a character vector with the names of fields to return (default is to return all).

Other data can be accessed with seqGetData.

Coercion methods

In the following code snippets x is a SeqVarGDSClass object.

seqAsVCF(x, chr.prefix="", info=NULL, geno=NULL):

Author(s)

Stephanie Gogarten, Xiuwen Zheng

See Also

gds.class, seqOpen

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
36
37
38
39
40
41
gds <- seqOpen(seqExampleFileName("gds"))
gds

## sample ID
head(seqGetData(gds, "sample.id"))

## variants
granges(gds)

## Not run: 
## alleles as comma-separated character strings
head(seqGetData(gds, "allele"))

## alleles as DNAStringSet or DNAStringSetList
ref(gds)
v <- alt(gds)

## genotype
geno <- seqGetData(gds, "genotype")
dim(geno)
## dimensions are: allele, sample, variant
geno[1,1:10,1:5]

## rsID
head(seqGetData(gds, "annotation/id"))

## alternate allele count
head(seqGetData(gds, "annotation/info/AC"))

## individual read depth
depth <- seqGetData(gds, "annotation/format/DP")
names(depth)
## VCF header defined DP as variable-length data
table(depth$length)
## all length 1, so depth$data should be a sample by variant matrix
dim(depth$data)
depth$data[1:10,1:5]

## End(Not run)

seqClose(gds)

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