def prune_small_terms(hpo_counts, min_samples):
    """
    Drop HPO terms with too few samples
    """

    filtered_counts = {}

    for term, count in hpo_counts.items():
        if count >= min_samples:
            filtered_counts[term] = count

    return filtered_counts