docs: def read_contig(contig_name, bamfile_name, reference_fasta, quality_cutoff=20, base_cutoff=2, base_fraction_cutoff=None):
      """
      Examines a contig to find if there are positions where more than one base is present.
      :param contig_name: Name of contig as a string.
      :param bamfile_name: Full path to bamfile. Must be sorted/indexed
      :param reference_fasta: Full path to fasta file that was used to generate the bamfile.
      :param report_file: File where information about each position found to have multiple bases
      will be written.
      :return: Dictionary of positions where more than one base is present. Keys are contig name, values are positions
      """
      bamfile = pysam.AlignmentFile(bamfile_name, 'rb')
      multibase_position_dict = dict()
      to_write = list()
      # These parameters seem to be fairly undocumented with pysam, but I think that they should make the output
      # that I'm getting to match up with what I'm seeing in Tablet.
      for column in bamfile.pileup(contig_name,
                                   stepper='samtools', ignore_orphans=False, fastafile=pysam.FastaFile(reference_fasta),
                                   min_base_quality=0):
          base_dict = find_if_multibase(column, quality_cutoff=quality_cutoff, base_cutoff=base_cutoff, base_fraction_cutoff=base_fraction_cutoff)
  
          if base_dict:
              # Pysam starts counting at 0, whereas we actually want to start counting at 1.
              actual_position = column.pos + 1
              if column.reference_name in multibase_position_dict:
                  multibase_position_dict[column.reference_name].append(actual_position)
              else:
                  multibase_position_dict[column.reference_name] = [actual_position]
              to_write.append('{reference},{position},{bases},{coverage}\n'.format(reference=column.reference_name,
                                                                              position=actual_position,
                                                                              bases=base_dict_to_string(base_dict),
                                                                              coverage=sum(base_dict.values())))
      bamfile.close()
      return multibase_position_dict, to_write