def bin_qual_scores(qual_scores):
 qual_bins = []
 qual_lens = []
 for l in qual_scores.values():
  qual_lens.append(len(l))
 max_seq_size = max(qual_lens)
 for base_position in range(max_seq_size):
  qual_bins.append([])
  for scores in qual_scores.values():
   try:
    qual_bins[base_position].append(scores[base_position])
   except IndexError:
    continue
 return qual_bins

def bin_qual_scores ( qual_scores ) : qual_bins = [ ] qual_lens = [ ] for l in qual_scores . values ( ) : qual_lens . append ( len ( l ) ) max_seq_size = max ( qual_lens ) for base_position in range ( max_seq_size ) : qual_bins . append ( [ ] ) for scores in qual_scores . values ( ) : try : qual_bins [ base_position ] . append ( scores [ base_position ] ) except IndexError : continue return qual_bins
bins qual score according to nucleotide position qual_scores: dict of label: numpy array of base scores .