@staticmethod<EOL><INDENT>def parse_sample_sheet(sample_file, dtype=str):<DEDENT>
<EOL>sep = infer_delimiter(sample_file)<EOL>try:<EOL><INDENT>df = pd.read_csv(sample_file, sep=sep, **READ_CSV_KWARGS)<EOL><DEDENT>except IOError:<EOL><INDENT>raise Project.MissingSampleSheetError(sample_file)<EOL><DEDENT>else:<EOL><INDENT>_LOGGER.info("<STR_LIT>", sample_file)<EOL>missing = {SAMPLE_NAME_COLNAME} - set(df.columns)<EOL>if len(missing) != <NUM_LIT:0>:<EOL><INDENT>_LOGGER.warning(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(sample_file, "<STR_LIT:\n>".join(missing),<EOL>"<STR_LIT:U+002CU+0020>".join(list(df.columns))))<EOL><DEDENT><DEDENT>return df<EOL>
Check if csv file exists and has all required columns.

:param str sample_file: path to sample annotations file.
:param type dtype: data type for CSV read.
:return pandas.core.frame.DataFrame: table populated by the project's
    sample annotations data
:raises IOError: if given annotations file can't be read.
:raises ValueError: if required column(s) is/are missing.