getbd5snp: Read a SNP from a Format 5 binary dosage file

View source: R/format5.R

getbd5snpR Documentation

Read a SNP from a Format 5 binary dosage file

Description

Seeks to the SNP's compressed block in the .bdose file, decompresses it, and returns the dosage and genotype probabilities for all samples.

Usage

getbd5snp(bd5info, snp)

Arguments

bd5info

Object returned by getbdinfo.

snp

The SNP to retrieve: either a 1-based integer index or a character SNP ID matching a value in bd5info$snps$snpid.

Value

A list with four numeric vectors, each of length n_samples:

dosage

DS values in [0, 2]; NA = missing.

p0

P(g=0) values in [0, 1]; NA = missing.

p1

P(g=1) values in [0, 1]; NA = missing.

p2

P(g=2) values in [0, 1]; NA = missing.


BinaryDosage documentation built on April 30, 2026, 1:09 a.m.