SeqVarGDSClass {SeqArray} | R Documentation |
A SeqVarGDSClass
object provides access to a GDS file containing
Variant Call Format (VCF) data. It extends gds.class
.
A SeqArray GDS file is created from a VCF file with
seqVCF2GDS
. This file can be opened with seqOpen
to create a SeqVarGDSClass
object.
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
.
In the following code snippets x
is a SeqVarGDSClass object.
seqAsVCF(x, chr.prefix="", info=NULL, geno=NULL)
:
Stephanie Gogarten, Xiuwen Zheng
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)