Title: | Test for Gene x Gene Interactions in Bi-Parental Populations |
---|---|
Description: | Provides functions to test for gene x gene interactions in a bi-parental population of inbred lines. The data are fitted with the mixed linear model described in Rio et al. (2022) <doi:10.1101/2022.12.18.520958>, that accounts for gene x gene interactions at both the fixed effect and variance levels. The package also provides graphical tools to display the gene x gene interaction trend at the mean level and the variance component analysis. |
Authors: | Simon Rio [aut, cre] |
Maintainer: | Simon Rio <[email protected]> |
License: | GPL (>= 3) |
Version: | 1.0.0 |
Built: | 2025-02-18 03:40:38 UTC |
Source: | https://github.com/cran/EpiTest |
Ancestry.list
is a list of numeric matrices corresponding to three populations
of the American maize NAM experiment. Each matrix has 0/1 entries representing
the ancestry of alleles (0: homozygous for B73 alleles and 1: homozygous
for alternative parent alleles).
Each matrix includes 191 to 196 recombinant inbred lines characterized at 1,106 markers.
Ancestry.list
Ancestry.list
A list of three numeric matrices
This function fits the EpiTest model on a bi-parental population dataset, then outputs the estimates of the fixed and random effects, along with their associated test results.
EpiTest.fit(Ancestry, Pheno, Trait, ParentName, Parents = NULL, Weight = FALSE)
EpiTest.fit(Ancestry, Pheno, Trait, ParentName, Parents = NULL, Weight = FALSE)
Ancestry |
a numeric matrix with 0/1 entries representing the allele ancestries of a bi-parental population at a set of markers (0: homozygous for parent A alleles and 1: homozygous for parent B alleles) |
Pheno |
a data.frame with a |
Trait |
a string indicating the name of the phenotypic trait |
ParentName |
a character vector of length 2 providing the parent names where the first element should be named P0 (parent whose allele ancestries are coded 0) and the second element should be named P1 (parent whose allele ancestries are coded 1) |
Parents |
(optional) a data.frame with a |
Weight |
a boolean indicating whether weights indicating the number of
observations should be used for the inference. If TRUE, a column |
Depending on cases, the data may be organized in two different ways.
In Case 1, the Ancestry
matrix and the Pheno
data.frame respectively provide
the whole ancestry and phenotypic data, including the parental data.
In Case 2, the phenotypic data are split into two parts, the parental data being included
in a separate Parents
data.frame.
In both cases, one may provide a set of weights associated to each individual by including
a Weight
column in the Pheno
and Parents
data.frames. These weights
correspond to the number of observations that where used to compute the parental BLUPS/mean values.
These weights must be provided as a Weight
column in the Parents
and Pheno
data.frame.
The fitted EpiTest model includes three variance components: the segregation variance,
the (segregation x
segregation) variance and the error variance.
For each genetic variance a likelihood ratio test is performed.
The fitted EpiTest model includes three fixed parameters: the intercept, the linear regression coefficient (beta) on parent proportions and the quadratic regression coefficient (delta) on parent proportions that only involves epistatic effects. Each fixed parameter is tested using a Wald test.
Additionally, epistasis can be tested by testing that both the (segregation x
segregation) variance component
and the quadratic mean component (delta) are null through a likelihood ratio test. Note that in this
case the LRT is based on the full (i.e. unrestricted) likelihoods.
The function outputs a list of five items: Beta is the vector of estimated fixed effects, Sigma2 is the vector of estimated variances, Test_full, Test_fixed, Text_random are 3 data.table that provide the results of the tests for no epistasis (jointly tested on fixed and variance components), and for the fixed and random effects, respectively.
A list of four items: Beta, Sigma2, Test_fixed, Test_random
## One bi-parental population, no weighting and no parental phenotypes data(Pheno.list) data(Ancestry.list) Ancestry <- Ancestry.list[[1]] Pheno <- Pheno.list[[1]] ParentName <- c(P0 = 'B73',P1 = 'B97') ETest.1 <- EpiTest.fit(Ancestry = Ancestry, Pheno = Pheno, ParentName = ParentName, Trait = "GDD_DTA") ## One bi-parental population, with weights and parental phenotypes data(Parents) ETest.2 <- EpiTest.fit(Ancestry = Ancestry, Pheno = Pheno, ParentName = ParentName, Trait = "GDD_DTA", Parents = Parents, Weight=TRUE) ## Full NAM analysis, with weights and parental phenotypes Parent.list <- Parents$Genotype[-1] names(Parent.list) <- Parents$Family[-1] ETest.nam <- purrr::imap(Parent.list, ~ EpiTest.fit(Ancestry = Ancestry.list[[.y]], Pheno = Pheno.list[[.y]], ParentName=c(P0 = 'B73',P1 = .x), Parents = Parents, Trait = 'GDD_DTA', Weight = TRUE))
## One bi-parental population, no weighting and no parental phenotypes data(Pheno.list) data(Ancestry.list) Ancestry <- Ancestry.list[[1]] Pheno <- Pheno.list[[1]] ParentName <- c(P0 = 'B73',P1 = 'B97') ETest.1 <- EpiTest.fit(Ancestry = Ancestry, Pheno = Pheno, ParentName = ParentName, Trait = "GDD_DTA") ## One bi-parental population, with weights and parental phenotypes data(Parents) ETest.2 <- EpiTest.fit(Ancestry = Ancestry, Pheno = Pheno, ParentName = ParentName, Trait = "GDD_DTA", Parents = Parents, Weight=TRUE) ## Full NAM analysis, with weights and parental phenotypes Parent.list <- Parents$Genotype[-1] names(Parent.list) <- Parents$Family[-1] ETest.nam <- purrr::imap(Parent.list, ~ EpiTest.fit(Ancestry = Ancestry.list[[.y]], Pheno = Pheno.list[[.y]], ParentName=c(P0 = 'B73',P1 = .x), Parents = Parents, Trait = 'GDD_DTA', Weight = TRUE))
Display variance component or directional epistasis graphs
EpiTest.plot( ETest, Title = NULL, Family_names = NULL, Colors = NULL, Type = "mean", Alpha = 5/100 )
EpiTest.plot( ETest, Title = NULL, Family_names = NULL, Colors = NULL, Type = "mean", Alpha = 5/100 )
ETest |
a list as obtained from the EpiTest.fit function |
Title |
(optional) a character string to be used as a title for the graph |
Family_names |
(optional) a character vector with family names |
Colors |
(optional) a character vector with three colors for the graphical display (for variance graphs only) |
Type |
a string with "mean" to display the directional epistasis plot or "var" to display the variance component graph |
Alpha |
type I error for the test, with 5% default value (for directional epistasis plot only) |
a ggplot graph
data(Pheno.list) data(Ancestry.list) ## Full NAM analysis Parent.list <- Parents$Genotype[-1] names(Parent.list) <- Parents$Family[-1] ETest.nam <- purrr::imap(Parent.list, ~ EpiTest.fit(Ancestry = Ancestry.list[[.y]], Pheno = Pheno.list[[.y]], ParentName = c(P0 = 'B73',P1 = .x), Parents = Parents, Trait = 'GDD_DTA', Weight = TRUE)) ## Variance component plot EpiTest.plot(ETest.nam,Title = 'Days to anthesis',Type = "var") ## Directional epistasis plot EpiTest.plot(ETest.nam,Title = 'Days to anthesis',Type = "mean",Alpha = 5/100)
data(Pheno.list) data(Ancestry.list) ## Full NAM analysis Parent.list <- Parents$Genotype[-1] names(Parent.list) <- Parents$Family[-1] ETest.nam <- purrr::imap(Parent.list, ~ EpiTest.fit(Ancestry = Ancestry.list[[.y]], Pheno = Pheno.list[[.y]], ParentName = c(P0 = 'B73',P1 = .x), Parents = Parents, Trait = 'GDD_DTA', Weight = TRUE)) ## Variance component plot EpiTest.plot(ETest.nam,Title = 'Days to anthesis',Type = "var") ## Directional epistasis plot EpiTest.plot(ETest.nam,Title = 'Days to anthesis',Type = "mean",Alpha = 5/100)
Display directional epistasis plot
EpiTest.plot.mean(ETest, Title = NULL, Family_names = NULL, Alpha = NULL)
EpiTest.plot.mean(ETest, Title = NULL, Family_names = NULL, Alpha = NULL)
ETest |
a list as obtained from the EpiTest.fit function |
Title |
(optional) a character string to be used as a title for the graph |
Family_names |
(optional) a character vector with family names |
Alpha |
type I error for the test |
A ggplot graph
Display variance component graphs
EpiTest.plot.var(ETest, Title = NULL, Family_names = NULL, Colors = NULL)
EpiTest.plot.var(ETest, Title = NULL, Family_names = NULL, Colors = NULL)
ETest |
a list as obtained from the EpiTest.fit function |
Title |
(optional) a character string to be used as a title for the graph |
Family_names |
(optional) a character vector with family names |
Colors |
(optional) a character vector with three colors for the graphical display |
a ggplot graph
Parents
is a data.frame with four rows. The first row corresponds to the
parental inbred line common to all bi-parental populations of the American maize NAM experiment
(i.e., B73), whereas the three other rows correspond to alternative inbred parental lines used to
generate other bi-parental populations. For each parental inbred line, the phenotypic values
for five traits are provided, along with two extra columns:
Genotype (providing the line ID) and Weight (providing the weight associated
with the individual, see function EpiTest.fit for details).
Parents
Parents
A data.frame
The approximate null distribution of a likelihood ratio for 2 nested mixed models,
where both fixed and random effects are tested simultaneously, is a very specific mixture
of chi-square distributions. It depends on both the number of random effects
and the number of fixed effects to be tested simultaneously. Note that this function is a copy
of the pchisqmix
function of the TcGSA
package.
pchisqmix(quant, s, q, lower.tail = TRUE)
pchisqmix(quant, s, q, lower.tail = TRUE)
quant |
a quantile |
s |
number of fixed effects to be tested |
q |
number of random effects to be tested |
lower.tail |
logical. if TRUE (default), probabilities are |
a probability.
Pheno.list
is a list of three data.frames corresponding to three
populations of the American maize NAM experiment.
Each data.frame contains the phenotypic values of 191 to 196 recombinant
inbred lines (RILs) evaluated for five different traits, along with
two extra columns:
Genotype (providing the RIL ID) and Weight (providing the weight associated
with the RIL, see function EpiTest.fit for details).
Pheno.list
Pheno.list
A list of three data.frames
This function computes the covariance matrices associated with
the variance components of the EpiTest model: the segregation variance,
the (segregation x
segregation) variance and the error variance
VarList.comp(Ancestry)
VarList.comp(Ancestry)
Ancestry |
a matrix with 0/1 entries representing the allele ancestries of a bi-parental population at a set of markers (0: homozygous for parent A alleles and 1: homozygous for parent B alleles) |
A list of three covariance matrices
## One bi-parental population, no weighting data(Ancestry.list) Ancestry <- Ancestry.list[[1]] VarList <- VarList.comp(Ancestry = Ancestry) purrr::map(VarList,~.x[1:5,1:5])
## One bi-parental population, no weighting data(Ancestry.list) Ancestry <- Ancestry.list[[1]] VarList <- VarList.comp(Ancestry = Ancestry) purrr::map(VarList,~.x[1:5,1:5])