Lift a region that overlaps the genomic occurrence of this repeat to the
    consensus sequence coordinates using just coordinates (not the full
    alignment, even if it is avaialble), when the length of the genomic match
    is greater than the concensus match. We assume there are insertions in
    the genomic sequence (i.e. gaps in the consensus match). We uniformly
    distribute the gaps through the consensus match. e.g. if the genomic
    region is 100nt long and the consensus match is 90nt long, we will consider
    an insertion to occurr every 10nt in the genomic sequence. The start and
    end coordinates of the region after lifting will be reduced by the number
    of genomic insertions that would have come before them.

    :param intersecting_region: a region that intersects this occurrence.
    :return: list of GenomicInterval objects. This is a list because, although
             the liftover can produce only one genomic interval in consensus,
             it might also produce none (if the interval overlaps only
             insertions in the genomic sequence), hence an empty list is
             possible.

def __liftover_coordinates_genomic_insertions(self, intersecting_region):
    """
    Lift a region that overlaps the genomic occurrence of this repeat to the
    consensus sequence coordinates using just coordinates (not the full
    alignment, even if it is avaialble), when the length of the genomic match
    is greater than the concensus match. We assume there are insertions in
    the genomic sequence (i.e. gaps in the consensus match). We uniformly
    distribute the gaps through the consensus match. e.g. if the genomic
    region is 100nt long and the consensus match is 90nt long, we will consider
    an insertion to occurr every 10nt in the genomic sequence. The start and
    end coordinates of the region after lifting will be reduced by the number
    of genomic insertions that would have come before them.

    :param intersecting_region: a region that intersects this occurrence.
    :return: list of GenomicInterval objects. This is a list because, although
             the liftover can produce only one genomic interval in consensus,
             it might also produce none (if the interval overlaps only
             insertions in the genomic sequence), hence an empty list is
             possible.
    """
    # should never happen, but check anyway...
    consensus_match_length = self.consensus_end - self.consensus_start
    size_dif = consensus_match_length - len(self)
    assert(size_dif < 0)

    gap_interval = len(self) / (-1 * size_dif)
    s_dist_to_gen_start = max(intersecting_region.start - self.start, 0)
    e_dist_to_gen_start = max(intersecting_region.end - self.start, 0)

    if self.consensus_match_strand is '+':
      s = s_dist_to_gen_start + self.consensus_start
      e = e_dist_to_gen_start + self.consensus_start
      s = s - (s_dist_to_gen_start / gap_interval)
      e = min(e - (e_dist_to_gen_start / gap_interval), self.consensus_len)
    else:
      e = self.consensus_end - s_dist_to_gen_start
      s = self.consensus_end - e_dist_to_gen_start
      s = max(s + (e_dist_to_gen_start / gap_interval),
              self.consensus_start)
      e = min(e + (s_dist_to_gen_start / gap_interval), self.consensus_end)

    res = [] if s == e else [GenomicInterval(self.repeat_name(), s, e,
                                             intersecting_region.name,
                                             intersecting_region.score,
                                             self.strand)]
    return res