Learn R Programming

polyRAD (version 1.1)

AddGenotypePriorProb_Mapping2Parents: Expected Genotype Frequencies in Mapping Populations

Description

Given the most likely genotypes of two parent taxa, expected genotype frequencies are estimated for a population of progeny and are added to the "RADdata" object in the $priorProb slot.

Usage

AddGenotypePriorProb_Mapping2Parents(object, ...)
# S3 method for RADdata
AddGenotypePriorProb_Mapping2Parents(object,
    donorParent = GetDonorParent(object), 
    recurrentParent = GetRecurrentParent(object), 
    n.gen.backcrossing = 0, n.gen.intermating = 0, n.gen.selfing = 0,
    donorParentPloidies = object$possiblePloidies,
    recurrentParentPloidies = object$possiblePloidies,
    minLikelihoodRatio = 10, …)

Arguments

object

A "RADdata" object. Ideally this should be set up as a mapping population using SetDonorParent, SetRecurrentParent, and AddAlleleFreqMapping.

Additional arguments, listed below, to be passed to the method for "RADdata" objects.

donorParent

A character string indicating which taxon is the donor parent. If backcrossing was not performed, it does not matter which was the donor or recurrent parent.

recurrentParent

A character string indicating which taxon is the recurrent parent.

n.gen.backcrossing

An integer, zero or greater, indicating how many generations of backcrossing to the recurrent parent were performed.

n.gen.intermating

An integer, zero or greater, indicating how many generations of intermating within the population were performed. (Values above one should not have an effect on the genotype priors that are output, i.e. genotype probabilities after one generation of random mating are identical to genotype probabilities after >1 generation of random mating, assuming no genetic drift or selection).

n.gen.selfing

An integer, zero or greater, indicating how many generations of selfing were performed.

donorParentPloidies

A list, where each item in the list is an integer vector indicating a potential inheritance mode that could be observed among loci in the donor parent. 2 indicates diploid, 4 indicates autotetraploid, c(2, 2) indicates allotetraploid, etc.

recurrentParentPloidies

A list in the same format as donorParentPloidies indicating inheritance modes that could be observed among loci in the recurrent parent.

minLikelihoodRatio

The minimum likelihood ratio for determining parental genotypes with confidence, to be passed to GetLikelyGen for both parental taxa.

Value

A "RADdata" object identical to that passed to the function, but with data stored in six new slots:

priorProb

A list of matrices, with one matrix per possible ploidy of offspring. For each matrix, allele copy number (from zero to the total ploidy) is in rows, and alleles are in columns. Each value is the probability of sampling an individual with that allele copy number from the population.

priorProbPloidies

A list in the same format as object$possiblePloidies, and the same length as object$priorProb. Each item in the list is a vector indicating the inheritance mode for the corresponding matrix in object$priorProb.

donorPloidies

A list in the same format as object$possiblePloidies, with one item corresponding to each in object$priorProbPloidies, indicating the donor parent ploidy for that progeny ploidy.

recurrentPloidies

A list in the same format as object$possiblePloidies, with one item corresponding to each in object$priorProbPloidies, indicating the recurrent parent ploidy for that progeny ploidy.

likelyGeno_donor

A matrix of the donor parent genotypes that were used for estimating genotype prior probabilities. Formatted like the output of GetLikelyGen.

likelyGeno_recurrent

A matrix of the recurrent parent genotypes that were use for estimating gentoype prior probabilities.

Details

The function first determines which combinations of inheritance modes from the two parents should be examined in the progeny. The expected progeny ploidy must be in object$possiblePloidies for a given combination to be examined.

The most likely genotypes for the two parents are estimated using GetLikelyGen. If parental gentoypes don't match progeny allele frequencies, the function attempts to correct the parental genotypes to the most likely combination that matches the allele frequency. For each ploidy being examined, F1 genotype probabilities are then calculated.

Genotype probabilities are updated for each backcrossing generation, then each intermating generation, then each selfing generation.

The default, with n.gen.backcrossing = 0, n.gen.intermating = 0 and n.gen.selfing = 0, will simulate an F1 population. A BC1F2 population, for example, would have n.gen.backcrossing = 1, n.gen.intermating = 0 and n.gen.selfing = 1. A typical F2 population would have n.gen.selfing = 1 and the other two parameters set to zero. However, in a self-incompatible species where many F1 are intermated to produce the F2, one would instead use n.gen.intermating = 1 and set the other parameters to zero.

See Also

AddGenotypeLikelihood, AddGenotypePriorProb_HWE

Examples

Run this code
# NOT RUN {
# load dataset and set some parameters
data(exampleRAD_mapping)
exampleRAD_mapping <- SetDonorParent(exampleRAD_mapping, "parent1")
exampleRAD_mapping <- SetRecurrentParent(exampleRAD_mapping, "parent2")
exampleRAD_mapping <- AddAlleleFreqMapping(exampleRAD_mapping,
                                           expectedFreqs = c(0.25, 0.75),
                                           allowedDeviation = 0.08)
exampleRAD_mapping <- AddGenotypeLikelihood(exampleRAD_mapping)

# examine the dataset
exampleRAD_mapping
exampleRAD_mapping$alleleFreq

# estimate genotype priors for a BC1 population
exampleRAD_mapping <- AddGenotypePriorProb_Mapping2Parents(exampleRAD_mapping,
                                                      n.gen.backcrossing = 1)
exampleRAD_mapping$priorProb
# }

Run the code above in your browser using DataLab