def get_qual_stats(qual_bins, score_min):
 ave_bins = []
 std_dev_bins = []
 total_bases_bins = []
 found_first_poor_qual_pos = False
 suggested_trunc_pos = None
 for base_position in qual_bins:
  total_bases_bins.append(len(base_position))
  std_dev_bins.append(std(base_position))
  ave_bins.append(average(base_position))
  if (not found_first_poor_qual_pos):
   if (average(base_position) < score_min):
    suggested_trunc_pos = qual_bins.index(base_position)
    found_first_poor_qual_pos = True
 return (ave_bins, std_dev_bins, total_bases_bins, suggested_trunc_pos)

def get_qual_stats ( qual_bins , score_min ) : ave_bins = [ ] std_dev_bins = [ ] total_bases_bins = [ ] found_first_poor_qual_pos = False suggested_trunc_pos = None for base_position in qual_bins : total_bases_bins . append ( len ( base_position ) ) std_dev_bins . append ( std ( base_position ) ) ave_bins . append ( average ( base_position ) ) if ( not found_first_poor_qual_pos ) : if ( average ( base_position ) < score_min ) : suggested_trunc_pos = qual_bins . index ( base_position ) found_first_poor_qual_pos = True return ( ave_bins , std_dev_bins , total_bases_bins , suggested_trunc_pos )
generates bins of averages .