parameters: (read_dict, verbosity, using_contamination)
docstring: Outputs a summary of the reads' alignments, grouping them by fully aligned, partially aligned
      and unaligned.
docstring_summary: Outputs a summary of the reads' alignments, grouping them by fully aligned, partially aligned
      and unaligned.
docstring_tokens: Outputs a summary of the reads alignments grouping them by fully aligned partially aligned and unaligned .
function: def print_alignment_summary_table(read_dict, verbosity, using_contamination):
      """
      Outputs a summary of the reads' alignments, grouping them by fully aligned, partially aligned
      and unaligned.
      """
      fully_aligned, partially_aligned, unaligned = group_reads_by_fraction_aligned(read_dict)
      ref_bases_aligned = 0
      for read in read_dict.values():
          ref_bases_aligned += read.get_reference_bases_aligned()
      log.log_section_header('Read alignment summary', single_newline=(verbosity > 1))
      max_v = max(len(read_dict), ref_bases_aligned)
  
      if using_contamination:
          contaminant_reads, contaminant_read_per, contaminant_bases, contaminant_base_per = \
              get_percent_contamination(read_dict)
      else:
          contaminant_reads, contaminant_read_per, contaminant_bases, contaminant_base_per = \
              None, None, None, None
      log.log('Total read count:        ' + int_to_str(len(read_dict), max_v))
      log.log('Fully aligned reads:     ' + int_to_str(len(fully_aligned), max_v))
      log.log('Partially aligned reads: ' + int_to_str(len(partially_aligned), max_v))
      if partially_aligned:
          log.log(dim(', '.join([x.name for x in partially_aligned])), 3)
          log.log('', 3)
      log.log('Unaligned reads:         ' + int_to_str(len(unaligned), max_v))
      if unaligned:
          log.log(dim(', '.join([x.name for x in unaligned])), 3)
          log.log('', 3)
  
      if using_contamination:
          log.log('Contaminant reads:       ' + int_to_str(contaminant_reads, max_v))
          log.log('Contaminant reads:       ' + float_to_str(contaminant_read_per, 1, max_v) + '%')
  
      log.log('Total bases aligned:     ' + int_to_str(ref_bases_aligned, max_v) + ' bp')
      if using_contamination:
          log.log('Contaminant bases:       ' + int_to_str(contaminant_bases, max_v) + ' bp')
          log.log('Contaminant bases:       ' + float_to_str(contaminant_base_per, 1, max_v) + '%')
  
      identities = []
      lengths = []
      for read in fully_aligned + partially_aligned:
          identities += [x.percent_identity for x in read.alignments]
          lengths += [x.get_aligned_ref_length() for x in read.alignments]
      mean_identity = weighted_average_list(identities, lengths)
      log.log('Mean alignment identity: ' + float_to_str(mean_identity, 1, max_v) + '%')
function_tokens: def print_alignment_summary_table ( read_dict , verbosity , using_contamination ) : fully_aligned , partially_aligned , unaligned = group_reads_by_fraction_aligned ( read_dict ) ref_bases_aligned = 0 for read in read_dict . values ( ) : ref_bases_aligned += read . get_reference_bases_aligned ( ) log . log_section_header ( 'Read alignment summary' , single_newline = ( verbosity > 1 ) ) max_v = max ( len ( read_dict ) , ref_bases_aligned ) if using_contamination : contaminant_reads , contaminant_read_per , contaminant_bases , contaminant_base_per = get_percent_contamination ( read_dict ) else : contaminant_reads , contaminant_read_per , contaminant_bases , contaminant_base_per = None , None , None , None log . log ( 'Total read count:        ' + int_to_str ( len ( read_dict ) , max_v ) ) log . log ( 'Fully aligned reads:     ' + int_to_str ( len ( fully_aligned ) , max_v ) ) log . log ( 'Partially aligned reads: ' + int_to_str ( len ( partially_aligned ) , max_v ) ) if partially_aligned : log . log ( dim ( ', ' . join ( [ x . name for x in partially_aligned ] ) ) , 3 ) log . log ( '' , 3 ) log . log ( 'Unaligned reads:         ' + int_to_str ( len ( unaligned ) , max_v ) ) if unaligned : log . log ( dim ( ', ' . join ( [ x . name for x in unaligned ] ) ) , 3 ) log . log ( '' , 3 ) if using_contamination : log . log ( 'Contaminant reads:       ' + int_to_str ( contaminant_reads , max_v ) ) log . log ( 'Contaminant reads:       ' + float_to_str ( contaminant_read_per , 1 , max_v ) + '%' ) log . log ( 'Total bases aligned:     ' + int_to_str ( ref_bases_aligned , max_v ) + ' bp' ) if using_contamination : log . log ( 'Contaminant bases:       ' + int_to_str ( contaminant_bases , max_v ) + ' bp' ) log . log ( 'Contaminant bases:       ' + float_to_str ( contaminant_base_per , 1 , max_v ) + '%' ) identities = [ ] lengths = [ ] for read in fully_aligned + partially_aligned : identities += [ x . percent_identity for x in read . alignments ] lengths += [ x . get_aligned_ref_length ( ) for x in read . alignments ] mean_identity = weighted_average_list ( identities , lengths ) log . log ( 'Mean alignment identity: ' + float_to_str ( mean_identity , 1 , max_v ) + '%' )