def nucmer_hits_to_ref_coords(cls, nucmer_hits, contig=None):
        '''Input is hits made by self._parse_nucmer_coords_file.
           Returns dictionary. Key = contig name. Value = list of coords in the
           reference sequence for that contig.
           if contig=contig_name, then just gets the ref coords from that contig,
           instead of using all the contigs'''
        coords = []
        if contig is None:
            coords = {key: [] for key in nucmer_hits.keys()}
        else:
            coords = {contig: []}

        for key in coords:
            coords[key] = [hit.ref_coords() for hit in nucmer_hits[key]]
            pyfastaq.intervals.merge_overlapping_in_list(coords[key])

        return coords
Input is hits made by self._parse_nucmer_coords_file.
           Returns dictionary. Key = contig name. Value = list of coords in the
           reference sequence for that contig.
           if contig=contig_name, then just gets the ref coords from that contig,
           instead of using all the contigs