for genotypes in itertools.product(*genotype_options):
paired = [VariantAndGenotypes(v, g) for v, g in zip(variants, genotypes)]
for haplotypes in create_haplotypes(paired, ref.start):
yield haplotypes, genotypes
def all_diploid_haplotypes(variants_and_genotypes, genotypes2haplotype):
Returns all diploid haplotypes for variants given their genotypes.
After Change
pass
genotype_options = genotype_options_for_variants(variants, enumeration_type)
haplotypes_to_genotypes_dict = collections.OrderedDict()
for genotypes in itertools.product(*genotype_options):
paired = [VariantAndGenotypes(v, g) for v, g in zip(variants, genotypes)]
for haplotypes in create_haplotypes(paired, ref.start):
key = frozenset(haplotypes)
if key not in haplotypes_to_genotypes_dict:
haplotypes_to_genotypes_dict[key] = []
haplotypes_to_genotypes_dict[key].append(genotypes)
return haplotypes_to_genotypes_dict
def all_diploid_haplotypes(variants_and_genotypes, genotypes2haplotype):
Returns all diploid haplotypes for variants given their genotypes.