backmeiosis: Sample from Parental Genotypes

Description Usage Arguments Value

Description

This takes a mating tensor, a vector of genotypes, a vector of weights, and matrices of numbers of possible seed and pollen parents (with seed[k,j] and pollen[k,j] being the numbers of possible j-genotype parents of genotype[k]), and samples from parental genotypes.

Usage

1
backmeiosis(x, mating, weights, seed, pollen)

Arguments

x

A vector of genotypes.

mating

A mating tensor.

weights

A numeric vector of length equal to number of genotypes.

seed

A matrix with dimensions length(x) by number of genotypes.

pollen

A matrix with dimensions length(x) by number of genotypes.

Value

A length(x) by 2 matrix whose first column is the genotype index and the second column is 1 or 2, meaning: 1 : seed (first dimension in mating tensor) 2 : pollen (second dimension in mating tensor)

For genotype=k, the probability of choosing parent genotype pair i,j is proportional to X[i,j] = mating[i,j,k]*seed[i]*pollen[j] and given i,j, the probability of choosing the seed parent is equal to weights[i]/(weights[i]+weights[j]) .


petrelharp/landsim documentation built on May 25, 2019, 2:53 a.m.