code: def umi_histogram(fastq):
      ''' Counts the number of reads for each UMI
  
      Expects formatted fastq files.
      '''
      annotations = detect_fastq_annotations(fastq)
      re_string = construct_transformed_regex(annotations)
      parser_re = re.compile(re_string)
  
      counter = collections.Counter()
      for read in read_fastq(fastq):
          match = parser_re.search(read).groupdict()
          counter[match['MB']] += 1
  
      for bc, count in counter.most_common():
          sys.stdout.write('{}\t{}\n'.format(bc, count)f umi_histogram(fastq):
      ''' Counts the number of reads for each UMI
  
      Expects formatted fastq files.
      '''
      annotations = detect_fastq_annotations(fastq)
      re_string = construct_transformed_regex(annotations)
      parser_re = re.compile(re_string)
  
      counter = collections.Counter()
      for read in read_fastq(fastq):
          match = parser_re.search(read).groupdict()
          counter[match['MB']] += 1
  
      for bc, count in counter.most_common():
          sys.stdout.write('{}\t{}\n'.format(bc, count))
docs: Counts the number of reads for each UMI
  
      Expects formatted fastq files.