imputedDosage {SeqVarTools} | R Documentation

## Get imputed dosage

### Description

Get matrix of imputed dosage values from a GDS object

### Usage

    ## S4 method for signature 'SeqVarGDSClass'
    imputedDosage(gdsobj, dosage.field="DS", use.names=TRUE)

### Arguments

`gdsobj` | A `SeqVarGDSClass` object with VCF data.
`dosage.field` | The name of the dosage field in the GDS object (will be prepended with `"annotation/format"`).
`use.names` | A logical indicating whether to assign sample and variant IDs as dimnames of the resulting matrix.

### Details

Reads dosage from the dosage-specific field in the GDS object, rather than counting alleles from called genotypes.

Only one dosage value per variant is allowed; the method will return an error if multiple dosages are present for a single variant.

### Value

A numeric matrix of dosage values with dimensions [sample,variant].

### Author(s)

Stephanie Gogarten

### See Also

`refDosage`, `altDosage`

### Examples

    # convert VCF to GDS keeping dosage field
    vcffile <- system.file("extdata", "gl_chr1.vcf", package="SeqVarTools")
    gdsfile <- tempfile()
    seqVCF2GDS(vcffile, gdsfile, fmt.import="DS", storage.option="ZIP_RA",
               verbose=FALSE)

    gds <- seqOpen(gdsfile)
    dos <- imputedDosage(gds)
    head(dos)
    seqClose(gds)
    unlink(gdsfile)

[Package SeqVarTools version 1.32.0 Index]