Description Usage Arguments Details Value See Also Examples
View source: R/make_RP_v9_Commented.R
Creates recent population similar to function sample_hp
with some modifications.
1 2 | make_rp(sh_out, Male_founders, Female_founders, ng, litter_size, Selection,
Training, saveAt, rp_output, Display)
|
sh_out |
( |
Male_founders |
(
Colomn 4) "value" Indicates to select high: "h" or low: "l" values. Note: This colomn is ignored if indviduals are selected randomly. |
Female_founders |
( |
ng |
Number of generations. Range: 1 ≤q \code{ng} ≤q 500. |
litter_size |
Litter size or the number of progeny per dam. Range: 1 ≤q \code{x} ≤q 200. |
Selection |
(
Column 3) "value" Indicates to select "h" or "l" values. Note: This colomn is ignored if indviduals are selected randomly. |
Training |
Optional (
Default: "rnd"
Default: "BRR" |
saveAt |
Optional ( |
rp_output |
Optional ( |
Display |
Optional ( |
Function make_rp
is used to create recent population(s) similar to function sample_hp
. The difference between these two functions is that, for function sample_hp
, male and female founders are always from the last generation of historical population. However, in function make_rp
, male and female founders can be selected from any generation of population created by function sample_hp
or in the second usage, founders can be selected from any generation of population created by the function make_rp
itself. So, basically function make_rp
can be used multiple times to sample individuals from the desired generation of population created by function sample_hp
or function make_rp
. See details for function sample_hp
and the package vignette for more clarification.
list
with all data of simulated generations.
(list
) Two-level list ($output[[x]][[y]]
) containing information about simulated generations. First index (x) indicates generation number. It should be noted that as data for base generation (0) is also stored by the function, to retrive data for a specific generation, index should be equal to generation number plus one. As an example to observe data for generation 2 index should be 3 i.e, $output[[3]]$data
. Second index (y) that ranges from 1 to 6 contain the information as following:
$output[[x]]$data
Individuals data except their genotypes. Here x is the generation index
$output[[x]]$qtl
QTL genotye of individuals..
$output[[x]]$mrk
Marker genotye of individuals.
$output[[x]]$sequ
Genotype (both marker (SNP) and QTL) of individuals.
$output[[x]]$freqQTL
QTL allele frequency.
$output[[x]]$freqMRK
Marker allele frequency.
Data frame with summary of simulated generations
.
Linkage map for qtl
.
Linkage map for marker
.
Integrated linkage map for both marker and qtl
.
QTL allele effects
.
Trait specifications
.
Genome specifications
.
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 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | # # # Simulation of a population where founders are from a population created by function sample_hp.
# CREATE HISTORICAL POPULATION
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(12,8)
genome$nmrk<-c(140,80)
genome$mpos<-c("rnd","even")
genome$nqtl<-c(25,25)
genome$qpos<-rep("rnd",2)
genome
hp<-make_hp(hpsize=100
,ng=10,h2=0.3,phen_var=1
,genome=genome,mutr=5*10**-4,sel_seq_qtl=0.05,sel_seq_mrk=0.05,laf=0.5)
# # MAKE FIRST RECENT POPULATION USING FUNCTION sample_hp
Male_founders<-data.frame(number=50,select='rnd')
Female_founders<-data.frame(number=50,select='rnd')
# Selection scheme in each generation of recent population
Selection<-data.frame(matrix(NA, nrow=2, ncol=2))
names(Selection)<-c('Number','type')
Selection$Number[1:2]<-c(50,50)
Selection$type[1:2]<-c('rnd','rnd')
Selection
RP_1<-sample_hp(hp_out=hp,Male_founders=
Male_founders,Female_founders=Female_founders,
ng=4,Selection=Selection,Training=Training,
litter_size=3,Display=TRUE)
# # MAKE SECOND RP (RP2) USING FUNCTION make_hp
# Select founders
# Select 30 males based on 'tbv' from generation 2 of RP1.
# Select 40 females based on 'phen' from generation 4 of RP1.
Males<-data.frame(number=30,generation=2,select='tbv',value='h')
Females<-data.frame(number=40,generation=4,select='phen',value='l')
# Selection scheme for RP2
# Selection of 20 sires and 50 dam
# Selection criteria is "tbv" for sires and "phen" for dams
Selection<-data.frame(matrix(NA, nrow=2, ncol=3))
names(Selection)<-c('Number','type','Value')
Selection$Number[1:2]<-c(20,50)
Selection$type[1:2]<-c('tbv','phen')
Selection$Value[1:2]<-c('h','h')
Selection
# Save "data" and "qtl" for first and last generation of RP1
rp2_output<-data.frame(matrix(NA, nrow=2, ncol=2))
names(rp2_output)<-c("data","qtl")
rp2_output[,1]<-c(1,4) # Save data for generations 1 and 4
rp2_output[,2]<-c(1,4) # Save qtl genotype for generations 1 and 4
rp2_output
RP_2<-make_rp(sh_out=RP_1,Male_founders=Males,
Female_founders=Females,Selection=Selection,
ng=4,litter_size=4,saveAt='RP2',
rp_output=rp2_output)
# Some output display
RP_2$summary_data
RP_2$output[[1]]$data # Data for base Generation
RP_2$output[[2]]$freqQTL # qtl frequencies for 1st Generation
RP_2$output[[4]]$freqMRK # Marker frequencies for 3rd Generation
RP_2$linkage_map_qtl
RP_2$allele_effcts
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.