select_pop: Make selections from a population

View source: R/pop_functions.R

select_popR Documentation

Make selections from a population

Description

Make selections from a population

Usage

select_pop(
  pop,
  intensity = 0.1,
  index = 1,
  type = c("phenotypic", "genomic", "random")
)

Arguments

pop

An object of class pop.

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 n_trait. If one trait is present, the coefficient is 1 or -1.

type

The type of selection to perform. If "phenotypic", individuals in the population are selected based on phenotypic values, if "genomic", individuals in the population are selected based on predicted genotypic values, and if "random", individuals in the population are selected randomly.

Details

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.

Value

An object of class pop that is a subset of the input pop for the selections.

Examples


# 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")



neyhartj/qgsim documentation built on Nov. 11, 2023, 4:08 p.m.