polymapr_test: Run segregation distortion tests as implemented in the...

View source: R/polymapr.R

polymapr_testR Documentation

Run segregation distortion tests as implemented in the polymapR package.

Description

The polymapR package tests for segregation distortion by iterating through all possible forms of disomic or polysomic inheritance from either parent, tests for concordance of the offspring genotypes using a chi-squared test, and returns the largest p-value. It sometimes chooses a different p-value based on other heuristics. They also sometimes return NA. When type = "segtest", we only look at patterns of the given parent genotypes, choosing the largest p-value. When type = "polymapR", we return what they use via their heuristics.

Usage

polymapr_test(x, g1 = NULL, g2 = NULL, type = c("segtest", "polymapR"))

Arguments

x

Either a vector of genotype counts, or a matrix of genotype posteriors where the rows index the individuals and the columns index the genotypes.

g1

Parent 1's genotype.

g2

Parent 2's genotype.

type

Either my implementation which approximates that of polymapR ("segtest") or the implementation through polymapR ("polymapR"). Note that polymapR needs to be installed for type = "polymapR".

Value

A list with the following elements:

p_value

The p-value of the test.

bestfit

The genotype frequencies of the best fit model.

frq_invalid

The frequency of invalid genotypes.

p_invalid

The p-value of the invalid proportion.

Author(s)

David Gerard

See Also

checkF1().

Examples

g1 <- 0
g2 <- 1
x <- c(4, 16, 0, 0, 0)
polymapr_test(x = x, g1 = g1, g2 = g2, type = "segtest")
polymapr_test(x = x, g1 = g1, g2 = g2, type = "polymapR")



segtest documentation built on July 1, 2025, 1:07 a.m.