probabilityToSnpMatrix: Convert posterior genotype probability to a SnpMatrix object

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

View source: R/methods-genotypeToSnpMatrix.R

Description

Convert a matrix of posterior genotype probabilites P(AA), P(AB), P(BB) to a SnpMatrix.

Usage

1

Arguments

probs

Matrix with three columns for the posterior probabilities of the three genotypes: "P(A/A)", "P(A/B)", "P(B/B)". Each row must sum to 1.

Details

probabilityToSnpMatrix converts a matrix of posterior probabilites of genotype calls into a SnpMatrix.

Value

An object of class "SnpMatrix" with one row (one sample). Posterior probabilities are encoded (approximately) as byte values, one per SNP. See the help page for SnpMatrix for complete details of the class structure.

Author(s)

Stephanie Gogarten <sdmorris@u.washington.edu>

See Also

genotypeToSnpMatrix, SnpMatrix

Examples

1
2
3
4
5
6
7
8
probs <- matrix(c(1,0,0,
                  0,1,0,
                  0,0,1,
                  NA,NA,NA),
                  ncol=3, byrow=TRUE,
                  dimnames=list(1:4,c("A/A","A/B","B/B")))
sm <- probabilityToSnpMatrix(probs)
as(sm, "character")

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