Skip to contents

Observed IBS-state counts per pair matched to expectations from the Table 1 P(IBS | IBD) with finite-sample corrections; P(Z=0..2) solved sequentially, bounded per p. 566, pi-hat = P(Z=1)/2 + P(Z=2) with the biological constraint transform when pi^2 <= P(Z=2). This is Purcell et al. (2007); it is sometimes misattributed to Browning and Browning (2010), whose fastIBD is an HMM segment method.

Usage

Ibdmtx(G)

Arguments

G

Genotype matrix coded 0/1/2 (individuals x SNPs); other values treated as missing.

Value

List with estimate (pi-hat matrix), Z0, Z1, Z2, ibs_counts, n_snps_used, n, m, method.

References

Purcell, S., Neale, B., Todd-Brown, K. et al. (2007), American Journal of Human Genetics 81(3), 559-575, Table 1 and pp. 565-566.

Examples

set.seed(1)
G <- matrix(sample(0:2, 30 * 12, replace = TRUE), 30, 12)
K <- Ibdmtx(G)
c(nrow(K), ncol(K))
#> NULL