def selectGenes(df, selection):
    """
    Remove all rows (gene_ids) from a data frame which can not be found in
    selection.

    Parameters
    ---------
    df : DataFrame
        The data frame to work with.
    selection : set
        All ids to keep.

    Return
    ------
    df : DataFrame
        The cleand data frame.
    """
    selection = set(selection)
    for id in df.index:
        if id not in selection:
            df = df.drop(id)
    return df
