setPhenoGCA: Set GCA as phenotype

View source: R/hybrids.R

setPhenoGCAR Documentation

Set GCA as phenotype

Description

Calculates general combining ability from a set of testers and returns these values as phenotypes for a population.

Usage

setPhenoGCA(
  pop,
  testers,
  use = "pheno",
  h2 = NULL,
  H2 = NULL,
  varE = NULL,
  corE = NULL,
  reps = 1,
  fixEff = 1L,
  p = NULL,
  inbred = FALSE,
  onlyPheno = FALSE,
  simParam = NULL
)

Arguments

pop

an object of Pop-class

testers

an object of Pop-class

use

true genetic value (gv) or phenotypes (pheno, default)

h2

a vector of desired narrow-sense heritabilities for each trait. See details in setPheno.

H2

a vector of desired broad-sense heritabilities for each trait. See details in setPheno.

varE

error (co)variances for traits. See details in setPheno.

corE

an optional matrix for correlations between errors. See details in setPheno.

reps

number of replications for phenotype. See details in setPheno.

fixEff

fixed effect to assign to the population. Used by genomic selection models only.

p

the p-value for the environmental covariate used by GxE traits. If NULL, a value is sampled at random.

inbred

are both pop and testers fully inbred. They are only fully inbred if created by newPop using inbred founders or by the makeDH function

onlyPheno

should only the phenotype be returned, see return

simParam

an object of SimParam

Value

Returns an object of Pop-class or a matrix if onlyPheno=TRUE

Examples

#Create founder haplotypes
founderPop = quickHaplo(nInd=10, nChr=1, segSites=10, inbred=TRUE)

#Set simulation parameters
SP = SimParam$new(founderPop)

SP$addTraitA(10)

#Create population
pop = newPop(founderPop, simParam=SP)

#Set phenotype to average per
pop2 = setPhenoGCA(pop, pop, use="gv", inbred=TRUE, simParam=SP)


AlphaSimR documentation built on Nov. 2, 2023, 6:01 p.m.