用于处理PAF(Pairwise mApping Format)文件的轻量级库

pafp的Python项目详细描述


帕菲

用于处理PAF(成对映射格式)文件的轻量级库。在

GitHub Workflow StatuscodecovPyPI ^{1}$ LicenseCode style: black

文档https://pafpy.xyz

目录

安装

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投稿,请签出^{}。在

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java是从此类字符串中提取数据的最佳方法   filenotfoundexception Java FileOutputStream Windows/Linux   java在SQLite数据库Android SDK中搜索特定字符串   java使用键值访问jsp中Map<Long,Map<String,Object>>的内容   java奇怪的HTMLeditor工具包问题   在java中使用数组只计算字母   每个应用程序都可以有自己独立的Java SDK吗   java如何将jasper报告生成的PDF文件保存在一个项目文件夹中   java BigDecimal包装器:静态字段为零   解码Base64图像时出现java IllegalArgumentException(非法的Base64字符)   将int转换为字节在Java和Actionscript中产生不同的结果   java什么使不可变对象在没有安全发布技术的情况下发布?   java将字节数据写入目录   一个计算器中有多个操作的java问题   面向对象Java重写是如何工作的   带hibernate的java ClassCastException   指向最后一个对象的java对象列表   java单元测试spring项目中的Get请求