allele-methods: Extract allele information from a GDS object

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

Description

Extract reference and alternate alleles and allele counts from a GDS object.

Usage

1
2
3
4
5
6
## S4 method for signature 'SeqVarGDSClass'
refChar(gdsobj)
## S4 method for signature 'SeqVarGDSClass'
altChar(gdsobj, n=0)
## S4 method for signature 'SeqVarGDSClass'
nAlleles(gdsobj)

Arguments

gdsobj

A SeqVarGDSClass object with VCF data.

n

An integer indicating which alternate allele to return. n=0 returns a comma-separated string of all alternate alleles.

Details

These methods parse the "allele" field of a GDS object.

Value

refChar returns a character vector of reference alleles.

altChar returns a character vector of alternate alleles. If n=0, multiple alternate alleles are represented as a comma-separated string. If n>0, only the nth alternate allele is returned.

nAlleles returns an integer vector of the number of alleles (reference and alternate) for each variant.

Author(s)

Stephanie Gogarten

See Also

SeqVarGDSClass, applyMethod

Examples

1
2
3
4
5
6
7
gds <- seqOpen(seqExampleFileName("gds"))
table(refChar(gds))
table(altChar(gds))
table(altChar(gds, n=1))
table(altChar(gds, n=2), useNA="ifany")
table(nAlleles(gds))
seqClose(gds)

SeqVarTools documentation built on Nov. 22, 2020, 2 a.m.