Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

pp

Unpack posterior probabilities from one-byte codes


Description

In snpStats, the three "posterior" probabilities corresponding to the possible values of an uncertain genotype are packed into a single byte code (with, of course, some loss in accuracy). This function, which is provided as an aid to writing new functions, unpacks the posterior probabilities from the single byte codes.

Usage

pp(x, transpose = FALSE)

Arguments

x

A vector, length N, which can be coerced into type raw

transpose

If FALSE, the result is an Nx3 matrix of posterior probabilities. If TRUE, a 3xN matrix is returned.

Value

A numeric matrix

Author(s)

David Clayton dc208@cam.ac.uk

Examples

##
## Read imputed data from a file produced by MACH 
##
path <- system.file("extdata/mach1.out.mlprob.gz", package="snpStats")
mach <- read.mach(path)
pp(mach[1:50, 10])

snpStats

SnpMatrix and XSnpMatrix classes and methods

v1.40.0
GPL-3
Authors
David Clayton <dc208@cam.ac.uk>
Initial release
2019-10-08

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.