otest_g: Jointly tests for segregation distortion and number of...

View source: R/overall.R

otest_gR Documentation

Jointly tests for segregation distortion and number of incompatible genotypes

Description

This is experimental. I haven't tested it out in lots of scenarios yet.

Usage

otest_g(
  x,
  g1,
  g2,
  pbad = 0.03,
  drbound = 1/6,
  pp = TRUE,
  dr = TRUE,
  alpha = 0,
  xi1 = 1/3,
  xi2 = 1/3
)

Arguments

x

A vector of genotype counts. x[i] is the number of offspring with genotype i-1.

g1

The genotype of parent 1.

g2

The genotype of parent 2.

pbad

The upper bound on the number of bad genotypes

drbound

The maximum rate of double reduction. A default of 1/6 is provided, which is the rate under the complete equational segregation model of meiosis.

pp

A logical. Should we account for preferential pairing (TRUE) or not (FALSE)?

dr

A logical. Should we account for double reduction (TRUE) or not (FALSE)?

alpha

If dr = FALSE, this is the known rate of double reduction.

xi1

If pp = FALSE, this is the known preferential pairing parameter of parent 1.

xi2

If pp = FALSE, this is the known preferential pairing parameter of parent 2.

Details

Here, we test if the compatible genotypes are consistent with F1 populations and separately test that the number of incompatible genotypes isn't too large (less than 3 percent by default). This is the strategy the polymapR software uses. But we use a Bonferroni correction to combine these tests (minimum of two times the p-values), while they just multiply the p-values together. So our approach accounts for double reduction and preferential pairing, while also controlling the family-wise error rate.

Value

A list with the following elements

statistic

The log-likelihood ratio test statistic.

df

The degrees of freedom.

p_value

The Bonferroni corrected p-value.

p_lrt

The p-value of the LRT.

p_binom

The p-value of the one-sided binomial test.

alpha

The estimated double reduction rate.

xi1

The estimated preferential pairing parameter of parent 1.

xi2

The estimated preferential pairing parameter of parent 2.

Author(s)

David Gerard

Examples

# Run a test where genotypes 0, 1, and 2 are possible
x <- c(10, 10, 4, 0, 5)
otest_g(x = x, g1 = 1, g2 = 0)

# polymapR's multiplication and the Bonferroni differ
df <- expand.grid(p1 = seq(0, 1, length.out = 20), p2 = seq(0, 1, length.out = 20))
df$polymapr <- NA
df$bonferroni <- NA
for (i in seq_len(nrow(df))) {
  df$polymapr[[i]] <- df$p1[[i]] * df$p2[[i]]
  df$bonferroni[[i]] <- 2 * min(c(df$p1[[i]], df$p2[[i]], 0.5))
}
graphics::plot(df$polymapr, df$bonferroni)



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