calc_allele_freq: Calculate the allele frequencies of loci

View source: R/allele_functions.R

calc_allele_freqR Documentation

Calculate the allele frequencies of loci

Description

Calculates the frequency of markers, QTL, or both.

Usage

calc_allele_freq(genome, pop, locus.type = c("qtl", "markers", "both"))

Arguments

genome

An object of class genome.

pop

A population.

locus.type

The type of loci for which allele frequenices should be returned. Can be "qtl", "markers", or "both".

Value

A list of frequencies of the 1 allele for the loci specified.

Examples

n.mar  <- c(505, 505, 505)
len <- c(120, 130, 140)

genome <- sim_genome(len, n.mar)

# Randomly generate 15 QTL with additive allelic effects following a
# genometric series
qtl.model <- matrix(nrow = 15, ncol = 4)
genome <- sim_gen_model(genome, qtl.model, add.dist = "geometric")

# Create a random population
pop <- sim_pop(genome = genome, n.ind = 200)

# Calculate QTL allele freqencies
calc_allele_freq(genome, pop, "qtl")
# For markers
calc_allele_freq(genome, pop, "markers")


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