Learn R Programming

polyRAD (version 1.6)

AddPriorTimesLikelihood: Multiply Genotype Prior Probabilities by Genotype Likelihoods

Description

In preparation for calculations to be done by other functions, the genotype likelihoods for each taxon, allele, and ploidy are multiplied by the corresponding genotype prior probabilities, then stored back in the "RADdata" object in the $priorTimesLikelihood slot.

Usage

AddPriorTimesLikelihood(object, ...)

Value

A "RADdata" object identical to that passed to the function, but with the $priorTimesLikelihood slot added. This slot contains a list. Each element in the list corresponds to an element in object$priorProbs. Each element is an array, with allele copy number in the first dimension, taxa in the second dimension, and alleles in the third dimension.

Arguments

object

A "RADdata" object. Prior genotype probabilities and genotype likelihood should have already been added.

...

Potential future arguments (none currently in use).

Author

Lindsay V. Clark

See Also

AddGenotypeLikelihood, AddGenotypePriorProb_Mapping2Parents

Examples

Run this code
# 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)
exampleRAD_mapping <- AddGenotypePriorProb_Mapping2Parents(exampleRAD_mapping,
                                                      n.gen.backcrossing = 1)
                                                      
# perform the multiplication
exampleRAD_mapping <- AddPriorTimesLikelihood(exampleRAD_mapping)
# examine the results
exampleRAD_mapping$priorTimesLikelihood[[1]][,50,] # for one progeny
exampleRAD_mapping$priorTimesLikelihood[[1]][,1,]
 # --> for the donor parent; not a good idea to use since the priors 
 #    aren't appropriate

Run the code above in your browser using DataLab