code: def iterative_overlap_assembly(
          variant_sequences,
          min_overlap_size=MIN_VARIANT_SEQUENCE_ASSEMBLY_OVERLAP_SIZE):
      
      if len(variant_sequences) <= 1:
          # if we don't have at least two sequences to start with then
          # skip the whole mess below
          return variant_sequences
  
      # reduce the number of inputs to the merge algorithm by first collapsing
      # shorter sequences onto the longer sequences which contain them
      n_before_collapse = len(variant_sequences)
      variant_sequences = collapse_substrings(variant_sequences)
      n_after_collapse = len(variant_sequences)
      logger.info(
          "Collapsed %d -> %d sequences",
          n_before_collapse,
          n_after_collapse)
  
      merged_variant_sequences = greedy_merge(variant_sequences, min_overlap_size)
      return list(sorted(
          merged_variant_sequences,
          key=lambda seq: -len(seq.reads)))
docs: Assembles longer sequences from reads centered on a variant by
      between merging all pairs of overlapping sequences and collapsing
      shorter sequences onto every longer sequence which contains them.
  
      Returns a list of variant sequences, sorted by decreasing read support.