床头读取器
bed-reader的Python项目详细描述
读写PLINK床格式,简单高效。在
特点:
- 快速多线程C++引擎。在
- 支持所有Python索引方法。按个体(样本)和/或snp(变异)对数据进行切片。在
- 由PySnpTools、FaST-LMM和{a5}使用。在
- 支持PLINK 1.9。在
安装
pip install bed-reader
使用
从.bed文件中读取基因组数据。在
^{pr2}$从20到30,每秒钟读一次个体和snp(变体)。在
>>>file_name2=sample_file("some_missing.bed")>>>bed2=open_bed(file_name2)>>>val2=bed2.read(index=np.s_[::2,20:30])>>>print(val2.shape)(50,10)>>>delbed2
列出前5个个人(示例)ID 前5个SNP(变体)ID,以及每个唯一的 染色体。然后,读取5号染色体上的每个值。在
>>>withopen_bed(file_name2)asbed3:...print(bed3.iid[:5])...print(bed3.sid[:5])...print(np.unique(bed3.chromosome))...val3=bed3.read(index=np.s_[:,bed3.chromosome=='5'])...print(val3.shape)['iid_0''iid_1''iid_2''iid_3''iid_4']['sid_0''sid_1''sid_2''sid_3''sid_4']['1''10''11''12''13''14''15''16''17''18''19''2''20''21''22''3''4''5''6''7''8''9'](100,6)
项目链接
- 项目
标签: