samplesheet.py 文件源码

python
阅读 44 收藏 0 点赞 0 评论 0

项目:cellranger 作者: 10XGenomics 项目源码 文件源码
def file_get_iem_data_frame(path):
    """
    Return the IEM samplesheet data as a Pandas DataFrame,
    to perform better slicing operations.
    """
    rows = read_csv_rows(path)
    if not rows_are_iem_samplesheet(rows):
        raise ValueError("Invalid IEM samplesheet format: %s" % path)
    section_gen = rows_iem_section_generator(rows)
    for section in section_gen:
        if section_is_valid_data(section):
            # TODO this appears to be a problem if you have data columns
            # with trailing all-blank entries (see CSI-215 fix)
            df = pd.DataFrame(data=section.rows[1:], columns=section.rows[0])
            # skip tailing rows
            return df[df['Sample_ID'].notnull()]
    raise ValueError("Invalid IEM samplesheet format, no data found: %s" % path)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号