AddGenotypePriorProb_ByTaxa: Estimate Prior Genotype Probabilities on a Per-Taxon Basis

Description Usage Arguments Value Author(s) See Also Examples

View source: R/classes_methods.R

Description

Using local allele frequencies estimated by AddAlleleFreqByTaxa and assuming Hardy-Weinberg Equilibruim on a local scale, AddGenotypePriorProb_ByTaxa estimates prior genotype probabilities at each taxon, allele, and possible ploidy. These are then stored in the $priorProb slot of the "RADdata" object.

Usage

1

Arguments

object

A "RADdata" object. AddAlleleFreqByTaxa should have already been run.

...

Additional arguments (none implemented).

Value

A "RADdata" object identical to that passed to the function, but with a list added to the $priorProb slot. Each item in the list corresponds to one ploidy in object$possiblePloidies, and is a three-dimensional array with allele copy number in the first dimension, taxa in the second dimension, and alleles in the third dimension. The values in the array are prior genotype probabilities. Additionally, object$possiblePloidies is copied to object$priorProbPloidies, and "taxon" is recorded in the "priorType" attribute.

Author(s)

Lindsay V. Clark

See Also

AddGenotypePriorProb_HWE, AddGenotypePriorProb_Mapping2Parents, AddGenotypeLikelihood

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# load data
data(exampleRAD)
# do PCA
exampleRAD <- AddPCA(exampleRAD, nPcsInit = 3)
# get allele frequencies
exampleRAD <- AddAlleleFreqByTaxa(exampleRAD)

# add prior probabilities
exampleRAD <- AddGenotypePriorProb_ByTaxa(exampleRAD)

exampleRAD$priorProb[[1]][,1,]
exampleRAD$priorProb[[2]][,1,]
exampleRAD$priorProb[[1]][,2,]
exampleRAD$priorProb[[2]][,2,]

lvclark/polyRAD documentation built on Feb. 14, 2018, 10:41 p.m.