mixedVCFtoSnpMatrix {gQTLstats} | R Documentation

## amalgamate called genotypes and imputed allelic dosages in VCF to SnpMatrix representation

### Description

amalgamate called genotypes and imputed allelic dosages in VCF to SnpMatrix representation

### Usage

    mixedVCFtoSnpMatrix(vcf, preferGT = TRUE)

### Arguments

`vcf` | object inheriting from `CollapsedVCF-class`
`preferGT` | logical. VCF allows loci for samples to be reported in various formats, and a given locus can have a call tagged GT and a genotype probability or likelihood representation tagged GP or GL. `genotypeToSnpMatrix` has an `uncertain` parameter that, if TRUE, will transform GP or GL content to allelic dose. Note that only the "first" dosage type appearing in the header will be transformed. Thus if GP is first in the header but a given locus is tagged only with GL, the genotype for thus locus will be recorded as NA.

### Details

emulates output from `genotypeToSnpMatrix`

### Value

list with elements `genotypes` and `map`

### Author(s)

VJ Carey

### See Also

`genotypeToSnpMatrix`

### Examples

    fn = system.file("vcf/polytypeSNV.vcf", package="gQTLstats")
    require("VariantAnnotation")
    require("snpStats")
    vv = readVcf(fn, genome="hg19") # only 4th SNP will have dosage coding
    mixedVCFtoSnpMatrix(vv)$genotypes@.Data

[Package gQTLstats version 1.16.0 Index]