View source: R/pop_functions.R
| select_pop | R Documentation | 
Make selections from a population
select_pop(
  pop,
  intensity = 0.1,
  index = 1,
  type = c("phenotypic", "genomic", "random")
)
| pop | An object of class  | 
| intensity | Either the prortion of individual in the population to select or the number of individuals in the population to select. | 
| index | The coefficients for the selection index. Positive coefficients 
equate to selection on higher trait values, and negative coefficients equate 
to selection on lower trait value. Must be a vector if length  | 
| type | The type of selection to perform. If  | 
If one trait is present, selection is performed on that one trait.
If two traits are present, an index is calculated using the index.
If there is a tie in the phenotypic or predicted genotypic values, individuals are randomly chosen.
An object of class pop that is a subset of the input pop for
the selections.
# Simulate a genome
n.mar  <- c(505, 505, 505)
len <- c(120, 130, 140)
genome <- sim_genome(len, n.mar)
# Simulate a quantitative trait influenced by 50 QTL
qtl.model <- matrix(NA, 50, 4)
genome <- sim_gen_model(genome = genome, qtl.model = qtl.model, 
                        add.dist = "geometric", max.qtl = 50)
                        
# Simulate the population
pop <- sim_pop(genome = genome, n.ind = 100)
# Select randomly
select_pop(pop = pop, intensity = 0.1, type = "random")
# Phenotype the population
pop <- sim_phenoval(pop = pop, h2 = 0.5)
# Select on phenotypes
select_pop(pop = pop, intensity = 0.1, type = "phenotypic")
# Predict genotypic values
pop <- pred_geno_val(genome = genome, training.pop = pop, candidate.pop = pop)
# Select on pgvs
select_pop(pop = pop, intensity = 0.1, type = "genomic")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.