For each possible allele copy number across each possible ploidy in each taxon,
AddGenotypeLikelihood
estimates the probability of observing the
distribution of read counts that are recorded for that taxon and locus.
AddGenotypeLikelihood(object, ...)# S3 method for RADdata
AddGenotypeLikelihood(object, overdispersion = 9, …)
A "RADdata"
object.
An overdispersion parameter. Higher values will cause the expected read depth distribution to more resemble the binomial distribution. Lower values indicate more overdispersion, i.e. sample-to-sample variance in the probability of observing reads from a given allele.
Other arguments; none are currently used.
A "RADdata"
object identical to that passed to the function, but with
genotype likelihoods stored in object$genotypeLikelihood
. This item is a
list, with one item for each possible ploidy, ignoring differences between
autopolyploids and allopolyploids. For each ploidy there is a three-dimensional
array with number of allele copies in the first dimension, taxa in the second dimension,
and alleles in the third dimension.
If allele frequencies are not already recorded in object
, they will
be added using AddAlleleFreqHWE
. Allele frequencies are then
used for estimating the probability of sampling an allele from a genotype due
to sample contamination. Given a known genotype with
To estimate the genotype likelihood, where
where
B is the beta function, and overdispersion
.
# NOT RUN {
# load example dataset and add allele frequency
data(exampleRAD)
exampleRAD <- AddAlleleFreqHWE(exampleRAD)
# estimate genotype likelihoods
exampleRAD <- AddGenotypeLikelihood(exampleRAD)
# inspect the results
# the first ten individuals and first two alleles, assuming diploidy
exampleRAD$alleleDepth[1:10,1:2]
exampleRAD$genotypeLikelihood[[1]][,1:10,1:2]
# assuming tetraploidy
exampleRAD$genotypeLikelihood[[2]][,1:10,1:2]
# }
Run the code above in your browser using DataLab