code: def _analyze_single(self, reference, result):
          '''Report mistmatches and indels for a single (aligned) reference and
          result.'''
          # TODO: Recalculate coverage based on reference (e.g. sequencing result
          # longer than template
          reference_str = str(reference)
          result_str = str(result)
          report = {'mismatches': [], 'insertions': [], 'deletions': []}
          for i, (ref, res) in enumerate(zip(reference_str, result_str)):
              if ref != res:
                  # It's a mismatch or indel
                  if ref == '-':
                      report['insertions'].append(i)
                  if res == '-':
                      report['deletions'].append(i)
                  else:
                      report['mismatches'].append(i)
  
          start = len(result_str) - len(result_str.lstrip('-'))
          stop = len(result_str) - len(result_str.rstrip('-'))
          report['coverage'] = [start, stop]
  
          return reporf _analyze_single(self, reference, result):
          '''Report mistmatches and indels for a single (aligned) reference and
          result.'''
          # TODO: Recalculate coverage based on reference (e.g. sequencing result
          # longer than template
          reference_str = str(reference)
          result_str = str(result)
          report = {'mismatches': [], 'insertions': [], 'deletions': []}
          for i, (ref, res) in enumerate(zip(reference_str, result_str)):
              if ref != res:
                  # It's a mismatch or indel
                  if ref == '-':
                      report['insertions'].append(i)
                  if res == '-':
                      report['deletions'].append(i)
                  else:
                      report['mismatches'].append(i)
  
          start = len(result_str) - len(result_str.lstrip('-'))
          stop = len(result_str) - len(result_str.rstrip('-'))
          report['coverage'] = [start, stop]
  
          return report
docs: Report mistmatches and indels for a single (aligned) reference and
          result.