new_contents: from CMash import MinHash as MH
  import marisa_trie as mt
  import khmer
  import timeit
  import os
  import h5py
  
  
  class MakeTSTNew:
      def __init__(self, training_database_file_name: str, TST_export_file_name: str):
          self. training_database_file_name = training_database_file_name
          self.TST_export_file_name = TST_export_file_name
  
      @staticmethod
      def yield_trie_items_to_insert_no_import(file_name):
          fid = h5py.File(file_name, 'r')
          if "CountEstimators" not in fid:
              fid.close()
              raise Exception("This function imports a single HDF5 file containing multiple sketches."
                              " It appears you've used it on a file containing a single sketch."
                              "Try using import_single_hdf5 instead")
  
          grp = fid["CountEstimators"]
          iterator = grp.keys()
  
          iterator = sorted(iterator, key=os.path.basename)  # sort so that we know the order of the input
  
          for (i, key) in enumerate(iterator):
              if key not in grp:
                  fid.close()
                  raise Exception("The key " + key + " is not in " + file_name)
  
              subgrp = grp[key]
              if "kmers" not in subgrp:
                  raise Exception("Kmers were not saved when creating the count estimators. Please make sure save_kmers='y' "
                                  "when creating the count estimators.")
              else:
                  temp_kmers = subgrp["kmers"][...]
                  kmers = [kmer.decode('utf-8') for kmer in temp_kmers]
                  for (kmer_index, kmer) in enumerate(kmers):
                      if kmer:
                          yield kmer + 'x' + str(i) + 'x' + str(kmer_index)  # format here is kmer+x+hash_index+kmer_index
                          # rev-comp kmer
                          kmer_rc = khmer.reverse_complement(kmer)
                          yield kmer_rc + 'x' + str(i) + 'x' + str(kmer_index)  # format here is kmer+x+hash_index+kmer_index
  
      def make_TST(self):
          tree = mt.Trie(self.yield_trie_items_to_insert_no_import(self. training_database_file_name))
          tree.save(self.TST_export_file_name)
  
subject: add class to make the new TST #29