def filter_blacklist(insertions, blacklist, field='gene_name'):
    """Filters annotations that assign insertions to blacklisted genes.

    Args:
        insertions (iterable[Insertion]):
        blacklist (iterable[str]): List of blacklisted gene ids to filter.
        field (str): Name of the column containing the id of the genes.

    Returns:
        iterable[Insertion]: Filtered annotated insertions, which have been
            reduced to remove blacklisted genes.

    """
    blacklist = set(blacklist)
    for insertion in insertions:
        if not insertion.metadata.get(field, None) in blacklist:
            yield insertion
