用于处理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使用(BluetoothGattCharacteristic)特性中的数据创建、写入和保存csv文件。getValue()   java如何使用groupBy创建一个值为BigDecimal字段平均值的映射?   日期时间Java将iso_即时格式的字符串转换为日期   java如何检索和显示Android firebase的配置文件?   scala AWSJAVASDK:解压缩大小必须小于262144000字节   要应用于列表的java JSTL if条件   java在3个点之间画一个正方形   Kotlin java抽象类IllegaAccessError   java原语双值相等取决于大小?   java有没有一种方法可以对数据集使用compareTo()方法,而不必遍历数据集的每个元素?   java为什么我发送的每个UDP消息都会改变端口源?   重新选择文件时swing Java JTree冻结   java不知道我的游戏是怎么回事   Motif L&F中自定义组合框渲染器中的Java Swing消失文本   java Trade Me API访问前的OAuth