dist_from_biallelic: Genetic distance matrix from biallelic allele counts

View source: R/genetic_covariance.R

dist_from_biallelicR Documentation

Genetic distance matrix from biallelic allele counts

Description

Computes pairwise squared genetic distances from biallelic (SNP) allele counts. This is a convenience wrapper for dist_from_cov(cov_from_biallelic(Y, N)).

Usage

dist_from_biallelic(Y, N)

Arguments

Y

Numeric matrix of derived-allele counts (populations/individuals in rows, loci in columns).

N

Numeric matrix of haploid sample sizes with the same dimensions as Y. See cov_from_biallelic for flexible N specifications.

Value

A symmetric numeric matrix of pairwise squared distances with zero diagonal. Suitable for use with mlpe or generalized_wishart.

See Also

cov_from_biallelic, dist_from_cov, fst_from_biallelic

Examples

Y <- matrix(c(2, 1, 0,
              1, 1, 1,
              0, 1, 2), nrow = 3, byrow = TRUE)
N <- matrix(2, nrow = 3, ncol = 3)
dist_from_biallelic(Y, N)


landgraph documentation built on Sept. 26, 2026, 1:08 a.m.