用于处理PAF(Pairwise mApping Format)文件的轻量级库
pafp的Python项目详细描述
帕菲
用于处理PAF(成对映射格式)文件的轻量级库。在
目录
安装
PyPi
pip install pafpy
康达
^{pr2}$局部
如果要在本地安装,建议使用poetry。在
git clone https://github.com/mbhall88/pafpy.git cd pafpy make install # to check the library is installed run poetry run python -c "from pafpy import PafRecord;print(str(PafRecord()))"# you should see a (unmapped) PAF record printed to the terminal# you can also run the tests if you like make test-code
使用
有关完整用法,请参阅documentation。如果有任何功能
您认为缺少或将使pafpy
更易于使用,请提出问题
有一个功能请求。在
在下面的基本用法模式中,我们收集了所有primary的BLAST identity 在我们的PAF文件中对齐到一个列表中。在
fromtypingimportListfrompafpyimportPafFilepath="path/to/sample.paf"identities:List[float]=[]withPafFile(path)aspaf:forrecordinpaf:ifrecord.is_primary():identity=record.blast_identity()identities.append(identity)
另一个用例可能是,我们希望获得与之对齐的所有记录的标识符 一个特定的contig,但只保留超过50%查询的对齐(read) 对齐。在
fromtypingimportListfrompafpyimportPafFilepath="path/to/sample.paf"contig="chr1"min_covg=0.5identifiers:List[str]=[]withPafFile(path)aspaf:forrecordinpaf:ifrecord.tname==contigandrecord.query_coverage>min_covg:identifiers.append(record.qname)
贡献
如果您想为pafpy
投稿,请签出^{
- 项目
标签: