docs: def minimise_transcripts(ensembl, gene_id, de_novos):
      """ get a set of minimal transcripts to contain all the de novos.
      
      We identify the minimal number of transcripts to contain all de novos. This
      allows for de novos on mutually exclusive transcripts. The transcripts are
      selected on the basis of containing the most number of de novos, while also
      being the longest possible transcript for the gene.
      
      Args:
          ensembl: EnsemblRequest object to request data from ensembl
          gene_id: HGNC symbol for gene
          de_novos: set of de novo positions
      
      Returns:
          dictionary of lengths and de novo counts, indexed by transcript ID for
          the set of minimal transcripts necessary to contain all de novos.
      """
      
      if len(de_novos) == 0:
          return {}
      
      counts = count_de_novos_per_transcript(ensembl, gene_id, de_novos)
      
      if len(counts) == 0:
          return {}
      
      # find the transcripts with the most de novos
      max_count = max( val["n"] for key, val in counts.items() )
      transcripts = [ key for key, val in counts.items() if val["n"] == max_count ]
      
      # find the transcripts with the greatest length, and the most de novos
      max_length = max( counts[key]["len"] for key in transcripts )
      tx_ids = [ key for key in transcripts if counts[key]["len"] == max_length ]
      max_transcripts = {x: counts[x] for x in counts if x in tx_ids}
      
      # find which de novos occur in the transcript with the most de novos
      gene = construct_gene_object(ensembl, next(iter(max_transcripts)))
      denovos_in_gene = get_de_novos_in_transcript(gene, de_novos)
      
      # trim the de novos to the ones not in the current transcript
      leftovers = [ x for x in de_novos if x not in denovos_in_gene ]
      
      # and recursively return the transcripts in the current transcript, along
      # with transcripts for the reminaing de novos
      max_transcripts.update(minimise_transcripts(ensembl, gene_id, leftovers))
      
      return max_transcripts