Add the ability to correct multiallelic genotypes to ensure that the sum of copy numbers across all alleles for a given locus is always equal to the ploidy. The internal BestMultiGeno function recursively searches all possible (i.e. totaling to the ploidy) multiallelic genotypes to find the one that has the highest product of posterior probabilities across alleles, for one taxon*locus. The internal CorrectGenos function takes an allele copy number matrix such as that output by GetProbableGenotypes, finds genotypes where allele copy does not sum to the ploidy, and depending on the do_correct argument either sets these to NA or runs BestMultiGeno to correct them. GetProbableGenotypes now internally calls CorrectGenos unless the user sets multiallelic = "ignore".
Add the ability to correct multiallelic genotypes to ensure that the sum of copy numbers across all alleles for a given locus is always equal to the ploidy. The internal
BestMultiGeno
function recursively searches all possible (i.e. totaling to the ploidy) multiallelic genotypes to find the one that has the highest product of posterior probabilities across alleles, for one taxon*locus. The internalCorrectGenos
function takes an allele copy number matrix such as that output byGetProbableGenotypes
, finds genotypes where allele copy does not sum to the ploidy, and depending on thedo_correct
argument either sets these toNA
or runsBestMultiGeno
to correct them.GetProbableGenotypes
now internally callsCorrectGenos
unless the user setsmultiallelic = "ignore"
.