def filter_to_transform(filter_fn, df_name='atoms'):
    """Create transform function (which operates on dataset items) from filter function (which operates on dataframes). By default, applies filter_fn to ``atoms`` dataframe, but a different dataframe can be specified optionally.

    :param filter_fn: Arbitrary filter function that takes in a dataframe and returns filtered dataframe
    :type filter_fn: filter function
    :param df_name: Name of dataframe to apply filter_fn to, defaults to 'atoms'
    :type df_name: str, optional
    """    
    def transform_fn(item):
        item[df_name] = filter_fn(item['atoms'])
        return item
    return transform_fn