Description Usage Arguments Details Value Examples
View source: R/make_hp_v4_Commented.R
Simulates historical generations to establish mutation-drift equilibrium and create linkage disequilibrium.
1 2 | make_hp(hpsize, ng, genome, h2, d2, phen_var, mutr, laf, sel_seq_qtl,
sel_seq_mrk, saveAt)
|
hpsize |
Size of historical population. Range: 0<\code{hpsize} ≤q 10000. |
ng |
Number of generations. Range: 0 ≤q \code{ng} ≤q 10000. |
genome |
|
h2 |
Narrow sense heritability. Range: 0< \code{h2} ≤q 1. |
d2 |
Ratio of dominance variance to phenotypic variance. Range: 0≤q \code{d2} ≤q 1. |
phen_var |
Phenotypic variance. Range: 0< \code{x} ≤q 10000. |
mutr |
Mutation rate. Range: 0≤q \code{mutr} ≤q 0.01. |
laf |
Optional Loci (marker and qtl) allele frequencies in the first historical generation with options:
Default: "rnd" |
sel_seq_qtl |
Optional Select segregating qtl in the last historical generation. QTL with minor allele frequency larger than or equal to |
sel_seq_mrk |
Optional Select segregating markers in the last historical generation. Markers with minor allele frequency larger than or equal to |
saveAt |
Optional ( |
Historical population
In order to create initial linkage disequilibrium (LD) and to establish mutation-drift equilibrium, a historical population is simulated by considering only two evolutionary forces: mutation and drift. Mutation constantly introduces new variation and genetic drift shifts the variation to fixation. Offspring are produced by random union of gametes, each from the male and female gametic pools. Population size is constant over discrete generations with equal number of males and females.
Genome
A wide range of parameters can be specified for simulating the genome, such as: number of chromosomes, markers and QTL, location of markers and QTL, mutation rate and initial allelic frequencies. This flexibility permits for a wide variety of genetic architectures to be considered. No allelic effects are simulated for markers, so they are treated as neutral. For QTL, additive allelic effects are sampled from gamma distribution with shape and scale parameters of 0.4 and 1.66, respectively. This provided an L-shaped distribution of QTL effects. To simulate dominance effects, first dominance degrees h_i are sampled from normal distribution (N(0.5,1)) then absolute dominance effects are considered as d_i=h_i.|a_i| where |a_i| is the absolute value of the additive effect. Thus, additive and dominance effects are dependent. Next, additive and dominance effects are scaled such that user defined h^2 and d^2 are met. Trait phenotypes are simulated by adding a standard normal residual effect to the genotypic value of each individual.
One important aspect of genome simulation is to model the recombination appropriately to produce realistic level of LD, given the recent and past population structures. make_hp
models crossover process, using a Poisson model. This is done by sampling the number of crossovers from a Poisson distribution and then the crossovers are located randomly across the chromosome. Because the input map is in centiMorgan it is straightforward to take into account the pattern of recombination hotspots and cold spots along the genome by adjusting the distances between markers. To establish mutation-drift equilibrium in the historical generations recurrent mutation model is used. The recurrent mutation model assumes that a mutation alters an allelic state to another and does not create a new allele. In the recurrent model, transition probabilities from one allelic state to another are assumed equal. Different mutation rates for simulated loci can be specified. The number of mutations is sampled from a Poisson distribution and it is assumed that mutation rates are equal for all loci.
In conclusion the main features for make_hp
are as following:
Multiple chromosomes with similar or different genome length in cM, each with different or similar density of markers and QTL maps, can be generated.
Trait of interest can be controlled by additive or both additive and dominance effects.
list
with data of last generation of historical population.
Genotype (both marker (SNP) and QTL) of individuals. Coded as 11,12,21,22 where first allele is always paternal allele
.
Marker genotye of individuals
.
QTL genotye of individuals
.
QTL allele frequency
.
Marker allele frequency
.
Linkage map for qtl
.
Linkage map for marker
.
Integrated linkage map for both marker and qtl
.
QTL allelic effects
.
Individuals data except their genotypes
.
Trait specifications
.
Mutation data.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | # # # EXAMPLE 1 Simulation of a historical population
#for an additive trait (h2=0.3) for 10 generations.
# Two chromosome with different parameters
genome<-data.frame(matrix(NA, nrow=2, ncol=6))
names(genome)<-c("chr","len","nmrk","mpos","nqtl","qpos")
genome$chr<-c(1,2)
genome$len<-c(100,200)
genome$nmrk<-c(100,100)
genome$mpos<-c("rnd","even")
genome$nqtl<-c(50,50)
genome$qpos<-c("even","rnd")
genome
hp<-make_hp(hpsize=100,
ng=10,h2=0.3,phen_var=1 ,genome=genome,
mutr=2.5e-4,saveAt="hp1")
head(hp$hp_data)
head(hp$freqQTL)
head(hp$linkage_map_qtl_mrk)
# # # EXAMPLE 2 Simulation of a historical population for a trait with both additive and
# dominance effects (h2=0.3, d2=0.1).
# All loci will have the same allele frequencies in the first generation.
# Segregating markers and qtl with MAF>0.1 will be selected in the last historical population.
genome<-data.frame(matrix(NA, nrow=3, ncol=6))
names(genome)<-c("chr","len","nmrk","mpos","nqtl","qpos")
genome$chr<-c(1,2,3)
genome$len<-c(12,8,11)
genome$nmrk<-c(140,80,73)
genome$mpos<-c("rnd","even","even")
genome$nqtl<-c(40,65,24)
genome$qpos<-rep("rnd",3)
genome
hp2<-make_hp(hpsize=100,
ng=10,h2=0.3,d2=0.1,phen_var=1 ,genome=genome,
mutr=2.5e-4,sel_seq_qtl=0.1,sel_seq_mrk=0.1,
laf=0.1,saveAt="hp2")
head(hp2$hp_data)
head(hp2$freqQTL)
head(hp2$linkage_map_qtl_mrk)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.