Simulation parameters
Container for global simulation parameters. Saving this object as SP will allow it to be accessed by function defaults.
nThreads
number of threads used on platforms with OpenMP support
snpChips
list of SNP chips
invalidQtl
list of segregating sites that aren't valid QTL
invalidSnp
list of segregating sites that aren't valid SNP
founderPop
founder population used for variance scaling
finalizePop
function applied to newly created populations. Currently does nothing and should only be changed by expert users.
v
the crossover interference parameter for a gamma model of recombination. A value of 1 indicates no crossover interference (e.g. Haldane mapping function). A value of 2.6 approximates the degree of crossover interference implied by the Kosambi mapping function. (default is 1)
quadProb
the probability of quadrivalent pairing in an autopolyploid. (default is 0)
traits
list of traits
nChr
number of chromosomes
nTraits
number of traits
nSnpChips
number of SNP chips
segSites
segregating sites per chromosome
sexes
sexes used for mating
sepMap
are there seperate genetic maps for males and females
genMap
"matrix" of chromosome genetic maps
femaleMap
"matrix" of chromosome genetic maps for females
maleMap
"matrix" of chromosome genetic maps for males
centromere
position of centromeres genetic map
femaleCentromere
position of centromeres on female genetic map
maleCentromere
position of centromeres on male genetic map
lastId
last ID number assigned
isTrackPed
is pedigree being tracked
pedigree
pedigree matrix for all individuals
isTrackRec
is recombination being tracked
recHist
list of historic recombination events
varA
additive genetic variance in founderPop
varG
total genetic variance in founderPop
varE
default error variance
version
the version of AlphaSimR used to generate this object
new()
Starts the process of building a new simulation by creating a new SimParam object and assigning a founder population to the class. It is recommended that you save the object with the name "SP", because subsequent functions will check your global enviroment for an object of this name if their simParam arguments are NULL. This allows you to call these functions without explicitly supplying a simParam argument with every call.
SimParam$new(founderPop)
founderPop
an object of MapPop-class
#Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10) #Set simulation parameters SP = SimParam$new(founderPop)
setTrackPed()
Sets pedigree tracking for the simulation.
By default pedigree tracking is turned off. When turned on,
the pedigree of all individuals created will be tracked,
except those created by hybridCross
. Turning
off pedigree tracking will turn off recombination tracking
if it is turned on.
SimParam$setTrackPed(isTrackPed, force = FALSE)
isTrackPed
should pedigree tracking be on.
force
should the check for a running simulation be ignored. Only set to TRUE if you know what you are doing.
#Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10) #Set simulation parameters SP = SimParam$new(founderPop) SP$setTrackPed(TRUE)
setTrackRec()
Sets recombination tracking for the simulation.
By default recombination tracking is turned off. When turned
on recombination tracking will also turn on pedigree tracking.
Recombination tracking keeps records of all individuals created,
except those created by hybridCross
, because their
pedigree is not tracked.
SimParam$setTrackRec(isTrackRec, force = FALSE)
isTrackRec
should recombination tracking be on.
force
should the check for a running simulation be ignored. Only set to TRUE if you know what you are doing.
#Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10) #Set simulation parameters SP = SimParam$new(founderPop) SP$setTrackRec(TRUE)
resetPed()
Resets the internal lastId, the pedigree and recombination tracking (if in use) to the supplied lastId. Be careful using this function because it may introduce a bug if you use individuals from the deleted portion of the pedigree.
SimParam$resetPed(lastId = 0L)
lastId
last ID to include in pedigree
#Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10) #Set simulation parameters SP = SimParam$new(founderPop) #Create population pop = newPop(founderPop, simParam=SP) pop@id # 1:10 #Create another population after reseting pedigree SP$resetPed() pop2 = newPop(founderPop, simParam=SP) pop2@id # 1:10
restrSegSites()
Sets restrictions on which segregating sites can serve as SNP and/or QTL.
SimParam$restrSegSites( minQtlPerChr = NULL, minSnpPerChr = NULL, overlap = FALSE, minSnpFreq = NULL )
minQtlPerChr
the minimum number of segSites for QTLs. Can be a single value or a vector values for each chromosome.
minSnpPerChr
the minimum number of segSites for SNPs. Can be a single value or a vector values for each chromosome.
overlap
should SNP and QTL sites be allowed to overlap.
minSnpFreq
minimum allowable frequency for SNP loci. No minimum SNP frequency is used if value is NULL.
#Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10) #Set simulation parameters SP = SimParam$new(founderPop) SP$restrSegSites(minQtlPerChr=5, minSnpPerChr=5)
setSexes()
Changes how sexes are determined in the simulation. The default sexes is "no", indicating all individuals are hermaphrodites. To add sexes to the simulation, run this function with "yes_sys" or "yes_rand". The value "yes_sys" will systematically assign sexes to newly created individuals as first male and then female. Populations with an odd number of individuals will have one more male than female. The value "yes_rand" will randomly assign a sex to each individual.
SimParam$setSexes(sexes, force = FALSE)
sexes
acceptable value are "no", "yes_sys", or "yes_rand"
force
should the check for a running simulation be ignored. Only set to TRUE if you know what you are doing.
#Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10) #Set simulation parameters SP = SimParam$new(founderPop) SP$setSexes("yes_sys")
addSnpChip()
Randomly assigns eligble SNPs to a SNP chip
SimParam$addSnpChip(nSnpPerChr, minSnpFreq = NULL, refPop = NULL)
nSnpPerChr
number of SNPs per chromosome. Can be a single value or nChr values.
minSnpFreq
minimum allowable frequency for SNP loci. If NULL, no minimum frequency is used.
refPop
reference population for calculating SNP frequency. If NULL, the founder population is used.
#Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10) #Set simulation parameters SP = SimParam$new(founderPop) SP$addSnpChip(10)
addStructuredSnpChip()
Randomly selects the number of snps in structure and then assigns them to chips based on structure
SimParam$addStructuredSnpChip(nSnpPerChr, structure, force = FALSE)
nSnpPerChr
number of SNPs per chromosome. Can be a single value or nChr values.
structure
a matrix. Rows are snp chips, columns are chips. If value is true then that snp is on that chip.
force
should the check for a running simulation be ignored. Only set to TRUE if you know what you are doing.
addTraitA()
Randomly assigns eligble QTLs for one or more additive traits. If simulating more than one trait, all traits will be pleiotrophic with correlated additive effects.
SimParam$addTraitA( nQtlPerChr, mean = 0, var = 1, corA = NULL, gamma = FALSE, shape = 1, force = FALSE )
nQtlPerChr
number of QTLs per chromosome. Can be a single value or nChr values.
mean
a vector of desired mean genetic values for one or more traits
var
a vector of desired genetic variances for one or more traits
corA
a matrix of correlations between additive effects
gamma
should a gamma distribution be used instead of normal
shape
the shape parameter for the gamma distribution
force
should the check for a running simulation be ignored. Only set to TRUE if you know what you are doing.
#Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10) #Set simulation parameters SP = SimParam$new(founderPop) SP$addTraitA(10)
addTraitAD()
Randomly assigns eligble QTLs for one or more traits with dominance. If simulating more than one trait, all traits will be pleiotrophic with correlated effects.
SimParam$addTraitAD( nQtlPerChr, mean = 0, var = 1, meanDD = 0, varDD = 0, corA = NULL, corDD = NULL, useVarA = TRUE, gamma = FALSE, shape = 1, force = FALSE )
nQtlPerChr
number of QTLs per chromosome. Can be a single value or nChr values.
mean
a vector of desired mean genetic values for one or more traits
var
a vector of desired genetic variances for one or more traits
meanDD
mean dominance degree
varDD
variance of dominance degree
corA
a matrix of correlations between additive effects
corDD
a matrix of correlations between dominance degrees
useVarA
tune according to additive genetic variance if true. If FALSE, tuning is performed according to total genetic variance.
gamma
should a gamma distribution be used instead of normal
shape
the shape parameter for the gamma distribution
force
should the check for a running simulation be ignored. Only set to TRUE if you know what you are doing.
#Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10) #Set simulation parameters SP = SimParam$new(founderPop) SP$addTraitAD(10, meanDD=0.5)
addTraitAG()
Randomly assigns eligble QTLs for one ore more additive GxE traits. If simulating more than one trait, all traits will be pleiotrophic with correlated effects.
SimParam$addTraitAG( nQtlPerChr, mean = 0, var = 1, varGxE = 1e-06, varEnv = 0, corA = NULL, corGxE = NULL, gamma = FALSE, shape = 1, force = FALSE )
nQtlPerChr
number of QTLs per chromosome. Can be a single value or nChr values.
mean
a vector of desired mean genetic values for one or more traits
var
a vector of desired genetic variances for one or more traits
varGxE
a vector of total genotype-by-environment variances for the traits
varEnv
a vector of environmental variances for one or more traits
corA
a matrix of correlations between additive effects
corGxE
a matrix of correlations between GxE effects
gamma
should a gamma distribution be used instead of normal
shape
the shape parameter for the gamma distribution
force
should the check for a running simulation be ignored. Only set to TRUE if you know what you are doing.
#Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10) #Set simulation parameters SP = SimParam$new(founderPop) SP$addTraitAG(10, varGxE=2)
addTraitADG()
Randomly assigns eligble QTLs for a trait with dominance and GxE.
SimParam$addTraitADG( nQtlPerChr, mean = 0, var = 1, varEnv = 1e-06, varGxE = 1e-06, meanDD = 0, varDD = 0, corA = NULL, corDD = NULL, corGxE = NULL, useVarA = TRUE, gamma = FALSE, shape = 1, force = FALSE )
nQtlPerChr
number of QTLs per chromosome. Can be a single value or nChr values.
mean
a vector of desired mean genetic values for one or more traits
var
a vector of desired genetic variances for one or more traits
varEnv
a vector of environmental variances for one or more traits
varGxE
a vector of total genotype-by-environment variances for the traits
meanDD
mean dominance degree
varDD
variance of dominance degree
corA
a matrix of correlations between additive effects
corDD
a matrix of correlations between dominance degrees
corGxE
a matrix of correlations between GxE effects
useVarA
tune according to additive genetic variance if true
gamma
should a gamma distribution be used instead of normal
shape
the shape parameter for the gamma distribution
force
should the check for a running simulation be ignored. Only set to TRUE if you know what you are doing.
#Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10) #Set simulation parameters SP = SimParam$new(founderPop) SP$addTraitADG(10, meanDD=0.5, varGxE=2)
addTraitAE()
Randomly assigns eligble QTLs for one or more additive and epistasis traits. If simulating more than one trait, all traits will be pleiotrophic with correlated additive effects.
SimParam$addTraitAE( nQtlPerChr, mean = 0, var = 1, relAA = 0, corA = NULL, corAA = NULL, useVarA = TRUE, gamma = FALSE, shape = 1, force = FALSE )
nQtlPerChr
number of QTLs per chromosome. Can be a single value or nChr values.
mean
a vector of desired mean genetic values for one or more traits
var
a vector of desired genetic variances for one or more traits
relAA
the relative value of additive-by-additive variance compared to additive variance in a diploid organism with allele frequency 0.5
corA
a matrix of correlations between additive effects
corAA
a matrix of correlations between additive-by-additive effects
useVarA
tune according to additive genetic variance if true. If FALSE, tuning is performed according to total genetic variance.
gamma
should a gamma distribution be used instead of normal
shape
the shape parameter for the gamma distribution
force
should the check for a running simulation be ignored. Only set to TRUE if you know what you are doing.
#Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10)
addTraitADE()
Randomly assigns eligble QTLs for one or more traits with dominance and epistasis. If simulating more than one trait, all traits will be pleiotrophic with correlated effects.
SimParam$addTraitADE( nQtlPerChr, mean = 0, var = 1, meanDD = 0, varDD = 0, relAA = 0, corA = NULL, corDD = NULL, corAA = NULL, useVarA = TRUE, gamma = FALSE, shape = 1, force = FALSE )
nQtlPerChr
number of QTLs per chromosome. Can be a single value or nChr values.
mean
a vector of desired mean genetic values for one or more traits
var
a vector of desired genetic variances for one or more traits
meanDD
mean dominance degree
varDD
variance of dominance degree
relAA
the relative value of additive-by-additive variance compared to additive variance in a diploid organism with allele frequency 0.5
corA
a matrix of correlations between additive effects
corDD
a matrix of correlations between dominance degrees
corAA
a matrix of correlations between additive-by-additive effects
useVarA
tune according to additive genetic variance if true. If FALSE, tuning is performed according to total genetic variance.
gamma
should a gamma distribution be used instead of normal
shape
the shape parameter for the gamma distribution
force
should the check for a running simulation be ignored. Only set to TRUE if you know what you are doing.
#Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10) #Set simulation parameters SP = SimParam$new(founderPop) SP$addTraitADE(10)
addTraitAEG()
Randomly assigns eligble QTLs for one or more additive and epistasis GxE traits. If simulating more than one trait, all traits will be pleiotrophic with correlated effects.
SimParam$addTraitAEG( nQtlPerChr, mean = 0, var = 1, relAA = 0, varGxE = 1e-06, varEnv = 0, corA = NULL, corAA = NULL, corGxE = NULL, useVarA = TRUE, gamma = FALSE, shape = 1, force = FALSE )
nQtlPerChr
number of QTLs per chromosome. Can be a single value or nChr values.
mean
a vector of desired mean genetic values for one or more traits
var
a vector of desired genetic variances for one or more traits
relAA
the relative value of additive-by-additive variance compared to additive variance in a diploid organism with allele frequency 0.5
varGxE
a vector of total genotype-by-environment variances for the traits
varEnv
a vector of environmental variances for one or more traits
corA
a matrix of correlations between additive effects
corAA
a matrix of correlations between additive-by-additive effects
corGxE
a matrix of correlations between GxE effects
useVarA
tune according to additive genetic variance if true. If FALSE, tuning is performed according to total genetic variance.
gamma
should a gamma distribution be used instead of normal
shape
the shape parameter for the gamma distribution
force
should the check for a running simulation be ignored. Only set to TRUE if you know what you are doing.
#Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10) #Set simulation parameters SP = SimParam$new(founderPop) SP$addTraitAEG(10, varGxE=2)
addTraitADEG()
Randomly assigns eligble QTLs for a trait with dominance, epistasis and GxE.
SimParam$addTraitADEG( nQtlPerChr, mean = 0, var = 1, varEnv = 1e-06, varGxE = 1e-06, meanDD = 0, varDD = 0, relAA = 0, corA = NULL, corDD = NULL, corAA = NULL, corGxE = NULL, useVarA = TRUE, gamma = FALSE, shape = 1, force = FALSE )
nQtlPerChr
number of QTLs per chromosome. Can be a single value or nChr values.
mean
a vector of desired mean genetic values for one or more traits
var
a vector of desired genetic variances for one or more traits
varEnv
a vector of environmental variances for one or more traits
varGxE
a vector of total genotype-by-environment variances for the traits
meanDD
mean dominance degree
varDD
variance of dominance degree
relAA
the relative value of additive-by-additive variance compared to additive variance in a diploid organism with allele frequency 0.5
corA
a matrix of correlations between additive effects
corDD
a matrix of correlations between dominance degrees
corAA
a matrix of correlations between additive-by-additive effects
corGxE
a matrix of correlations between GxE effects
useVarA
tune according to additive genetic variance if true
gamma
should a gamma distribution be used instead of normal
shape
the shape parameter for the gamma distribution
force
should the check for a running simulation be ignored. Only set to TRUE if you know what you are doing.
#Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10) #Set simulation parameters SP = SimParam$new(founderPop) SP$addTraitADEG(10, meanDD=0.5, varGxE=2)
manAddTrait()
Manually add a new trait to the simulation.
SimParam$manAddTrait(lociMap, varE = NA_real_, force = FALSE)
lociMap
a new object descended from
LociMap-class
varE
default error variance for phenotype, optional
force
should the check for a running simulation be ignored. Only set to TRUE if you know what you are doing
switchTrait()
Switch a trait in the simulation.
SimParam$switchTrait(traitPos, lociMap, varE = NA_real_, force = FALSE)
traitPos
an integer indicate which trait to switch
lociMap
a new object descended from
LociMap-class
varE
default error variance for phenotype, optional
force
should the check for a running simulation be ignored. Only set to TRUE if you know what you are doing
removeTrait()
Remove a trait from the simulation
SimParam$removeTrait(traits, force = FALSE)
traits
an integer vector indicating which traits to remove
force
should the check for a running simulation be ignored. Only set to TRUE if you know what you are doing
setVarE()
Defines a default value for error variances in the simulation.
SimParam$setVarE(h2 = NULL, H2 = NULL, varE = NULL)
h2
a vector of desired narrow-sense heritabilities
H2
a vector of desired broad-sense heritabilities
varE
a vector or matrix of error variances
#Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10) #Set simulation parameters SP = SimParam$new(founderPop) SP$addTraitA(10) SP$setVarE(h2=0.5)
setCorE()
Defines a correlation structure for default
error variances. You must call setVarE
first to define
the default error variances.
SimParam$setCorE(corE)
corE
a correlation matrix for the error variances
#Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10) #Set simulation parameters SP = SimParam$new(founderPop) SP$addTraitA(10, mean=c(0,0), var=c(1,1), corA=diag(2)) SP$setVarE(varE=c(1,1)) E = 0.5*diag(2)+0.5 #Positively correlated error SP$setCorE(E)
rescaleTraits()
Linearly scales all traits to achieve desired values of means and variances in the founder population.
SimParam$rescaleTraits( mean = 0, var = 1, varEnv = 0, varGxE = 1e-06, useVarA = TRUE )
mean
a vector of new trait means
var
a vector of new trait variances
varEnv
a vector of new environmental variances
varGxE
a vector of new GxE variances
useVarA
tune according to additive genetic variance if true
#Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10) #Set simulation parameters SP = SimParam$new(founderPop) SP$addTraitA(10) #Create population pop = newPop(founderPop, simParam=SP) meanG(pop) #Change mean to 1 SP$rescaleTraits(mean=1) #Run resetPop for change to take effect pop = resetPop(pop, simParam=SP) meanG(pop)
setRecombRatio()
Set the relative recombination rates between males and females. This allows for sex-specific recombination rates, under the assumption of equivalent recombination landscapes.
SimParam$setRecombRatio(femaleRatio)
femaleRatio
relative ratio of recombination in females compared to males. A value of 2 indicate twice as much recombination in females. The value must be greater than 0. (default is 1)
#Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10) #Set simulation parameters SP = SimParam$new(founderPop) SP$setRecombRatio(2) #Twice as much recombination in females
switchGenMap()
Replaces existing genetic map.
SimParam$switchGenMap(genMap, centromere = NULL)
genMap
a list of length nChr containing numeric vectors for the position of each segregating site on a chromosome.
centromere
a numeric vector of centromere positions. If NULL, the centromere are assumed to be metacentric.
switchFemaleMap()
Replaces existing female genetic map.
SimParam$switchFemaleMap(genMap, centromere = NULL)
genMap
a list of length nChr containing numeric vectors for the position of each segregating site on a chromosome.
centromere
a numeric vector of centromere positions. If NULL, the centromere are assumed to be metacentric.
switchMaleMap()
Replaces existing male genetic map.
SimParam$switchMaleMap(genMap, centromere = NULL)
genMap
a list of length nChr containing numeric vectors for the position of each segregating site on a chromosome.
centromere
a numeric vector of centromere positions. If NULL, the centromere are assumed to be metacentric.
addToRec()
For internal use only.
SimParam$addToRec(hist)
hist
new recombination history
updateLastId()
For internal use only.
SimParam$updateLastId(lastId)
lastId
last ID assigned
addToPed()
For internal use only.
SimParam$addToPed(lastId, mother, father, isDH)
lastId
ID of last individual
mother
vector of mother IDs
father
vector of father IDs
isDH
vector of DH indicators
clone()
The objects of this class are cloneable with this method.
SimParam$clone(deep = FALSE)
deep
Whether to make a deep clone.
By default the founder population is the population used to
initalize the SimParam object. This population can be changed by
replacing the population in the founderPop slot. You must run
resetPop
on any existing populations to obtain the
new trait values.
## ------------------------------------------------ ## Method `SimParam$new` ## ------------------------------------------------ #Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10) #Set simulation parameters SP = SimParam$new(founderPop) ## ------------------------------------------------ ## Method `SimParam$setTrackPed` ## ------------------------------------------------ #Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10) #Set simulation parameters SP = SimParam$new(founderPop) SP$setTrackPed(TRUE) ## ------------------------------------------------ ## Method `SimParam$setTrackRec` ## ------------------------------------------------ #Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10) #Set simulation parameters SP = SimParam$new(founderPop) SP$setTrackRec(TRUE) ## ------------------------------------------------ ## Method `SimParam$resetPed` ## ------------------------------------------------ #Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10) #Set simulation parameters SP = SimParam$new(founderPop) #Create population pop = newPop(founderPop, simParam=SP) pop@id # 1:10 #Create another population after reseting pedigree SP$resetPed() pop2 = newPop(founderPop, simParam=SP) pop2@id # 1:10 ## ------------------------------------------------ ## Method `SimParam$restrSegSites` ## ------------------------------------------------ #Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10) #Set simulation parameters SP = SimParam$new(founderPop) SP$restrSegSites(minQtlPerChr=5, minSnpPerChr=5) ## ------------------------------------------------ ## Method `SimParam$setSexes` ## ------------------------------------------------ #Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10) #Set simulation parameters SP = SimParam$new(founderPop) SP$setSexes("yes_sys") ## ------------------------------------------------ ## Method `SimParam$addSnpChip` ## ------------------------------------------------ #Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10) #Set simulation parameters SP = SimParam$new(founderPop) SP$addSnpChip(10) ## ------------------------------------------------ ## Method `SimParam$addTraitA` ## ------------------------------------------------ #Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10) #Set simulation parameters SP = SimParam$new(founderPop) SP$addTraitA(10) ## ------------------------------------------------ ## Method `SimParam$addTraitAD` ## ------------------------------------------------ #Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10) #Set simulation parameters SP = SimParam$new(founderPop) SP$addTraitAD(10, meanDD=0.5) ## ------------------------------------------------ ## Method `SimParam$addTraitAG` ## ------------------------------------------------ #Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10) #Set simulation parameters SP = SimParam$new(founderPop) SP$addTraitAG(10, varGxE=2) ## ------------------------------------------------ ## Method `SimParam$addTraitADG` ## ------------------------------------------------ #Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10) #Set simulation parameters SP = SimParam$new(founderPop) SP$addTraitADG(10, meanDD=0.5, varGxE=2) ## ------------------------------------------------ ## Method `SimParam$addTraitAE` ## ------------------------------------------------ #Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10) ## ------------------------------------------------ ## Method `SimParam$addTraitADE` ## ------------------------------------------------ #Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10) #Set simulation parameters SP = SimParam$new(founderPop) SP$addTraitADE(10) ## ------------------------------------------------ ## Method `SimParam$addTraitAEG` ## ------------------------------------------------ #Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10) #Set simulation parameters SP = SimParam$new(founderPop) SP$addTraitAEG(10, varGxE=2) ## ------------------------------------------------ ## Method `SimParam$addTraitADEG` ## ------------------------------------------------ #Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10) #Set simulation parameters SP = SimParam$new(founderPop) SP$addTraitADEG(10, meanDD=0.5, varGxE=2) ## ------------------------------------------------ ## Method `SimParam$setVarE` ## ------------------------------------------------ #Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10) #Set simulation parameters SP = SimParam$new(founderPop) SP$addTraitA(10) SP$setVarE(h2=0.5) ## ------------------------------------------------ ## Method `SimParam$setCorE` ## ------------------------------------------------ #Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10) #Set simulation parameters SP = SimParam$new(founderPop) SP$addTraitA(10, mean=c(0,0), var=c(1,1), corA=diag(2)) SP$setVarE(varE=c(1,1)) E = 0.5*diag(2)+0.5 #Positively correlated error SP$setCorE(E) ## ------------------------------------------------ ## Method `SimParam$rescaleTraits` ## ------------------------------------------------ #Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10) #Set simulation parameters SP = SimParam$new(founderPop) SP$addTraitA(10) #Create population pop = newPop(founderPop, simParam=SP) meanG(pop) #Change mean to 1 SP$rescaleTraits(mean=1) #Run resetPop for change to take effect pop = resetPop(pop, simParam=SP) meanG(pop) ## ------------------------------------------------ ## Method `SimParam$setRecombRatio` ## ------------------------------------------------ #Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10) #Set simulation parameters SP = SimParam$new(founderPop) SP$setRecombRatio(2) #Twice as much recombination in females
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.