def read_kmer_counts(infile, verbose=False):
    """
    Read the k-mer counts file and create a dict of dicts
    :param infile: the file to read. This should be the output from GetNucFrequency_PerSeq_varK.pl
    :param verbose: more output, but it is written to stderr
    :return: a dict of dicts
    """

    khash = {}
    with open(infile, 'r') as f:
        names = f.readline().strip().split("\t")
        # define an empty set of dicts
        khash = {x:{} for x in names[1:]}
        for l in f:
            # convert this to an array
            p = l.strip().split("\t")
            key = p[0]
            for i in range(1, len(p)):
                khash[names[i]][key] = float(p[i])
    return khash