def sparcc_paper_filter(table):
    """if a observation averages more than 2 reads per sample then keep,
    if a sample has more than 500 reads then keep"""
    table = table.copy()
    table.filter(table.ids(axis='sample')[table.sum(axis='sample') > 500],
        axis='sample')
    table.filter(table.ids(axis='observation')[table.sum(axis='observation'
        ) / table.shape[1] >= 2], axis='observation')
    return table
