def get_template_len(template_file):
    """
        return a dict of each seq's len based on the faidx
    """
    template_len_for = {}
    with open(template_file + '.fai') as f:
        for line in f:
            id, length = line.split('\t')[0:2]
            template_len_for[id] = int(length)
    return template_len_for
