genotype.index: Genotype indices

Description Usage Arguments Value Author(s) Examples

View source: R/genotype.index.R

Description

Functions giving genotype indices as a function of the number of alleles (for a single locus) or the number of allele at each locus (for multiple loci).

Usage

1
2
genotype.index(l)
genotype.index.multilocus(allele_vec,r,method)

Arguments

l

Number of alleles

allele_vec

Vector giving the number of alleles at each locus

r

Recombination rate. A single value between 0 and 0.5. For more than two loci, recombination rate must be set to 0.5.

method

A string defining the method used to store the genotypes. One of either "gamete" or "genotype". For two loci and r < 0.5, method must be "gamete".

Value

For genotype.index, a square matrix whose [i,j] element gives the index of the genotype formed by the i and j alleles.

For genotype.index.multilocus, the value depends on the argument method. If method = "gamete", it is a square matrix whose [i,j] element gives the index of the multilocus genotype formed by the i and j gametes. If method = "genotype", it is an n-dimensional array, where n is the number of loci, giving the index of the multilocus genotype formed by the ith single-locus genotype at the first locus, the jth single-locus genotype at the second locus, etc.

Author(s)

Marco Andrello

Examples

1
2
3
4
5
6
7
# Monolocus case:
genotype.index(2)

# Multilocus case:
allele_vec <- c(2,2)
genotype.index.multilocus(allele_vec,r=0.5,method="gamete")
genotype.index.multilocus(allele_vec,r=0.5,method="genotype")

MarcoAndrello/MetaPopGen-2.0 documentation built on Nov. 25, 2020, 11:20 p.m.