Changes

From Genome Analysis Wiki
Jump to: navigation, search

Relationship between Ploidy, Alleles and Genotypes

17 bytes removed, 15:13, 28 June 2016
Getting the genotypes from a genotype index and a given ploidy
= Getting the genotypes from a genotype index and a given ploidy =
std::vector<int32_t> bcf_ip2g(int32_t genotype_index, uint32_t no_ploidy) {
std::vector<int32_t> genotype(no_ploidy, 0);
 
int32_t pth = no_ploidy;
int32_t max_allele_index = genotype_index;
int32_t leftover_genotype_index = genotype_index;
int d = 0;
while (pth>0)
{
{
int32_t i = choose(pth+allele_index-1, pth);
 
 
if (i>=leftover_genotype_index)
{
return genotype;
}
= Simple cases =
1,102
edits

Navigation menu