def convert_and_list(df):
    """ Add the additional columns which will be needed and obtain a list of all gids in the df"""

    newcols = ['parent1', 'parent2', 'parent3', 'parentgid']
    header_list = list(df.columns) + newcols
    df = df.reindex(columns=header_list)
    try:
        df_gid_list = df['gid'].unique()
    except KeyError as e:
        raise ValueError("The argument must have a column named gid")
    return df, df_gid_list