def pivot_bulk_data(data, values='log2_rpkm'):
    """
    take long format expression data and pivot to a wider (subject x region) x gene dataframe

    data: long format dataframe (gene x region x subject) x rpkm
    values: metric of interest to create a (region x subject) x gene matrix of metrics

    returns:
    table_data: wide format dataframe
    """

    # select data
    selected_data = data.loc[:,['symbol', 'sample', 'region', 'age', values]]
    # pivot
    table_data = selected_data.pivot_table(index=['sample', 'region', 'age'], columns='symbol', values=values)
    table_data = table_data.reset_index()

    return table_data