get_kernel: Envirotype-informed kernels for statistical models

View source: R/getGEenriched.R

get_kernelR Documentation

Envirotype-informed kernels for statistical models

Description

Get multiple genomic and/or envirotype-informed kernels for bayesian genomic prediciton.

Usage

get_kernel(
  K_E = NULL,
  K_G = NULL,
  data = NULL,
  model = NULL,
  intercept.random = FALSE,
  reaction = FALSE,
  dimension_KE = NULL,
  ne = NULL,
  ng = NULL,
  env = "env",
  gid = "gid",
  y = "value"
)

Arguments

K_E

list. Contains n matrices of envirotype-related kernels (n x n genotypes-environment). If NULL, benchmarck genomic kernels are built.

K_G

list. Contains matrices of genomic enabled kernels (p x p genotypes). See BGGE::getK for more information.

data

data.frame. Should contain the following colunms: environemnt, genotype, phenotype.

model

character. Model structure for genomic predicion. It can be c('MM','MDs','EMM','EMDs'), in which MM (main effect model y = m + Z_{E} + G) and MDs (y = m + Z_{E} + G + GE).

intercept.random

boolean. Indicates the inclusion of a genomic random intercept (default = FALSE). For more details, see BGGE package vignette.

reaction

boolean. Indicates the inclusion of a reaction norm based GxE kernel (default = FALSE).

dimension_KE

character. size_E=c('q','n'). In the first, 'q' means taht the environmental relationship kernel has the dimensions of q x q observations,in which q is the number of environments. If 'n', the relationship kernel has the dimension n=pq, in which p is the number of genotypes

ne

numeric. denotes the number of environments (q)

ng

numeric. denotes the number of genotypes (p)

env

character. denotes the name of the column respectively to environments

gid

character. denotes the name of the column respectively to genotypes

y

character. denotes the name of the column respectively to phenotype values

Details

Detail on the model structures is given in the GitHub page: https://github.com/allogamous/EnvRtype/blob/master/Prediction.md

Value

A list of kernels (relationship matrices) to be used in genomic models.

Author(s)

Germano Costa Neto

See Also

env_typing W_matrix kernel_model

Examples

## Not run: 
### Loading the genomic, phenotype and weather data
data('maizeG'); data('maizeYield'); data("maizeWTH")

data("maizeYield") # toy set of phenotype data (grain yield per environment)
data("maizeG"    ) # toy set of genomic relationship for additive effects
data("maizeWTH")   # toy set of environmental data
y   = "value"      # name of the vector of phenotypes
gid = "gid"        # name of the vector of genotypes
env = "env"        # name of the vector of environments
ECs  = W_matrix(env.data = maizeWTH[maizeWTH$daysFromStart < 100, ], var.id = c("FRUE",'PETP',"SRAD","T2M_MAX"),statistic = 'mean')
## KG and KE might be a list of kernels
KE = list(W = env_kernel(env.data = ECs)[[2]])
KG = list(G=maizeG);
## Creating kernel models with get_kernel
## y = fixed + Genomic + error (main effect model, MM)
MM    = get_kernel(K_G = KG, y = y,gid = gid,env = env, data = maizeYield,model = "MM")
## y = fixed + Genomic + Genomic x Environment + error (MM plus a single GE deviation, MDs model, assuming GE as a block diagonal genomic effects)
MDs   = get_kernel(K_G = KG, y = y,gid = gid,env = env,  data = maizeYield, model = "MDs")
EMM   = get_kernel(K_G = KG, K_E = KE, y = y,gid = gid,env = env,  data = maizeYield, model = "EMM")
EMDs  = get_kernel(K_G = KG, K_E = KE, y = y,gid = gid,env = env,  data = maizeYield, model = "EMDs")
RMMM  = get_kernel(K_G = KG, K_E = KE, y = y,gid = gid,env = env,  data = maizeYield, model = "RNMM")
RNMDs = get_kernel(K_G = KG, K_E = KE, y = y,gid = gid,env = env,  data = maizeYield, model = "RNMDs")
## Examples of Models without any genetic relatedness, which G = I a identity for genotypes
MDs   = get_kernel(K_G = NULL, y = y,gid = gid,env = env,  data = maizeYield, model = "MDs")
EMDs  = get_kernel(K_G = NULL, K_E = KE, y = y,gid = gid,env = env,  data = maizeYield, model = "EMDs")

## End(Not run)


allogamous/EnvRtype documentation built on Nov. 1, 2024, 3:48 a.m.