genetic_relatedness: Estimates pair-wise relatedness

View source: R/genetic_relatedness.R

genetic_relatednessR Documentation

Estimates pair-wise relatedness

Description

This function returns single relatedness estimates as a pairwise matrix.

Usage

genetic_relatedness(
  x,
  loci = NA,
  mode = c("Nason", "LynchRitland")[1],
  freqs = NA
)

Arguments

x

A data.frame that has locus columns.

loci

The loci to use (if missing all loci are used).

mode

The kind of relatedness to be estimated. Currently Fij (the default) and LynchRitland are available.

freqs

An optional data.frame (as returned by the function frequencies() with allele frequencies). If this is not provided, it will be estimated from all the data. This allows you to estimate relatedness among subsets of individuals using more global measures of relatedness.

Value

A matrix of pairwise relatedness estimates.

Note

This only works on diploid data and will return NA for any comparison of missing genotypes.

Examples

x <- c( locus(1:2), locus(c(2,2)), locus(1:2) )
genetic_relatedness( x )

dyerlab/gstudio documentation built on Feb. 2, 2024, 8:24 p.m.