parameters: (alleles, genotype_index, ref=None)
return_statement: return alleles_lookup
docstring: Build lookup table for mapping of alleles to PL field
docstring_summary: Build lookup table for mapping of alleles to PL field
docstring_tokens: Build lookup table for mapping of alleles to PL field
function: def build_PL_indices_lookup(alleles, genotype_index, ref=None):
      """Build lookup table for mapping of alleles to PL field"""
  
      n_uniq_alleles = len(set(alleles))
      alleles_comb = itertools.chain(
          itertools.product(
              alleles, repeat=2),
          itertools.product(
              alleles, repeat=3),
          itertools.product(
              alleles, repeat=4))
      alleles_comb = itertools.ifilter(
          lambda x: len(set(x)) == min(len(x), n_uniq_alleles), alleles_comb)
      alleles_comb = itertools.ifilter(lambda x: ref not in x[1:], alleles_comb)
      alleles_lookup = {
          alleles: allele_indices(alleles, genotype_index)
          for alleles in alleles_comb
      }
  
      return alleles_lookup
function_tokens: def build_PL_indices_lookup ( alleles , genotype_index , ref = None ) : n_uniq_alleles = len ( set ( alleles ) ) alleles_comb = itertools . chain ( itertools . product ( alleles , repeat = 2 ) , itertools . product ( alleles , repeat = 3 ) , itertools . product ( alleles , repeat = 4 ) ) alleles_comb = itertools . ifilter ( lambda x : len ( set ( x ) ) == min ( len ( x ) , n_uniq_alleles ) , alleles_comb ) alleles_comb = itertools . ifilter ( lambda x : ref not in x [ 1 : ] , alleles_comb ) alleles_lookup = { alleles : allele_indices ( alleles , genotype_index ) for alleles in alleles_comb } return alleles_lookup