def get_subject_list(manifest_df, subject_list_file):
    """
    If a list of subject is provided then use that, else collect all unique
    subject ids from the s3 spreadsheet and use that instead
    :param manifest_df: pandas dataframe created from the s3 csv
    :param subject_list_file: cli path to file containing list of subjects
    :return: subject_list
    """
    subject_list = set()

    if subject_list_file:
        print('\tSubjects:\t%s' % subject_list_file)
        subject_list = [line.rstrip('\n') for line in open(subject_list_file)]

    # Otherwise get all subjects from the S3 spreadsheet
    else:
        print('\tSubjects:\tAll subjects')
        for manifest_name in manifest_df['manifest_name'].values:
            subject_id = manifest_name.split('.')[0]
            subject_list.add(subject_id)

    return list(subject_list)