compute_eff_cardinalities: Function to compute marker effective cardinalities

View source: R/compute_marker_summaries.R

compute_eff_cardinalitiesR Documentation

Function to compute marker effective cardinalities

Description

Given a matrix of marker allele frequencies, compute_eff_cardinalities returns the effective cardinalites of t = 1,...,m markers, where m is the marker count. Effective cardinalities are per-marker allele counts that account for inequifrequenct alleles. Each effective cardinality is calculated as described in [1], i.e. without correcting for finite sample sizes or considering uncertainty.

Usage

compute_eff_cardinalities(fs, warn_fs = TRUE)

Arguments

fs

Matrix of marker allele frequencies, i.e. the fts in [1]. Specifically, a m by Kmax matrix, where m is the marker count and Kmax is the maximum cardinality (per-marker allele count) observed over all m markers. If, for any t = 1,...,m, the maximum cardinality exceeds that of the t-th marker (i.e. if Kmax > Kt), then all fs[t,1:Kt] are in (0,1] and all fs[t,(Kt+1):Kmax] are zero. For example, if Kt = 2 and Kmax = 4 then fs[t,] might look like [0.3, 0.7, 0, 0].

warn_fs

Logical indicating if the function should return warnings following allele frequency checks.

Value

Effective cardinalities for t = 1,…,m markers.

References

  1. Taylor, A.R., Jacob, P.E., Neafsey, D.E. and Buckee, C.O., 2019. Estimating relatedness between malaria parasites. Genetics, 212(4), pp.1337-1351.

Examples

compute_eff_cardinalities(fs = frequencies$Colombia)


artaylor85/paneljudge documentation built on March 6, 2023, 1:50 a.m.