code: def populate_iteration(self, iteration):
          
  
          cur_idx = iteration.cur_idx
  
          if cur_idx < self.total_locus_count:
              buffer = struct.unpack(self.fmt_string,
                                     self.genotype_file.read(self.bytes_per_read))
              genotypes = numpy.ma.MaskedArray(self.extract_genotypes(buffer),
                                               self.ind_mask).compressed()
  
              iteration.chr, iteration.pos = self.markers[cur_idx]
              iteration.rsid = self.rsids[cur_idx]
  
  
              if DataParser.boundary.TestBoundary(iteration.chr,
                                                  iteration.pos,
                                                  iteration.rsid):
                  hz_count = numpy.sum(genotypes==1)
                  allele_count1 = numpy.sum(genotypes==0)*2 + hz_count
                  allele_count2 = numpy.sum(genotypes==2)*2 + hz_count
                  iteration.minor_allele, \
                      iteration.major_allele = self.alleles[cur_idx]
  
                  if allele_count2 > allele_count1:
                      iteration.maj_allele_count = allele_count2
                      iteration.min_allele_count = allele_count1
                  else:
                      iteration.maj_allele_count = allele_count1
                      iteration.min_allele_count = allele_count2
                  iteration.allele_count2 = allele_count2
                  iteration.genotype_data = genotypes
                  maf = iteration.maf
                  iteration.hetero_count = hz_count
                  return maf >= DataParser.min_maf and \
                         maf <= DataParser.max_maf
          else:
              raise StopIteration
          return False
docs: Parse genotypes from the file and iteration with relevant marker \
              details.
  
          :param iteration: ParseLocus object which is returned per iteration
          :return: True indicates current locus is valid.
  
          StopIteration is thrown if the marker reaches the end of the file or
          the valid genomic region for analysis.