Learn R Programming

polyRAD (version 1.1)

AddGenotypePriorProb_Even: Add Uniform Priors to a RADdata Object

Description

To estimate genotype posterior probabilities based on read depth alone, without taking any population parameters into account, this function can be used to set a uniform prior probability on all possible genotypes. This function is not part of any pipeline but can be used for very rough and quick genotype estimates, when followed by AddGenotypeLikelihood, AddGenotypePosteriorProb, AddPloidyChiSq, and GetWeightedMeanGenotypes or GetProbableGenotypes.

Usage

AddGenotypePriorProb_Even(object, ...)

Arguments

object

A RADdata object.

Additional arguments (none implemented).

Value

A “RADdata” object identical that passed to the function, but with data stored in two new slots:

priorProb

A list of matrices, with one matrix per possible ploidy. For each matrix, allele copy number (from zero to the total ploidy) is in rows, and alleles are in columns. Each value is \(1 / (ploidy + 1).\)

priorProbPloidies

A list identical to object$possiblePloidies. It is in the same order as $priorProb, with each item indicating the inheritance mode for the corresponding prior probability matrix.

See Also

AddGenotypePriorProb_HWE

Examples

Run this code
# NOT RUN {
data(exampleRAD)

exampleRAD <- AddGenotypePriorProb_Even(exampleRAD)
exampleRAD$priorProb

# finish protocol to get genotypes
exampleRAD <- AddGenotypeLikelihood(exampleRAD)
exampleRAD <- AddPloidyChiSq(exampleRAD)
exampleRAD <- AddGenotypePosteriorProb(exampleRAD)

genmat <- GetWeightedMeanGenotypes(exampleRAD)
genmat
# }

Run the code above in your browser using DataLab