samplesheet.py 文件源码

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

项目:cellranger 作者: 10XGenomics 项目源码 文件源码
def read_csv_rows(path):
    """
    Extract the rows from the CSV at the specified path.
    Will throw an error if the file doesn't exist.

    :type path: string
    :rtype: list[list[string]]
    """
    with open(path, 'rU') as infile:
        reader = csv.reader(infile, delimiter=',')
        rows = [row for row in reader]
        # eliminate trailing cols that have no entries (CSI-215)
        for idx, row in enumerate(rows):
            clipIndex = 0
            for col in row[::-1]:
                if not col:
                    clipIndex -= 1
                else:
                    break
            if clipIndex < 0:
                rows[idx] = rows[idx][:clipIndex]
    return rows
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号