calc_genotype_distance: Calculate distance between two genotypes

View source: R/summarize_dataset.R

calc_genotype_distanceR Documentation

Calculate distance between two genotypes

Description

Given two vectors representing genotypes, produce a scalar value for the distance between them. The vectors should be sorted the same such that the each two values of each vector represent two alleles of the same locus. In this implementation the distance is simply the number of mismatches between the alleles for each locus, accounting for either order of alleles.

Usage

calc_genotype_distance(g1, g2, na_reject = TRUE)

Arguments

g1

vector for genotype.

g2

vector for genotype.

na_reject

logical; should NA entries be treated as mismatches? TRUE by default.

Value

numeric distance score for the pair of input genotypes.


ShawHahnLab/chiimp documentation built on Aug. 20, 2023, 1:41 a.m.