<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def check_required_columns(df, filename, required_columns):
 """ Ensure that all required columns are present in the given dataframe, otherwise raise an exception. """

    available_columns = set(df.columns)
    for column_name in required_columns:
        if column_name not in available_columns:
            raise ValueError("FPKM tracking file %s missing column '%s'" % (
                filename,
                column_name))